:root {
    --sidebar-primary-width: 80px;
    --sidebar-secondary-width: 250px;
}
@media (min-width: 992px) {
    #main-content {
        max-width: calc(
            100vw 
            - var(--sidebar-primary-width) 
            - var(--sidebar-secondary-width)
        );
        width: calc(
            100vw 
            - var(--sidebar-primary-width) 
            - var(--sidebar-secondary-width)
        );

        overflow-x: hidden;
    }
}
@media (min-width: 992px) {
    #main-content .table-responsive {
        overflow-x: auto;
        max-width: 100%;
    }
    body.sidebar-secondary-collapsed #sidebar-secondary {
        transform: translateX(-100%);
        opacity: 0;
        pointer-events: none;
    }

    body.sidebar-secondary-collapsed #main-content {
        margin-left: var(--sidebar-primary-width);
        max-width: calc(100vw - var(--sidebar-primary-width));
        width: calc(100vw - var(--sidebar-primary-width));
    }
}
.table-responsive {
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, 0.45) transparent;
}
.table-responsive::-webkit-scrollbar{
    width: 6px;
}

.table-responsive::-webkit-scrollbar-thumb{
    background-color: rgba(100, 116, 139, 0.45);
    border-radius: 10px;
}

@media (max-width: 768px) {
    #sidebar-secondary {
        position: fixed;
        top: 0;
        left: 0 !important;
        height: 100vh;
        width: var(--sidebar-secondary-width);

        transform: translateX(-100%);
        opacity: 0;
        pointer-events: none;

        z-index: 1100 !important;
        background: #f6f7fb;

        transition:
            transform .32s cubic-bezier(.4,0,.2,1),
            opacity .2s ease;
    }

    body.sidebar-secondary-open #sidebar-secondary {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }
}
.sidebar-secondary-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 1090;

    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}

.sidebar-secondary-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.icon-spin {
  animation: spin 2s linear infinite;
}

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

/* ==============================
   SIDEBAR PRINCIPAL (ICONOS)
================================= */
#sidebar-main {
    width: var(--sidebar-primary-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    align-items: center;
}

#sidebar-main .nav-item{
    width: 100%;
    display: flex;
    justify-content: center;
}

#sidebar-main .nav-link{
    margin-left: auto;
    margin-right: auto;
}
.sidebar-scroll-btn.is-up{
    top: 6px;
}

.sidebar-scroll-btn.is-down{
    bottom: 6px;
}


/* ==============================
   SIDEBAR SECONDARY — USER CONTEXT (SIMPLE)
================================ */

.sidebar-user-context-simple{
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 12px;
    margin: 0;
    width: 100%;

    background: #ffffff;
    border-bottom: 1px solid rgba(0,0,0,0.06);

    cursor: pointer;
}

.sidebar-user-avatar{
    width: 42px;
    height: 42px;
    flex-shrink: 0;
}

.sidebar-user-text{
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sidebar-user-text .vis-name{
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
}

.sidebar-user-text .vis-meta{
    font-size: 12px;
    color: rgba(31,36,48,.6);
}

.sidebar-user-status{
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

/* Badge más compacto */
.sidebar-user-status .chat-status{
    font-size: 10.5px;
    padding: 4px 8px;
}

/* Base */

#sidebar-main .nav-link {
    width: 56px;
    height: 64px;
    margin: 6px 0;
    padding: 6px 0;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    position: relative;
}

#sidebar-main .nav-link i {
    font-size: 20px;
    line-height: 1;
}
#sidebar-main .nav-label {
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
    opacity: 0.9;
}

/* Hover */
#sidebar-main .nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

/* Activo */
#sidebar-main .nav-link.active {
    background: rgba(88, 153, 255, 0.18);
    color: #ffffff;
}

/* Indicador lateral (barra izquierda) */
#sidebar-main .nav-link.active::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 10px;
    width: 4px;
    height: 40px;
    border-radius: 4px;
    background: #5899ff;
}

/* Icono */
#sidebar-main .nav-link i {
    font-size: 22px;
}

/* ==============================
   SIDEBAR LOGO
================================= */

#sidebar-main .sidebar-logo {
    width: 56px;
    height: 56px;
    margin-bottom: 16px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

#sidebar-main .sidebar-logo img {
    width: 70px;
    height: 32px;
    object-fit: contain;
    pointer-events: none; /* no clickable */
}

/* ==============================
   SIDEBAR AVATAR — HOVER / ACTIVE
================================= */

#sidebar-main .avatar-link {
    width: 56px;
    height: 72px;
    margin-top: 8px;
    padding: 6px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    position: relative;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.8);
}

/* Avatar */
#sidebar-main .avatar-link img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: border-color 0.15s ease;
}

/* Hover */
#sidebar-main .avatar-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

#sidebar-main .avatar-link:hover img {
    border-color: rgba(255, 255, 255, 0.6);
}

/* Active */
#sidebar-main .avatar-link.active {
    background: rgba(88, 153, 255, 0.18);
    color: #ffffff;
}

#sidebar-main .avatar-link.active img {
    border-color: #5899ff;
}

/* Indicador lateral (igual al menú) */
#sidebar-main .avatar-link.active::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 14px;
    width: 4px;
    height: 44px;
    border-radius: 4px;
    background: #5899ff;
}
.sidebar-menu-wrapper{
    position: relative;
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    justify-content: flex-start;
}
.sidebar-menu{
    flex: 1 1 auto;             /* CLAVE: que ocupe el alto disponible */
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    width: 100%;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
    overflow-x: hidden;
    scrollbar-width: none;
    flex-wrap: nowrap !important;
    align-content: flex-start !important;
}
.sidebar-menu::-webkit-scrollbar{
    display: none;
}
.sidebar-menu-wrapper.has-overflow .sidebar-menu{
    flex: 1 1 auto;
}
.sidebar-scroll-btn{
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    width: 36px;
    height: 36px;
    border-radius: 999px;

    background: rgba(255,255,255,.22);
    border: none;
    color: #fff;

    display: flex;
    align-items: center;
    justify-content: center;

    backdrop-filter: blur(6px);
    box-shadow: 0 6px 18px rgba(0,0,0,.25);

    opacity: 0;
    pointer-events: none;

    transition: opacity .2s ease, transform .15s ease;
}

.sidebar-scroll-btn i{
    font-size: 18px;
}

/* visible cuando hay overflow */
.sidebar-menu-wrapper.has-overflow .sidebar-scroll-btn{
    opacity: 1;
    pointer-events: auto;
}

/* hover desktop */
.sidebar-scroll-btn:hover{
    background: rgba(255,255,255,.35);
}

/* active touch */
.sidebar-scroll-btn:active{
    transform: translateX(-50%) scale(.92);
}
/* ==============================
   SIDEBAR MENU — GRADIENT FADE
================================ */

.sidebar-menu-wrapper::before,
.sidebar-menu-wrapper::after{
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 32px;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s ease;
}

/* Gradiente superior */
.sidebar-menu-wrapper::before{
    top: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.18),
        rgba(0,0,0,0)
    );
}

/* Gradiente inferior */
.sidebar-menu-wrapper::after{
    bottom: 0;
    background: linear-gradient(
        to top,
        rgba(0,0,0,0.18),
        rgba(0,0,0,0)
    );
}

/* Mostrar según estado */
.sidebar-menu-wrapper.has-top::before{
    opacity: 1;
}

.sidebar-menu-wrapper.has-bottom::after{
    opacity: 1;
}

