/**
 * ============================================================================
 * LECTOR JSON — FACTUDTE
 * Design System: Glassmorphism + Gradients + Bordes Sutiles
 * ============================================================================
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /**
     * Design Tokens · Paleta validada WCAG 2.1 AA (contraste mínimo 4.5:1 sobre #FFFFFF)
     * ---------------------------------------------------------------------------------
     * Cálculos relativos luminancia sRGB lineal, ratio = (L1 + 0.05) / (L2 + 0.05)
     *   --text-main  #1E293B  ≈ 15.2:1  ✅
     *   --text-sub   #334155  ≈ 7.26:1  ✅
     *   --text-muted #475569  ≈ 6.48:1  ✅ (antes #64748B = 4.07:1 ❌)
     *   --text-hint  #596777  ≈ 4.90:1  ✅ (antes #94A3B8 = 2.64:1 ❌)
     *   --primary    #4F46E5  ≈ 7.55:1  ✅
     *   --secondary  #0891B2  ≈ 4.54:1  ✅ (antes #06B6D4 = 1.75:1 ❌ texto blanco sobre él)
     *   --success    #059669  ≈ 5.77:1  ✅ (antes #10B981 = 2.41:1 ❌ como texto sobre blanco)
     *   --warning    #D97706  ≈ 4.58:1  ✅ (antes #F59E0B = 2.14:1 ❌ como texto sobre blanco)
     *   --danger     #DC2626  ≈ 5.59:1  ✅
     *   --purple     #7C3AED  ≈ 4.57:1  ✅
     */
    --primary:       #4F46E5;
    --primary-dark:  #3730A3;
    --primary-light: #818CF8;
    --secondary:     #0891B2;
    --success:       #059669;
    --warning:       #D97706;
    --danger:        #DC2626;
    --info:          #0891B2;
    --purple:        #7C3AED;

    --success-bg:  #D1FAE5;
    --danger-bg:   #FEE2E2;
    --warning-bg:  #FEF3C7;
    --info-bg:     #CFFAFE;

    --bg-body:      #F0F5FF;
    --bg-sidebar:   #FFFFFF;
    --topbar-height: 56px;

    --gradient-main:    linear-gradient(135deg, #4F46E5 0%, #7C3AED 50%, #A855F7 100%);
    --gradient-welcome: linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #0891B2 100%);
    --gradient-emerald: linear-gradient(135deg, #059669 0%, #10B981 50%, #34D399 100%);
    --gradient-cyan:    linear-gradient(135deg, #0E7490 0%, #0891B2 50%, #06B6D4 100%);
    --gradient-sunset:  linear-gradient(135deg, #B45309 0%, #D97706 50%, #F59E0B 100%);
    --gradient-danger:  linear-gradient(135deg, #B91C1C 0%, #DC2626 50%, #EF4444 100%);
    --gradient-rose:    linear-gradient(135deg, #BE123C 0%, #E11D48 50%, #EC4899 100%);
    --gradient-slate:   linear-gradient(135deg, #334155 0%, #475569 50%, #64748B 100%);

    /**
     * Badges WCAG (pequeños <14px · necesitan ≥4.5:1 con texto blanco sobre color)
     * Se usan versiones shade-600 de Tailwind (más oscuras) en los gradientes.
     */
    --badge-success: #059669;  /* ratio sobre blanco con blanco-texto = 1.05/0.182≈5.77:1 ✅ */
    --badge-warning: #B45309;  /* 1.05/0.158≈6.65:1 ✅  */
    --badge-danger:  #B91C1C;  /* 1.05/0.08≈13.1:1 ✅ */
    --badge-info:    #0E7490;  /* 1.05/0.23≈4.57:1 ✅ */
    --badge-purple:  #6D28D9;  /* 1.05/0.117≈8.97:1 ✅ */
    --badge-amber:   #B45309;

    --text-main:  #1E293B;
    --text-sub:   #334155;
    --text-muted: #475569;
    --text-hint:  #596777;

    --border:       #E2E8F0;
    --border-light: #F1F5F9;

    --glass-bg:       rgba(255, 255, 255, 0.65);
    --glass-bg-strong:rgba(255, 255, 255, 0.82);
    --glass-border:   rgba(255, 255, 255, 0.6);
    --glass-shadow:   0 4px 20px rgba(30, 41, 59, 0.05);

    --card-shadow:       0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.03);
    --card-shadow-hover: 0 6px 20px rgba(79, 70, 229, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
    --shadow-lg:         0 16px 40px rgba(79, 70, 229, 0.12), 0 4px 12px rgba(15, 23, 42, 0.05);

    --radius:    14px;
    --radius-sm: 10px;
    --radius-xs: 7px;
    --radius-pill: 9999px;

    --ease: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --ease-fast: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

    /**
     * Helpers de contraste: usar con texto sobre gradientes o fondos complejos.
     * Útil para pantallas con bajo brillo o luz solar directa.
     */
    --text-contrast-shadow: 0 1px 2px rgba(15,23,42,0.35);
    --text-contrast-strong: 0 1px 2px rgba(15,23,42,0.55), 0 0 6px rgba(15,23,42,0.25);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-main);
    text-rendering: optimizeLegibility;
    background-color: #0000004f;
    background-image:
        radial-gradient(circle at 0% 0%,      rgba(99, 102, 241, 0.10) 0%, transparent 10%),
        radial-gradient(circle at 100% 0%,    rgba(168, 85, 247, 0.08) 0%, transparent 5%),
        linear-gradient(180deg, #ffffffd7 0%, #F8FAFC 100%);
    background-attachment: fixed;

    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.login-page {
    min-height: 100vh;
    background-image:
        radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.18) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(168, 85, 247, 0.16) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.10) 0%, transparent 60%),
        linear-gradient(180deg, #EEF2FF 0%, #F8FAFC 100%);
}

body.onboarding-page {
    font-feature-settings: "cv02", "cv03", "cv04", "cv11", "ss01";
    background:
        radial-gradient(1200px 800px at 8% 0%, rgba(124, 58, 237, 0.18) 0%, transparent 55%),
        radial-gradient(900px 700px at 100% 10%, rgba(79, 70, 229, 0.15) 0%, transparent 55%),
        radial-gradient(1000px 800px at 50% 120%, rgba(6, 182, 212, 0.14) 0%, transparent 60%),
        linear-gradient(180deg, #eef2ff 0%, #f5f3ff 50%, #ecfeff 100%);
    background-attachment: fixed;
}

body.body-lock-scroll {
    overflow: hidden;
}

/* ==========================================================================
   NAVBAR — Glass sutil con borde degradado
   ========================================================================== */
.glass-navbar {
    background: rgba(255, 255, 255, 0.32) !important;
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.55) !important;
    box-shadow:
        0 1px 0 rgba(226, 232, 240, 0.7),
        0 12px 48px -12px rgba(79, 70, 229, 0.14),
        0 8px 22px -14px rgba(15, 23, 42, 0.14) !important;
    height: var(--topbar-height);
    position: relative;
    background-clip: padding-box;
}

.glass-navbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(79, 70, 229, 0.22) 22%,
        rgba(168, 85, 247, 0.26) 50%,
        rgba(6, 182, 212, 0.22) 78%,
        transparent 100%
    );
}

.navbar-brand {
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--primary) !important;
    transition: var(--ease-fast);
}

.navbar-brand:hover { transform: scale(1.01); }

.navbar-brand img {
    filter: drop-shadow(0 1px 3px rgba(79, 70, 229, 0.3));
}

.navbar-nav .nav-link {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-sub) !important;
    padding: 0.4rem 0.8rem !important;
    border-radius: var(--radius-xs);
    transition: var(--ease-fast);
    margin: 0 0.05rem;
    position: relative;
}

.navbar-nav .nav-link::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(168, 85, 247, 0.04));
    opacity: 0;
    transition: var(--ease-fast);
    z-index: -1;
}

.navbar-nav .nav-link:hover {
    color: var(--primary) !important;
    transform: translateY(-1px);
}

.navbar-nav .nav-link:hover::before { opacity: 1; }

.navbar-nav .nav-link.active {
    color: var(--primary) !important;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.10), rgba(168, 85, 247, 0.06));
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.12);
}

.dropdown-menu {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-sm);
    box-shadow:
        0 8px 24px rgba(79, 70, 229, 0.09),
        0 2px 6px rgba(15, 23, 42, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 1);
    padding: 0.35rem;
}

.dropdown-item {
    color: var(--text-sub);
    font-weight: 500;
    font-size: 0.8rem;
    border-radius: var(--radius-xs);
    padding: 0.45rem 0.75rem;
    transition: var(--ease-fast);
}

.dropdown-item:hover {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.07), rgba(168, 85, 247, 0.03));
    color: var(--primary);
    transform: translateX(2px);
}

.dropdown-divider {
    border-top: 1px solid rgba(226, 232, 240, 0.7);
    margin: 0.4rem 0.2rem;
}

/* ==========================================================================
   CARDS — Glass con borde degradado sutil
   ========================================================================== */
.card,
.glass-card {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: var(--radius);
    box-shadow:
        var(--card-shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: var(--ease);
    color: var(--text-main);
    position: relative;
    overflow: visible;
    isolation: isolate;
}

.card > .card-header,
.glass-card > .card-header {
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
    overflow: hidden;
}

.card > .card-footer,
.glass-card > .card-footer {
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
    overflow: hidden;
}

.glass-card .dropdown-menu,
.card .dropdown-menu {
    z-index: 9999 !important;
}

.dropdown-menu {
    z-index: 9999 !important;
    --bs-dropdown-zindex: 9999;
}

.card::before,
.glass-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    padding: 1px;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 1) 0%,
        rgba(79, 70, 229, 0.06) 40%,
        rgba(168, 85, 247, 0.04) 70%,
        rgba(255, 255, 255, 1) 100%
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.8;
}

.card:hover,
.glass-card:hover {
    box-shadow:
        var(--card-shadow-hover),
        inset 0 1px 0 rgba(255, 255, 255, 1);
    transform: translateY(-1px);
}

.glass-card-interactive {
    cursor: pointer;
    transition: var(--ease-bounce);
}

.glass-card-interactive::before {
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 1) 0%,
        rgba(79, 70, 229, 0.10) 40%,
        rgba(168, 85, 247, 0.08) 70%,
        rgba(255, 255, 255, 1) 100%
    );
}

.glass-card-interactive:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow:
        0 18px 44px rgba(79, 70, 229, 0.14),
        0 6px 14px rgba(15, 23, 42, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 1);
}

