[x-cloak] {
    display: none !important;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Tema moderno con gradientes y sombras suaves */
.modern-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.modern-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Botones modernos con gradientes */
.modern-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(102, 126, 234, 0.4);
}

.modern-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px -2px rgba(102, 126, 234, 0.5);
}

.modern-button:active {
    transform: translateY(0);
}

.modern-button-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 4px 6px -1px rgba(240, 147, 251, 0.4);
}

.modern-button-success {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 4px 6px -1px rgba(79, 172, 254, 0.4);
}

.modern-button-danger {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    box-shadow: 0 4px 6px -1px rgba(250, 112, 154, 0.4);
}

.modern-button-outline {
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1);
}

.modern-button-outline:hover {
    background: #667eea;
    color: white;
}

/* Inputs modernos */
.modern-input {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    background: white;
}

.modern-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Sidebar moderna */
.modern-sidebar {
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    border-radius: 0 16px 16px 0;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.1);
}

/* Tabla moderna */
.modern-table {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.modern-table-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.modern-table-row {
    transition: all 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
}

.modern-table-row:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    transform: scale(1.01);
}

.modern-table-row.selected {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
}

/* Badges modernos */
.modern-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-activo {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    color: white;
}

.badge-inactivo {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
    color: white;
}

.badge-suspendido {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
}

.badge-cancelado {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    color: white;
}

/* Modal moderno */
.modern-modal {
    backdrop-filter: blur(8px);
    background: rgba(0, 0, 0, 0.5);
}

.modern-modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar moderna */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f91 100%);
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.fade-in {
    animation: fadeIn 0.3s ease;
}

.fade-out {
    animation: fadeOut 0.3s ease;
}

/* Efectos de glassmorphism */
.glass-effect {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

/* Splash screen moderno */
.modern-splash {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Estados de carga */
.loading-spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 3px solid white;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tooltips modernos */
.modern-tooltip {
    position: relative;
}

.modern-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background: #1f2937;
    color: white;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modern-tooltip:hover::after {
    opacity: 1;
}

/* ========== DataTables Custom Styles ========== */

/* Contenedor principal de DataTables */
.dataTables_wrapper {
    padding: 0;
}

/* Encabezado de tabla DataTables */
table.dataTable thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    padding: 16px 12px;
    border: none;
    text-align: left;
}

table.dataTable thead th:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f91 100%);
}

/* Filas de la tabla */
table.dataTable tbody tr {
    transition: all 0.2s ease;
}

table.dataTable tbody tr:hover {
    background-color: #f8f9ff;
    transform: scale(1.01);
}

table.dataTable tbody td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
}

/* Ordenamiento */
table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc {
    cursor: pointer;
    position: relative;
}

table.dataTable thead .sorting:after,
table.dataTable thead .sorting_asc:after,
table.dataTable thead .sorting_desc:after {
    opacity: 0.5;
    margin-left: 8px;
}

/* Paginación moderna */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 0.5rem 0.75rem;
    margin: 0 2px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: white;
    color: #374151;
    transition: all 0.2s ease;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Búsqueda DataTables */
.dataTables_wrapper .dataTables_filter input {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    transition: all 0.2s ease;
    margin-left: 8px;
}

.dataTables_wrapper .dataTables_filter input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Información de DataTables */
.dataTables_wrapper .dataTables_info {
    padding: 0.75rem 0;
    color: #6b7280;
    font-size: 0.875rem;
}

/* Selector de longitud */
.dataTables_wrapper .dataTables_length select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    margin: 0 8px;
}

/* Botones de exportación DataTables */
.dt-buttons {
    margin-bottom: 1rem;
}

.dt-button {
    padding: 0.5rem 1rem;
    margin-right: 0.5rem;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dt-button:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f91 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Tabla responsive */
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control {
    position: relative;
    padding-left: 30px;
    cursor: pointer;
}

table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control:before {
    top: 50%;
    left: 5px;
    height: 14px;
    width: 14px;
    margin-top: -7px;
    display: block;
    position: absolute;
    color: white;
    border: 2px solid white;
    border-radius: 14px;
    box-shadow: 0 0 3px #444;
    box-sizing: content-box;
    text-align: center;
    text-indent: 0 !important;
    font-family: 'Courier New', Courier, monospace;
    line-height: 14px;
    content: '+';
    background-color: #667eea;
}

/* Estilos para modales CRUD */
.crud-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.crud-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.3s ease;
}

/* Tabs modernos para navegación entre entidades */
.modern-tabs {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

.modern-tab {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    font-weight: 500;
    color: #6b7280;
}

.modern-tab:hover {
    color: #667eea;
    background-color: #f8f9ff;
}

.modern-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background-color: #f8f9ff;
}

/* Badges para estados de facturas */
.badge-pendiente {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
}

.badge-pagada {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    color: white;
}

.badge-vencida {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    color: white;
}

.badge-anulada {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
    color: white;
}