/* ==============================
   SIDEBAR SECUNDARIO
================================= */
#sidebar-secondary {
    width: var(--sidebar-secondary-width);
    background: #f6f7fb;
    border-right: 1px solid rgba(0,0,0,0.05);
    position: fixed;
    top: 0;
    left: var(--sidebar-primary-width);
    height: 100vh;
    z-index: 900;
    transition:
        transform .32s cubic-bezier(.4,0,.2,1),
        opacity .2s ease;
}

.chat-list {
    display: flex;
    flex-direction: column;
    max-height: 100%;
    gap: 6px;
    padding: 8px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, 0.45) transparent;
}

@media (hover: hover) and (pointer: fine) {
    .chat-list {
        overflow-y: hidden;
    }
    .chat-list:hover {
        overflow-y: auto;
    }
}
.chat-list::-webkit-scrollbar {
    width: 6px;
}
.chat-list::-webkit-scrollbar-thumb {
    background-color: rgba(100, 116, 139, 0.45);
    border-radius: 10px;
}

.chat-list .chat-item {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 12px;
    border-radius: 14px;
    background: #ffffff;
    text-decoration: none;

    transition: background-color 0.15s ease,
        box-shadow 0.15s ease;
}

.chat-list .chat-item:hover {
    background: rgba(73, 109, 235, 0.06);
}

/* Activo */
.chat-list .chat-item.active {
    background: linear-gradient(
        135deg,
        rgba(165, 41, 234, 0.15),
        rgba(73, 109, 235, 0.15)
    );
    box-shadow: inset 0 0 0 1px rgba(73, 109, 235, 0.25);
}

/* Avatar */
.chat-list .chat-item img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;

    border: 2px solid rgba(73, 109, 235, 0.5);
    background: #ffffff;
}

/* Meta */
.chat-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    width: 100%;
}

.chat-meta strong {
    max-width: 120px;
    font-size: 13px;
    color: #212529;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-meta small {
    font-size: 12px;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Activo: texto */
.chat-list .chat-item.active strong {
    color: #3f37c9;
}

/* Fila superior: nombre + estado */
.chat-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

/* Nombre */
.chat-name {
    font-size: 13px;
    font-weight: 600;
    color: #212529;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Perfil */
.chat-role {
    font-size: 12px;
    color: #6c757d;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==============================
   CHAT STATUS — BADGE
================================= */

.chat-status {
    font-size: 10.5px;
    font-weight: 600;
    padding: 4px 8px;
    width: fit-content;

    letter-spacing: 0.02em;
}

/* success → activo */
.badge-success {
    background-color: rgba(var(--bs-success-rgb), 0.15);
    color: var(--bs-success);
}

/* danger → no disponible */
.badge-danger {
    background-color: rgba(var(--bs-danger-rgb), 0.15);
    color: var(--bs-danger);
}

/* secondary → desconectado */
.badge-secondary {
    background-color: rgba(var(--bs-secondary-rgb), 0.15);
    color: var(--bs-secondary);
}

/* warning → otros */
.badge-warning {
    background-color: rgba(var(--bs-warning-rgb), 0.2);
    color: var(--bs-warning);
}
.badge-info {
    background-color: rgba(var(--bs-info-rgb), 0.2);
    color: var(--bs-info);
}

.chat-list .chat-item{
  position: relative;
}

.chat-list-unread-badge{
  position: absolute;
  top: 10px;
  right: 10px;

  min-width: 18px;
  height: 18px;
  padding: 0 6px;

  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-size: 11px;
  font-weight: 800;
  color: #fff;

  background: linear-gradient(135deg, var(--vis-accent-1), var(--vis-primary));
  box-shadow: 0 6px 14px rgba(73,109,235,.25);

  pointer-events: none;
}


/* ==============================
   USER STATUS — SEMÁNTICA
================================= */

/* Punto de estado */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    vertical-align: middle;
    box-shadow: 0 0 0 3px rgba(40,167,69,.12);
}

/* success → activo */
.status-success {
    background-color: var(--bs-success);
}

/* danger → no disponible */
.status-danger {
    background-color: var(--bs-danger);
}

/* disabled → desconectado */
.status-disabled, .status-secondary {
    background-color: var(--bs-secondary);
}

/* warning → otros estados */
.status-warning {
    background-color: var(--bs-warning);
}


/* ==============================
   PANEL CENTRAL (CHAT)
================================= */


#main-content {
    display: flex;
    flex-direction: column;
    background: white;
    margin-left: calc(80px + 250px);
    margin-right: 0;
    height: 100vh;
}

#content-header {
    background: #496deb;
    color: #fff;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

#content-body {
    flex: 1 1 auto; 
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    scroll-behavior: smooth;
    background: var(--vis-bg);
}

/* ==============================
   CONTENT HEADER — MEDIA (IMG / ICON)
================================= */

.content-header-media {
    min-width: 44px;
    height: 44px;
    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(255, 255, 255, 0.15);
}

/* Imagen */
.content-header-media img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* Ícono */
.content-header-media i {
    font-size: 22px;
    color: #ffffff;
}

.content-header-actions {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Grupo de botones controlables */
.header-actions-group {
    display: flex;
    align-items: center;
    gap: 8px;

    /* Estado visible */
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;

    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Oculto (desktop default animación horizontal) */
.header-actions-group.hidden {
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
}

/* ==============================
   MOBILE
================================= */

@media (max-width: 768px) {

    .content-header-actions {
        align-items: flex-start;
    }

    .header-actions-group {
        position: absolute;
        top: 44px;
        right: 0;

        flex-direction: column;
        align-items: stretch;

        background: rgba(255, 255, 255, 0.95);
        border-radius: 12px;
        padding: 8px;

        box-shadow: 0 8px 24px rgba(0,0,0,0.12);

        transform: translateY(0);
    }

    /* Oculto en mobile (animación vertical) */
    .header-actions-group.hidden {
        opacity: 0;
        transform: translateY(-10px);
        pointer-events: none;
    }
}

/* Botón base */
.header-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #ffffff;

    transition: background-color 0.15s ease,
                transform 0.1s ease;
}

/* ==============================
   CONTENT HEADER — MOBILE FIX
================================= */

@media (max-width: 768px) {

    /* Botones dentro del menú desplegable */
    .header-actions-group .header-btn {
        background: rgba(73, 109, 235, 0.08);
        color: #496deb;
        width: 100%;
        justify-content: flex-start;
        padding: 9px;
    }

    .header-actions-group .header-btn i {
        color: #496deb;
    }

    /* Hover */
    .header-actions-group .header-btn:hover {
        background: rgba(73, 109, 235, 0.16);
    }

    /* Active */
    .header-actions-group .header-btn:active {
        background: rgba(73, 109, 235, 0.24);
    }
}



/* Icono */
.header-btn i {
    font-size: 18px;
    line-height: 1;
}

/* Hover */
.header-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Active (click) */
.header-btn:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.35);
}

/* Focus accesible */
.header-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}
/* ==============================
   PANEL DERECHO — DETALLE
================================= */
#detail-panel {
    width: 280px;
    background: #ffffff;
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;

    z-index: 1200;

    /* Estado oculto */
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;

    transition:
        transform .32s cubic-bezier(.4,0,.2,1),
        opacity .2s ease;

    box-shadow:
        -12px 0 32px rgba(0,0,0,.18),
        -2px 0 8px rgba(0,0,0,.08);
}

#detail-panel.is-visible{
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.detail-panel-overlay{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 1060;

    opacity: 0;
    pointer-events: none;

    transition: opacity .25s ease;
}

.detail-panel-overlay.active{
    opacity: 1;
    pointer-events: auto;
}