.card-header {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
    padding: 0.8rem 1.1rem;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text-main);
    border-radius: var(--radius) var(--radius) 0 0 !important;
}

.card-header.bg-gradient-main,
.card-header.bg-gradient-indigo {
    background: var(--gradient-main) !important;
    color: #fff;
    border: none;
    position: relative;
    overflow: hidden;
}

.card-header.bg-gradient-indigo::before,
.card-header.bg-gradient-main::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 0%, rgba(255,255,255,0.18) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(255,255,255,0.08) 0%, transparent 50%);
    pointer-events: none;
}

.card-header.bg-gradient-emerald {
    background: var(--gradient-emerald) !important;
    color: #fff;
    border: none;
    position: relative;
    overflow: hidden;
}

.card-header.bg-gradient-emerald::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 0%, rgba(255,255,255,0.18) 0%, transparent 50%);
    pointer-events: none;
}

.card-header.bg-gradient-cyan    { background: var(--gradient-cyan) !important;    color: #fff; border: none; }
.card-header.bg-gradient-sunset  { background: var(--gradient-sunset) !important;  color: #fff; border: none; }
.card-header.bg-gradient-danger  { background: var(--gradient-danger) !important;  color: #fff; border: none; }

.card-body   { padding: 1.1rem; }
.card-footer {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(226, 232, 240, 0.7);
    padding: 0.8rem 1.1rem;
}

/* Stat icon wrapper con gradiente y glass */
.stat-icon-wrapper {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 2px 8px rgba(0,0,0,0.06),
        inset 0 1px 0 rgba(255,255,255,0.25);
    transition: var(--ease-fast);
}

.stat-icon-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.25), transparent);
    transform: skewX(-20deg);
    transition: all 0.5s ease;
}

.glass-card:hover .stat-icon-wrapper::after {
    left: 150%;
}

.glass-card:hover .stat-icon-wrapper {
    transform: scale(1.05);
}

/* ==========================================================================
   HERO BANNER — Vidrio esmerilado con gradiente
   ========================================================================== */
.hero-banner {
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    background: var(--gradient-welcome);
    box-shadow:
        var(--shadow-lg),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.hero-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 20%, rgba(255,255,255,0.22) 0%, transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(255,255,255,0.12) 0%, transparent 40%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.hero-banner::after {
    content: '';
    position: absolute;
    bottom: -40%;
    right: -10%;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(255,255,255,0.14) 0%, transparent 70%);
    pointer-events: none;
    border-radius: 50%;
}

.glass-pill {
    background: rgba(255, 255, 255, 0.18) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.28) !important;
    border-radius: var(--radius-pill);
    padding: 0.4rem 1rem;
    box-shadow:
        0 4px 14px rgba(0,0,0,0.08),
        inset 0 1px 0 rgba(255,255,255,0.2);
}

.bg-gradient-dark { background: var(--gradient-slate) !important; }
.bg-emerald { background: var(--gradient-emerald) !important; }

/* ==========================================================================
   DEGRADADOS DE MARCA
   ========================================================================== */
.bg-gradient-indigo,
.bg-gradient-main    { background: var(--gradient-main)    !important; }
.bg-gradient-emerald { background: var(--gradient-emerald) !important; }
.bg-gradient-cyan    { background: var(--gradient-cyan)    !important; }
.bg-gradient-sunset  { background: var(--gradient-sunset)  !important; }
.bg-gradient-danger  { background: var(--gradient-danger)  !important; }
.bg-gradient-welcome { background: var(--gradient-welcome) !important; }
.bg-gradient-rose    { background: var(--gradient-rose)    !important; }
.bg-gradient-purple  { background: linear-gradient(135deg, #7C3AED 0%, #A855F7 100%) !important; }

/* ==========================================================================
   BOTONES
   ========================================================================== */
.btn {
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.825rem;
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    border: none;
    transition: var(--ease-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    cursor: pointer;
    line-height: 1.35;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 50%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.25), transparent);
    transform: skewX(-20deg);
    transition: all 0.5s ease;
}

.btn:hover::after { left: 130%; }

.btn-lg { padding: 0.7rem 1.5rem; font-size: 0.9rem; border-radius: var(--radius); }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.75rem; border-radius: var(--radius-xs); }

.btn-primary {
    background: var(--gradient-main);
    color: #fff;
    box-shadow:
        0 4px 16px rgba(79, 70, 229, 0.32),
        inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-primary:hover {
    filter: brightness(1.08);
    transform: translateY(-2px);
    box-shadow:
        0 10px 26px rgba(79, 70, 229, 0.42),
        inset 0 1px 0 rgba(255,255,255,0.2);
    color: #fff;
}

.btn-success {
    background: var(--gradient-emerald);
    color: #fff;
    box-shadow: 0 4px 16px rgba(5, 150, 105, 0.28);
}
.btn-success:hover { filter: brightness(1.08); transform: translateY(-2px); color: #fff; box-shadow: 0 10px 26px rgba(5, 150, 105, 0.38); }

.btn-info {
    background: var(--gradient-cyan);
    color: #fff;
    box-shadow: 0 4px 16px rgba(6, 182, 212, 0.28);
}
.btn-info:hover { filter: brightness(1.08); transform: translateY(-2px); color: #fff; box-shadow: 0 10px 26px rgba(6, 182, 212, 0.38); }

.btn-warning {
    background: var(--gradient-sunset);
    color: #fff;
    box-shadow: 0 4px 16px rgba(217, 119, 6, 0.28);
}
.btn-warning:hover { filter: brightness(1.08); transform: translateY(-2px); color: #fff; box-shadow: 0 10px 26px rgba(217, 119, 6, 0.38); }

.btn-danger {
    background: var(--gradient-danger);
    color: #fff;
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.28);
}
.btn-danger:hover { filter: brightness(1.08); transform: translateY(-2px); color: #fff; box-shadow: 0 10px 26px rgba(220, 38, 38, 0.38); }

.btn-outline-secondary {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    border: 1.5px solid rgba(226, 232, 240, 0.9);
    color: var(--text-sub);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}
.btn-outline-secondary:hover {
    background: #fff;
    color: var(--primary);
    border-color: rgba(79, 70, 229, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.10);
}

.btn-light {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    color: var(--text-sub);
    border: 1px solid rgba(255, 255, 255, 0.95);
    box-shadow:
        0 2px 8px rgba(0,0,0,0.05),
        inset 0 1px 0 rgba(255,255,255,1);
}
.btn-light:hover {
    background: #fff;
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.15);
}

/* ==========================================================================
   TABLAS
   ========================================================================== */
.table {
    font-size: 0.825rem;
    color: var(--text-main);
    margin-bottom: 0;
}

.table th {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.625rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: rgba(248, 250, 252, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1.5px solid rgba(226, 232, 240, 0.9);
    padding: 0.6rem 0.8rem;
    white-space: nowrap;
}

.table td {
    padding: 0.55rem 0.8rem;
    vertical-align: middle;
    border-bottom: 1px solid rgba(241, 245, 249, 0.9);
    color: var(--text-main);
    background: transparent;
}

.table-hover tbody tr:hover td {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.04), rgba(168, 85, 247, 0.02));
}

.table-responsive { border-radius: var(--radius-sm); overflow: hidden; }

/* ==========================================================================
   FORMULARIOS
   ========================================================================== */
.form-control, .form-select {
    font-family: var(--font);
    border: 1.5px solid rgba(226, 232, 240, 0.9);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
    color: var(--text-main);
    transition: var(--ease-fast);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.03);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow:
        0 0 0 3px rgba(79, 70, 229, 0.10),
        inset 0 1px 2px rgba(0,0,0,0.03);
    background: #fff;
    color: var(--text-main);
    outline: none;
}

.form-label {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-sub);
    margin-bottom: 0.3rem;
}

.form-text { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ==========================================================================
   UPLOAD ZONE
   ========================================================================== */
.upload-zone {
    border: 2px dashed rgba(79, 70, 229, 0.25);
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.03), rgba(168, 85, 247, 0.02));
    backdrop-filter: blur(4px);
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--ease-fast);
    position: relative;
}

.upload-zone::before {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: calc(var(--radius) - 3px);
    background: rgba(255,255,255,0.35);
    pointer-events: none;
}

.upload-zone:hover {
    border-color: rgba(79, 70, 229, 0.5);
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.06), rgba(168, 85, 247, 0.04));
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.08);
}

.upload-zone.drag-over {
    border-color: var(--success);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.06), rgba(6, 182, 212, 0.03));
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.10);
}

.upload-icon-pulse {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background: var(--gradient-main);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow:
        0 8px 20px rgba(79, 70, 229, 0.32),
        inset 0 1px 0 rgba(255,255,255,0.25);
    animation: floatPulse 3.2s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.upload-icon-pulse::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(79, 70, 229, 0.2);
    animation: ringPulse 2s ease-out infinite;
}

@keyframes floatPulse {
    0%, 100% { transform: translateY(0);    box-shadow: 0 12px 32px rgba(79,70,229,0.40), inset 0 1px 0 rgba(255,255,255,0.25); }
    50%       { transform: translateY(-10px); box-shadow: 0 22px 44px rgba(79,70,229,0.52), inset 0 1px 0 rgba(255,255,255,0.25); }
}

