.sidebar-sublink {
    display: block;
    padding: 6px 10px;
    border-radius: 8px;
    color: #ccc;
    transition: all 0.3s ease;
}

.sidebar-sublink:hover {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    transform: translateX(5px);
}

.submenu {
    transition: all 0.3s ease;
}
.presence-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.presence-badge::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
}

.presence-badge--online {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
}

.presence-badge--online::before {
    background: #22c55e;
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.12);
}

.presence-badge--offline {
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
}

.presence-badge--offline::before {
    background: #94a3b8;
}
.sidebar-premium__group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-premium__link--toggle {
    width: 100%;
    background: transparent;
    border: 0;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-premium__submenu {
    display: none;
    padding-left: 18px;
    margin-top: 4px;
}

.sidebar-premium__submenu.is-open {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-premium__sublink {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 10px 14px;
    border-radius: 12px;
    color: #c8cfdb;
    text-decoration: none;
    transition: all .2s ease;
}

.sidebar-premium__sublink:hover {
    background: rgba(255,255,255,.05);
    color: #fff;
}

.sidebar-premium__sublink.is-active {
    background: rgba(255, 204, 0, .12);
    color: #ffcc00;
}

.sidebar-premium__caret {
    transition: transform .2s ease;
}

.sidebar-premium__caret.is-rotated {
    transform: rotate(180deg);
}
.sidebar-premium__group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-premium__link--toggle {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.sidebar-premium__link-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-premium__submenu {
    display: none;
    flex-direction: column;
    gap: 6px;
    padding-left: 18px;
    margin-top: 2px;
}

.sidebar-premium__submenu.is-open {
    display: flex;
}

.sidebar-premium__sublink {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 10px 14px;
    border-radius: 12px;
    color: rgba(255,255,255,.72);
    text-decoration: none;
    transition: all .25s ease;
    font-size: .92rem;
}

.sidebar-premium__sublink:hover {
    background: rgba(255,255,255,.06);
    color: #fff;
}

.sidebar-premium__sublink.is-active {
    background: linear-gradient(90deg, rgba(255, 210, 52, .18), rgba(255, 210, 52, .05));
    color: #ffd234;
    box-shadow: inset 2px 0 0 #ffd234;
}

.sidebar-premium__caret {
    transition: transform .25s ease;
}

.sidebar-premium__caret.is-rotated {
    transform: rotate(180deg);
}

/* =========================
   SIDEBAR PREMIUM RESTORE
========================= */

.sidebar-premium {
    position: sticky;
    top: 0;
    width: 262px;
    min-width: 262px;
    height: 100vh;
    padding: 18px 14px;
    overflow-y: auto;
    z-index: 1050;
    color: #e8edf7;
    background:
        radial-gradient(circle at top left, rgba(255, 210, 52, 0.14), transparent 26%),
        linear-gradient(180deg, #07111f 0%, #0b1525 45%, #0d1829 100%);
    border-right: 1px solid rgba(255,255,255,0.04);
    transition: width .25s ease, min-width .25s ease, transform .25s ease;
    box-shadow: inset -1px 0 0 rgba(255,255,255,0.03);
}

.sidebar-premium__bg,
.sidebar-premium__glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.sidebar-premium__glow {
    background: radial-gradient(circle at 18% 8%, rgba(255, 210, 52, 0.18), transparent 22%);
    opacity: .9;
}

.sidebar-premium__brand {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    padding: 10px 8px 14px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.sidebar-premium__brand-mark {
    width: 46px;
    height: 46px;
    min-width: 46px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ffd234 0%, #ffbf00 100%);
    color: #0a1322;
    box-shadow:
        0 10px 24px rgba(255, 210, 52, .22),
        0 0 0 1px rgba(255,255,255,.1) inset;
    font-size: 1.1rem;
}

.sidebar-premium__brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.sidebar-premium__brand-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: .2px;
}

.sidebar-premium__brand-subtitle {
    color: rgba(255,255,255,.64);
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: .73rem;
    margin-top: 2px;
}

.sidebar-premium__nav {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-premium__link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 16px;
    color: rgba(230, 237, 247, .84);
    text-decoration: none;
    transition: all .25s ease;
    border: 1px solid transparent;
    background: transparent;
    font-weight: 600;
    overflow: hidden;
}

.sidebar-premium__link i {
    font-size: 1.05rem;
    min-width: 18px;
}

.sidebar-premium__link:hover {
    color: #fff;
    background: rgba(255,255,255,.05);
    border-color: rgba(255,255,255,.04);
    transform: translateX(2px);
}

.sidebar-premium__link.is-active {
    color: #fff5cc;
    background: linear-gradient(90deg, rgba(255, 210, 52, 0.18), rgba(255,255,255,0.03));
    border-color: rgba(255, 210, 52, 0.18);
    box-shadow:
        inset 3px 0 0 #ffd234,
        0 10px 30px rgba(0,0,0,.16);
}

.sidebar-premium__link.is-active i {
    color: #ffd234;
}

.sidebar-premium__group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-premium__link--toggle {
    width: 100%;
    border: 1px solid transparent;
    background: transparent;
    text-align: left;
    justify-content: space-between;
    cursor: pointer;
}

.sidebar-premium__link-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-premium__submenu {
    display: none;
    flex-direction: column;
    gap: 6px;
    padding-left: 18px;
    margin-top: 2px;
}

.sidebar-premium__submenu.is-open {
    display: flex;
}

.sidebar-premium__sublink {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 10px 14px;
    border-radius: 14px;
    text-decoration: none;
    color: rgba(230, 237, 247, .72);
    transition: all .22s ease;
    font-size: .92rem;
    border: 1px solid transparent;
}

.sidebar-premium__sublink:hover {
    color: #fff;
    background: rgba(255,255,255,.05);
}

.sidebar-premium__sublink.is-active {
    color: #ffd234;
    background: rgba(255, 210, 52, 0.10);
    border-color: rgba(255, 210, 52, 0.12);
    box-shadow: inset 2px 0 0 #ffd234;
}

.sidebar-premium__caret {
    transition: transform .25s ease;
    color: rgba(255,255,255,.64);
}

.sidebar-premium__caret.is-rotated {
    transform: rotate(180deg);
}

.sidebar-premium.collapsed {
    width: 88px;
    min-width: 88px;
}

.sidebar-premium.collapsed .sidebar-premium__brand-text,
.sidebar-premium.collapsed .sidebar-premium__link span,
.sidebar-premium.collapsed .sidebar-premium__link-content span,
.sidebar-premium.collapsed .sidebar-premium__submenu {
    display: none !important;
}

.sidebar-premium.collapsed .sidebar-premium__link,
.sidebar-premium.collapsed .sidebar-premium__link--toggle {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.sidebar-premium.collapsed .sidebar-premium__caret {
    display: none;
}

@media (max-width: 991.98px) {
    .sidebar-premium {
        position: fixed;
        left: 0;
        transform: translateX(-100%);
    }

    .sidebar-premium.mobile-open {
        transform: translateX(0);
    }
}
.support-chat-box {
    max-height: 520px;
    overflow-y: auto;
    padding: 16px;
    border-radius: 18px;
    background: #f7f9fd;
    border: 1px solid #e8edf5;
}

.support-chat-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 18px;
}

.support-chat-row.is-admin {
    align-items: flex-end;
}

.support-chat-row.is-user {
    align-items: flex-start;
}

.support-chat-meta {
    font-size: .78rem;
    color: #6b7280;
    margin-bottom: 6px;
}

.support-chat-bubble {
    max-width: 78%;
    padding: 12px 14px;
    border-radius: 16px;
    line-height: 1.5;
    font-size: .95rem;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.support-chat-bubble.is-user {
    background: #0f172a;
    color: #fff;
    border-bottom-left-radius: 6px;
}

.support-chat-bubble.is-admin {
    background: linear-gradient(135deg, #ffd234, #ffbf00);
    color: #101828;
    border-bottom-right-radius: 6px;
}
.sidebar-premium__badge {
    margin-left: auto;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffd234;
    color: #111827;
    font-size: .75rem;
    font-weight: 700;
}
.support-chat-box {
    max-height: 520px;
    overflow-y: auto;
    padding: 16px;
    border-radius: 18px;
    background: #f7f9fd;
    border: 1px solid #e8edf5;
}

.support-chat-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 18px;
}

.support-chat-row.is-admin {
    align-items: flex-end;
}

.support-chat-row.is-user {
    align-items: flex-start;
}

.support-chat-meta {
    font-size: .78rem;
    color: #6b7280;
    margin-bottom: 6px;
}

.support-chat-bubble {
    max-width: 78%;
    padding: 12px 14px;
    border-radius: 16px;
    line-height: 1.5;
    font-size: .95rem;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.support-chat-bubble.is-user {
    background: #0f172a;
    color: #fff;
    border-bottom-left-radius: 6px;
}

.support-chat-bubble.is-admin {
    background: linear-gradient(135deg, #ffd234, #ffbf00);
    color: #101828;
    border-bottom-right-radius: 6px;
}
.support-chat-box {
    max-height: 520px;
    overflow-y: auto;
    padding: 16px;
    border-radius: 18px;
    background: #f7f9fd;
    border: 1px solid #e8edf5;
}

.support-chat-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 18px;
}

.support-chat-row.is-admin {
    align-items: flex-end;
}

.support-chat-row.is-user {
    align-items: flex-start;
}

.support-chat-meta {
    font-size: .78rem;
    color: #6b7280;
    margin-bottom: 6px;
}

.support-chat-bubble {
    max-width: 78%;
    padding: 12px 14px;
    border-radius: 16px;
    line-height: 1.5;
    font-size: .95rem;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.support-chat-bubble.is-user {
    background: #0f172a;
    color: #fff;
    border-bottom-left-radius: 6px;
}

.support-chat-bubble.is-admin {
    background: linear-gradient(135deg, #ffd234, #ffbf00);
    color: #101828;
    border-bottom-right-radius: 6px;
}
.sidebar-premium__badge {
    margin-left: auto;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffd234;
    color: #111827;
    font-size: .75rem;
    font-weight: 700;
}
/* =========================================
   ANIMACIONES PREMIUM UI
========================================= */

:root {
    --premium-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --premium-shadow-hover: 0 18px 40px rgba(15, 23, 42, 0.12);
    --premium-yellow-glow: 0 0 0 1px rgba(255, 210, 52, 0.18), 0 10px 24px rgba(255, 210, 52, 0.18);
}

/* Entrada general */
@keyframes premiumFadeUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes premiumFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes premiumScaleIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Cards */
.card,
.support-chat-box,
.support-widget__panel {
    animation: premiumFadeUp .45s var(--premium-ease);
}

.card {
    transition: transform .25s var(--premium-ease), box-shadow .25s var(--premium-ease);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--premium-shadow-hover);
}

/* Botones */
.btn,
.sidebar-premium__link,
.sidebar-premium__sublink,
.support-widget__toggle {
    transition:
        transform .22s var(--premium-ease),
        box-shadow .22s var(--premium-ease),
        background-color .22s var(--premium-ease),
        border-color .22s var(--premium-ease),
        color .22s var(--premium-ease);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-dark:hover {
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.22);
}

.btn-outline-dark:hover,
.btn-outline-warning:hover,
.btn-outline-danger:hover,
.btn-outline-secondary:hover {
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.10);
}

/* Sidebar premium */
.sidebar-premium__link,
.sidebar-premium__sublink {
    position: relative;
    overflow: hidden;
}

.sidebar-premium__link::after,
.sidebar-premium__sublink::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.05), transparent);
    transform: translateX(-100%);
    transition: transform .55s var(--premium-ease);
}

.sidebar-premium__link:hover::after,
.sidebar-premium__sublink:hover::after {
    transform: translateX(100%);
}

.sidebar-premium__link.is-active {
    box-shadow: var(--premium-yellow-glow);
}

/* Tablas */
.table tbody tr {
    transition: transform .18s var(--premium-ease), background-color .18s var(--premium-ease);
}

.table tbody tr:hover {
    background-color: rgba(255, 210, 52, 0.04);
    transform: scale(1.003);
}

/* Inputs */
.form-control:focus,
.form-select:focus,
textarea:focus {
    border-color: rgba(255, 210, 52, 0.6) !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 210, 52, 0.12) !important;
}

/* Chat admin y usuario */
.support-chat-row {
    animation: premiumFadeUp .32s var(--premium-ease);
}

.support-chat-bubble,
.support-widget__bubble {
    transition: transform .22s var(--premium-ease), box-shadow .22s var(--premium-ease);
}

.support-chat-bubble:hover,
.support-widget__bubble:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.10);
}

