/* =====================================================
   🌐 PIDT + SYNCFUSION BLENDING THEME
   ===================================================== */

/* --- Fuentes oficiales PIDT --- */
@import url('https://fonts.googleapis.com/css2?family=Public+Sans:wght@400;600;700&family=Karla:wght@400;500;700&display=swap');

/* --- Variables globales PIDT (Paleta Oficial) --- */
:root {
    /* Colores principales PIDT */
    --pidt-primary: #36C1FF;
    --pidt-primary-dark: #4459D7;
    --pidt-secondary: #6877F7;
    --pidt-accent: #003399;
    --pidt-accent-tecna-ice: #0E1A4E;
    --pidt-accent-tecna-ice-2: #003399;

    /* Colores funcionales */
    --pidt-success: #43A047;
    --pidt-warning: #FFB300;
    --pidt-danger: #E53935;

    /* Colores de fondo y superficie */
    --pidt-surface: #F7F9FC;
    --pidt-background: #FFFFFF;

    /* Colores de texto */
    --pidt-text: #1A1A1A;
    --pidt-text-light: #6E6E6E;
    --pidt-text-white: #FFFFFF;

    /* Colores adicionales de la paleta */
    --pidt-blue-light: #4Cafd2;
    --pidt-navy: #060051;
    --pidt-teal: #2E9a8e;

    /* Tipografía */
    --pidt-font-primary: 'Karla', sans-serif;
    --pidt-font-secondary: 'Public Sans', 'Nunito', sans-serif;

    /* Efectos */
    --pidt-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    --pidt-shadow-strong: 0 8px 24px rgba(0, 0, 0, 0.15);
    --pidt-radius: 8px;
    --pidt-radius-small: 4px;
    --pidt-radius-large: 12px;

    /* Transiciones */
    --pidt-transition: 0.3s ease;
    --pidt-transition-fast: 0.15s ease;
}

/* =====================================================
   ✍️ TIPOGRAFÍA Y BASE GLOBAL
   ===================================================== */
body {
    font-family: var(--pidt-font-primary);
    background: var(--pidt-surface);
    color: var(--pidt-text);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: margin-left var(--pidt-transition);
}

h1, h2, h3, h4, h5 {
    font-family: var(--pidt-font-secondary);
    color: var(--pidt-primary-dark);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

a {
    color: var(--pidt-primary);
    text-decoration: none;
    transition: color var(--pidt-transition-fast);
}

/* =====================================================
   🔘 TOOLBAR - Contener elementos correctamente
   ===================================================== */
.e-toolbar {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 70px !important;
    background: var(--pidt-background);
    box-shadow: var(--pidt-shadow);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex !important;
    align-items: center !important;
    box-sizing: border-box;
    overflow: hidden;
    z-index: 1001;
}

.e-toolbar .e-toolbar-items.e-tbar-pos .e-toolbar-left {
    height: 70px;
}

/* =====================================================
   🍔 MENÚ HAMBURGUESA
   ===================================================== */
.menu.e-small {
    color: var(--pidt-primary-dark) !important;
    border: none;
    background: transparent;
    padding: 8px 12px;
    min-width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.menu.e-small:hover {
    background: rgba(35, 182, 204, 0.15);
    border-radius: var(--pidt-radius);
}

.menu.e-small .e-btn-icon,
.menu.e-small .e-menu {
    font-size: 32px !important;
}

.menu.e-small .e-btn-icon::before,
.menu.e-small .e-icons::before {
    font-size: 28px !important;
}

/* =====================================================
   🎨 TOOLBAR BRAND - Logo + Separador + Texto
   ===================================================== */
.brand-with-logo {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 16px;
}

.brand-logo-container {
    display: flex;
    align-items: center;
}

.pidt-logo {
    height: 90px;
    width: auto;
}

.brand-divider {
    width: 1px;
    height: 32px;
    background: linear-gradient(
            180deg,
            transparent 0%,
            rgba(68, 89, 215, 0.3) 20%,
            rgba(68, 89, 215, 0.5) 50%,
            rgba(68, 89, 215, 0.3) 80%,
            transparent 100%
    );
}

.brand-text-simple {
    font-size: 18px;
    font-weight: 700;
    color: var(--pidt-primary-dark);
    letter-spacing: 0.5px;
    font-family: var(--pidt-font-secondary);
}

/* =====================================================
   🏢 COMPANY BADGE - Badge Cliente
   ===================================================== */
.company-badge-subtle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
}

.company-label {
    font-size: 11px;
    color: #6b6b6b;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.company-name-subtle {
    font-size: 14px;
    font-weight: 600;
    color: var(--pidt-primary-dark);
    font-family: var(--pidt-font-primary);
}

/* ================================
   📌 CONTENEDOR DEL MENÚ
   ================================ */
.user-menu-container {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
}

/* Avatar + nombre */
.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-radius: var(--pidt-radius);
    transition: background-color 0.25s ease, transform 0.20s ease;
}