@keyframes ringPulse {
    0%   { transform: scale(0.9); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* ==========================================================================
   ALERTAS
   ========================================================================== */
.alert {
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.9rem 1.15rem;
    font-size: 0.875rem;
    font-weight: 500;
    backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.alert::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;
}

.alert-success {
    background: linear-gradient(135deg, #ECFDF5, #D1FAE5);
    color: #065F46;
}
.alert-success::before { background: var(--gradient-emerald); }

.alert-danger {
    background: linear-gradient(135deg, #FEF2F2, #FEE2E2);
    color: #7F1D1D;
}
.alert-danger::before { background: var(--gradient-danger); }

.alert-info {
    background: linear-gradient(135deg, #ECFEFF, #CFFAFE);
    color: #0C4A6E;
}
.alert-info::before { background: var(--gradient-cyan); }

.alert-warning {
    background: linear-gradient(135deg, #FFFBEB, #FEF3C7);
    color: #78350F;
}
.alert-warning::before { background: var(--gradient-sunset); }

/* ==========================================================================
   TOASTS
   ========================================================================== */
.fdte-toast-viewport {
    position: fixed;
    top: max(1rem, env(safe-area-inset-top));
    right: max(1rem, env(safe-area-inset-right));
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    width: min(100vw - 1.5rem, 420px);
    z-index: 2000;
    pointer-events: none;
}

.fdte-toast {
    --fdte-toast-accent: var(--primary);
    --fdte-toast-accent-soft: rgba(79, 70, 229, 0.18);
    --fdte-toast-bg: rgba(255, 255, 255, 0.94);
    --fdte-toast-text: #172033;
    --fdte-toast-shadow:
        0 20px 40px rgba(15, 23, 42, 0.16),
        0 6px 18px rgba(79, 70, 229, 0.12);
    position: relative;
    overflow: hidden;
    pointer-events: auto;
    border-radius: 1.15rem;
    border: 1px solid rgba(255, 255, 255, 0.72);
    background:
        linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(248,250,252,0.94) 100%);
    box-shadow: var(--fdte-toast-shadow);
    color: var(--fdte-toast-text);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    transform: translate3d(0, -10px, 0) scale(0.98);
    opacity: 0;
    transition:
        opacity 0.2s ease,
        transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.2s ease;
}

.fdte-toast::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: linear-gradient(180deg, var(--fdte-toast-accent), rgba(255, 255, 255, 0.92));
}

.fdte-toast.is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
}

.fdte-toast.is-leaving {
    opacity: 0;
    transform: translate3d(0, -8px, 0) scale(0.97);
}

.fdte-toast.is-paused .fdte-toast__progress::after {
    animation-play-state: paused;
}

.fdte-toast:focus-visible {
    outline: 3px solid rgba(79, 70, 229, 0.28);
    outline-offset: 3px;
}

.fdte-toast__content-wrap {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: 0.875rem;
    padding: 1rem 1rem 0.95rem 1rem;
}

.fdte-toast__icon {
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: linear-gradient(135deg, var(--fdte-toast-accent-soft), rgba(255,255,255,0.8));
    color: var(--fdte-toast-accent);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
    font-size: 1rem;
    flex-shrink: 0;
}

.fdte-toast__body {
    min-width: 0;
}

.fdte-toast__title {
    font-size: 0.95rem;
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #0f172a;
    margin-bottom: 0.2rem;
}

.fdte-toast__message {
    font-size: 0.875rem;
    line-height: 1.55;
    color: #334155;
    word-break: break-word;
}

.fdte-toast__close {
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 9999px;
    background: rgba(148, 163, 184, 0.12);
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--ease-fast);
    flex-shrink: 0;
}

.fdte-toast__close:hover,
.fdte-toast__close:focus-visible {
    background: rgba(15, 23, 42, 0.12);
    color: #0f172a;
}

.fdte-toast__close:focus-visible {
    outline: 2px solid rgba(79, 70, 229, 0.28);
    outline-offset: 2px;
}

.fdte-toast__progress {
    position: relative;
    height: 4px;
    background: rgba(226, 232, 240, 0.7);
}

.fdte-toast__progress::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--fdte-toast-accent), rgba(255, 255, 255, 0.92));
    transform-origin: left center;
    animation: fdteToastProgress var(--fdte-toast-duration, 5000ms) linear forwards;
}

.fdte-toast--success {
    --fdte-toast-accent: #047857;
    --fdte-toast-accent-soft: rgba(5, 150, 105, 0.16);
}

.fdte-toast--info {
    --fdte-toast-accent: #0f766e;
    --fdte-toast-accent-soft: rgba(8, 145, 178, 0.16);
}

.fdte-toast--warning {
    --fdte-toast-accent: #b45309;
    --fdte-toast-accent-soft: rgba(217, 119, 6, 0.18);
}

.fdte-toast--danger {
    --fdte-toast-accent: #b91c1c;
    --fdte-toast-accent-soft: rgba(220, 38, 38, 0.18);
}

@keyframes fdteToastProgress {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

@media (max-width: 767.98px) {
    .fdte-toast-viewport {
        top: max(0.75rem, env(safe-area-inset-top));
        left: max(0.75rem, env(safe-area-inset-left));
        right: max(0.75rem, env(safe-area-inset-right));
        width: auto;
    }

    .fdte-toast {
        border-radius: 1rem;
    }

    .fdte-toast__content-wrap {
        padding: 0.95rem 0.9rem 0.9rem 0.9rem;
        gap: 0.75rem;
    }

    .fdte-toast__title {
        font-size: 0.9rem;
    }

    .fdte-toast__message {
        font-size: 0.825rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fdte-toast,
    .fdte-toast__close,
    .fdte-toast__progress::after {
        transition: none !important;
        animation: none !important;
    }

    .fdte-toast {
        transform: none !important;
    }
}

/* ==========================================================================
   BADGES
   ========================================================================== */
.badge {
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.65rem;
    padding: 0.3em 0.65em;
    border-radius: var(--radius-pill);
    letter-spacing: 0.02em;
    backdrop-filter: blur(6px);
}

/* ==========================================================================
   LIST-GROUP
   ========================================================================== */
.list-group-item {
    background: transparent;
    border-color: rgba(241, 245, 249, 0.9);
    color: var(--text-main);
    transition: var(--ease-fast);
    font-size: 0.825rem;
    padding: 0.65rem 1rem;
}

.list-group-item:hover {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.04), transparent);
    padding-left: 1.15rem;
}

.list-group-item.active {
    background: var(--gradient-main) !important;
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
}

.list-group-item-action:hover {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.06), rgba(168, 85, 247, 0.02)) !important;
    color: var(--primary);
}

/* ==========================================================================
   ACCORDION
   ========================================================================== */
.accordion-button {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.825rem;
    box-shadow: none !important;
    border-radius: var(--radius-sm) !important;
    padding: 0.55rem 1rem;
}

.accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.06), rgba(168, 85, 247, 0.03));
    color: var(--primary);
    box-shadow: none !important;
}

.accordion-body { background: rgba(255, 255, 255, 0.4); color: var(--text-main); font-size: 0.825rem; padding: 0.9rem 1rem; }
.accordion-item {
    border-color: rgba(226, 232, 240, 0.7);
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    border-radius: var(--radius);
    overflow: hidden;
}

/* ==========================================================================
   MODAL
   ========================================================================== */
.modal-content {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.95);
    border-radius: var(--radius);
    box-shadow:
        0 24px 60px rgba(15, 23, 42, 0.16),
        0 6px 16px rgba(15, 23, 42, 0.05),
        inset 0 1px 0 rgba(255,255,255,1);
    color: var(--text-main);
}

.modal-header {
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
    padding: 0.9rem 1.2rem;
    background: rgba(255, 255, 255, 0.5);
}
.modal-footer {
    border-top: 1px solid rgba(226, 232, 240, 0.7);
    padding: 0.75rem 1.2rem;
    background: rgba(255, 255, 255, 0.4);
}

/* ==========================================================================
   FOOTER — Glass sutil
   ========================================================================== */
.glass-footer {
    background: rgba(255, 255, 255, 0.68) !important;
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-top: 1px solid rgba(255, 255, 255, 0.8) !important;
    padding: 1rem 1.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    position: relative;
    box-shadow: 0 -2px 12px rgba(79, 70, 229, 0.03);
}

/* ==========================================================================
   LOGIN — Diseño glassmorphism full-screen
   ========================================================================== */
