@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    /* Colores institucionales */
    --primary-color: #1e3a8a;
    --secondary-color: #3b82f6;
    --accent-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --success-color: #22c55e;
    --info-color: #06b6d4;
    --dark-color: #1f2937;
    --light-color: #f8fafc;
    --white-color: #ffffff;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Fuente */
    --font-family: 'Poppins', sans-serif;
    
    /* Sombras */
    --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);
    
    /* Bordes */
    --border-radius: 0.375rem;
    --border-radius-lg: 0.5rem;
    --border-radius-xl: 0.75rem;
}

/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--light-color);
    color: var(--gray-800);
    line-height: 1.6;
}

/* Layout principal */
.main-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.main-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white-color);
    padding: 0.75rem 0;
    box-shadow: var(--shadow-md);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 70px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    height: 100%;
    max-width: 100%;
    margin: 0 auto;
    min-width: 0;
}

.logo h1 {
    font-weight: 700;
    font-size: 1.5rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.user-details {
    text-align: right;
    line-height: 1.2;
    min-width: 0;
    flex-shrink: 1;
}

.user-details small {
    font-size: 0.75rem;
}

.user-details strong {
    font-size: 0.875rem;
    display: block;
    white-space: nowrap;
}

.user-menu {
    position: relative;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

/* Sidebar */
.sidebar {
    background: var(--white-color);
    width: 250px;
    box-shadow: var(--shadow-md);
    border-right: 1px solid var(--gray-200);
    position: fixed;
    top: 70px;
    left: 0;
    height: calc(100vh - 70px);
    overflow-y: auto;
    z-index: 999;
    transition: transform 0.3s ease;
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
}

.sidebar-menu li {
    margin: 0.25rem 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--gray-700);
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: var(--border-radius);
    margin: 0 1rem;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: var(--primary-color);
    color: var(--white-color);
    transform: translateX(5px);
}

.sidebar-menu i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

/* Divisor del sidebar */
.sidebar-divider {
    padding: 1rem 1.5rem 0.5rem 1.5rem;
    margin-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.sidebar-divider-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Contenido principal */
.main-content {
    flex: 1;
    padding: 1.5rem;
    margin-left: 250px;
    margin-top: 70px;
    min-height: calc(100vh - 70px);
    transition: margin-left 0.3s ease;
    width: calc(100% - 250px);
}

.content-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--gray-600);
    font-size: 1rem;
}

/* Cards */
.card {
    background: var(--white-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

.card-body {
    padding: 1.5rem;
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white-color);
}

.btn-primary:hover {
    background: #1e40af;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--gray-600);
    color: var(--white-color);
}

.btn-success {
    background: var(--success-color);
    color: var(--white-color);
}

.btn-warning {
    background: var(--warning-color);
    color: var(--white-color);
}

.btn-danger {
    background: var(--danger-color);
    color: var(--white-color);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

/* Formularios */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    transition: all 0.3s ease;
    font-family: var(--font-family);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Tablas */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white-color);
    font-size: 0.875rem;
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-200);
}

.table tbody tr:hover {
    background: var(--gray-50);
}

/* Estados */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-success {
    background: rgba(34, 197, 94, 0.1);
    color: #166534;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #92400e;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #991b1b;
}

.badge-info {
    background: rgba(6, 182, 212, 0.1);
    color: #155e75;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.2);
    color: #166534;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.2);
    color: #92400e;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #991b1b;
}

.alert-info {
    background: rgba(6, 182, 212, 0.1);
    border-color: rgba(6, 182, 212, 0.2);
    color: #155e75;
}

/* Utilidades */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.align-items-center { align-items: center; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-3 { margin-left: 1rem; }

.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 1rem; }

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        padding: 0 1rem;
    }
    
    .logo h1 {
        font-size: 1.25rem;
    }
    
    .user-info {
        gap: 0.5rem;
    }
    
    .user-details {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        font-size: 0.75rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }
}

/* Login page */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.login-card {
    background: var(--white-color);
    padding: 3rem;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--gray-600);
}