/* ==============================
   DETAIL PANEL — AVATAR
================================= */

#detail-panel img.rounded-circle {
    width: 88px;
    height: 88px;
    object-fit: cover;

    /* Borde acorde al sistema */
    border: 3px solid rgba(73, 109, 235, 0.5);
    
    border-radius: 50%;
}

/* Responsive */
@media (max-width: 992px) {
    #main-content {
        margin-left: 80px;
        margin-right: 0;
    }
}
@media (max-width: 768px) {
    #sidebar-main .nav-label {
        {{-- display: none; --}}
    }
    #sidebar-main {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: 8px 0 24px rgba(0,0,0,0.18);
    }

    #sidebar-main.mobile-open {
        transform: translateX(0);
    }

    /* main no se mueve */
    #main-content {
        margin-left: 0 !important;
    }
}
.mobile-sidebar-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.mobile-sidebar-overlay.active{
  opacity: 1;
  pointer-events: auto;
}

.mobile-sidebar-toggle {
    width: 36px;
    height: 36px;
    border-radius: 10px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;
    background: rgba(255,255,255,0.15);
    color: #ffffff;

    transition: background-color .15s ease, transform .1s ease;
}

.mobile-sidebar-toggle:hover {
    background: rgba(255,255,255,0.25);
}

.mobile-sidebar-toggle:active {
    transform: scale(0.95);
}


.gradient-custom-2 {
    /* fallback for old browsers */
    background: #605bef;
    /* Chrome 10-25, Safari 5.1-6 */
    background: -webkit-linear-gradient(to right, #a529ea, #9333ef, #6d53ee, #486deb);
    /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
    background: linear-gradient(to right, #a529ea, #9333ef, #6d53ee, #486deb);
}
/* ==============================
   DETAIL PANEL — USER INFO
================================= */

.user-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Secciones */
.user-info-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Títulos */
.section-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6d53ee;
    margin-bottom: 4px;
}

/* Ítems de info */
.info-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    padding: 10px;
    border-radius: 10px;
    background: rgba(73, 109, 235, 0.06);
}

.info-item i {
    font-size: 16px;
    color: #496deb;
    margin-top: 2px;
}

.info-item .label {
    font-size: 11px;
    color: #6c757d;
    display: block;
}

.info-item .value {
    font-size: 13px;
    font-weight: 500;
    color: #212529;
}

/* Badges */
.info-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge-status {
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 999px;
    color: #ffffff;
}

/* ==============================
   DETAIL PANEL — BOOTSTRAP BUTTONS
================================= */

.user-actions {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Ajuste general */
.user-actions .btn {
    border-radius: 14px;       /* coherente con cards */
    font-size: 13px;
    font-weight: 500;
    padding: 10px 14px;
}

/* Iconos */
.user-actions .btn i {
    font-size: 16px;
}

/* Outline primary más alineado al sistema */
.user-actions .btn-outline-primary {
    color: #496deb;
    border-color: rgba(73, 109, 235, 0.5);
}

.user-actions .btn-outline-primary:hover {
    background-color: rgba(73, 109, 235, 0.08);
    border-color: #496deb;
    color: #496deb;
}

/* Estados */
.badge-status.online {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.badge-status.verified {
    background: linear-gradient(135deg, #496deb, #6d53ee);
}

/* Texto secundario */
.info-muted {
    font-size: 12px;
    color: #6c757d;
}


/* ==============================
   VISOR CONTENT — THEME LAYER
================================= */
:root{
  --vis-primary: #496deb;
  --vis-accent-1: #a529ea;
  --vis-accent-2: #9333ef;
  --vis-accent-3: #6d53ee;
  --vis-bg: #f6f7fb;
  --vis-card: #ffffff;
  --vis-border: rgba(0,0,0,.06);
  --vis-shadow: 0 10px 30px rgba(0,0,0,.06);
}

#content-body{
  background: var(--vis-bg);
}

/* Card base */
.vis-card {
    position: relative;
    background: var(--vis-card);
    border: 1px solid var(--vis-border);
    border-radius: 18px;
    box-shadow: var(--vis-shadow);
    overflow: hidden;
}

/* Header con barra sutil tipo “accent” */
.vis-card__header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  background: linear-gradient(180deg, rgba(73,109,235,.06), rgba(165,41,234,.04));
  border-bottom: 1px solid var(--vis-border);
  position: relative;
}

.vis-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;

    background: linear-gradient(
        180deg,
        var(--vis-accent-1),
        var(--vis-primary)
    );

    border-top-left-radius: 18px;
    border-bottom-left-radius: 18px;
}