body.login-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 10%, rgba(99, 102, 241, 0.25), transparent 50%),
        radial-gradient(circle at 80% 90%, rgba(236, 72, 153, 0.20), transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.15), transparent 60%),
        linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    overflow-x: hidden;
}
body.login-body::before {
    content: "";
    position: absolute; inset: 0;
    background-image:
        radial-gradient(rgba(255,255,255,0.07) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
    opacity: 0.5;
    z-index: 0;
}
.login-card {
    position: relative; z-index: 1;
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 1.5rem;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.45);
    padding: 2.5rem 2rem;
    color: #f1f5f9;
}
.login-card .login-logo {
    width: 72px; height: 72px;
    border-radius: 1.25rem;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 12px 32px rgba(124, 58, 237, 0.45);
    margin-bottom: 1rem;
}
.login-card .login-logo i { font-size: 2rem; color: #fff; }
.login-card h1 { font-size: 1.6rem; font-weight: 800; margin: 0; }
.login-card .lead { font-size: 0.9rem; opacity: 0.92; margin-top: 0.35rem; text-shadow: 0 1px 2px rgba(0,0,0,0.45); }
.login-card .form-control {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.24);
    color: #f8fafc;
    border-radius: 0.75rem;
    padding: 0.7rem 0.95rem;
    transition: all 0.2s;
    box-shadow: inset 0 1px 1px rgba(0,0,0,0.25);
}
.login-card .form-control::placeholder { color: rgba(241, 245, 249, 0.72); font-weight: 500; }
.login-card .form-control:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(165, 180, 252, 0.72);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.22), inset 0 1px 1px rgba(0,0,0,0.2);
    color: #fff;
}
.login-card .input-group-text {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-right: none;
    color: rgba(241, 245, 249, 0.88);
    border-radius: 0.75rem 0 0 0.75rem;
}
.login-card .input-group .form-control { border-left: none; border-radius: 0 0.75rem 0.75rem 0; }
.login-card .form-label {
    font-size: 0.78rem; font-weight: 700; color: rgba(248, 250, 252, 0.92);
    text-transform: uppercase; letter-spacing: 0.05em;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.login-card .btn-primary {
    background: linear-gradient(135deg, #4338CA 0%, #6D28D9 100%);
    border: none;
    border-radius: 0.75rem;
    padding: 0.78rem 1rem;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.45), inset 0 1px 0 rgba(255,255,255,0.18);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}
.login-card .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(79, 70, 229, 0.55); }
.login-card .btn-google {
    background: rgba(255, 255, 255, 0.97);
    color: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.68);
    border-radius: 0.75rem;
    padding: 0.7rem 1rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center; gap: 0.6rem;
    width: 100%;
    text-decoration: none;
    transition: all 0.2s;
}
.login-card .btn-google:hover { background: #fff; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0,0,0,0.28); }
.login-card .divider {
    display: flex; align-items: center; gap: 0.75rem;
    color: rgba(241, 245, 249, 0.78);
    font-size: 0.75rem;
    font-weight: 600;
    margin: 1.25rem 0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.login-card .divider::before, .login-card .divider::after {
    content: ""; flex: 1; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.30), transparent);
}
.login-card .login-footer {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    text-align: center;
    font-size: 0.77rem;
    font-weight: 500;
    color: rgba(241, 245, 249, 0.78);
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.login-chip {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.3rem 0.7rem;
    background: rgba(99, 102, 241, 0.18);
    color: #c7d2fe;
    border-radius: 9999px;
    font-size: 0.7rem; font-weight: 600;
    border: 1px solid rgba(99, 102, 241, 0.3);
}
.login-alert {
    border-radius: 0.75rem;
    padding: 0.7rem 0.95rem;
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
    border: 1px solid;
}
.login-alert.danger  { background: rgba(239, 68, 68, 0.15);  color: #fecaca; border-color: rgba(239, 68, 68, 0.3); }
.login-alert.success { background: rgba(16, 185, 129, 0.15); color: #a7f3d0; border-color: rgba(16, 185, 129, 0.3); }
.login-alert.warning { background: rgba(245, 158, 11, 0.15); color: #fde68a; border-color: rgba(245, 158, 11, 0.3); }
.login-alert.info    { background: rgba(99, 102, 241, 0.15); color: #c7d2fe; border-color: rgba(99, 102, 241, 0.3); }

@media (max-width: 480px) {
    .login-card { padding: 2rem 1.5rem; }
    .login-card h1 { font-size: 1.4rem; }
}

/* ============================================================
 * ADMIN · MODALES (Detalle, Reset, Mensaje, Bandeja)
 * ============================================================ */
.info-tile {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(99, 102, 241, 0.12);
    border-radius: 0.85rem;
    height: 100%;
    transition: all 0.18s ease;
}
.info-tile:hover {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(99, 102, 241, 0.28);
    transform: translateY(-1px);
}
.info-tile .icon {
    width: 38px; height: 38px;
    flex-shrink: 0;
    border-radius: 0.65rem;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(6,182,212,0.15));
    color: var(--primary);
    font-size: 0.95rem;
}
.info-tile .label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 0.15rem;
}
.info-tile .value {
    font-size: 0.92rem;
    color: #1f2937;
    font-weight: 500;
    word-break: break-word;
}

.stat-tile {
    text-align: center;
    padding: 1rem 0.75rem;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(99, 102, 241, 0.12);
    border-radius: 0.85rem;
    height: 100%;
}
.stat-tile .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}
.stat-tile .stat-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    margin-top: 0.25rem;
    font-weight: 600;
}

.empresa-asignada {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    background: rgba(99, 102, 241, 0.08);
    color: #4338ca;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 500;
    margin: 0.15rem 0.25rem 0.15rem 0;
    border: 1px solid rgba(99, 102, 241, 0.15);
}
.empresa-asignada i { color: var(--primary); }

.audit-list {
    list-style: none;
    padding: 0; margin: 0;
    max-height: 240px;
    overflow-y: auto;
}
.audit-item {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.55rem 0.75rem;
    border-radius: 0.6rem;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0,0,0,0.05);
    margin-bottom: 0.4rem;
    font-size: 0.82rem;
}
.audit-item .audit-icon {
    width: 28px; height: 28px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    font-size: 0.75rem;
}
.audit-item .audit-body { flex: 1; min-width: 0; }
.audit-item .audit-action { font-weight: 600; color: #1f2937; }
.audit-item .audit-meta { font-size: 0.7rem; color: #6b7280; }

.user-avatar-lg {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 6px 14px rgba(99, 102, 241, 0.25);
}

.action-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px; height: 30px;
    border-radius: 0.55rem;
    border: 1px solid rgba(99, 102, 241, 0.15);
    background: rgba(255, 255, 255, 0.7);
    color: var(--primary);
    text-decoration: none;
    transition: all 0.15s ease;
    margin: 0 1px;
    font-size: 0.78rem;
}
.action-pill:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-1px);
}
.action-pill.danger { color: var(--danger); border-color: rgba(239,68,68,0.25); }
.action-pill.danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.action-pill.warning { color: var(--warning); border-color: rgba(245,158,11,0.25); }
.action-pill.warning:hover { background: var(--warning); color: #fff; border-color: var(--warning); }
.action-pill.success { color: var(--success); border-color: rgba(16,185,129,0.25); }
.action-pill.success:hover { background: var(--success); color: #fff; border-color: var(--success); }
.action-pill.info { color: var(--secondary); border-color: rgba(8,145,178,0.25); }
.action-pill.info:hover { background: var(--secondary); color: #fff; border-color: var(--secondary); }

.modal-glass .modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.18);
}

/* ============================================================
 * CAMPANA DE NOTIFICACIONES (header) — Mejorada con glassmorphism
 * ============================================================ */
.bell-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.bell-btn {
    background: linear-gradient(135deg, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0.30) 100%);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border: 1px solid rgba(79, 70, 229, 0.18);
    color: #4F46E5;
    width: 42px; height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    transition: all 0.22s cubic-bezier(.22,1,.36,1);
    position: relative;
    box-shadow:
        0 2px 10px rgba(79, 70, 229, 0.08),
        inset 0 1px 0 rgba(255,255,255,0.9);
    cursor: pointer;
}
.bell-btn:hover {
    background: linear-gradient(135deg, rgba(79,70,229,0.12) 0%, rgba(168,85,247,0.08) 100%);
    color: #4338CA;
    border-color: rgba(79, 70, 229, 0.32);
    transform: translateY(-1.5px) scale(1.03);
    box-shadow:
        0 6px 18px rgba(79, 70, 229, 0.20),
        0 2px 4px rgba(15,23,42,0.06),
        inset 0 1px 0 rgba(255,255,255,1);
}
.bell-btn:hover i {
    animation: bellShake 0.6s cubic-bezier(.36,.07,.19,.97) both;
}
@keyframes bellShake {
    10%, 90% { transform: rotate(-8deg); }
    20%, 80% { transform: rotate(10deg); }
    30%, 50%, 70% { transform: rotate(-14deg); }
    40%, 60% { transform: rotate(14deg); }
}
.bell-btn .bell-dot {
    position: absolute;
    top: -4px; right: -4px;
    min-width: 20px; height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #EF4444 0%, #F87171 100%);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    line-height: 20px;
    text-align: center;
    padding: 0 5px;
    border: 2.5px solid rgba(255,255,255,0.95);
    box-shadow:
        0 4px 10px rgba(239, 68, 68, 0.45),
        0 0 0 1px rgba(239,68,68,0.2);
    animation: badgePulse 2.2s ease-in-out infinite;
}
@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.08); }
}
.bell-dropdown {
    width: 380px;
    max-width: 94vw;
    border-radius: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.95);
    box-shadow:
        0 30px 70px rgba(15, 23, 42, 0.22),
        0 8px 24px rgba(79, 70, 229, 0.12),
        inset 0 1px 0 rgba(255,255,255,1);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    margin-top: 0.6rem !important;
}
.bell-dropdown::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4F46E5 0%, #7C3AED 50%, #06B6D4 100%);
}
.bell-dropdown .bell-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.15rem 0.9rem;
    background: linear-gradient(135deg,
        rgba(79,70,229,0.10) 0%,
        rgba(168,85,247,0.06) 50%,
        rgba(6,182,212,0.08) 100%);
    border-bottom: 1px solid rgba(79, 70, 229, 0.10);
}
.bell-dropdown .bell-head h6 {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.bell-dropdown .bell-head h6 i {
    -webkit-text-fill-color: #4F46E5;
    font-size: 1rem;
}
.bell-dropdown .bell-list { max-height: 380px; overflow-y: auto; padding: 0.35rem 0; }
.bell-item {
    display: flex; align-items: flex-start; gap: 0.85rem;
    padding: 0.85rem 1.05rem;
    margin: 0 0.45rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.08);
    border-radius: 0.9rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.18s cubic-bezier(.22,1,.36,1);
    cursor: pointer;
    position: relative;
}
.bell-item:last-child { border-bottom: none; }
.bell-item:hover {
    background: linear-gradient(135deg, rgba(79,70,229,0.07) 0%, rgba(168,85,247,0.04) 100%);
    transform: translateX(3px);
    box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.10);
}
.bell-item.unread {
    background: linear-gradient(135deg, rgba(79,70,229,0.10) 0%, rgba(168,85,247,0.06) 100%);
    box-shadow: inset 3px 0 0 0 #4F46E5, inset 0 0 0 1px rgba(79, 70, 229, 0.10);
}
.bell-item.unread::before {
    content: '';
    position: absolute;
    top: 1.1rem;
    left: 0.55rem;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}
.bell-item.unread { padding-left: 1.85rem; }
.bell-item .bell-icon {
    width: 40px; height: 40px;
    flex-shrink: 0;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.95rem;
    color: #fff;
    text-shadow: var(--text-contrast-shadow);
    box-shadow:
        0 3px 10px rgba(0,0,0,0.12),
        inset 0 1px 0 rgba(255,255,255,0.25);
    position: relative;
    overflow: hidden;
}
.bell-item .bell-icon::after {
    content: '';
    position: absolute;
    top: 0; left: -50%;
    width: 100%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.22), transparent);
    transform: skewX(-20deg);
}
.bell-item .bell-icon.tipo-info    { background: linear-gradient(135deg, #0891B2, var(--badge-info)); }
.bell-item .bell-icon.tipo-aviso   { background: linear-gradient(135deg, var(--warning), var(--badge-warning)); }
.bell-item .bell-icon.tipo-alerta  { background: linear-gradient(135deg, var(--danger), var(--badge-danger)); }
.bell-item .bell-icon.tipo-cuenta  { background: linear-gradient(135deg, var(--badge-purple), var(--primary)); }
.bell-item .bell-icon.tipo-sistema { background: linear-gradient(135deg, var(--primary), var(--badge-info)); }
.bell-item .bell-icon.tipo-success { background: linear-gradient(135deg, var(--badge-success), #047857); }
.bell-item .bell-icon.tipo-warning { background: linear-gradient(135deg, var(--warning), var(--badge-warning)); }
.bell-item .bell-icon.tipo-danger  { background: linear-gradient(135deg, var(--danger), var(--badge-danger)); }
.bell-item .bell-icon.tipo-soporte { background: linear-gradient(135deg, var(--purple), var(--badge-purple)); }
.bell-item .bell-body { flex: 1; min-width: 0; }
.bell-item .bell-title {
    font-weight: 700;
    font-size: 0.86rem;
    line-height: 1.25;
    margin-bottom: 0.2rem;
    color: #1e293b;
}
.bell-item.unread .bell-title { color: #1e1b4b; font-weight: 800; }
.bell-item .bell-preview {
    font-size: 0.79rem;
    color: #475569;
    line-height: 1.4;
}
.bell-item .bell-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 500;
}
.bell-item .bell-time i { font-size: 0.62rem; }
.bell-empty {
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.88rem;
}
.bell-empty i {
    font-size: 2.8rem;
    background: linear-gradient(135deg, rgba(129,140,248,0.35), rgba(168,85,247,0.25));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.75rem;
    display: block;
}
.bell-dropdown .bell-foot {
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(79,70,229,0.04) 0%, rgba(6,182,212,0.04) 100%);
    border-top: 1px solid rgba(79, 70, 229, 0.08);
    text-align: center;
}
.bell-dropdown .bell-foot a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1.1rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: #fff;
    font-weight: 700;
    font-size: 0.78rem;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.30);
    transition: all 0.2s ease;
}
.bell-dropdown .bell-foot a:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(79, 70, 229, 0.42);
    filter: brightness(1.07);
}