/* Hover con efecto suave */
.user-menu-trigger:hover {
    background-color: rgba(35, 182, 204, 0.15);   /* mismo color del popup hover */
    transform: translateY(-1px);                 /* efecto sutil */
}

/* Avatar */
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pidt-primary-dark) 0%, var(--pidt-primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ================================
   📌 POPUP DEL MENÚ
   ================================ */
.user-menu-popup {
    position: fixed !important;
    top: 60px;
    right: 0;
    transform: translateY(-10px); /* empieza ligeramente movido */

    background: white;
    border-radius: var(--pidt-radius);
    min-width: 200px;
    width: 220px;

    box-shadow: 0 4px 14px rgba(0,0,0,0.1);
    padding: 8px 0;
    z-index: 1000;

    opacity: 0;
    pointer-events: none;

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

/* Mostrar popup con animación */
.user-menu-container:hover .user-menu-popup {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0); /* aparece suavemente */
}

/* ================================
   📌 ÍTEMS DEL MENÚ
   ================================ */
.user-menu-item {
    padding: 10px 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    border-radius: var(--pidt-radius);
    transition: background-color 0.20s ease, padding-left 0.20s ease;
}

/* Hover suave del ítem */
.user-menu-item:hover {
    background-color: rgba(35, 182, 204, 0.15);
    padding-left: 20px; /* efecto de desplazamiento elegante */
}

/* Divider */
.submenu-divider {
    height: 1px;
    background-color: #e3e3e3;
    margin: 8px 0;
}

/* ================================
   🌐 SUBMENÚ DE IDIOMAS
   ================================ */
.submenu-container {
    padding: 0;
}

/* Parent */
.submenu-parent {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

/* Items */
.submenu-items {
    display: flex;
    flex-direction: column;
    padding-left: 10px;
    transition: all 0.25s ease;
}

.submenu-item {
    padding: 8px 16px;
    border-radius: var(--pidt-radius);
    transition: background-color 0.25s ease, padding-left 0.25s ease;
}

.submenu-item:hover {
    background-color: rgba(35, 182, 204, 0.15);
    padding-left: 20px;
}




/* =====================================================
   🧭 SIDEBAR - OPCIÓN 1 CON SEPARADORES DE SECCIÓN
   ===================================================== */
.sf-sidebar,
.e-sidebar {
    position: fixed !important;
    top: 90px !important; /* 🔹 Bajado de 70px a 90px para dar espacio */
    left: 0;
    height: calc(100vh - 90px) !important; /* 🔹 Ajustado para compensar */
    background: linear-gradient(180deg, var(--pidt-navy) 0%, var(--pidt-primary-dark) 100%);
    box-shadow: var(--pidt-shadow-strong);
    color: var(--pidt-text-white);
    border: none;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    z-index: 1000;
    transition: width var(--pidt-transition), left var(--pidt-transition);
    padding: 0;
    border-top-right-radius: 20px;
}

.main-menu {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1rem 0; /* 🔹 Padding para espaciado interno */
}

.menu-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.menu-section-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px; /* 🔹 Reducido de 11px a 10px */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px; /* 🔹 Reducido de 1px */
    padding: 16px 20px 6px 20px; /* 🔹 Reducido padding */
    margin-top: 6px; /* 🔹 Reducido de 8px */
    font-family: var(--pidt-font-secondary);
    opacity: 1;
    transition: opacity var(--pidt-transition);
}

.menu-item {
    color: rgba(255, 255, 255, 0.9);
    padding: 10px 16px; /* 🔹 Reducido de 14px 24px */
    margin: 3px 12px; /* 🔹 Reducido de 4px 16px */
    border-radius: 6px; /* 🔹 Reducido de 8px */
    display: flex;
    align-items: center;
    gap: 10px; /* 🔹 Reducido de 12px */
    cursor: pointer;
    font-size: 14px; /* 🔹 Reducido de 15px */
    font-weight: 500;
    font-family: var(--pidt-font-primary);
    user-select: none;
    /* 🔹 SOLO transiciones de background y transform, NO de opacidad */
    transition: background 0.2s ease, transform 0.2s ease;
}

.menu-item:hover {
    background: rgba(54, 193, 255, 0.15);
    transform: translateX(4px);
    color: var(--pidt-text-white);
}

.menu-item.active {
    background: rgba(54, 193, 255, 0.25);
    font-weight: 600;
    color: var(--pidt-text-white);
}

.menu-item .menu-icon {
    font-size: 14px; /* 🔹 Reducido de 16px */
    width: 26px; /* 🔹 Reducido de 32px */
    height: 26px; /* 🔹 Reducido de 32px */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 5px; /* 🔹 Reducido de 6px */
    /* 🔹 CERO transiciones, CERO animaciones */
    transition: none !important;
    animation: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    will-change: auto !important; /* Prevenir optimizaciones que causen parpadeo */
}

/* 🔹 Hover solo escala el icono, sin afectar opacidad */
.menu-item:hover .menu-icon {
    transform: scale(1.05);
    transition: transform 0.2s ease !important; /* Solo transform */
    opacity: 1 !important;
}

/* 🎨 Colores específicos por módulo */
/* Dashboard */
.menu-item:nth-child(2) .menu-icon {
    background: rgba(68, 89, 215, 0.2);
    color: #4459D7;
}

/* Trabajadores */
.menu-item:nth-child(4) .menu-icon {
    background: rgba(54, 193, 255, 0.2);
    color: #36C1FF;
}

/* Indicadores */
.menu-item:nth-child(6) .menu-icon {
    background: rgba(104, 119, 247, 0.2);
    color: #6877F7;
}

/* Auditorías */
.menu-item:nth-child(7) .menu-icon {
    background: rgba(67, 160, 71, 0.2);
    color: #43A047;
}

/* Configuración */
.menu-item:nth-child(9) .menu-icon {
    background: rgba(255, 179, 0, 0.2);
    color: #FFB300;
}

/* Active state - agregar sombra al icono */
.menu-item.active .menu-icon {
    box-shadow: 0 0 0 2px rgba(54, 193, 255, 0.3);
    opacity: 1 !important;
}

.menu-item .menu-text {
    opacity: 1;
    transition: opacity 0.15s ease; /* 🔹 Transición rápida sin delay */
    white-space: nowrap;
}

.e-sidebar.e-close .menu-section-label,
.e-sidebar.e-close .menu-text {
    opacity: 0;
    display: none;
    transition: none; /* 🔹 Sin transición al cerrar, desaparece inmediatamente */
}

.e-sidebar.e-close .menu-item {
    justify-content: center;
    padding: 10px 0; /* 🔹 Reducido de 14px */
    margin: 3px 6px; /* 🔹 Reducido de 4px 8px */
    transition: none !important; /* 🔹 Sin transiciones al cerrar */
}

.e-sidebar.e-close .menu-item .menu-icon {
    margin: 0;
    width: 28px; /* 🔹 Reducido de 36px */
    height: 28px; /* 🔹 Reducido de 36px */
    opacity: 1 !important;
    display: flex !important;
    visibility: visible !important;
    transition: none !important; /* 🔹 CERO transiciones */
    animation: none !important; /* 🔹 CERO animaciones */
    transform: none !important; /* 🔹 Sin transformaciones */
}

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

/* 🔹 Animación SOLO para texto y labels, NUNCA para iconos */
.e-sidebar:not(.e-close) .menu-section-label {
    animation: fadeInMenu 0.3s ease 0.1s forwards;
}

.e-sidebar:not(.e-close) .menu-text {
    animation: fadeInMenu 0.3s ease 0.1s forwards;
}

/* 🔹 Los iconos NUNCA JAMÁS tienen animación */
.menu-icon,
.e-sidebar .menu-icon,
.e-sidebar:not(.e-close) .menu-icon,
.e-sidebar.e-close .menu-icon,
.e-sidebar.e-open .menu-icon,
.e-sidebar.e-transition .menu-icon {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.footer-content {
    position: relative;
    bottom: 0;
    padding: 0.75rem; /* 🔹 Reducido de 1rem */
    margin-top: auto;
}

.footer-content p {
    color: var(--pidt-text-white);
    font-size: 0.7rem; /* 🔹 Reducido de 0.75rem */
    font-family: var(--pidt-font-secondary);
    opacity: 0.9;
    line-height: 1.4;
    text-align: center;
}

.footer-content.invisible-box {
    display: none;
}

.e-sidebar:not(.e-close) .footer-content {
    opacity: 0;
    animation: fadeInMenu 0.4s ease 0.2s forwards;
}

.e-sidebar.e-close .footer-content {
    display: none;
}

.menu-content::-webkit-scrollbar {
    width: 6px;
}

.menu-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.menu-content::-webkit-scrollbar-thumb {
    background: rgba(54, 193, 255, 0.3);
    border-radius: 3px;
}

.menu-content::-webkit-scrollbar-thumb:hover {
    background: rgba(54, 193, 255, 0.5);
}

/* =====================================================
   📄 MAIN CONTENT
   ===================================================== */
.main-content {
    margin-top: 70px !important;
    background: var(--pidt-surface);
    padding: 2rem 2rem 2rem 2rem;
    min-height: calc(100vh - 70px);
    transition: margin-left var(--pidt-transition);
}

@media (min-width: 600px) {
    .e-sidebar.e-open + .main-content {
        margin-left: 200px; /* 🔹 Reducido de 240px */
    }

    .e-sidebar.e-close + .main-content {
        margin-left: 55px; /* 🔹 Reducido de 60px */
    }
}

@media (max-width: 599px) {
    .main-content {
        margin-left: 0 !important;
    }
}

/* =====================================================
   🔍 SEARCH INPUT
   ===================================================== */
.search-input .e-input-group {
    border-radius: var(--pidt-radius);
    background: #F3F3F9;
    font-family: var(--pidt-font-primary);
}

.search-input .e-input-group input {
    border: none;
    background: #F3F3F9;
    padding-left: 40px;
    color: var(--pidt-text);
}

.search-input .e-input-group:before {
    content: "\F0349";
    font: normal normal normal 24px/1 "Material Design Icons";
    position: absolute;
    left: 8px;
    top: 5px;
    color: #939598;
}

/* =====================================================
   🧮 BOTONES
   ===================================================== */
.e-btn {
    border-radius: var(--pidt-radius);
    font-family: var(--pidt-font-primary);
    transition: all var(--pidt-transition-fast);
}

.e-btn.e-primary {
    background: var(--pidt-primary);
    color: var(--pidt-text-white);
    border: 1px solid var(--pidt-primary);
}

.e-btn.e-primary:hover {
    background: var(--pidt-primary-dark);
    border-color: var(--pidt-primary-dark);
}

.e-btn.e-outline {
    background: white;
    border: 1px solid var(--pidt-primary-dark);
    color: var(--pidt-primary-dark);
}

.e-btn.e-outline:hover {
    background: var(--pidt-primary-dark);
    color: var(--pidt-text-white);
}

/* =====================================================
   ✨ ANIMACIONES Y UTILIDADES
   ===================================================== */
.fade-in {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.4s ease forwards;
}

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

.text-muted {
    color: var(--pidt-text-light);
}

.bg-primary {
    background: var(--pidt-primary);
    color: white;
}

/* =====================================================
   🌐 BUTTON GROUP - SELECTOR DE IDIOMA
   ===================================================== */
.language-buttongroup-wrapper .e-btn-group {
    border-radius: 5px !important;
    overflow: hidden !important;
    border: none !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
    background: transparent !important;
}

.language-buttongroup-wrapper .e-btn-group .e-btn {
    background-image: none !important;
    color: #2d2d2d !important;
    border: none !important;
    padding: 4px 12px !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    min-width: 75px !important;
    height: 28px !important;
    font-family: var(--pidt-font-primary) !important;
    transition: all 0.2s ease !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    line-height: 1.2 !important;
}

.language-buttongroup-wrapper .e-btn-group .e-btn:hover:not(.e-active) {
    background-color: #9597a5 !important;
    background-image: none !important;
    color: #1a1a1a !important;
}

.language-buttongroup-wrapper .e-btn-group .e-btn.e-active {
    background-color: #4459D7 !important;
    background-image: none !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15) !important;
}

.language-buttongroup-wrapper .e-btn-group .e-btn:focus,
.language-buttongroup-wrapper .e-btn-group .e-btn:active,
.language-buttongroup-wrapper .e-btn-group .e-btn.e-focused {
    outline: none !important;
    box-shadow: none !important;
}

.language-buttongroup-wrapper .e-btn-group .e-btn.e-active:focus,
.language-buttongroup-wrapper .e-btn-group .e-btn.e-active:active {
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15) !important;
}