.vis-card.success::before {
    background: linear-gradient(180deg, #22c55e, #16a34a);
}

.vis-card.warning::before {
    background: linear-gradient(180deg, #f59e0b, #d97706);
}

.vis-card.danger::before {
    background: linear-gradient(180deg, #ef4444, #dc2626);
}


.vis-card__body{ padding: 6px 0; }
.vis-card__footer{
  padding: 12px 16px;
  /*border-top: 1px solid var(--vis-border);*/
  background: #fff;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}

/* ==============================
   EJECUTIVOS — REFINES
================================= */

/* Nombre más protagonista */
.vis-name {
    font-size: 14px;
    font-weight: 700;
    color: #1f2430;
}

/* Estado con aire */
.vis-table td .badge {
    font-size: 12px;
}

/* ==============================
   BTN-GROUP — RADIOS CORRECTOS
================================= */

.vis-table .btn-group > .btn {
    border-radius: 0; /* reset base */
}

/* Primer botón */
.vis-table .btn-group > .btn:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

/* Último botón */
.vis-table .btn-group > .btn:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* Botones intermedios */
.vis-table .btn-group > .btn:not(:first-child):not(:last-child) {
    border-radius: 0;
}

/* Evitar doble borde visual */
.vis-table .btn-group > .btn + .btn {
    margin-left: -1px;
}

/* Hover más expresivo en fila */
.vis-row:hover {
    background: linear-gradient(
        90deg,
        rgba(73,109,235,0.06),
        rgba(165,41,234,0.04)
    );
}

/* Responsive: acciones en columna */
@media (max-width: 768px) {

    .vis-table thead {
        display: none;
    }

    .vis-table tbody tr {
        display: block;
        border-bottom: 1px solid rgba(0,0,0,0.06);
    }

    .vis-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 14px;
    }

    .vis-table tbody td::before {
        content: attr(data-label);
        font-size: 11px;
        font-weight: 600;
        color: rgba(31,36,48,0.6);
    }

    .vis-table tbody td:last-child {
        justify-content: flex-end;
    }

    .vis-table .btn-group {
        flex-wrap: wrap;
        gap: 6px;
    }
}


.vis-title{
  font-weight: 700;
  font-size: 14px;
  color: #1f2430;
  line-height: 1.1;
}
.vis-subtitle{
  font-size: 12px;
  color: rgba(31,36,48,.65);
}
.vis-muted{ color: rgba(31,36,48,.6); }

/* Pills icon */
.vis-icon-pill{
  min-width: 34px;
  height: 34px;
  border-radius: 12px;
  display:flex;
  align-items:center;
  justify-content:center;
  color: #fff;
  background: linear-gradient(135deg, var(--vis-accent-1), var(--vis-primary));
  box-shadow: 0 8px 18px rgba(73,109,235,.25);
}
.vis-icon-pill i{ font-size: 16px; }

/* Search */
.vis-search{
  position: relative;
  min-width: 220px;
}
.vis-search i{
  position:absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(31,36,48,.45);
  font-size: 14px;
}
.vis-search .form-control{
  padding-left: 30px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.9);
}
.vis-select{
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.08);
}

/* Table modern skin */
.vis-table{
  margin: 0;
}
.vis-table thead th{
  font-size: 12px;
  font-weight: 700;
  color: rgba(31,36,48,.7);
  background: #fff;
  border-bottom: 1px solid var(--vis-border);
  padding: 12px 14px;
  white-space: nowrap;
}
.vis-table tbody td{
  font-size: 13px;
  color: #1f2430;
  padding: 14px;
  border-top: 1px solid rgba(0,0,0,.04);
  vertical-align: middle;
}
.vis-row{
  transition: background-color .15s ease, transform .12s ease;
}
.vis-row:hover{
  background: rgba(73,109,235,.04);
}

/* Avatar + name/meta */
.vis-avatar{
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(73,109,235,.45);
  background: #fff;
}
.vis-name{ font-weight: 700; }
.vis-meta{
  font-size: 12px;
  color: rgba(31,36,48,.6);
}

/* ID pill */
.vis-id{
  display:inline-flex;
  align-items:center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(73,109,235,.08);
  color: var(--vis-primary);
  font-weight: 700;
  font-size: 12px;
}

/* Tags chips */
.vis-chip{
  background: rgba(165,41,234,.10);
  color: #5a22b9;
  border: 1px solid rgba(165,41,234,.18);
  font-weight: 600;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: .875em;
}

/* Small dot near status */
.vis-dot{
  display:inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  vertical-align: middle;
  box-shadow: 0 0 0 3px rgba(40,167,69,.12);
}

/* Soft button that still uses Bootstrap btn */
.vis-btn-soft{
  border-radius: 12px;
  border-color: rgba(73,109,235,.18) !important;
  background: rgba(73,109,235,.06);
  color: #2b3a67;
}
.vis-btn-soft:hover{
  background: rgba(73,109,235,.12);
  border-color: rgba(73,109,235,.30) !important;
  color: #2b3a67;
}

/* Empty state */
.vis-empty{
  display:flex;
  align-items:flex-start;
  gap: 12px;
  padding: 18px 16px;
  color: rgba(31,36,48,.65);
}
.vis-empty i{
  font-size: 18px;
  color: var(--vis-primary);
  margin-top: 2px;
}
.vis-empty__title{
  font-weight: 700;
  color: rgba(31,36,48,.85);
}
.vis-empty__text{
  font-size: 12px;
  margin-top: 2px;
}

/* ==============================
   EJECUTIVO — CALL CONTEXT
================================= */

.exec-status {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Fila principal */
.exec-status-main {
    display: flex;
    align-items: center;
}

/* Contexto de llamada */
.call-context {
    display: flex;
    align-items: center;
    gap: 8px;

    padding: 6px 10px;
    border-radius: 12px;

    background: rgba(245, 158, 11, 0.12); /* warning soft */
    border: 1px solid rgba(245, 158, 11, 0.25);

    font-size: 11px;
}

/* Etiqueta de llamada */
.call-tag {
    background: rgba(165, 41, 234, 0.15);
    color: #5a22b9;

    padding: 4px 8px;
    border-radius: 999px;
    font-weight: 600;
    white-space: nowrap;
}

/* Metadatos */
.call-meta {
    display: inline-block;
    {{-- align-items: center;
    gap: 4px; --}}
    color: rgba(31, 36, 48, 0.7);
}

.call-meta i {
    font-size: 12px;
}
/* ==============================
   STATUS INFO BUTTON
================================= */

.status-info-btn {
    padding: 3px;
    line-height: 1;
}

.status-info-btn i {
    font-size: 14px;
}



/* Responsive tweaks */
@media (max-width: 768px){
  #content-body{ padding: 12px !important; }
  .vis-card__header{ flex-direction: column; align-items: stretch; }
  .vis-search{ min-width: 100%; }
  .vis-card__footer{ flex-direction: column; align-items: stretch; }
}
@media (max-width: 768px) {
  /* Override: el header del floating chat debe seguir siendo en fila */
  .floating-chat__header.vis-card__header{
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
  }

  /* Columna izquierda (avatar + textos) */
  .floating-chat__header.vis-card__header > .d-flex:first-child{
    flex: 1 1 auto;
    min-width: 0;            /* permite ellipsis/truncate */
    justify-content: flex-start;
  }

  /* Columna derecha (botones) */
  .floating-chat__header.vis-card__header > .d-flex:last-child{
    flex: 0 0 auto;
    margin-left: 10px;
  }
}


/* ==============================
   SUMMARY CARDS
================================= */

.summary-card {
    display: flex;
    align-items: center;
    gap: 16px;

    padding: 18px;
    border-radius: 18px;

    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 10px 28px rgba(0,0,0,0.06);

    transition: transform 0.15s ease,
                box-shadow 0.15s ease;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(0,0,0,0.08);
}

/* Icono */
.summary-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #ffffff;
    font-size: 22px;

    flex-shrink: 0;
}

/* Contenido */
.summary-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(31,36,48,0.6);
}

.summary-value {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    color: #1f2430;
}

.summary-meta {
    font-size: 12px;
}

/* ==============================
   VARIANTES DE COLOR
================================= */

/* Primary (gradiente base de la app) */
.summary-primary .summary-icon {
    background: linear-gradient(
        135deg,
        #a529ea,
        #6d53ee,
        #486deb
    );
}

/* Success */
.summary-success .summary-icon {
    background: linear-gradient(
        135deg,
        #34d399,
        #059669
    );
}
/* Warning */
.summary-warning .summary-icon {
    background: linear-gradient(
        135deg,
        #f59e0b,
        #fbbf24
    );
}

/* Danger */
.summary-danger .summary-icon {
    background: linear-gradient(
        135deg,
        #ef4444,
        #dc2626
    );
}

/* ==============================
   MODAL — STATUS HISTORY
================================= */

.vis-modal {
    border-radius: 18px;
    border: none;
}

.vis-modal .modal-header {
    background: linear-gradient(
        180deg,
        rgba(73,109,235,0.08),
        rgba(165,41,234,0.05)
    );
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.vis-modal .modal-title {
    font-weight: 700;
    font-size: 16px;
}

/* ==============================
   MODAL — FORM DATA
================================= */

.form-data-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-data-item {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 12px;

    padding: 10px 12px;
    border-radius: 12px;

    background: rgba(73,109,235,0.04);
    border: 1px solid rgba(73,109,235,0.08);
}

.form-data-label {
    font-size: 12px;
    font-weight: 700;
    color: rgba(31,36,48,0.7);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.form-data-value {
    font-size: 13px;
    font-weight: 500;
    color: #1f2430;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ==============================
   SKELETON LOADER
================================= */

.skeleton-line,
.skeleton-block {
    position: relative;
    overflow: hidden;
    background: rgba(73,109,235,0.12);
    border-radius: 12px;
}

/* Líneas */
.skeleton-line {
    height: 14px;
}

/* Bloques tipo campo */
.skeleton-block {
    height: 42px;
    margin-bottom: 10px;
}

/* Animación shimmer */
.skeleton-line::after,
.skeleton-block::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;

    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,0.6),
        transparent
    );

    animation: skeleton-loading 1.2s infinite;
}

@keyframes skeleton-loading {
    100% {
        left: 100%;
    }
}