/* ============================================================
 * BOTÓN REINICIAR DEL NAVBAR — Mejorado
 * ============================================================ */
.glass-navbar .btn-reiniciar-nav {
    padding: 0.45rem 0.95rem !important;
    border-radius: 12px !important;
    font-weight: 700;
    font-size: 0.78rem;
    transition: all 0.22s cubic-bezier(.22,1,.36,1);
    border: 1px solid rgba(239, 68, 68, 0.25) !important;
    color: #EF4444 !important;
    background: linear-gradient(135deg, rgba(255,255,255,0.7) 0%, rgba(254,226,226,0.35) 100%) !important;
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow:
        0 2px 10px rgba(239, 68, 68, 0.10),
        inset 0 1px 0 rgba(255,255,255,0.9);
}
.glass-navbar .btn-reiniciar-nav:hover {
    transform: translateY(-1.5px);
    border-color: rgba(239, 68, 68, 0.45) !important;
    background: linear-gradient(135deg, rgba(239,68,68,0.12) 0%, rgba(248,113,113,0.08) 100%) !important;
    color: #DC2626 !important;
    box-shadow:
        0 6px 18px rgba(239, 68, 68, 0.22),
        inset 0 1px 0 rgba(255,255,255,1);
}
.glass-navbar .btn-reiniciar-nav i {
    transition: transform 0.4s cubic-bezier(.34,1.56,.64,1);
}
.glass-navbar .btn-reiniciar-nav:hover i {
    transform: rotate(-180deg);
}

/* ============================================================
 * BANDEJA DE MENSAJES (vistas/mensajes.php) — Estilo Chat Real
 * ============================================================ */