.language-buttongroup-wrapper .e-btn-group .e-btn .flag {
    font-size: 13px !important;
    margin-right: 3px !important;
}

.language-buttongroup-wrapper {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    margin-top: 6px !important;
}

.language-selector-container {
    text-align: center !important;
    margin-top: 14px !important;
    padding-top: 14px !important;
    border-top: 1px solid rgba(0, 0, 0, 0.1) !important;
}

.language-label {
    color: #6b6b6b !important;
    font-size: 10px !important;
    margin-bottom: 6px !important;
    font-weight: 500 !important;
    font-family: var(--pidt-font-primary) !important;
}

/* =====================================================
   📝 INPUTS
   ===================================================== */
.e-float-input.e-control-wrapper:not(.e-error) input:valid ~ label.e-float-text,
.e-float-input.e-control-wrapper:not(.e-error) input ~ label.e-label-top.e-float-text {
    color: #1e1e1e;
    font-size: 0.8rem;
    font-weight: 600;
}

/* =====================================================
   📱 RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    .brand-text-simple {
        font-size: 16px;
    }

    .company-badge-subtle {
        padding: 6px 12px;
    }

    .company-name-subtle {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .company-label {
        display: none;
    }

    .menu-section-label {
        font-size: 10px;
        padding: 16px 20px 6px 20px;
    }

    .menu-item {
        font-size: 14px;
        padding: 12px 20px;
    }
}

@media (max-width: 480px) {
    .brand-with-logo {
        gap: 8px;
        padding: 4px 8px;
    }

    .pidt-logo {
        height: 28px;
    }

    .brand-text-simple {
        font-size: 14px;
    }
}

/* =====================================================
   📱 DASHBOARD
   ===================================================== */