/* Responsive */
@media (max-width: 576px) {
    .form-data-item {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}


/* ==============================
   TIMELINE VERTICAL — STATUS
================================= */

.status-timeline-vertical {
    position: relative;
    padding-left: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Línea vertical */
.status-timeline-vertical::before {
    content: "";
    position: absolute;
    left: 9px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(
        180deg,
        rgba(73,109,235,0.3),
        rgba(165,41,234,0.3)
    );
}

/* Item */
.timeline-item {
    position: relative;
    display: flex;
    gap: 16px;
}

/* Punto */
.timeline-marker {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-left: -2px;

    box-shadow: 0 0 0 4px rgba(0,0,0,0.04);
}

/* Contenido */
.timeline-content {
    background: rgba(73,109,235,0.04);
    border: 1px solid rgba(73,109,235,0.08);
    border-radius: 14px;
    padding: 12px 14px;

    width: 100%;
}

/* Título */
.timeline-title {
    font-size: 14px;
    font-weight: 700;
    color: #1f2430;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

/* Meta (horas) */
.timeline-meta {
    margin-top: 4px;
    font-size: 12px;
    color: rgba(31,36,48,0.6);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Descripción */
.timeline-description {
    margin-top: 6px;
    font-size: 12px;
    color: rgba(31,36,48,0.75);
}

/* Responsive */
@media (max-width: 576px) {
    .status-timeline-vertical {
        padding-left: 20px;
    }

    .timeline-content {
        padding: 10px 12px;
    }
}




/* Responsive */
@media (max-width: 768px) {
    .summary-card {
        padding: 16px;
    }

    .summary-value {
        font-size: 24px;
    }
}

/* Tabs con look “visor” (reutiliza header style) */
.vis-tabs{
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,.65);
}

.vis-tabs .nav-link{
  border: 0 !important;
  border-radius: 0 !important;
  font-weight: 600;
  font-size: 12.5px;
  color: rgba(31,36,48,.7);
  padding: 10px 12px;
}

.vis-tabs .nav-link:hover{
  background: rgba(73,109,235,.06);
  color: rgba(31,36,48,.85);
}

.vis-tabs .nav-link.active{
  background: linear-gradient(135deg, rgba(165,41,234,.14), rgba(73,109,235,.12));
  color: #3f37c9;
  box-shadow: inset 0 0 0 1px rgba(73,109,235,.18);
}

/* Icono llamada (moderno, consistente con gradientes del sistema) */
.call-icon{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex !important;
  align-items:center;
  justify-content:center;
  color:#fff;
  background: linear-gradient(135deg, var(--vis-accent-1), var(--vis-primary));
  box-shadow: 0 10px 22px rgba(73,109,235,.22);
  flex: 0 0 auto;
}

.call-icon i{ font-size: 18px; }

.call-action-btn{
  border-radius: 14px;
  font-weight: 600;
  padding: 10px 14px;
}

/* Mobile: acciones apiladas y tabs al 100% */
@media (max-width: 576px){
  .vis-tabs{ width: 100%; }
  .call-action-btn{ width: 100%; }
}

/* ==============================
   FULLCALENDAR — BASE SKIN
================================= */

#calendar {
    background: var(--vis-card);
    border-radius: 18px;
    border: 1px solid var(--vis-border);
    box-shadow: var(--vis-shadow);
    overflow: hidden;
    font-family: inherit;
}
/* Toolbar */
.fc-toolbar {
    padding: 14px 16px;
    margin: 0 !important;

    background: linear-gradient(
        180deg,
        rgba(73,109,235,.06),
        rgba(165,41,234,.04)
    );

    border-bottom: 1px solid var(--vis-border);
}

/* Título (mes/año) */
.fc-center h2 {
    font-size: 16px;
    font-weight: 700;
    color: #1f2430;
    margin: 0;
}
/* Reset botones FC */
.fc-button {
    background: transparent !important;
    border: 1px solid rgba(73,109,235,.18) !important;
    color: #2b3a67 !important;

    border-radius: 12px !important;

    font-size: 12px;
    font-weight: 600;

    box-shadow: none !important;
    text-shadow: none !important;

    transition: background-color .15s ease, color .15s ease;
}

/* Hover */
.fc-button:hover {
    background: rgba(73,109,235,.08) !important;
}
.fc button .fc-icon {
    top: -.15em;
}

/* Activo */
.fc-state-active,
.fc-button.fc-state-active {
    background: linear-gradient(
        135deg,
        rgba(165,41,234,.18),
        rgba(73,109,235,.16)
    ) !important;

    border-color: rgba(73,109,235,.35) !important;
    color: #3f37c9 !important;
}

/* Disabled */
.fc-state-disabled {
    opacity: .45;
    cursor: not-allowed;
}

/* Grupos de botones */
.fc-button-group > .fc-button {
    border-radius: 0 !important;
}

.fc-button-group > .fc-button:first-child {
    border-top-left-radius: 12px !important;
    border-bottom-left-radius: 12px !important;
}

.fc-button-group > .fc-button:last-child {
    border-top-right-radius: 12px !important;
    border-bottom-right-radius: 12px !important;
}
/* Header días semana */
.fc-head-container {
    background: #ffffff;
    border-bottom: 1px solid var(--vis-border);
}

.fc-day-header {
    font-size: 12px;
    font-weight: 700;
    color: rgba(31,36,48,.65);
    padding: 10px 0;
    text-transform: capitalize;
}
/* Grid base */
.fc-day {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,.04);
    transition: background-color .12s ease;
}

/* Hover día */
.fc-day:hover {
    background: rgba(73,109,235,.04);
}

/* Días fuera del mes */
.fc-other-month {
    background: rgba(0,0,0,.015);
}

.fc-other-month .fc-day-number {
    opacity: .35;
}
/* Día actual */
.fc-today {
    background: linear-gradient(
        135deg,
        rgba(165,41,234,.12),
        rgba(73,109,235,.10)
    ) !important;

    border: 1px solid rgba(73,109,235,.35) !important;
}

/* Número del día actual */
.fc-today .fc-day-number {
    font-weight: 800;
    color: #3f37c9;
}
.fc-day-number {
    font-size: 12px;
    font-weight: 600;
    color: rgba(31,36,48,.75);
    padding: 6px 8px;
}
/* Columna semana */
.fc-week-number {
    background: rgba(73,109,235,.04);
    border-right: 1px solid rgba(0,0,0,.05);

    font-size: 11px;
    font-weight: 700;
    color: rgba(31,36,48,.6);
}
/* Eliminar sombras viejas */
.fc-widget-content,
.fc-widget-header {
    border-color: rgba(0,0,0,.04) !important;
}

/* Scroll container */
.fc-scroller {
    overflow: auto !important;
}

/* Quitar fondos grises viejos */
.fc-bg table {
    background: transparent;
}

/* ==============================
   AGENDA GLOSSARY — MODAL
================================= */

.agenda-glossary-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Item */
.agenda-item {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 10px 12px;
    border-radius: 12px;

    background: rgba(73,109,235,0.04);
    border: 1px solid rgba(73,109,235,0.08);
}

/* Color indicator */
.agenda-color {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    flex-shrink: 0;
}

/* Text */
.agenda-text {
    font-size: 13px;
    font-weight: 500;
    color: #1f2430;
}
/* ==============================
   MODAL — CALL RECORD FIX
   (summary grid inside columns)
================================= */

.call-summary .form-data-item{
  /* Deja de usar 220px en columnas pequeñas */
  grid-template-columns: 1fr;
  gap: 6px;
  align-content: start;

  /* aire visual y consistencia */
  padding: 12px 14px;
  min-height: 72px;

  /* evita desbordes raros */
  min-width: 0;
}

.call-summary .form-data-label{
  font-size: 11px;
  opacity: .9;
}

.call-summary .form-data-value{
  font-size: 13px;
  font-weight: 600;
  color: #1f2430;

  /* importante: evita overlay / overflow */
  min-width: 0;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.call-summary .form-data-value i{
  opacity: .85;
}

/* Institución / sucursal (suelen ser largas) */
.call-summary .form-data-item.is-long{
  min-height: 88px;
}

/* Etiqueta como chip, bien alineada */
.call-summary .form-data-item.is-tag .form-data-value{
  font-weight: 500;
}

/* ==============================
   CALL SUMMARY — INLINE LAYOUT
================================ */

.call-summary--inline{
    display: flex;
    gap: 12px;
    flex-direction: unset;
    flex-wrap: wrap; /* evita desbordes */
}

/* Cada item ocupa el mismo ancho */
.call-summary--inline .form-data-item{
    flex: 1 1 0;
    min-width: 0; /* importante para elipsis */
}
@media (min-width: 768px){
    .call-summary--inline .form-data-item:first-child{
        flex: 0 0 180px;
    }
}

/* Desktop grande: más aire */
@media (min-width: 992px){
    .call-summary--inline{
        gap: 16px;
    }
}

/* Mobile: apilado */
@media (max-width: 576px){
    .call-summary--inline{
        flex-direction: column;
    }

    .call-summary--inline .form-data-item{
        width: 100%;
    }
}
/* ==============================
   VIS CARD — COLLAPSIBLE
================================ */

.vis-card__body{
    overflow: hidden;
    transition:
        max-height .35s cubic-bezier(.4,0,.2,1),
        opacity .2s ease,
        transform .25s cubic-bezier(.4,0,.2,1);
}

/* Estado colapsado */
.vis-card.is-collapsed .vis-card__body{
    max-height: 0;
    opacity: 0;
    transform: translateY(-6px);
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Estado expandido */
.vis-card:not(.is-collapsed) .vis-card__body{
    opacity: 1;
    transform: translateY(0);
}

/* Botón */
.vis-card-toggle i{
    transition: transform .25s cubic-bezier(.4,0,.2,1);
}

/* Icono rotado cuando está expandido */
.vis-card:not(.is-collapsed) .vis-card-toggle i{
    transform: rotate(180deg);
}
.vis-card.is-collapsed .vis-card__header{
    box-shadow: inset 0 -1px 0 rgba(0,0,0,0.06);
}

/* ==============================
   FLOATING CHAT — CONTAINER
================================= */

#floatingChatContainer{
    position: fixed;
    bottom: 12px;
    right: 280px; /* respeta detail-panel */
    display: flex;
    gap: 12px;
    z-index: 950;
    margin-right: 20px;
    align-items: flex-end;
}
.floating-chat{
    width: 300px;
    height: 420px;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    overflow: hidden;
    transition:
        height .28s cubic-bezier(.4,0,.2,1),
        box-shadow .2s ease;
    will-change: height;
}
.floating-chat__header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    cursor: default;
    flex-shrink: 0;
    z-index: 2;
}
@media (max-width: 768px) {
    .floating-chat__header {
        flex-wrap: nowrap;
    }

    .floating-chat__header > .d-flex:first-child {
        min-width: 0;
    }

    .floating-chat__header > .d-flex:last-child {
        margin-left: auto;
        flex-shrink: 0;
    }
}
.floating-chat__header .vis-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 145px;
}
.floating-chat__body{
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 10px;
    background: var(--vis-bg);
}
.floating-chat__footer{
    padding: 8px;
    border-top: 1px solid var(--vis-border);
    background: #fff;
}