/* Widget soporte */
.support-widget__panel {
    transform-origin: bottom right;
    animation: premiumScaleIn .28s var(--premium-ease);
}

.support-widget__toggle:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 16px 34px rgba(0, 0, 0, .22);
}

.support-widget__badge {
    animation: premiumFadeIn .25s var(--premium-ease);
}

/* Encabezados de página */
.page-header h1,
.page-header .mb-1 {
    animation: premiumFadeUp .38s var(--premium-ease);
}

.page-header p,
.page-header .text-muted {
    animation: premiumFadeIn .55s var(--premium-ease);
}

/* Alertas */
.alert {
    animation: premiumFadeUp .3s var(--premium-ease);
}
.support-chat-box::-webkit-scrollbar,
.support-widget__messages::-webkit-scrollbar {
    width: 10px;
}

.support-chat-box::-webkit-scrollbar-track,
.support-widget__messages::-webkit-scrollbar-track {
    background: transparent;
}

.support-chat-box::-webkit-scrollbar-thumb,
.support-widget__messages::-webkit-scrollbar-thumb {
    background: rgba(34, 58, 94, 0.25);
    border-radius: 999px;
}

.support-chat-box::-webkit-scrollbar-thumb:hover,
.support-widget__messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 210, 52, 0.45);
}
.badge.bg-warning.text-dark {
    box-shadow: 0 8px 18px rgba(255, 191, 0, 0.18);
}