.dashboard-container {
    padding: 0;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding: 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.dashboard-title {
    font-size: 28px;
    font-weight: 700;
    color: #4459D7;
    margin: 0;
    font-family: 'Public Sans', sans-serif;
}

.dashboard-subtitle {
    font-size: 14px;
    color: #6b6b6b;
    margin: 4px 0 0 0;
}

.current-date {
    font-size: 14px;
    color: #6b6b6b;
    font-weight: 500;
}

/* KPI CARDS */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.kpi-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    gap: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.12);
}

.kpi-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-content {
    flex: 1;
}

.kpi-label {
    font-size: 13px;
    color: #6b6b6b;
    font-weight: 500;
    margin-bottom: 4px;
}

.kpi-value {
    font-size: 32px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 4px;
}

.kpi-trend {
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.kpi-trend.positive {
    color: #43A047;
}

.kpi-trend.negative {
    color: #E53935;
}

.kpi-trend.neutral {
    color: #FFB300;
}

/* CHARTS */
.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.chart-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.chart-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.chart-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 4px 0;
}

.chart-subtitle {
    font-size: 13px;
    color: #6b6b6b;
}

.chart-body {
    padding: 16px;
}

/* TABLES */
.tables-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.table-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.table-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
}

.view-all-link {
    font-size: 13px;
    color: #4459D7;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.view-all-link:hover {
    color: #36C1FF;
}