.floating-chat__body,
.floating-chat__footer{
    transition:
        opacity .18s ease,
        transform .25s cubic-bezier(.4,0,.2,1);
}
/* Mensajes */
.message{
    display: flex;
    margin-bottom: 6px;
}

/* ENTRANTE — neutro */
.message-in{
    justify-content: flex-start;
}

.message-in .message-bubble{
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.06);
    color: #1f2430;
    padding: 10px 14px;
    border-radius: 8px;
}

/* SALIENTE — color sistema */
.message-out{
    justify-content: flex-end;
}

.message-out .message-bubble{
    background: #e0ecff;
    color: #1f2430;
    padding: 10px 14px;
    border-radius: 8px;
    max-width: 96%;
}

.floating-chat.minimized{
    height: 64px;
    box-shadow: 0 6px 14px rgba(0,0,0,.12);
}

.floating-chat.minimized .floating-chat__body,
.floating-chat.minimized .floating-chat__footer{
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.floating-chat.minimized .floating-chat__header:hover{
    background: linear-gradient(
        180deg,
        rgba(73,109,235,.16),
        rgba(165,41,234,.12)
    );
}
.floating-chat__toggle i{
    transition: transform .25s cubic-bezier(.4,0,.2,1);
}

.floating-chat.minimized .floating-chat__toggle i{
    transform: rotate(180deg);
}
.chat-unread-badge{
    position: absolute;
    top: 5px;
    right: 73px;
    min-width: 18px;
    height: 18px;
    padding: 10px 7px;

    border-radius: 999px;
    background: linear-gradient(
        135deg,
        var(--vis-accent-1),
        var(--vis-primary)
    );

    color: #fff;
    font-size: 11px;
    font-weight: 700;

    display: flex;
    align-items: center;
    justify-content: center;

    box-shadow: 0 4px 10px rgba(73,109,235,.35);
    pointer-events: none;
}


@media (max-width: 768px){

    #floatingChatContainer{
        right: 12px;
        left: 12px;
        justify-content: center;
    }

    .floating-chat{
        width: 100%;
        max-width: 100%;
    }
}
/* ==============================
   CHAT INPUT — ACTIONS
================================ */

.chat-input-wrapper{
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
}
.chat-input-wrapper--stacked{
    flex-direction: column;
    align-items: stretch;
}
.chat-input-wrapper--stacked .chat-input-row{
    position: relative;
    display: flex;
    align-items: center;
}
.chat-input,.chat-input-call{
    padding: 0.5rem;
    flex: 1;
    padding-left: 72px;
    padding-right: 36px;
    border-radius: 12px;
}

/* Contenedor botones izquierda */
.chat-input-actions{
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);

    display: flex;
    gap: 4px;
}

.chat-input-wrapper--stacked .chat-input-row .chat-input-actions,
.chat-input-wrapper--stacked .chat-input-row .chat-send-btn-call{
    top: 42%;
}

/* Botones acción */
.chat-action-btn{
    width: 28px;
    height: 28px;
    border-radius: 8px;

    border: none;
    background: rgba(73,109,235,0.08);
    color: #496deb;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
    transition: background-color .15s ease, transform .1s ease;
}

.chat-action-btn i{
    font-size: 14px;
}

/* Hover */
.chat-action-btn:hover{
    background: rgba(73,109,235,0.18);
}

/* Active */
.chat-action-btn:active{
    transform: scale(.95);
}

/* Emoji con leve diferencia visual */
.chat-emoji-btn{
    background: rgba(165,41,234,0.08);
    color: #6d53ee;
}

.chat-emoji-btn:hover{
    background: rgba(165,41,234,0.18);
}


.chat-send-btn,.chat-send-btn-call{
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    min-width: 26px;
    height: 26px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(
        135deg,
        var(--vis-accent-1),
        var(--vis-primary)
    );
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
    transition: transform .1s ease, opacity .15s ease;
}