/* Dashboard stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white-color);
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Estilos para tarjetas de acceso rápido que son enlaces */
a .stat-card {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

a .stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

a .stat-card .stat-value {
    color: var(--primary-color);
}

a .stat-card .stat-label {
    color: var(--gray-700);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--gray-600);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Charts */
.chart-container {
    position: relative;
    height: 400px;
    margin-bottom: 2rem;
}

/* Calendar */
.calendar-container {
    background: var(--white-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

/* DataTables customization */
.dataTables_wrapper {
    font-family: var(--font-family);
}

.dataTables_filter input {
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    margin-left: 0.5rem;
}

.dataTables_length select {
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    margin: 0 0.5rem;
}

/* Estadísticas del dashboard */
.stats-section {
    margin-bottom: 1.5rem;
}

.stats-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
    border-left: 3px solid var(--primary-color);
}

.stats-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

.stats-grid-1 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.stats-grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stats-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.stats-grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stats-grid-5 {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.stats-grid-6 {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.stats-grid-6 {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.stat-card {
    background: var(--white-color);
    border-radius: var(--border-radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gray-300);
    transition: all 0.3s ease;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--gray-600);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.8;
}

/* Colores para estadísticas */
.stat-primary::before { background: var(--primary-color); }
.stat-primary .stat-value { color: var(--primary-color); }
.stat-primary .stat-icon { color: var(--primary-color); }

.stat-secondary::before { background: var(--secondary-color); }
.stat-secondary .stat-value { color: var(--secondary-color); }
.stat-secondary .stat-icon { color: var(--secondary-color); }

.stat-warning::before { background: var(--warning-color); }
.stat-warning .stat-value { color: var(--warning-color); }
.stat-warning .stat-icon { color: var(--warning-color); }

.stat-success::before { background: var(--success-color); }
.stat-success .stat-value { color: var(--success-color); }
.stat-success .stat-icon { color: var(--success-color); }

.stat-danger::before { background: var(--danger-color); }
.stat-danger .stat-value { color: var(--danger-color); }
.stat-danger .stat-icon { color: var(--danger-color); }

.stat-info::before { background: var(--info-color); }
.stat-info .stat-value { color: var(--info-color); }
.stat-info .stat-icon { color: var(--info-color); }

.stat-accent::before { background: var(--accent-color); }
.stat-accent .stat-value { color: var(--accent-color); }
.stat-accent .stat-icon { color: var(--accent-color); }

/* ========================= 
   NUEVO CARD GRANDE PARA MONTO TOTAL
   ========================= */

/* Card grande para monto total */
.stat-card-large {
    background: linear-gradient(135deg, var(--success-color) 0%, var(--accent-color) 100%);
    color: var(--white-color);
    border: none;
    border-radius: var(--border-radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.stat-card-large:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.stat-card-large::before {
    display: none;
}

.stat-icon-xl {
    font-size: 4rem;
    color: var(--white-color);
    opacity: 0.9;
    margin-bottom: 1rem;
}

.stat-content-large {
    text-align: left;
}

.stat-value-xl {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--white-color);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 0.5rem;
}

.stat-label-xl {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--white-color);
    opacity: 0.95;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-subtitle-large {
    font-size: 1rem;
    color: var(--white-color);
    opacity: 0.85;
    font-weight: 500;
    display: flex;
    align-items: center;
}

/* Card destacado para monto total */
.stat-card-featured {
    padding: 2rem 1.5rem;
    background: linear-gradient(135deg, #ff6b6b 0%, #4ecdc4 100%) !important;
    color: var(--white-color) !important;
    border: 3px solid #ff0000 !important;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    margin: 1rem 0 !important;
}

.stat-card-featured::before {
    display: none;
}

.stat-card-featured:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.stat-card-featured .stat-icon-large {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.9;
    color: var(--white-color);
}

.stat-card-featured .stat-value-large {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    line-height: 1;
    color: var(--white-color);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-card-featured .stat-label-large {
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    color: var(--white-color);
    opacity: 0.95;
}

.stat-card-featured .stat-subtitle {
    font-size: 0.875rem;
    color: var(--white-color);
    opacity: 0.8;
    font-weight: 400;
}
.stat-accent .stat-value { color: var(--accent-color); }
.stat-accent .stat-icon { color: var(--accent-color); }

/* Loading spinner */
.spinner {
    border: 4px solid var(--gray-200);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== RESPONSIVE DESIGN ===== */

/* Contenedor base */
body {
    font-family: var(--font-family);
    background-color: var(--light-color);
    color: var(--gray-800);
    line-height: 1.6;
}

/* Ajustes generales para todas las pantallas */
.container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Tablets y pantallas medianas (992px - 1199px) */
@media (max-width: 1199.98px) and (min-width: 992px) {
    .sidebar {
        width: 220px;
        top: 70px;
        height: calc(100vh - 70px);
    }
    
    .main-content {
        margin-left: 220px;
        margin-top: 70px;
        padding: 1.25rem;
        width: calc(100% - 220px);
    }
    
    .user-details {
        display: none !important;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
}

/* Tablets (768px - 991px) */
@media (max-width: 991.98px) {
    .main-content {
        margin-left: 0 !important;
        margin-top: 70px;
        padding: 1rem;
        transition: margin-left 0.3s ease;
        width: 100% !important;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1050;
        position: fixed;
        width: 250px;
        top: 70px;
        height: calc(100vh - 70px);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        display: none;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    .mobile-menu-btn {
        display: block !important;
        background: none;
        border: none;
        color: white;
        font-size: 1.25rem;
        padding: 0.5rem;
        cursor: pointer;
        margin-right: 0.75rem;
    }
    
    .user-details {
        display: none !important;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .page-title {
        font-size: 1.75rem;
    }
    
    .table-responsive {
        border: 1px solid var(--gray-200);
        border-radius: var(--border-radius);
    }
    
    .navbar-nav {
        padding: 1rem 0;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
}

/* Móviles (576px - 767px) */
@media (max-width: 767.98px) {
    .main-content {
        padding: 0.75rem;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .page-subtitle {
        font-size: 0.9rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .card-header {
        padding: 0.75rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .btn {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
    
    .btn-group .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
        vertical-align: middle;
    }
    
    /* Ocultar botón de dropdown en DataTables */
    .dt-length,
    .dt-info {
        font-size: 0.8rem;
    }
    
    .dt-search input {
        font-size: 0.875rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Mejorar paginación en móviles */
    .dt-paging .dt-paging-button {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
    
    /* Formularios responsive */
    .form-control {
        font-size: 16px; /* Previene zoom en iOS */
    }
    
    .row .col-md-3,
    .row .col-md-4,
    .row .col-md-6 {
        margin-bottom: 1rem;
    }
    
    /* Badges más pequeños */
    .badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Estadísticas responsive */
    .stats-grid-6,
    .stats-grid-5,
    .stats-grid-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .stats-grid-3 {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .stats-grid-1 {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-icon {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }
    
    .stats-section {
        margin-bottom: 1.25rem;
    }
    
    .stats-section-title {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
    }
    
    /* Modales responsive */
    .modal-dialog {
        margin: 0.5rem;
    }
    
    /* Filtros responsive */
    .filter-section {
        margin-bottom: 1rem;
    }
    
    .filter-section .row {
        --bs-gutter-x: 0.5rem;
    }
    
    /* Botones de acción responsive */
    .action-buttons {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .action-buttons .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Móviles pequeños (hasta 575px) */
@media (max-width: 575.98px) {
    .container,
    .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .main-content {
        padding: 0.5rem;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .logo h1 {
        font-size: 1rem;
    }
    
    .page-title {
        font-size: 1.25rem;
    }
    
    .card-header,
    .card-body {
        padding: 0.5rem;
    }
    
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        border-radius: var(--border-radius) !important;
        margin-bottom: 0.25rem;
    }
    
    .d-flex.gap-2 {
        flex-direction: column;
    }
    
    .col-auto {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .form-floating {
        margin-bottom: 1rem;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 1rem;
    }
    
    /* Estadísticas en una columna */
    .stats-grid-6,
    .stats-grid-5,
    .stats-grid-4,
    .stats-grid-3,
    .stats-grid-2,
    .stats-grid-1 {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
    
    .stat-icon {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }
    
    /* Card grande en móviles */
    .stat-card-large {
        padding: 1.5rem 1rem;
        margin-bottom: 1rem;
    }
    
    .stat-icon-xl {
        font-size: 2.5rem;
        margin-bottom: 0.75rem;
    }
    
    .stat-value-xl {
        font-size: 2.5rem;
        margin-bottom: 0.25rem;
    }
    
    .stat-label-xl {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .stat-subtitle-large {
        font-size: 0.875rem;
    }
    
    .stat-content-large {
        text-align: center;
    }
    
    /* Card destacado en móviles */
    .stat-card-featured {
        padding: 1.5rem 1rem;
    }
    
    .stat-card-featured .stat-icon-large {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }
    
    .stat-card-featured .stat-value-large {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .stat-card-featured .stat-label-large {
        font-size: 0.875rem;
        margin-bottom: 0.25rem;
    }
    
    .stat-card-featured .stat-subtitle {
        font-size: 0.75rem;
    }
    
    .stats-section {
        margin-bottom: 1rem;
    }
    
    .stats-section-title {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }
    
    /* Formularios más compactos */
    .row.g-3 {
        --bs-gutter-x: 0.5rem;
        --bs-gutter-y: 0.5rem;
    }
    
    .row {
        margin-left: -0.25rem;
        margin-right: -0.25rem;
    }
    
    .row > * {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
}

/* Landscape en móviles */
@media (max-width: 767.98px) and (orientation: landscape) {
    .main-content {
        padding: 0.5rem;
    }
    
    .page-title {
        font-size: 1.25rem;
    }
    
    .sidebar {
        width: 250px;
    }
}

/* Utilidades de visualización responsive */
.d-mobile-none {
    display: block;
}

@media (max-width: 767.98px) {
    .d-mobile-none {
        display: none !important;
    }
}

.d-mobile-block {
    display: none;
}

@media (max-width: 767.98px) {
    .d-mobile-block {
        display: block !important;
    }
}

/* Botón de menú móvil (oculto por defecto) */
.mobile-menu-btn {
    display: none;
}

/* Overlay para sidebar móvil */
.sidebar-overlay {
    display: none;
}

/* Media query para pantallas extra pequeñas */
@media (max-width: 480px) {
    .header-content {
        padding: 0 0.75rem;
    }
    
    .logo h1 {
        font-size: 1rem;
        gap: 0.25rem;
    }
    
    .logo h1 i {
        font-size: 1.25rem;
    }
    
    .user-info {
        gap: 0.25rem;
    }
    
    .user-avatar {
        width: 35px;
        height: 35px;
        font-size: 0.75rem;
    }
    
    .main-content {
        padding: 0.75rem;
    }
}

/* Indicador de carga para campos de formulario */
.form-control.is-loading {
    background-image: url("data:image/svg+xml,%3csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M10 2a8 8 0 1 0 8 8 8 8 0 0 0-8-8zm0 14a6 6 0 1 1 6-6 6 6 0 0 1-6 6z' fill='%236b7280'/%3e%3cpath d='M10 2a8 8 0 0 1 8 8' fill='none' stroke='%233b82f6' stroke-width='2' stroke-linecap='round'%3e%3canimateTransform attributeName='transform' type='rotate' values='0 10 10;360 10 10' dur='1s' repeatCount='indefinite'/%3e%3c/path%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px 16px;
    padding-right: 35px !important;
}

/* Animación de fade para toasts */
.toast {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Ajustes para impresión */
@media print {
    .sidebar,
    .main-header,
    .btn,
    .pagination,
    .mobile-menu-btn,
    .toast-container {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }
}

/* Estilos para edición de observaciones */
.observaciones-container {
    transition: all 0.3s ease;
}

.observaciones-edit-mode {
    background-color: var(--gray-100);
    border: 2px dashed var(--primary-color);
    border-radius: var(--border-radius);
    padding: 1rem;
}

.observaciones-readonly:hover {
    background-color: var(--gray-100);
    cursor: text;
}

.btn-editar-observaciones {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.btn-editar-observaciones:hover {
    opacity: 1;
}

#observacionesTextarea {
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

#observacionesTextarea:focus {
    box-shadow: 0 0 0 0.25rem rgba(30, 58, 138, 0.25);
}

/* Estilos para los cards de estadísticas mejorados */
.stats-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0.75rem !important;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    position: relative;
    overflow: hidden;
}

.stats-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.1), 0 10px 20px -5px rgba(0, 0, 0, 0.04) !important;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #10b981, #f59e0b, #06b6d4);
    opacity: 0.8;
}

.stats-icon-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
}

.stats-card:hover .stats-icon-circle {
    transform: scale(1.1);
}

.stats-number {
    font-size: 2.25rem;
    line-height: 1.2;
    font-weight: 700;
    transition: all 0.3s ease;
}

.stats-label {
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.stats-trend .badge {
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
    transition: all 0.3s ease;
}

.progress {
    border-radius: 50px;
    background-color: rgba(0, 0, 0, 0.05);
}

.progress-bar {
    border-radius: 50px;
    transition: width 0.6s ease;
}

/* Animaciones para los cards */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stats-card {
    animation: slideInUp 0.6s ease-out;
}

.stats-card:nth-child(1) { animation-delay: 0.1s; }
.stats-card:nth-child(2) { animation-delay: 0.2s; }
.stats-card:nth-child(3) { animation-delay: 0.3s; }
.stats-card:nth-child(4) { animation-delay: 0.4s; }

/* Mejoras responsivas para los cards */
@media (max-width: 768px) {
    .stats-number {
        font-size: 1.875rem;
    }
    
    .stats-icon-circle {
        width: 50px;
        height: 50px;
    }
    
    .stats-card {
        margin-bottom: 1rem;
    }
}

/* Efectos de hover para elementos interactivos */
.stats-card .card-body {
    position: relative;
    z-index: 2;
}

.stats-card:hover .stats-number {
    transform: scale(1.05);
}

.stats-card:hover .badge {
    transform: scale(1.1);
}