.table-body {
    padding: 16px;
}

.badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-confirmado {
    background: rgba(67, 160, 71, 0.1);
    color: #43A047;
}

.badge-programado {
    background: rgba(54, 193, 255, 0.1);
    color: #36C1FF;
}

.priority-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
}

.priority-alta {
    background: rgba(229, 57, 53, 0.1);
    color: #E53935;
}

.priority-media {
    background: rgba(255, 179, 0, 0.1);
    color: #FFB300;
}

.priority-baja {
    background: rgba(67, 160, 71, 0.1);
    color: #43A047;
}

/* QUICK ACTIONS */
.quick-actions {
    margin-bottom: 32px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 16px;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.action-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.action-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.12);
    border-color: #4459D7;
}

.action-icon {
    font-size: 32px;
    color: #4459D7;
}

.action-label {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    text-align: center;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .charts-row,
    .tables-row {
        grid-template-columns: 1fr;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}
#quickFadeContainer {
    transition: opacity .35s ease-in-out;
    opacity: 1;
}

#quickFadeContainer.fade-out {
    opacity: 0;
}

#quickFadeContainer.fade-in {
    opacity: 1;
}

/* ========================================
   CONFIGURACIÓN UNIFICADA - PIDT G-CASST
   Con integración Syncfusion Grid
   ======================================== */