.badge.bg-success {
    box-shadow: 0 8px 18px rgba(34, 197, 94, 0.16);
}

.badge.bg-secondary {
    box-shadow: 0 8px 18px rgba(100, 116, 139, 0.14);
}
.global-search-results {
    position: absolute;
    top: 110%;
    left: 0;
    width: 320px;
    max-height: 380px;
    overflow-y: auto;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(15,23,42,0.15);
    border: 1px solid #e5e9f2;
    z-index: 9999;
}

.global-search-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f1f4f9;
    transition: background .2s;
}

.global-search-item:hover {
    background: rgba(255,210,52,0.08);
}

.global-search-item strong {
    display: block;
    font-size: .9rem;
}

.global-search-item small {
    color: #6b7280;
}
.topbar-search--global {
    position: relative;
}

.global-search-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    max-height: 380px;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15);
    border: 1px solid #e5e9f2;
    z-index: 9999;
    padding: 8px 0;
}

.global-search-item {
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f1f4f9;
    transition: background .2s ease;
}

.global-search-item:last-child {
    border-bottom: none;
}

.global-search-item:hover {
    background: rgba(255, 210, 52, 0.08);
}

.global-search-item strong {
    display: block;
    font-size: .92rem;
    color: #111827;
}

.global-search-item small {
    color: #6b7280;
    font-size: .82rem;
}

.global-search-role {
    display: inline-flex;
    margin-top: 6px;
    font-size: .72rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 4px 8px;
    background: #f4f6fb;
    color: #334155;
}
#admin-support-user-meta .presence-badge {
    margin-left: 8px;
}

.presence-badge--online {
    animation: pulsePresence 1.8s infinite;
}

@keyframes pulsePresence {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.22); }
    70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}