.note-send-btn-call,.btn-vis-primary{
    border-radius: 8px;
    border: none;
    background: linear-gradient(
        135deg,
        var(--vis-accent-1),
        var(--vis-primary)
    );
    color: #fff;
    cursor: pointer;
    transition: transform .1s ease, opacity .15s ease;
}

/* ===============================
   VIS – Outline Primary
   =============================== */

.btn-vis-outline-primary {
    color: var(--vis-primary);
    border-color: linear-gradient(
        135deg,
        var(--vis-accent-1),
        var(--vis-primary)
    );
    background-color: transparent;

    transition:
        color .2s ease,
        background-color .2s ease,
        border-color .2s ease,
        box-shadow .2s ease;
}
.btn-vis-outline-primary:hover,
.btn-vis-outline-primary:focus {
    border-color: linear-gradient(
        135deg,
        var(--vis-accent-1),
        var(--vis-primary)
    );
    background: linear-gradient(
        135deg,
        var(--vis-accent-1),
        var(--vis-primary)
    );
    color: #fff;
    transition: transform .1s ease, opacity .15s ease;
}
.btn-vis-outline-primary.active,
.btn-vis-outline-primary:active {
    border-color: linear-gradient(
        135deg,
        var(--vis-accent-1),
        var(--vis-primary)
    );
    background: linear-gradient(
        135deg,
        var(--vis-accent-1),
        var(--vis-primary)
    );
    color: #fff;
    transition: transform .1s ease, opacity .15s ease;
    box-shadow: 0 0 0 0.2rem rgba(72, 109, 235, 0.25);
}
.btn-vis-outline-primary:disabled,
.btn-vis-outline-primary.disabled {
    color: #94a3b8;
    border-color: #cbd5f5;
    background-color: transparent;
    opacity: 0.65;
}


.chat-send-btn:hover,.chat-send-btn-call:hover,.note-send-btn-call:hover,.btn-vis-primary:hover{
    opacity: .9;
}
.note-send-btn-call:active,.btn-vis-primary:active{
    transform: translateY(-5%) scale(.95);
}
.chat-send-btn:active,.chat-send-btn-call:active{
    transform: translateY(-50%) scale(.95);
}

.chat-send-btn i,.chat-send-btn.call i{
    font-size: 12px;
}
.chat-timestamp{
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: rgba(31,36,48,.55);
    margin: 8px 0 6px;
    user-select: none;
}
.note-item {
  position: relative;
  padding: 0.75rem 2.75rem 0.75rem 0.75rem;
  margin-bottom: 0.5rem;
  background: #fff;
  border: 1px solid #e6e9f0;
  border-radius: 12px;
}
.note-item.is-editing {
  padding: 0.75rem;
  background: #f8f9ff;
  border-color: #c7d2fe;
}

.note-item:hover {
  background: #fafbff;
}
.note-meta {
  display: flex;
  align-items: center;
  font-size: 0.75rem;
  color: #6c757d;
  margin-bottom: 0.25rem;
}

.note-author {
  font-weight: 600;
}
.note-time {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 0.7rem;
  color: #adb5bd;
  white-space: nowrap;
}
.note-content {
  font-size: 0.875rem;
  color: #212529;
  white-space: pre-wrap;
}
.note-actions {
  position: absolute;
  top: 2.1rem;
  right: 0.5rem;
  display: flex;
  gap: 0.25rem;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.note-item:hover .note-actions {
  opacity: 1;
}
.btn-icon {
  padding: 0.25rem;
  line-height: 1;
}
.btn-icon:hover{
    border-color: #c7d2fe;
    background: #fafbff;
}
.btnIcon {
    cursor: pointer;
}
/* === SUBTÍTULOS === */

.call-subtitles {
    margin-top: 1rem;
}

/* Reutiliza lógica de colapsado */
.call-subtitles.is-collapsed .vis-card__body {
    display: none;
}

/* CONTROLES */
.subtitle-controls {
    border-bottom: 1px solid #e6e9f0;
    padding-bottom: 0.5rem;
}
.subtitle-control-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(73,109,235,0.08);
    color: #496deb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.subtitle-control-icon i {
    font-size: 14px;
}


/* LABELS */
.subtitle-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

/* BLOQUE LIVE */
.subtitle-live {
    background: #000;
    color: #fff;
    border-radius: 12px;
    padding: 0.75rem;
}

.subtitle-live-text {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    min-height: 1.4em;
}

/* HISTORIAL */
.subtitle-history {
    background: #111;
    color: #fff;
    border-radius: 12px;
    padding: 0.75rem;
}

.subtitle-history-content {
    max-height: 160px;
    overflow-y: auto;
    font-size: 0.85rem;
}

.subtitle-history-content div {
    margin-bottom: 0.25rem;
    opacity: 0.9;
}

/* ==============================
   FLOATING CHAT — SNAP ANIMATION
================================= */

@keyframes chatSnapIn {
    0% {
        opacity: 0;
        transform: translateY(24px) scale(0.92);
    }
    60% {
        opacity: 1;
        transform: translateY(-2px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes chatSnapOut {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(24px) scale(0.92);
    }
}

/* Estado inicial (al crear) */
.floating-chat.snap-enter {
    animation: chatSnapIn 0.38s cubic-bezier(.34,1.56,.64,1) both;
}

/* Estado salida (antes de eliminar) */
.floating-chat.snap-exit {
    animation: chatSnapOut 0.22s cubic-bezier(.4,0,.6,1) both;
}

/* ==============================
   CHAT FILE PREVIEW
================================ */

.chat-file-preview{
    padding: 6px 8px;
}

.file-preview-card{
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 10px 12px;
    border-radius: 14px;

    background: rgba(73,109,235,0.06);
    border: 1px solid rgba(73,109,235,0.18);
}

.file-icon{
    width: 38px;
    height: 38px;
    border-radius: 10px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: linear-gradient(
        135deg,
        var(--vis-accent-1),
        var(--vis-primary)
    );

    color: #fff;
    flex-shrink: 0;
}

.file-icon i{
    font-size: 18px;
}

.file-meta{
    flex: 1;
    min-width: 0;
}

.file-name{
    font-size: 13px;
    font-weight: 600;
    color: #1f2430;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size{
    font-size: 11px;
    color: rgba(31,36,48,.6);
}

.file-remove-btn{
    border: none;
    background: transparent;
    color: rgba(31,36,48,.5);

    width: 28px;
    height: 28px;
    border-radius: 8px;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
    transition: background-color .15s ease;
}

.file-remove-btn:hover{
    background: rgba(0,0,0,.06);
}
/* ==============================
   CHAT DROP ZONE
================================ */

.floating-chat.drag-over{
    box-shadow: 0 0 0 3px rgba(73,109,235,0.35);
}
#tab-chat.drag-over{
    border-radius: 15px;
    box-shadow: 0 0 0 3px rgba(73,109,235,0.35);
}
.file-download-btn{
    width: 28px;
    height: 28px;
    border-radius: 8px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(73,109,235,0.08);
    color: #496deb;
    text-decoration: none;

    transition: background-color .15s ease;
}

.file-download-btn:hover{
    background: rgba(73,109,235,0.18);
}
/* ==============================
   EMOJI PICKER (FIX: grid + scroll)
================================ */

.chat-emoji-picker{
    position: fixed;
    bottom: 42px;
    left: 0;

    /* ancho flexible, pero con mínimo suficiente para la grilla */
    width: min(320px, calc(100vw - 48px));
    max-height: 200px;

    background: #ffffff;
    border-radius: 16px;
    padding: 10px;

    box-shadow: 0 12px 32px rgba(0,0,0,0.18);
    border: 1px solid rgba(0,0,0,0.06);

    /* clave: scroll cuando no cabe */
    overflow-y: auto;
    overscroll-behavior: contain;

    /* clave: grilla adaptable (no columnas rígidas) */
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(28px, 1fr));
    gap: 6px;

    box-sizing: border-box;
    z-index: 10000;
}