.mensaje-card {
    background: rgba(255,255,255,0.82);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 1.25rem;
    padding: 1.15rem 1.25rem 1rem;
    margin-bottom: 1rem;
    transition: all 0.25s cubic-bezier(.22,1,.36,1);
    cursor: pointer;
    position: relative;
    box-shadow:
        var(--card-shadow),
        inset 0 1px 0 rgba(255,255,255,0.95);
    overflow: visible;
    isolation: isolate;
}
.mensaje-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1.25rem;
    padding: 1px;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 1) 0%,
        rgba(79, 70, 229, 0.08) 35%,
        rgba(168, 85, 247, 0.06) 65%,
        rgba(255, 255, 255, 1) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.9;
}
.mensaje-card:hover {
    box-shadow:
        0 12px 32px rgba(79, 70, 229, 0.10),
        0 4px 10px rgba(15, 23, 42, 0.05),
        inset 0 1px 0 rgba(255,255,255,1);
    transform: translateY(-3px);
}
.mensaje-card.unread {
    background: linear-gradient(135deg, rgba(255,255,255,0.92) 0%, rgba(224,231,255,0.65) 100%);
    border: 1px solid rgba(165, 180, 252, 0.45);
}
.mensaje-card.unread::after {
    content: '';
    position: absolute;
    top: 1.35rem;
    right: 1.25rem;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    box-shadow:
        0 0 0 4px rgba(79, 70, 229, 0.12),
        0 2px 8px rgba(79, 70, 229, 0.45);
    animation: msgPulse 2s ease-in-out infinite;
}
@keyframes msgPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12), 0 2px 8px rgba(79, 70, 229, 0.45); }
    50%      { transform: scale(1.12); box-shadow: 0 0 0 6px rgba(79, 70, 229, 0.08), 0 4px 14px rgba(79, 70, 229, 0.55); }
}
.mensaje-card.tipo-info   { --msg-accent: #0891B2; }
.mensaje-card.tipo-aviso  { --msg-accent: var(--warning); }
.mensaje-card.tipo-alerta { --msg-accent: var(--danger); }
.mensaje-card.tipo-cuenta { --msg-accent: var(--purple); }
.mensaje-card.tipo-sistema{ --msg-accent: #4F46E5; }
.mensaje-card.tipo-success{ --msg-accent: var(--success); }
.mensaje-card.tipo-warning{ --msg-accent: var(--warning); }
.mensaje-card.tipo-danger { --msg-accent: var(--danger); }
.mensaje-card.tipo-soporte{ --msg-accent: var(--badge-purple); }

.mensaje-card .msg-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.9rem;
}
.mensaje-card .msg-head-left {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    flex: 1;
    min-width: 0;
}
.mensaje-card .msg-avatar {
    width: 48px; height: 48px;
    border-radius: 16px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    text-shadow: var(--text-contrast-shadow);
    box-shadow:
        0 4px 14px rgba(0,0,0,0.12),
        inset 0 1px 0 rgba(255,255,255,0.25);
    position: relative;
    overflow: hidden;
}
.mensaje-card.tipo-info    .msg-avatar { background: linear-gradient(135deg, #0891B2, var(--badge-info)); }
.mensaje-card.tipo-aviso   .msg-avatar { background: linear-gradient(135deg, var(--warning), var(--badge-warning)); }
.mensaje-card.tipo-alerta  .msg-avatar { background: linear-gradient(135deg, var(--danger), var(--badge-danger)); }
.mensaje-card.tipo-cuenta  .msg-avatar { background: linear-gradient(135deg, var(--badge-purple), var(--primary)); }
.mensaje-card.tipo-sistema .msg-avatar { background: linear-gradient(135deg, var(--primary), var(--badge-info)); }
.mensaje-card.tipo-success .msg-avatar { background: linear-gradient(135deg, var(--badge-success), #047857); }
.mensaje-card.tipo-warning .msg-avatar { background: linear-gradient(135deg, var(--warning), var(--badge-warning)); }
.mensaje-card.tipo-danger  .msg-avatar { background: linear-gradient(135deg, var(--danger), var(--badge-danger)); }
.mensaje-card.tipo-soporte .msg-avatar { background: linear-gradient(135deg, var(--purple), var(--badge-purple)); }
.mensaje-card .msg-avatar::after {
    content: '';
    position: absolute;
    top: 0; left: -50%;
    width: 100%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.22), transparent);
    transform: skewX(-20deg);
    transition: all 0.5s ease;
}
.mensaje-card:hover .msg-avatar::after { left: 150%; }
.mensaje-card .msg-head-info {
    flex: 1;
    min-width: 0;
}
.mensaje-card .msg-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.35rem;
}
.mensaje-card .msg-title {
    font-weight: 800;
    font-size: 1rem;
    color: #0f172a;
    letter-spacing: -0.01em;
    line-height: 1.3;
}
.mensaje-card.unread .msg-title {
    background: linear-gradient(135deg, #1e1b4b 0%, #4338CA 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.mensaje-card .msg-meta  {
    font-size: 0.74rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-weight: 500;
}
.mensaje-card .msg-meta .meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.mensaje-card .msg-meta i {
    font-size: 0.7rem;
    opacity: 0.8;
}
.mensaje-card .msg-body-wrap {
    position: relative;
    margin-left: 0;
    padding: 1rem 1.1rem;
    border-radius: 0 1rem 1rem 1rem;
    background: linear-gradient(135deg,
        rgba(248, 250, 252, 0.95) 0%,
        rgba(241, 245, 249, 0.85) 100%);
    border: 1px solid rgba(226, 232, 240, 0.85);
    box-shadow: inset 0 1px 0 rgba(255,255,255,1);
}
.mensaje-card.unread .msg-body-wrap {
    background: linear-gradient(135deg,
        rgba(238, 242, 255, 0.95) 0%,
        rgba(224, 231, 255, 0.80) 100%);
    border-color: rgba(199, 210, 254, 0.7);
}
.mensaje-card .msg-body-wrap::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 18px;
    width: 16px; height: 16px;
    background: linear-gradient(135deg,
        rgba(248, 250, 252, 0.95) 0%,
        rgba(241, 245, 249, 0.85) 50%);
    border-left: 1px solid rgba(226, 232, 240, 0.85);
    border-top: 1px solid rgba(226, 232, 240, 0.85);
    transform: rotate(45deg);
    border-radius: 3px;
}
.mensaje-card.unread .msg-body-wrap::before {
    background: linear-gradient(135deg,
        rgba(238, 242, 255, 0.95) 0%,
        rgba(224, 231, 255, 0.80) 50%);
    border-color: rgba(199, 210, 254, 0.7);
}
.mensaje-card .msg-body  {
    font-size: 0.9rem;
    color: #334155;
    line-height: 1.6;
    max-height: 5.2em;
    overflow: hidden;
    position: relative;
    word-wrap: break-word;
}
.mensaje-card .msg-foot  {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.95rem;
    flex-wrap: wrap;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(226, 232, 240, 0.6);
}
.mensaje-card.unread .msg-foot { border-top-color: rgba(199, 210, 254, 0.6); }
.mensaje-card .msg-foot .btn {
    padding: 0.38rem 0.9rem;
    font-size: 0.75rem;
    border-radius: 10px;
    font-weight: 700;
    transition: all 0.2s cubic-bezier(.22,1,.36,1);
}
.mensaje-card .msg-foot .btn:hover {
    transform: translateY(-1px);
}

.mensaje-tipo-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.7rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #fff;
    text-shadow: var(--text-contrast-strong);
    box-shadow:
        0 2px 8px rgba(0,0,0,0.12),
        inset 0 1px 0 rgba(255,255,255,0.25);
}
.mensaje-tipo-badge i { font-size: 0.72rem; }
.mensaje-tipo-badge.tipo-info    { background: linear-gradient(135deg, #0891B2, var(--badge-info)); }
.mensaje-tipo-badge.tipo-aviso   { background: linear-gradient(135deg, var(--warning), var(--badge-warning)); }
.mensaje-tipo-badge.tipo-alerta  { background: linear-gradient(135deg, var(--danger), var(--badge-danger)); }
.mensaje-tipo-badge.tipo-cuenta  { background: linear-gradient(135deg, var(--badge-purple), #5B21B6); }
.mensaje-tipo-badge.tipo-sistema { background: linear-gradient(135deg, var(--primary-dark), var(--badge-info)); }
.mensaje-tipo-badge.tipo-success { background: linear-gradient(135deg, var(--badge-success), #047857); }
.mensaje-tipo-badge.tipo-warning { background: linear-gradient(135deg, var(--warning), var(--badge-warning)); }
.mensaje-tipo-badge.tipo-danger  { background: linear-gradient(135deg, var(--danger), var(--badge-danger)); }
.mensaje-tipo-badge.tipo-soporte { background: linear-gradient(135deg, var(--purple), var(--badge-purple)); }


.glass-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(79, 70, 229, 0.12) 20%,
        rgba(168, 85, 247, 0.12) 50%,
        rgba(6, 182, 212, 0.12) 80%,
        transparent 100%
    );
}

/* ==========================================================================
   ANIMACIONES
   ========================================================================== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeInUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ==========================================================================
   SCROLLBAR
   ========================================================================== */
::-webkit-scrollbar       { width: 7px; height: 7px; }
::-webkit-scrollbar-track {
    background: rgba(241, 245, 249, 0.7);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(129, 140, 248, 0.5), rgba(168, 85, 247, 0.4));
    border-radius: 10px;
    transition: var(--ease);
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-light), var(--purple));
}

/* ==========================================================================
   UTILIDADES
   ========================================================================== */
.text-primary  { color: var(--primary)   !important; }
.text-success  { color: var(--success)   !important; }
.text-info     { color: var(--info)      !important; }
.text-warning  { color: var(--warning)   !important; }
.text-danger   { color: var(--danger)    !important; }
.text-purple   { color: var(--purple)    !important; }
.text-muted    { color: var(--text-muted) !important; }
.fw-extrabold  { font-weight: 800; }
.tracking-wider { letter-spacing: 0.05em; }

.me-1\.5 { margin-right: 0.4rem !important; }
.p-3\.5 { padding: 1.1rem !important; }
.border-4 { border-width: 4px !important; }

.text-indigo { color: var(--primary) !important; }
.bg-opacity-90 { --bs-bg-opacity: 0.9; }
.bg-opacity-10 { --bs-bg-opacity: 0.1; }
.bg-opacity-20 { --bs-bg-opacity: 0.2; }
.bg-opacity-50 { --bs-bg-opacity: 0.5; }

/* Stat card borde izquierdo degradado */
.glass-card.border-start {
    border-left: 3px solid !important;
    position: relative;
}

.glass-card.border-start.border-primary {
    border-image: linear-gradient(180deg, var(--primary), var(--purple)) 1 !important;
}
.glass-card.border-start.border-success {
    border-image: linear-gradient(180deg, var(--success), #34D399) 1 !important;
}
.glass-card.border-start.border-info {
    border-image: linear-gradient(180deg, var(--info), #22D3EE) 1 !important;
}
.glass-card.border-start.border-warning {
    border-image: linear-gradient(180deg, var(--warning), #FBBF24) 1 !important;
}

/* ==========================================================================
   GESTIÓN DE EMPRESAS · Dropdown navbar + Modales
   ========================================================================== */

/* ---------- Botón / chip del dropdown en el navbar ---------- */
.empresa-dropdown-nav { display: inline-flex; }
.empresa-dropdown-nav .dropdown-menu.show { display: block; }
.empresa-chip-nav {
    background: linear-gradient(135deg, rgba(255,255,255,0.70) 0%, rgba(255,255,255,0.35) 100%);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(79, 70, 229, 0.20);
    border-radius: 16px;
    padding: 0.45rem 0.65rem 0.45rem 0.5rem;
    min-height: 44px;
    color: #1e1b4b;
    transition: all 0.22s cubic-bezier(.22,1,.36,1);
    box-shadow:
        0 3px 12px rgba(79, 70, 229, 0.08),
        inset 0 1px 0 rgba(255,255,255,0.95);
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.empresa-chip-nav:hover {
    transform: translateY(-1.5px);
    border-color: rgba(79, 70, 229, 0.35);
    background: linear-gradient(135deg, rgba(79,70,229,0.12) 0%, rgba(168,85,247,0.08) 100%);
    box-shadow:
        0 8px 22px rgba(79, 70, 229, 0.22),
        0 2px 6px rgba(15,23,42,0.05),
        inset 0 1px 0 rgba(255,255,255,1);
}
.empresa-chip-nav.show,
.empresa-chip-nav[aria-expanded="true"] {
    border-color: rgba(79, 70, 229, 0.42);
    background: linear-gradient(135deg, rgba(129,140,248,0.22) 0%, rgba(168,85,247,0.12) 100%);
    box-shadow:
        0 10px 26px rgba(79, 70, 229, 0.28),
        inset 0 1px 0 rgba(255,255,255,1);
}
.emp-chip-ico {
    width: 36px; height: 36px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.95rem;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 50%, #06B6D4 100%);
    box-shadow:
        0 4px 12px rgba(79, 70, 229, 0.35),
        inset 0 1px 0 rgba(255,255,255,0.25);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
.emp-chip-ico::after {
    content: '';
    position: absolute;
    top: 0; left: -50%;
    width: 100%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.28), transparent);
    transform: skewX(-20deg);
}
.emp-chip-texts { display: flex; flex-direction: column; line-height: 1.1; }
.emp-chip-name {
    font-weight: 800;
    font-size: 0.86rem;
    letter-spacing: -0.01em;
    color: #1e1b4b;
    background: linear-gradient(135deg, #1e1b4b 0%, #4338CA 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.emp-chip-nit {
    font-size: 0.7rem;
    color: #6366F1;
    font-weight: 600;
    margin-top: 0.1rem;
    opacity: 0.92;
}
.emp-chip-arrow {
    color: #6366F1;
    opacity: 0.85;
    transition: transform 0.22s ease;
    margin-left: 0.2rem;
}
.empresa-chip-nav.show .emp-chip-arrow { transform: rotate(180deg); }

@media (max-width: 991px) {
    .empresa-chip-nav { min-height: 40px; padding: 0.4rem 0.55rem; }
    .emp-chip-ico { width: 32px; height: 32px; font-size: 0.85rem; border-radius: 10px; }
    .emp-chip-name { max-width: 170px; font-size: 0.8rem; }
    .emp-chip-nit { display: none; }
}

/* ---------- Dropdown menu ---------- */
.empresa-dropdown-menu {
    width: 420px;
    max-width: 94vw;
    border-radius: 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.95);
    padding: 0.5rem 0;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    box-shadow:
        0 28px 70px rgba(15, 23, 42, 0.22),
        0 6px 18px rgba(79, 70, 229, 0.12),
        inset 0 1px 0 rgba(255,255,255,1);
    margin-top: 0.6rem !important;
}
.empresa-dropdown-menu::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4F46E5 0%, #7C3AED 50%, #06B6D4 100%);
}
.empresa-dropdown-menu .dropdown-header {
    border-bottom: 1px solid rgba(99, 102, 241, 0.10);
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
    margin-bottom: 0.25rem;
}
.emp-list-inner { padding: 0.15rem 0.25rem 0.25rem; }

.emp-dropdown-item-wrap {
    border-radius: 0.9rem;
    margin: 0.2rem 0.3rem;
    transition: all 0.18s cubic-bezier(.22,1,.36,1);
    position: relative;
}
.emp-dropdown-item-wrap.is-active {
    background: linear-gradient(135deg, rgba(129,140,248,0.16) 0%, rgba(168,85,247,0.08) 100%);
    box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.18);
}
.emp-dropdown-item-wrap:hover:not(.is-active) {
    background: linear-gradient(135deg, rgba(148,163,184,0.08) 0%, rgba(99,102,241,0.06) 100%);
}
.emp-dropdown-item-wrap.is-active::before {
    content: '';
    position: absolute;
    left: 0.6rem; top: 50%;
    transform: translateY(-50%);
    width: 4px; height: 65%;
    border-radius: 2px;
    background: linear-gradient(180deg, #4F46E5, #06B6D4);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.10);
}
.emp-row-main {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.65rem 0.5rem 1.1rem;
}
.emp-dropdown-item-wrap.is-active .emp-row-main { padding-left: 1.45rem; }

.emp-row-btn {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
    color: inherit;
    padding: 0.25rem 0.1rem;
    border-radius: 0.55rem;
    background: transparent;
    border: 0;
    width: 100%;
    text-align: left;
    font-family: inherit;
}
.emp-row-btn:not(.emp-activa):hover {
    transform: translateX(2px);
}
.emp-row-name {
    display: block;
    font-weight: 700;
    font-size: 0.84rem;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.emp-dropdown-item-wrap.is-active .emp-row-name {
    color: #1e1b4b;
    font-weight: 800;
    background: linear-gradient(135deg, #1e1b4b 0%, #4338CA 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.emp-row-meta {
    display: block;
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.35;
    margin-top: 0.1rem;
}
.emp-row-meta em {
    display: block;
    margin-top: 0.2rem;
    color: #4F46E5;
    font-weight: 600;
}

.emp-row-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding-left: 0.25rem;
    flex-shrink: 0;
    border-left: 1px solid rgba(99, 102, 241, 0.10);
    margin-left: 0.25rem;
}
.btn-emp-action {
    width: 32px; height: 32px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    background: rgba(255,255,255,0.85);
    border: 1px solid rgba(99, 102, 241, 0.15);
    color: #334155;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(.22,1,.36,1);
    font-family: inherit;
    line-height: 1;
}
.btn-emp-action:hover {
    transform: translateY(-1px);
}
.btn-emp-edit {
    color: #4F46E5;
}
.btn-emp-edit:hover {
    background: linear-gradient(135deg, rgba(79,70,229,0.10), rgba(124,58,237,0.08));
    border-color: rgba(79, 70, 229, 0.35);
    color: #4338CA;
    box-shadow: 0 5px 14px rgba(79, 70, 229, 0.22);
}
.btn-emp-del {
    color: #EF4444;
}
.btn-emp-del:hover {
    background: linear-gradient(135deg, rgba(239,68,68,0.10), rgba(248,113,113,0.08));
    border-color: rgba(239, 68, 68, 0.35);
    color: #DC2626;
    box-shadow: 0 5px 14px rgba(239, 68, 68, 0.22);
}
.emp-row-locked {
    width: 32px; height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    color: var(--text-hint);
    background: rgba(226, 232, 240, 0.5);
    font-size: 0.78rem;
    cursor: help;
}

/* Botón "Agregar otra empresa" */
.btn-add-emp {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.72rem 1rem;
    border-radius: 14px;
    border: 0;
    font-weight: 800;
    font-size: 0.86rem;
    letter-spacing: 0.01em;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 50%, #06B6D4 100%);
    background-size: 200% 200%;
    background-position: 0% 50%;
    box-shadow:
        0 8px 22px rgba(79, 70, 229, 0.35),
        inset 0 1px 0 rgba(255,255,255,0.25);
    transition: all 0.25s cubic-bezier(.22,1,.36,1);
}
.btn-add-emp:hover {
    transform: translateY(-1.5px);
    background-position: 100% 50%;
    box-shadow:
        0 14px 32px rgba(79, 70, 229, 0.45),
        0 2px 6px rgba(15,23,42,0.06),
        inset 0 1px 0 rgba(255,255,255,0.3);
    filter: brightness(1.05);
}
.btn-add-emp i { font-size: 0.95rem; }

/* ---------- Modal de crear/editar empresa ---------- */
.empresa-modal-content {
    border: 0;
    border-radius: 1.4rem;
    overflow: hidden;
    background: #fff;
    box-shadow:
        0 40px 90px rgba(15, 23, 42, 0.30),
        0 8px 24px rgba(79, 70, 229, 0.18);
}
.empresa-modal-gradient {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #4F46E5 0%, #4338CA 30%, #7C3AED 60%, #06B6D4 100%);
    background-size: 220% 220%;
    background-position: 0% 0%;
    animation: empGrad 16s ease-in-out infinite;
    padding: 1.7rem 1.7rem 1.5rem;
    color: #fff;
}
@keyframes empGrad {
    0%,100%  { background-position: 0% 0%; }
    50%     { background-position: 100% 100%; }
}
.empresa-modal-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    opacity: 0.22;
}
.emp-orb-1 {
    top: -60%; right: -5%;
    width: 320px; height: 320px;
    background: radial-gradient(circle at center, #fff, transparent 60%);
}
.emp-orb-2 {
    bottom: -80%; left: -10%;
    width: 260px; height: 260px;
    background: radial-gradient(circle at center, #06B6D4, transparent 60%);
}
.empresa-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.empresa-modal-avatar {
    width: 62px; height: 62px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.55rem;
    color: #4F46E5;
    background: rgba(255, 255, 255, 0.92);
    box-shadow:
        0 12px 28px rgba(15, 23, 42, 0.18),
        inset 0 1px 0 rgba(255,255,255,0.9);
    flex-shrink: 0;
    position: relative;
}
.empresa-modal-avatar::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(135deg, rgba(255,255,255,0.8), rgba(168,85,247,0.3));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}
.empresa-modal-header h5 {
    color: #fff;
    font-size: 1.22rem;
    letter-spacing: -0.01em;
    font-weight: 900;
    text-shadow: 0 2px 10px rgba(15,23,42,0.20);
}
.empresa-modal-sub {
    color: rgba(255,255,255,0.92);
    font-size: 0.78rem;
    font-weight: 500;
    text-shadow: var(--text-contrast-shadow);
}
.empresa-modal-close {
    width: 40px; height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.12);
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.18s ease;
    flex-shrink: 0;
}
.empresa-modal-close:hover {
    background: rgba(255,255,255,0.22);
    border-color: rgba(255,255,255,0.4);
    transform: rotate(90deg);
}

.empresa-modal-body {
    background: linear-gradient(180deg, #fbfcff 0%, #f8fafc 100%);
    padding: 1.6rem 1.7rem 1.4rem;
}
.emp-input {
    border-radius: 12px;
    border: 1.5px solid #E2E8F0;
    background: #fff;
    padding: 0.7rem 0.9rem;
    font-weight: 500;
    color: #0f172a;
    transition: all 0.18s ease;
    box-shadow: inset 0 1px 0 rgba(255,255,255,1);
}
.emp-input:focus {
    border-color: #6366F1;
    box-shadow:
        0 0 0 4px rgba(99, 102, 241, 0.12),
        inset 0 1px 0 rgba(255,255,255,1);
    background: #fff;
    color: #0f172a;
}
.emp-input::placeholder { color: var(--text-hint); font-weight: 500; }

.empresa-modal-footer {
    background: linear-gradient(180deg, rgba(248,250,252,0.7) 0%, rgba(241,245,249,0.9) 100%);
    border-top: 1px solid rgba(226, 232, 240, 0.8);
    padding: 1rem 1.7rem 1.25rem;
}
.btn-guardar-emp {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 50%, #06B6D4 100%);
    background-size: 220% 220%;
    background-position: 0% 50%;
    color: #fff;
    border: 0;
    box-shadow:
        0 10px 26px rgba(79, 70, 229, 0.42),
        inset 0 1px 0 rgba(255,255,255,0.25);
    transition: all 0.22s cubic-bezier(.22,1,.36,1);
}
.btn-guardar-emp:hover {
    transform: translateY(-1.5px);
    background-position: 100% 50%;
    color: #fff;
    box-shadow:
        0 16px 36px rgba(79, 70, 229, 0.52),
        0 2px 6px rgba(15,23,42,0.06),
        inset 0 1px 0 rgba(255,255,255,0.3);
    filter: brightness(1.06);
}
.btn-guardar-emp:active { transform: translateY(0); }

/* ==========================================================================
   PRINT
   ========================================================================== */
/* ==========================================================================
   NAVBAR MÓVIL — Animaciones, touch 48x48, glass, accesibilidad
   ========================================================================== */

/* Botón hamburguesa: área táctil 48x48 + barras animadas */
.glass-navbar .navbar-toggler {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255,255,255,0.65), rgba(255,255,255,0.35));
    box-shadow:
        0 6px 18px rgba(79,70,229,0.16),
        inset 0 1px 0 rgba(255,255,255,0.85);
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    transition: transform 300ms cubic-bezier(.22,1,.36,1),
                background-color 300ms cubic-bezier(.22,1,.36,1),
                box-shadow 300ms cubic-bezier(.22,1,.36,1);
    outline: none;
    position: relative;
    z-index: 2;
}
.glass-navbar .navbar-toggler:hover {
    transform: translateY(-1px);
    box-shadow:
        0 10px 26px rgba(79,70,229,0.22),
        inset 0 1px 0 rgba(255,255,255,0.9);
}
.glass-navbar .navbar-toggler:focus-visible {
    outline: 2px solid #4F46E5;
    outline-offset: 3px;
}
.glass-navbar .navbar-toggler[aria-expanded="true"] {
    background: linear-gradient(135deg, rgba(79,70,229,0.14), rgba(6,182,212,0.10));
}

.toggler-bars {
    width: 24px;
    height: 20px;
    display: inline-flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
}
.toggler-bars > span {
    display: block;
    height: 2.5px;
    border-radius: 999px;
    background: linear-gradient(90deg, #2E1B73 0%, #4338CA 55%, #06B6D4 100%);
    transform-origin: 1px 50%;
    transition: transform 300ms cubic-bezier(.22,1,.36,1),
                opacity 220ms ease,
                width 300ms cubic-bezier(.22,1,.36,1);
}
.toggler-bars > span:nth-child(1) { width: 78%; }
.toggler-bars > span:nth-child(2) { width: 100%; }
.toggler-bars > span:nth-child(3) { width: 58%; align-self: flex-end; }
.glass-navbar .navbar-toggler[aria-expanded="true"] .toggler-bars > span:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
    width: 100%;
}
.glass-navbar .navbar-toggler[aria-expanded="true"] .toggler-bars > span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0.2);
}
.glass-navbar .navbar-toggler[aria-expanded="true"] .toggler-bars > span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
    width: 100%;
}