/* ========================================
   PAGE HEADER
   ======================================== */

.page-header {
    margin-bottom: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title-section h1 {
    font-size: 28px;
    font-weight: 700;
    color: #4459D7;
    margin-bottom: 8px;
}

.page-subtitle {
    font-size: 14px;
    color: #6b6b6b;
}

.role-badge {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-badge.superadmin {
    background: linear-gradient(135deg, #E53935 0%, #C62828 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(229, 57, 53, 0.3);
}

.role-badge.admin {
    background: linear-gradient(135deg, #4459D7 0%, #36C1FF 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(68, 89, 215, 0.3);
}

/* ========================================
   TABS
   ======================================== */

.tabs {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.tabs-header {
    display: flex;
    border-bottom: 2px solid #f0f0f0;
    background: #fafafa;
}

.tab-button {
    padding: 16px 32px;
    border: none;
    background: none;
    font-size: 15px;
    font-weight: 600;
    color: #6b6b6b;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    display: none;
    align-items: center;
    gap: 8px;
}

.tab-button.visible {
    display: flex;
}

.tab-button:hover {
    background: rgba(68, 89, 215, 0.05);
    color: #4459D7;
}

.tab-button.active {
    color: #4459D7;
    background: white;
    border-bottom-color: #4459D7;
}

.tab-content {
    padding: 32px;
    display: none;
}

.tab-content.active {
    display: block;
}

/* ========================================
   SECTION HEADER
   ======================================== */

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 20px;
}

.section-header > div {
    flex: 1;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 12px;
}

/* Search Box Personalizado */
.search-box {
    max-width: 400px;
    margin-top: 8px;
}

.search-box .e-input-group {
    border-radius: 8px !important;
}

.search-box .e-input-group input {
    padding: 10px 16px !important;
    font-size: 14px !important;
}

.search-box .e-input-group.e-outline {
    border-color: #e0e0e0 !important;
}

.search-box .e-input-group.e-outline:hover {
    border-color: #4459D7 !important;
}

.search-box .e-input-group.e-input-focus.e-outline {
    border-color: #4459D7 !important;
    box-shadow: 0 0 0 3px rgba(68, 89, 215, 0.1) !important;
}

.btn-primary {
    background: #4459D7;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #36C1FF;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(68, 89, 215, 0.3);
}

/* ========================================
   STATS CARDS
   ======================================== */

.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    padding: 16px;
    background: #f8f9ff;
    border-radius: 8px;
    border-left: 4px solid #4459D7;
}

.stat-label {
    font-size: 12px;
    color: #6b6b6b;
    font-weight: 600;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #4459D7;
}

/* ========================================
   SYNCFUSION GRID CUSTOMIZATION
   ======================================== */

/* Grid container */
.e-grid {
    border: none !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

/* Grid header */
.e-grid .e-gridheader {
    background: #f8f9ff !important;
    border: none !important;
}

.e-grid .e-headercell {
    background: #f8f9ff !important;
    color: #4459D7 !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    border-color: #f0f0f0 !important;
}

/* Grid rows */
.e-grid .e-row {
    border-bottom: 1px solid #f0f0f0 !important;
}

.e-grid .e-row:hover {
    background: #f8f9ff !important;
}

.e-grid .e-altrow {
    background: #fafafa !important;
}

/* Grid cells */
.e-grid .e-rowcell {
    padding: 16px !important;
    border-color: #f0f0f0 !important;
}

/* Search box in toolbar */
.e-grid .e-toolbar .e-search {
    border: 2px solid #e0e0e0 !important;
    border-radius: 8px !important;
}

.e-grid .e-toolbar .e-search:focus-within {
    border-color: #4459D7 !important;
}

/* Filter bar */
.e-grid .e-filterbar {
    background: #fafafa !important;
}

.e-grid .e-filterbar .e-filterbarcell {
    background: #fafafa !important;
}

.e-grid .e-filterbar input {
    border: 2px solid #e0e0e0 !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
}

.e-grid .e-filterbar input:focus {
    border-color: #4459D7 !important;
    outline: none !important;
}

/* Pager */
.e-grid .e-pager {
    background: #fafafa !important;
    border: none !important;
    border-top: 1px solid #f0f0f0 !important;
    padding: 16px !important;
}

.e-grid .e-pager .e-numericitem {
    border: 2px solid #e0e0e0 !important;
    border-radius: 6px !important;
    color: #4459D7 !important;
    font-weight: 600 !important;
}

.e-grid .e-pager .e-currentitem {
    background: #4459D7 !important;
    color: white !important;
    border-color: #4459D7 !important;
}

/* ========================================
   ITEM INFO (Avatar + Details)
   ======================================== */

.item-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.item-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4459D7 0%, #36C1FF 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.item-avatar.logo {
    border-radius: 8px;
}

.item-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.item-name {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-email {
    font-size: 12px;
    color: #6b6b6b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========================================
   BADGES
   ======================================== */

.badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    white-space: nowrap;
}

.badge-activo {
    background: #d4edda;
    color: #155724;
}

.badge-inactivo {
    background: #f8d7da;
    color: #721c24;
}

.badge-rol {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-limite {
    background: #fff3e0;
    color: #7f6003;
    font-size: 11px;
}

/* ========================================
   ACTION BUTTONS
   ======================================== */

.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    background: #f0f0f0;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn-icon:hover {
    background: #4459D7;
    color: white;
    transform: scale(1.1);
}

.btn-icon.btn-delete:hover {
    background: #E53935;
}

/* ========================================
   SISTEMA TAB - FORMS WITH SYNCFUSION
   ======================================== */

.sistema-form {
    width: 100%;
}

/* Modal styles */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #f0f0f0;
}

.modal-body {
    padding: 24px;
}

.form-warning {
    font-size: 12px;
    color: #ff9800;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-section {
    margin-bottom: 32px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}

.form-label.required::after {
    content: ' *';
    color: #E53935;
}

/* Syncfusion TextBox Customization */
.form-group .e-input-group,
.form-group .e-float-input {
    width: 100%;
}

.form-group .e-input-group.e-control-wrapper,
.form-group .e-float-input.e-control-wrapper {
    border-radius: 8px !important;
}

.form-group .e-input-group.e-outline,
.form-group .e-float-input.e-outline {
    border-color: #e0e0e0 !important;
}

.form-group .e-input-group.e-outline:hover,
.form-group .e-float-input.e-outline:hover {
    border-color: #4459D7 !important;
}

.form-group .e-input-group.e-input-focus.e-outline,
.form-group .e-float-input.e-input-focus.e-outline {
    border-color: #4459D7 !important;
    box-shadow: 0 0 0 2px rgba(68, 89, 215, 0.1) !important;
}

.form-group .e-input-group input,
.form-group .e-float-input input {
    padding: 12px 16px !important;
    font-size: 14px !important;
}

/* Syncfusion DropDownList Customization */
.form-group .e-ddl.e-control-wrapper {
    border-radius: 8px !important;
}

.form-group .e-ddl.e-outline {
    border-color: #e0e0e0 !important;
}

.form-group .e-ddl.e-outline:hover {
    border-color: #4459D7 !important;
}

.form-group .e-ddl.e-input-focus.e-outline {
    border-color: #4459D7 !important;
    box-shadow: 0 0 0 2px rgba(68, 89, 215, 0.1) !important;
}

.form-group .e-ddl .e-input-group-icon {
    color: #4459D7 !important;
}

/* Syncfusion Uploader Customization */
.form-group .e-upload {
    border: 2px dashed #e0e0e0 !important;
    border-radius: 8px !important;
    padding: 20px !important;
    background: #f8f9ff !important;
}

.form-group .e-upload:hover {
    border-color: #4459D7 !important;
}

.form-group .e-file-select-wrap {
    padding: 0 !important;
}

.form-group .e-file-select-wrap button {
    background: white !important;
    border: 2px solid #4459D7 !important;
    color: #4459D7 !important;
    padding: 10px 20px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.form-group .e-file-select-wrap button:hover {
    background: #4459D7 !important;
    color: white !important;
}

.form-section-title {
    font-size: 16px;
    font-weight: 700;
    color: #4459D7;
    margin: 24px 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
}

.form-help {
    font-size: 12px;
    color: #6b6b6b;
    margin-top: 4px;
}

.logo-upload {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-preview {
    width: 100px;
    height: 100px;
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9ff;
    font-size: 48px;
    overflow: hidden;
}

.logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.logo-preview span {
    font-size: 48px;
}

/* Syncfusion Button for Save */
.btn-save.e-btn {
    background: #00C853 !important;
    color: white !important;
    border: none !important;
    padding: 12px 32px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    margin-top: 16px !important;
}

.btn-save.e-btn:hover {
    background: #00E676 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 200, 83, 0.3) !important;
}

.btn-save.e-btn .e-btn-icon {
    margin-right: 8px !important;
}

/* ========================================
   MODALS
   ======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #4459D7;
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f0f0f0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    color: #6b6b6b;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #e0e0e0;
    color: #2d3748;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 24px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    position: sticky;
    bottom: 0;
    background: white;
    z-index: 10;
}

.btn-secondary {
    background: white;
    border: 2px solid #36C1FF;
    color: #36C1FF;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #36C1FF;
    color: white;
}

.form-warning {
    padding: 12px;
    background: #fff3e0;
    border-left: 3px solid #FFB300;
    border-radius: 4px;
    font-size: 13px;
    color: #7f6003;
    margin-top: 8px;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.form-checkbox input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-checkbox label {
    font-size: 14px;
    color: #2d3748;
    cursor: pointer;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1024px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .tab-button {
        padding: 12px 16px;
        font-size: 13px;
    }

    .tab-content {
        padding: 16px;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .btn-primary {
        width: 100%;
        justify-content: center;
    }
}

.delete-warning {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: #fff3e0;
    border-radius: 8px;
    border-left: 4px solid #FFB300;
    margin-bottom: 16px;
}

.warning-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.warning-content {
    flex: 1;
}

.delete-info-box {
    padding: 12px 16px;
    background: #ffebee;
    border-radius: 6px;
    border-left: 3px solid #E53935;
}


.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Contenedor del botón */
.btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Spinner dentro del botón */
.spinner-btn {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin-btn 0.8s linear infinite;
    display: inline-block;
}

@keyframes spin-btn {
    to { transform: rotate(360deg); }
}

/* Botón deshabilitado */
.save-client-btn.e-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed !important;
}

/* Asegurar que el spinner sea visible */
.e-dialog .modal-footer .e-btn {
    min-height: 36px;
}