/* botones consistentes (evita que agranden la grilla) */
.chat-emoji-picker button{
    width: 28px;
    height: 28px;

    font-size: 20px;
    line-height: 1;

    border: none;
    background: transparent;
    border-radius: 8px;

    cursor: pointer;
    padding: 0;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    transition: background-color .12s ease, transform .08s ease;
}

.chat-emoji-picker button:hover{
    background: rgba(73,109,235,0.12);
}

.chat-emoji-picker button:active{
    transform: scale(0.92);
}
.sender-out {
    font-size: 12px;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    justify-content: flex-end;
    display: flex;
}
.sender-in{
    font-size: 12px;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    justify-content: flex-start;
    display: flex;
}
/* ==============================
   GLOBAL ALERT — FIXED TOP
================================ */
#globalAlertContainer{
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1200;
    width: min(720px, calc(100% - 32px));
    pointer-events: none;
}

.global-alert{
    pointer-events: auto;
    border-radius: 16px;
    box-shadow: 0 14px 36px rgba(0,0,0,.18);
    animation: globalAlertIn .35s cubic-bezier(.34,1.56,.64,1);
}

@keyframes globalAlertIn{
    from{
        opacity: 0;
        transform: translateY(-16px) scale(.96);
    }
    to{
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ==============================
   GLOBAL ALERT — COMPOSER
.global-alert-composer{
    border-radius: 18px;
    box-shadow: var(--vis-shadow);
    overflow: hidden;
    animation: composerIn .25s ease;
    position: fixed;
    z-index: 1100;
    width: 100%;
    max-width: 360px;
    opacity: 0;
    transform: translate(-50%, -48%) scale(.96);
    transition:
        opacity .18s ease,
        transform .22s cubic-bezier(.4,0,.2,1);
}
================================ */
.global-alert-composer{
    position: fixed;
    z-index: 1100;
    width: 100%;
    max-width: 360px;
    overflow: hidden;
    border-radius: 18px;

    opacity: 0;
    pointer-events: none;

    transition:
        opacity .18s ease,
        transform .22s cubic-bezier(.4,0,.2,1);

    box-shadow:
        0 30px 80px rgba(0,0,0,.45),
        0 10px 24px rgba(0,0,0,.25);
    border: 1px solid rgba(0,0,0,.08);
    backdrop-filter: blur(2px);
}

/* Visible */
.global-alert-composer.is-visible{
    opacity: 1;
    pointer-events: auto;
}

.global-alert-composer{
    box-shadow:
        0 30px 80px rgba(0,0,0,.45),
        0 10px 24px rgba(0,0,0,.25);
    border: 1px solid rgba(0,0,0,.08);
    backdrop-filter: blur(2px);
}

@keyframes composerIn{
    from{
        opacity: 0;
        transform: translateY(-8px) scale(.96);
    }
    to{
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* MOBILE: centrado tipo modal */
@media (max-width: 768px){
    .global-alert-composer{
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(.96);
        width: calc(100% - 32px);
        max-width: 420px;
    }

    .global-alert-composer.is-visible{
        transform: translate(-50%, -50%) scale(1);
    }
}
.td-tags {
    max-width: 220px;
}

.vis-tags-compact {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
    overflow: hidden;
}

.vis-chip--more {
    background: rgba(73,109,235,0.1);
    color: var(--vis-primary);
    font-weight: 600;
    cursor: pointer;
    min-width: 40px;
}
/* Columna acciones mínima */
.td-actions {
    position: relative;
    width: 1%;
    white-space: nowrap;
}

/* Panel de acciones */
.row-actions {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%) translateX(10px);

    display: flex;
    gap: 6px;

    background: #fff;
    border: 1px solid #e6e9f0;
    border-radius: 12px;
    padding: 6px 8px;

    box-shadow: 0 8px 24px rgba(0,0,0,0.08);

    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease, transform .15s ease;
    z-index: 5;
}

/* Mostrar solo al hover de la fila */
.vis-table tbody tr:hover .row-actions {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-50%) translateX(0);
}
.copy-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
}

.copy-wrapper .text-truncate {
    min-width: 0;
}

/* Botón copiar */
.btn-copy {
    border: none;
    background: transparent;
    color: #6c757d;
    padding: 2px;
    opacity: 0;
    transition: opacity .15s ease, color .15s ease;
}

.copy-wrapper:hover .btn-copy {
    opacity: 1;
}

.btn-copy:hover {
    color: var(--vis-primary);
}
.modal-content {
    overflow: visible;
}
/* =========================================
   BTN DEFAULT — DataTables / Neutral Button
========================================= */

.btn-default {
    --bs-btn-color: #495057;
    --bs-btn-bg: #f1f3f5;
    --bs-btn-border-color: #dee2e6;

    --bs-btn-hover-color: #212529;
    --bs-btn-hover-bg: #e9ecef;
    --bs-btn-hover-border-color: #ced4da;

    --bs-btn-active-color: #212529;
    --bs-btn-active-bg: #dee2e6;
    --bs-btn-active-border-color: #ced4da;

    --bs-btn-focus-shadow-rgb: 130,138,145;

    background-color: var(--bs-btn-bg);
    border-color: var(--bs-btn-border-color);
    color: var(--bs-btn-color);
}

/* Tamaño coherente con toolbar */
.btn-default.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 0.375rem;
}

/* Iconos dentro */
.btn-default i {
    font-size: 0.85em;
    margin-right: 0.25rem;
}

/* Disabled */
.btn-default:disabled,
.btn-default.disabled {
    opacity: .6;
    pointer-events: none;
}
.chosen-container-multi .chosen-choices .search-choice {
    border-radius: 8px;
    border: none;
    background: linear-gradient( 135deg, var(--vis-accent-1), var(--vis-primary) );
    color: #fff;
    transition: transform .1s ease, opacity .15s ease;
    padding: 5px 8px;
}
.chosen-container-multi .chosen-choices .search-choice span {
    margin-right: 15px;
}
.chosen-container-multi .chosen-choices .search-choice .search-choice-close {
    top: 0.3rem;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ffffff' d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3C/svg%3E");
}
.btn-clear-search:active {
    border: 0;
}
.app_version {
    font-size: 10px;
}

/* ==============================
   GLOBAL UNREAD BADGE (HEADER)
================================= */
.vis-total-unread-badge{
  position:absolute;
  top:-4px;
  right:-4px;

  min-width: 18px;
  height: 18px;
  padding: 0 6px;

  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-size: 11px;
  font-weight: 800;

  background-color: var(--bs-danger);
  color: #fff;
  box-shadow: 0 6px 14px rgba(73,109,235,.25);

  pointer-events:none;
  z-index: 2;
}

.color-primary {
    color: var(--vis-primary);
}

.vis-password-wrap{
    position: relative;
}
.vis-password-wrap .form-control{
    padding-right: 44px; /* espacio para el botón */
}
.vis-password-toggle{
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);

    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: rgba(31,36,48,.55);

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;
    cursor: pointer;
    padding: 0;
}
.vis-password-toggle:hover{
    background: rgba(73,109,235,0.08);
    color: #496deb;
}
.vis-password-toggle:active{
    transform: translateY(-50%) scale(.95);
}