/* Sobreescribir animación por defecto de Bootstrap .collapse (350ms → 300ms sin saltos) */
.glass-navbar .navbar-collapse.collapse {
    transition: height 300ms cubic-bezier(.22,1,.36,1),
                transform 300ms cubic-bezier(.22,1,.36,1),
                opacity 240ms ease !important;
    height: 0;
}
.glass-navbar .navbar-collapse.collapsing {
    transition: height 300ms cubic-bezier(.22,1,.36,1),
                transform 300ms cubic-bezier(.22,1,.36,1),
                opacity 240ms ease !important;
    overflow: hidden;
    height: 0;
    opacity: 0.2;
}
.glass-navbar .navbar-collapse.collapse.show {
    opacity: 1;
}

/* Vista móvil: menú como panel lateral inferior a offcanvas */
@media (max-width: 991px) {
    html, body { overflow-x: hidden; }
    .container, .container-fluid { max-width: 100vw; }

    .glass-navbar #navdgii.nav-mobile-collapse {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(86vw, 360px);
        height: 100dvh !important;
        max-height: 100dvh;
        z-index: 1065;
        padding: 0;
        margin: 0 !important;
        border-left: 1px solid rgba(226, 232, 240, 0.95);
        background: #ffffff;
        box-shadow: -18px 0 42px rgba(15, 23, 42, 0.16);
        transform: translateX(105%);
        opacity: 0;
        display: flex !important;
        flex-direction: column;
        will-change: transform, opacity;
        isolation: isolate;
        pointer-events: none;
    }
    .glass-navbar #navdgii.nav-mobile-collapse.collapsing {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(86vw, 360px);
        height: 100dvh !important;
        max-height: 100dvh;
        margin: 0 !important;
        padding: 0;
        overflow: hidden;
        transform: translateX(0);
        opacity: 0.3;
        transition: transform 300ms cubic-bezier(.22,1,.36,1),
                    opacity 260ms ease !important;
        z-index: 1065;
        pointer-events: auto;
    }
    .glass-navbar #navdgii.nav-mobile-collapse.show {
        transform: translateX(0);
        opacity: 1;
        transition: transform 300ms cubic-bezier(.22,1,.36,1),
                    opacity 260ms ease !important;
        z-index: 1065;
        pointer-events: auto;
    }
    /* Overlay sutil al abrir el menú */
    body.nav-mobile-open::after {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.38);
        z-index: 1060;
        opacity: 1;
        animation: fadeOverlayIn 260ms ease forwards;
        pointer-events: auto;
    }
    @keyframes fadeOverlayIn {
        from { opacity: 0; }
        to   { opacity: 1; }
    }

    /* Cabecera del menú móvil */
    .nav-mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 1rem 1rem 0.9rem 1.1rem;
        border-bottom: 1px solid var(--border);
        position: relative;
        background: #ffffff;
        z-index: 2;
    }
    .nav-mobile-title { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
    .nav-mobile-title-ico {
        width: 42px; height: 42px;
        border-radius: 12px;
        display: inline-flex; align-items: center; justify-content: center;
        color: #ffffff;
        background: linear-gradient(135deg, #4F46E5 0%, #06B6D4 100%);
        border: 0;
        font-size: 1.05rem;
        flex-shrink: 0;
        box-shadow: 0 10px 22px rgba(79, 70, 229, 0.22);
    }
    .nav-mobile-title > div { min-width: 0; }
    .nav-mobile-title .fw-extrabold {
        font-size: 0.98rem;
        letter-spacing: -0.01em;
        line-height: 1.15;
        margin: 0;
        color: var(--text-main);
        font-weight: 800;
    }
    .nav-mobile-title small { font-size: 0.72rem; line-height: 1.2; color: var(--text-muted); font-weight: 500; }

    .nav-mobile-close {
        width: 42px; height: 42px;
        min-width: 42px; min-height: 42px;
        border-radius: 12px;
        border: 1px solid var(--border);
        background: #F8FAFC;
        color: var(--text-sub);
        font-size: 1.05rem;
        display: inline-flex; align-items: center; justify-content: center;
        transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
        cursor: pointer;
        flex-shrink: 0;
    }
    .nav-mobile-close:hover {
        background: #EEF2FF;
        border-color: rgba(79, 70, 229, 0.18);
        color: var(--primary);
    }
    .nav-mobile-close:focus-visible {
        outline: 2px solid rgba(79, 70, 229, 0.45);
        outline-offset: 2px;
    }

    .nav-mobile-list {
        list-style: none;
        margin: 0;
        padding: 0.6rem 0.85rem 1.2rem !important;
        overflow-y: auto;
        overflow-x: hidden;
        flex: 1 1 auto;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: rgba(148, 163, 184, 0.65) transparent;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        background: #ffffff;
        position: relative;
        z-index: 1;
    }
    .nav-mobile-list::-webkit-scrollbar { width: 6px; }
    .nav-mobile-list::-webkit-scrollbar-thumb {
        background: rgba(148, 163, 184, 0.65);
        border-radius: 999px;
    }
    .nav-mobile-list > .nav-item,
    .nav-mobile-list > .nav-mobile-section {
        width: 100%;
        margin: 0;
        display: flex;
        align-items: stretch;
        justify-content: flex-start;
    }
    .nav-mobile-list .nav-item + .nav-item { margin-top: 0.15rem; }

    .nav-mobile-section.nav-mobile-section-header {
        padding: 0.85rem 0.35rem 0.35rem;
        margin-top: 0.4rem;
    }
    .nav-mobile-section.nav-mobile-section-header:first-child { margin-top: 0; padding-top: 0.25rem; }
    .nav-section-title {
        font-size: 0.68rem;
        font-weight: 700;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        color: var(--text-hint);
        padding-left: 0.55rem;
    }

    .nav-item-ico {
        flex-shrink: 0 !important;
        width: 22px !important;
        min-width: 22px !important;
        text-align: center !important;
        font-size: 1rem;
        display: inline-block;
        line-height: 1;
    }

    .nav-mobile-list .nav-link,
    .nav-mobile-list .bell-btn,
    .nav-mobile-list .user-chip,
    .nav-mobile-list .btn-reiniciar-nav,
    .nav-mobile-list .empresa-chip-nav,
    .nav-mobile-list .dropdown-toggle {
        min-height: 48px;
        min-width: 48px;
        width: 100% !important;
        padding: 0.78rem 0.95rem !important;
        border-radius: 12px !important;
        font-size: 0.93rem !important;
        font-weight: 600;
        color: var(--text-sub) !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 0.75rem;
        text-align: left !important;
        transition: background 200ms ease, transform 200ms cubic-bezier(.22,1,.36,1), color 200ms ease;
        box-sizing: border-box;
        letter-spacing: -0.005em;
        text-decoration: none !important;
        border: 1px solid transparent !important;
        background: transparent !important;
        box-shadow: none !important;
        position: relative;
        z-index: 1;
        pointer-events: auto !important;
    }
    .nav-mobile-list .nav-link i,
    .nav-mobile-list .bell-btn i,
    .nav-mobile-list .user-chip i,
    .nav-mobile-list .btn-reiniciar-nav i,
    .nav-mobile-list .dropdown-toggle i {
        font-size: 1rem;
        width: 22px;
        min-width: 22px;
        text-align: center;
        color: var(--text-muted) !important;
        flex-shrink: 0;
        opacity: 1 !important;
    }
    .nav-mobile-list .nav-link:hover,
    .nav-mobile-list .bell-btn:hover,
    .nav-mobile-list .user-chip:hover,
    .nav-mobile-list .btn-reiniciar-nav:hover,
    .nav-mobile-list .empresa-chip-nav:hover {
        background: #F8FAFC !important;
        border-color: rgba(79, 70, 229, 0.12) !important;
        color: var(--primary) !important;
    }
    .nav-mobile-list .nav-link:hover i,
    .nav-mobile-list .bell-btn:hover i,
    .nav-mobile-list .user-chip:hover i,
    .nav-mobile-list .btn-reiniciar-nav:hover i {
        color: var(--primary) !important;
    }
    .nav-mobile-list .nav-link.active {
        background: rgba(79, 70, 229, 0.08) !important;
        color: var(--primary) !important;
        box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.12) !important;
        font-weight: 700;
    }
    .nav-mobile-list .nav-link.active i { color: var(--primary) !important; opacity: 1 !important; }

    .nav-mobile-list .btn-reiniciar-nav {
        justify-content: flex-start !important;
        background: #ffffff !important;
        border: 1px solid var(--border) !important;
        color: var(--text-sub) !important;
        font-weight: 600 !important;
    }
    .nav-mobile-list .btn-reiniciar-nav i { color: var(--text-muted) !important; }
    .nav-mobile-list .btn-reiniciar-nav:hover {
        background: #FFF1F2 !important;
        border-color: rgba(220, 38, 38, 0.18) !important;
        color: var(--danger) !important;
    }
    .nav-mobile-list .btn-reiniciar-nav:hover i { color: var(--danger) !important; }

    .nav-mobile-list .dropdown-menu {
        position: static !important;
        transform: none !important;
        width: 100% !important;
        margin: 0.45rem 0.35rem 0.25rem !important;
        max-width: calc(100% - 0.7rem);
        border-radius: 14px !important;
        background: #ffffff !important;
        border: 1px solid var(--border) !important;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08) !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        position: relative !important;
        z-index: 3 !important;
        pointer-events: auto !important;
    }
    .nav-mobile-list .dropdown-menu .dropdown-item {
        min-height: 44px;
        padding: 0.7rem 0.85rem;
        border-radius: 10px;
        font-size: 0.88rem;
        display: flex;
        align-items: center;
        gap: 0.6rem;
        color: var(--text-sub) !important;
    }
    .nav-mobile-list .dropdown-menu .dropdown-item:hover {
        background: rgba(79, 70, 229, 0.08);
        color: var(--primary);
    }
    .nav-mobile-list .dropdown-menu .dropdown-header {
        padding: 0.8rem 0.85rem 0.45rem;
        color: var(--text-hint) !important;
    }

    .nav-mobile-list .bell-dropdown {
        width: calc(100% - 0.7rem) !important;
        max-width: calc(100% - 0.7rem) !important;
        min-width: 0 !important;
    }
    .nav-mobile-list .empresa-dropdown-menu {
        width: calc(100% - 0.7rem) !important;
        max-width: calc(100% - 0.7rem) !important;
        min-width: 0 !important;
    }
    .nav-mobile-list .empresa-chip-nav {
        justify-content: flex-start;
        background: transparent !important;
    }

    .nav-mobile-list .bell-btn {
        position: relative;
        justify-content: space-between !important;
    }
    .nav-mobile-list .bell-label-group {
        display: inline-flex;
        align-items: center;
        gap: 0.75rem;
        flex-shrink: 1;
        min-width: 0;
    }
    .nav-mobile-list .bell-label-group span {
        flex-shrink: 1;
        min-width: 0;
    }
    .nav-mobile-list .bell-dot {
        position: static !important;
        margin-left: auto;
        flex-shrink: 0;
        min-width: 24px;
        height: 24px;
        border-radius: 999px;
        font-size: 0.72rem;
        font-weight: 700;
        background: linear-gradient(135deg, #4F46E5, #06B6D4);
        color: #fff;
        padding: 0 0.55rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 6px 14px rgba(79, 70, 229, 0.24);
    }

    .nav-mobile-list .user-chip .user-name { color: var(--text-main); font-weight: 600; }
    .nav-mobile-list .user-chip .user-role { color: var(--text-muted) !important; font-weight: 500; }
}

