/* ============================================
   VARIABLES Y CONFIGURACIÓN GLOBAL
   ============================================ */
:root {
    --primary-color: #00377b;
    --primary-dark: #001d4e;
    --primary-light: #0051a2;
    --accent-color: #00c8ff;
    --accent-hover: #00a8d9;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Gradientes azules modernos */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #667eea 100%);
    --gradient-primary-alt: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-primary-dark: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #1e3c72 100%);
    --gradient-primary-light: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-accent: linear-gradient(135deg, #00c8ff 0%, #0099cc 50%, #00c8ff 100%);
    --gradient-menu: linear-gradient(180deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
    
    /* Botones - Colores consistentes */
    --gradient-button: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #1d4ed8 100%);
    --gradient-button-hover: linear-gradient(135deg, #60a5fa 0%, #3b82f6 50%, #2563eb 100%);
    --gradient-button-secondary: linear-gradient(135deg, #6b7280 0%, #9ca3af 100%);
    --gradient-button-secondary-hover: linear-gradient(135deg, #9ca3af 0%, #d1d5db 100%);
    --gradient-button-success: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    --gradient-button-success-hover: linear-gradient(135deg, #34d399 0%, #6ee7b7 100%);
    --gradient-button-danger: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    --gradient-button-danger-hover: linear-gradient(135deg, #f87171 0%, #fca5a5 100%);
    --gradient-button-warning: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    --gradient-button-warning-hover: linear-gradient(135deg, #fbbf24 0%, #fcd34d 100%);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   SIDEBAR MODERNO 2025 - MEJORADO
   ============================================ */
.sidenav {
    height: 100vh;
    width: 280px;
    position: fixed;
    top: 0;
    left: 0;
    /* Gradiente moderno azul intermedio-oscuro con movimiento sutil */
    background: linear-gradient(180deg, 
        #1e40af 0%, 
        #1e3a8a 25%, 
        #2563eb 50%, 
        #1e3a8a 75%, 
        #1e40af 100%);
    background-size: 100% 300%;
    animation: gradientShift 20s ease-in-out infinite;
    color: #fff;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    padding: 0;
    /* Efecto glassmorphism con sombra moderna */
    box-shadow: 
        4px 0 24px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: var(--transition);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 0% 100%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.sidenav::-webkit-scrollbar {
    width: 8px;
}

.sidenav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
}

.sidenav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.sidenav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
    background-clip: padding-box;
}

/* Logo Container - Moderno con efecto glass */
.sidenav .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 24px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
}

.sidenav .logo::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s;
}

.sidenav .logo:hover::before {
    left: 100%;
}

.sidenav .logo img {
    max-height: 65px;
    width: auto;
    filter: brightness(0) invert(1) drop-shadow(0 2px 8px rgba(255, 255, 255, 0.2));
    transition: var(--transition);
    position: relative;
    z-index: 1;
}

.sidenav .logo:hover img {
    transform: scale(1.05);
    filter: brightness(0) invert(1) drop-shadow(0 4px 12px rgba(255, 255, 255, 0.3));
}

/* Lista de navegación */
.sidenav ul {
    list-style-type: none;
    padding: 12px 0;
    margin: 0;
}

.sidenav li {
    margin: 6px 16px;
    border-radius: 14px;
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

/* Efecto hover mejorado */
.sidenav li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: linear-gradient(180deg, #60a5fa 0%, #3b82f6 100%);
    border-radius: 0 4px 4px 0;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.sidenav li:hover::before {
    height: 60%;
    opacity: 1;
}

.sidenav li:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(6px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sidenav li:active {
    transform: translateX(3px);
}

/* Estado activo para el item actual */
.sidenav li.active {
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 
        0 4px 16px rgba(59, 130, 246, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.sidenav li.active::before {
    height: 70%;
    opacity: 1;
    background: linear-gradient(180deg, #93c5fd 0%, #60a5fa 50%, #3b82f6 100%);
    box-shadow: 0 0 12px rgba(96, 165, 250, 0.6);
}

.sidenav li.active a {
    color: #ffffff;
    font-weight: 600;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.sidenav li.active a i {
    opacity: 1;
    transform: scale(1.1);
    color: #93c5fd;
}

/* Enlaces del menú */
.sidenav a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition);
    border-radius: 14px;
    position: relative;
    letter-spacing: 0.3px;
}

.sidenav a:hover {
    color: #ffffff;
    background: transparent;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.sidenav a i {
    margin-right: 14px;
    font-size: 20px;
    width: 26px;
    text-align: center;
    opacity: 0.85;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.85);
}

.sidenav li:hover a i {
    opacity: 1;
    transform: scale(1.25);
    color: #ffffff;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.4));
}

.sidenav li.active a i {
    opacity: 1;
    transform: scale(1.2);
    color: #ffffff;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.6);
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.5));
}

/* Separador HR mejorado */
.sidenav hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.15) 20%, 
        rgba(255, 255, 255, 0.15) 80%, 
        transparent 100%);
    margin: 16px 20px;
    position: relative;
}

.sidenav hr::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

/* ============================================
   CONTENIDO PRINCIPAL
   ============================================ */
.content {
    margin-left: 280px;
    padding: 32px;
    min-height: 100vh;
    transition: var(--transition);
    background: var(--bg-color);
}

/* ============================================
   NAVBAR SUPERIOR
   ============================================ */
.navbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    background: var(--card-bg);
    padding: 16px 32px;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border-color);
    margin-left: 280px;
    position: sticky;
    top: 0;
    z-index: 999;
    transition: var(--transition);
}

.logout-btn {
    background: var(--gradient-button);
    background-size: 200% 200%;
    color: white;
    border: none;
    padding: 10px 24px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    margin-left: 16px;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.logout-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.logout-btn:hover::before {
    left: 100%;
}

.logout-btn:hover {
    background: var(--gradient-button-hover);
    background-size: 200% 200%;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.logout-btn:active {
    transform: translateY(0);
}

.username {
    margin-left: 16px;
    color: var(--text-primary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.username i {
    color: var(--primary-color);
}

/* ============================================
   CARDS MEJORADAS
   ============================================ */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    width: 100%;
}

/* Media query para móvil - tarjetas verticales */
@media (max-width: 768px) {
    .stats-cards {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
}

.topcard {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    color: white;
    width: 100%;
    min-height: 140px;
    padding: 24px;
    margin: 0;
    text-align: center;
    justify-content: center;
    align-items: center;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: none;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
}

.topcard::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.topcard:hover::before {
    transform: translateX(100%);
}

.topcard:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

.topcard h5 {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
    margin-bottom: 12px;
}

.topcard h4 {
    font-size: 32px;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Colores de cards */
.topcard.blue1 {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
}

.topcard.darkgray {
    background: linear-gradient(135deg, #475569 0%, #64748b 100%);
}

.topcard.blue2 {
    background: linear-gradient(135deg, #2563eb 0%, #60a5fa 100%);
}

.topcard.orange {
    background: linear-gradient(135deg, #ea580c 0%, #fb923c 100%);
}

.topcard.orange1 {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.topcard.green1 {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.topcard.red1 {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* ============================================
   TARJETAS DE GRÁFICOS
   ============================================ */
.tarjeta_graficos {
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: var(--card-bg);
    background-clip: border-box;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    padding: 24px;
    border-radius: 16px;
    transition: var(--transition);
    margin: 1%;
}

.tarjeta_graficos:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.titulo_grafico {
    background: var(--gradient-accent);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    color: white;
    font-size: 18px;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    border: none;
    padding: 16px 24px;
    border-radius: 12px 12px 0 0;
    margin: -24px -24px 24px -24px;
}

.titulo_grafico h2,
.titulo_grafico h4 {
    margin: 0;
    font-weight: 600;
    font-size: 20px !important;
}

/* ============================================
   TABLAS MEJORADAS
   ============================================ */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    font-size: 14px;
}

table thead {
    background: var(--gradient-menu);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    color: white;
}

table thead th {
    padding: 18px 16px;
    text-align: left;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border: none;
    color: white;
    position: relative;
    white-space: nowrap;
}

table thead th:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 25%;
    height: 50%;
    width: 1px;
    background: rgba(255, 255, 255, 0.25);
}

table tbody tr {
    transition: all 0.25s ease;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    background: var(--card-bg);
    position: relative;
}

table tbody tr::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-color), rgba(59, 130, 246, 0.5));
    transition: width 0.3s ease;
}

table tbody tr:nth-child(even) {
    background: rgba(241, 245, 249, 0.5);
}

table tbody tr:hover {
    background: rgba(59, 130, 246, 0.1);
    transform: translateX(3px);
    box-shadow: -3px 0 0 0 rgba(59, 130, 246, 0.5), 0 2px 8px rgba(59, 130, 246, 0.15);
}

table tbody tr:hover::after {
    width: 100%;
}

table tbody tr:last-child {
    border-bottom: none;
}

table tbody td {
    padding: 14px 16px;
    border-right: 1px solid rgba(226, 232, 240, 0.4);
    color: var(--text-primary);
    vertical-align: middle;
    line-height: 1.6;
    font-size: 14px;
    position: relative;
}

table tbody td:last-child {
    border-right: none;
}

table tbody td strong {
    font-weight: 600;
    color: var(--text-primary);
}

/* Botones dentro de tablas - Mejor disposición */
table tbody td .btn-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    justify-content: flex-start;
    padding: 4px 0;
}

table tbody td .btn,
table tbody td a.btn {
    margin: 0;
    white-space: nowrap;
    font-size: 12px;
    padding: 6px 12px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

table tbody td .btn i,
table tbody td a.btn i {
    font-size: 11px;
    margin-right: 0;
}

table tbody td .btn-container a:not(.btn),
table tbody td a:not(.btn) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    gap: 5px;
    white-space: nowrap;
    min-height: 32px;
}

/* Enlaces simples en tablas convertidos a botones */
table tbody td a:not(.btn):not([class*="btn"]) {
    background: var(--gradient-button);
    background-size: 200% 200%;
    color: white;
    border: none;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

table tbody td a:not(.btn):not([class*="btn"])::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

table tbody td a:not(.btn):not([class*="btn"]):hover::before {
    left: 100%;
}

table tbody td a:not(.btn):not([class*="btn"]):hover {
    background: var(--gradient-button-hover);
    background-size: 200% 200%;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: white;
}

/* Mejora para columnas de acciones */
table tbody td:has(.btn-container) {
    min-width: 200px;
    text-align: left;
}

/* Responsive para botones en tablas */
@media (max-width: 768px) {
    table tbody td .btn-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    table tbody td .btn,
    table tbody td a.btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   BOTONES MEJORADOS
   ============================================ */
.btn, .bnt_general, .bnt_login {
    display: inline-block;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border: none;
    border-radius: 10px;
    color: #fff;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.btn::before, .bnt_general::before, .bnt_login::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before, .bnt_general:hover::before, .bnt_login:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover, .bnt_general:hover, .bnt_login:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:active, .bnt_general:active, .bnt_login:active {
    transform: translateY(0);
}

.bnt_login {
    width: 100%;
    background: var(--gradient-button);
    background-size: 200% 200%;
    padding: 14px;
    font-size: 16px;
    margin-top: 8px;
    position: relative;
    overflow: hidden;
}

.bnt_login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.bnt_login:hover::before {
    left: 100%;
}

.bnt_login:hover {
    background: var(--gradient-button-hover);
    background-size: 200% 200%;
}

.bnt_general {
    background: var(--gradient-button);
    background-size: 200% 200%;
    position: relative;
    overflow: hidden;
}

.bnt_general::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.bnt_general:hover::before {
    left: 100%;
}

.bnt_general:hover {
    background: var(--gradient-button-hover);
    background-size: 200% 200%;
}

.btn-primary {
    background: var(--gradient-button);
    background-size: 200% 200%;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background: var(--gradient-button-hover);
    background-size: 200% 200%;
}

.btn-success {
    background: var(--gradient-button-success);
    background-size: 200% 200%;
    color: white;
    border: none;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-success::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-success:hover::before {
    left: 100%;
}

.btn-success:hover {
    background: var(--gradient-button-success-hover);
    background-size: 200% 200%;
}

.btn-danger {
    background: var(--gradient-button-danger);
    background-size: 200% 200%;
    color: white;
    border: none;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-danger::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-danger:hover::before {
    left: 100%;
}

.btn-danger:hover {
    background: var(--gradient-button-danger-hover);
    background-size: 200% 200%;
}

.btn-warning {
    background: var(--gradient-button-warning);
    background-size: 200% 200%;
    color: white;
    border: none;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-warning::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-warning:hover::before {
    left: 100%;
}

.btn-warning:hover {
    background: var(--gradient-button-warning-hover);
    background-size: 200% 200%;
}

.btn-secondary {
    background: var(--gradient-button-secondary);
    background-size: 200% 200%;
    color: white;
    border: none;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-secondary:hover::before {
    left: 100%;
}

.btn-secondary:hover {
    background: var(--gradient-button-secondary-hover);
    background-size: 200% 200%;
}

/* Botones pequeños */
.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 8px;
    height: auto;
    min-height: 32px;
}

.btn-sm i {
    font-size: 12px;
}

/* ============================================
   FORMULARIOS MEJORADOS
   ============================================ */
.input_form, .input_register {
    width: 100%;
    margin-bottom: 16px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    outline: none;
    padding: 12px 16px;
    font-size: 15px;
    color: var(--text-primary);
    border-radius: 10px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.input_form:focus, .input_register:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 200, 255, 0.1);
    transform: translateY(-1px);
}

.login_form {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 450px;
    width: 100%;
}

.logo_login {
    background: var(--gradient-button);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    width: 100%;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 24px;
    box-shadow: var(--shadow-lg);
}

.logo_login img {
    max-height: 60px;
    filter: brightness(0) invert(1);
}

/* ============================================
   CONTENEDOR LOGIN
   ============================================ */
.contenedor_login {
    position: absolute;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

/* ============================================
   BOTONES FLOTANTES
   ============================================ */
.floating-buttons {
    position: fixed;
    right: 24px;
    bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1000;
}

.round-button {
    background: var(--gradient-button);
    background-size: 200% 200%;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 18px;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.round-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.round-button:hover::before {
    width: 300px;
    height: 300px;
}

.round-button:hover {
    background: var(--gradient-button-hover);
    background-size: 200% 200%;
    transform: scale(1.1) rotate(5deg);
    box-shadow: var(--shadow-xl);
}

.round-button:active {
    transform: scale(0.95);
}

/* ============================================
   REGISTROS Y CARDS
   ============================================ */
.registro {
    display: flex;
    flex-wrap: wrap;
    border: 1px solid var(--border-color);
    margin-bottom: 16px;
    padding: 20px;
    background-color: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.registro:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card {
    border: 1px solid var(--border-color);
    padding: 24px;
    margin: 16px;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

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

/* ============================================
   BOTONES ESPECIALES
   ============================================ */
.btn_gray {
    background: var(--gradient-button-secondary);
    background-size: 200% 200%;
    color: white;
    border: none;
    border-radius: 10px;
    height: 44px;
    margin-top: 8px;
    width: 45%;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn_gray::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn_gray:hover::before {
    left: 100%;
}

.btn_gray:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: var(--gradient-button-secondary-hover);
    background-size: 200% 200%;
}

.btn_darkgray {
    background: var(--gradient-button);
    background-size: 200% 200%;
    color: white;
    border: none;
    border-radius: 10px;
    height: 44px;
    margin-top: 8px;
    width: 45%;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn_darkgray::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn_darkgray:hover::before {
    left: 100%;
}

.btn_darkgray:hover {
    background: var(--gradient-button-hover);
    background-size: 200% 200%;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn_blue {
    background: var(--gradient-button);
    background-size: 200% 200%;
    color: white;
    border: none;
    border-radius: 10px;
    height: 44px;
    padding: 0 24px;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.btn_blue::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn_blue:hover::before {
    left: 100%;
}

.btn_blue:hover {
    background: var(--gradient-button-hover);
    background-size: 200% 200%;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ============================================
   UTILIDADES
   ============================================ */
.row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    margin: -1%;
    gap: 0;
}

/* Estilos para tablas de ranking */
.ranking-table {
    position: relative;
}

.ranking-table tbody tr:first-child {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(251, 191, 36, 0.05) 100%);
}

.ranking-table tbody tr:first-child td {
    border-left: 3px solid #fbbf24;
}

.ranking-table tbody tr:nth-child(2) {
    background: linear-gradient(135deg, rgba(156, 163, 175, 0.1) 0%, rgba(156, 163, 175, 0.05) 100%);
}

.ranking-table tbody tr:nth-child(2) td {
    border-left: 3px solid #9ca3af;
}

.ranking-table tbody tr:nth-child(3) {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.1) 0%, rgba(205, 127, 50, 0.05) 100%);
}

.ranking-table tbody tr:nth-child(3) td {
    border-left: 3px solid #cd7f32;
}

.search {
    width: 100%;
    margin-top: 16px;
    margin-bottom: 16px;
    border-radius: 10px;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    font-size: 15px;
    transition: var(--transition);
}

.search:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 200, 255, 0.1);
    outline: none;
}

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

.content > * {
    animation: fadeIn 0.5s ease-out;
}

/* ============================================
   VISTAS WEB Y MOBILE
   ============================================ */
/* Por defecto: web visible, mobile oculto */
.web {
    display: block;
}

.mobile {
    display: none;
}

/* ============================================
   FILTROS TIPO CRM
   ============================================ */
.filter-container {
    background: var(--card-bg);
    border-radius: var(--border-radius-md);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 16px;
    width: 100%;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-field {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 200px;
    max-width: none;
}

.filter-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-field input,
.filter-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    transition: var(--transition);
    background: var(--card-bg);
    color: var(--text-primary);
}

.filter-field input:focus,
.filter-field select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 200, 255, 0.1);
}

.filter-actions {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-shrink: 0;
    margin-left: auto;
}

.filter-actions button,
.filter-actions a {
    white-space: nowrap;
    padding: 10px 20px;
    height: fit-content;
    min-width: 140px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Filtros compactos - varios por fila */
.filter-compact .filter-row {
    gap: 20px;
}

.filter-compact .filter-field {
    min-width: 200px;
    flex: 1 1 auto;
}

.filter-compact .filter-field input,
.filter-compact .filter-field select {
    padding: 10px 14px;
    font-size: 14px;
}

/* Campos de fecha más pequeños */
.filter-compact .filter-field:has(input[type="date"]) {
    flex: 0 0 160px;
    min-width: 160px;
    max-width: 160px;
}

.filter-compact .filter-field input[type="date"] {
    width: 100%;
}

/* Selectores más pequeños */
.filter-compact .filter-field select {
    min-width: 160px;
}

/* Campo de búsqueda más ancho */
.filter-compact .filter-field[style*="flex: 2"] {
    flex: 2 1 auto;
    min-width: 300px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 767px) {
    .web {
        display: none !important;
    }

    .mobile {
        display: block !important;
    }
    
    .filter-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .filter-field {
        min-width: 100%;
        width: 100%;
    }
    
    .filter-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .filter-actions button {
        width: 100%;
    }

    .navbar {
        margin-left: 0 !important;
        padding: 12px 16px;
        position: relative;
        z-index: 1001;
    }
    
    .user-info-desktop {
        display: none !important;
    }
    
    .menu-toggle {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 1002 !important;
        position: relative !important;
    }

    .content {
        margin-left: 0;
        padding: 16px;
    }

    .sidenav {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidenav.active {
        transform: translateX(0);
    }

    .topcard {
        min-width: 100% !important;
        width: 100% !important;
        min-height: 120px;
        padding: 16px;
    }

    .topcard h4 {
        font-size: 24px;
    }

    .tarjeta_graficos {
        width: 100% !important;
        margin: 8px 0;
    }

    .login_form {
        padding: 24px;
        margin: 0 16px;
        width: calc(100% - 32px);
    }

    .floating-buttons {
        right: 16px;
        bottom: 16px;
    }

    .round-button {
        width: 44px;
        height: 44px;
        font-size: 16px;
    }

    table {
        font-size: 14px;
    }

    table thead th,
    table tbody td {
        padding: 12px 8px;
    }
}

/* ============================================
   MEJORAS ADICIONALES
   ============================================ */
.container {
    display: flex;
}

.logo_feeling {
    width: 30%;
    margin-top: -2%;
    padding-bottom: 2%;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

/* Efecto de carga suave */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Mejora de scrollbar global */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ============================================
   GRID DE IMÁGENES MEJORADO
   ============================================ */
.imagenes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.imagen-contenedor {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    background: var(--card-bg);
}

.imagen-contenedor:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.imagen-contenedor img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.imagen-contenedor:hover img {
    transform: scale(1.05);
}

/* Overlay para hover en imágenes */
.imagen-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.imagen-contenedor:hover .imagen-overlay {
    background: rgba(0, 0, 0, 0.3);
}

.imagen-overlay i {
    color: white;
    font-size: 32px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.imagen-contenedor:hover .imagen-overlay i {
    opacity: 1;
}

/* Botones de acción en imágenes */
.imagen-contenedor .btn-accion-imagen {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.imagen-contenedor .btn-accion-imagen:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

/* Modal de imágenes */
.imagen-modal,
#imagenModal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.imagen-modal.active,
#imagenModal.active {
    display: flex;
}

.imagen-modal-content,
#imagenModalContent {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease;
    cursor: pointer;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

#imagenModal .close-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    transition: var(--transition);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
}

#imagenModal .close-modal:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: rotate(90deg);
}

/* Responsive para grid de imágenes */
@media (max-width: 768px) {
    .imagenes-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .imagen-contenedor img {
        height: 200px;
    }
    
    #imagenModalContent {
        max-width: 95%;
        max-height: 85%;
    }
}

/* ============================================
   MODAL PARA CARGAR FOTOS
   ============================================ */
.modal-cargar-fotos {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-cargar-fotos.active {
    display: flex;
}

.modal-cargar-fotos-content {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideDown 0.3s ease;
}

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

.modal-cargar-fotos-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gradient-menu);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
}

.modal-cargar-fotos-header h3 {
    color: white;
    font-size: 20px;
    font-weight: 700;
}

.close-modal-cargar {
    color: white;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
}

.close-modal-cargar:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-cargar-fotos-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(90vh - 100px);
}

/* Mensaje de éxito */
.mensaje-exito {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    animation: slideInRight 0.5s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.mensaje-exito-content {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    border-left: 4px solid #10b981;
    min-width: 300px;
    text-align: center;
    animation: pulse 2s infinite;
}

/* Responsive para modal de cargar fotos */
@media (max-width: 768px) {
    .modal-cargar-fotos-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-cargar-fotos-header {
        padding: 16px;
    }
    
    .modal-cargar-fotos-header h3 {
        font-size: 18px;
    }
    
    .modal-cargar-fotos-body {
        padding: 16px;
    }
    
    .mensaje-exito {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .mensaje-exito-content {
        min-width: auto;
        width: 100%;
    }
}

/* ============================================
   ESTILOS MOBILE-FIRST PARA COORDINADOR
   ============================================ */
@media (max-width: 768px) {
    /* Ajustes generales para móvil */
    body {
        font-size: 14px;
    }
    
    /* Sidebar en móvil */
    .sidenav {
        width: 280px !important;
        max-width: 85vw;
        transform: translateX(-100%) !important;
        transition: transform 0.3s ease !important;
        z-index: 1000 !important;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        height: 100vh !important;
    }
    
    .sidenav.open {
        transform: translateX(0) !important;
    }
    
    /* Overlay para móvil */
    #overlay {
        z-index: 999 !important;
    }
    
    /* Botón hamburguesa siempre visible en móvil */
    .menu-toggle {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Contenido principal */
    .main-content {
        margin-left: 0 !important;
        padding: 16px !important;
    }
    
    /* Botones táctiles */
    .btn, button, a.btn {
        min-height: 44px;
        min-width: 44px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
    
    /* Inputs y formularios */
    input, select, textarea {
        font-size: 16px !important; /* Previene zoom en iOS */
        min-height: 44px;
    }
    
    /* Tablas responsivas */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
        overflow-x: auto;
    }
    
    /* Modales en móvil */
    .modal-content {
        width: 95% !important;
        max-height: 90vh !important;
        margin: 2.5vh auto !important;
    }
    
    /* Tarjetas en móvil */
    .topcard {
        margin-bottom: 12px !important;
    }
    
    /* Espaciado reducido */
    .tarjeta_graficos {
        margin-bottom: 16px !important;
    }
    
    /* Gráficos responsivos */
    canvas {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Grid de imágenes responsivo */
    .imagenes-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
        gap: 12px !important;
    }
}