/* Ajustes para pantallas muy pequeñas (<=380px) */
@media (max-width: 380px) {
    .glass-navbar #navdgii.nav-mobile-collapse,
    .glass-navbar #navdgii.nav-mobile-collapse.collapsing {
        width: 100vw;
    }
    .nav-mobile-header { padding: 1rem 0.85rem 0.85rem; }
    .nav-mobile-list { padding: 0.5rem 0.55rem 1rem !important; }
}

/* Ajustes para tablets (577px - 991px) */
@media (min-width: 577px) and (max-width: 991px) {
    .glass-navbar #navdgii.nav-mobile-collapse,
    .glass-navbar #navdgii.nav-mobile-collapse.collapsing {
        width: min(60vw, 380px);
    }
}

/* Focus visible general para accesibilidad */
.nav-mobile-list [role="menuitem"]:focus-visible,
.glass-navbar .nav-link:focus-visible,
.glass-navbar .dropdown-item:focus-visible {
    outline: 2px solid #4F46E5;
    outline-offset: 2px;
    border-radius: 10px;
}

@media print {
    body     { background: #fff !important; }
    .navbar, .btn, footer, .no-print { display: none !important; }
    .card, .glass-card {
        box-shadow: none !important;
        border: 1px solid #e2e8f0 !important;
        background: #fff !important;
        backdrop-filter: none !important;
    }
    .card, .glass-card { --tw-ring-shadow: none !important; }
    .table td, .table th { background: #fff !important; }
}
