/* =====================================================
   TEMA MODERNO OVERRIDE
   Sobrescribe estilos oscuros duplicados en módulos
   para mantener la estética Glassmorphism/Neomorfismo
   del panel administrativo Hospital San Roque UTI.
   ===================================================== */

/* Forzar fondo claro general */
body {
    background: #F8FAFC !important;
    color: #0A1A31 !important;
    font-family: 'Plus Jakarta Sans', 'Inter', 'Segoe UI', sans-serif !important;
}

/* Sidebar */
.sidebar {
    background: rgba(255, 255, 255, 0.82) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-right: 1px solid rgba(196, 158, 86, 0.55) !important;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.04) !important;
}

.sidebar-header {
    background: linear-gradient(135deg, rgba(22, 63, 115, 0.08) 0%, rgba(61, 127, 194, 0.06) 100%) !important;
    border-bottom: 1px solid rgba(196, 158, 86, 0.55) !important;
}

.sidebar-header h2 {
    color: #0A1A31 !important;
}

.nav-link {
    color: #64748B !important;
    border-radius: 14px !important;
}

.nav-link:hover {
    background: rgba(22, 63, 115, 0.06) !important;
    color: #163F73 !important;
}

.nav-link.active {
    background: linear-gradient(135deg, #163F73 0%, #3D7FC2 100%) !important;
    color: white !important;
    box-shadow: 0 10px 30px rgba(22, 63, 115, 0.18) !important;
}

.user-info {
    background: rgba(255, 255, 255, 0.9) !important;
    border-top: 1px solid rgba(196, 158, 86, 0.55) !important;
}

.user-info p {
    color: #64748B !important;
}

.user-info strong {
    color: #0A1A31 !important;
}

/* Header y contenido */
.header {
    background: linear-gradient(90deg, #FFFFFF 0%, #3D7FC2 100%) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-bottom: 1px solid rgba(196, 158, 86, 0.55) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02) !important;
}

.header h1 {
    color: #0A1A31 !important;
}

.content {
    background: transparent !important;
}

.page-title {
    color: #0A1A31 !important;
}

/* Contenedores oscuros que usan los módulos */
.table-container,
.filters-container,
.form-container,
.modal-content,
.card {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(196, 158, 86, 0.55) !important;
    border-radius: 20px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03) !important;
    color: #0A1A31 !important;
}

/* Tablas */
.table {
    color: #0A1A31 !important;
}

.table th {
    background: rgba(248, 250, 252, 0.9) !important;
    color: #0A1A31 !important;
    border-bottom: 1px solid rgba(196, 158, 86, 0.55) !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    font-size: 0.82rem !important;
    letter-spacing: 0.03em !important;
}

.table td {
    color: #64748B !important;
    border-bottom: 1px solid rgba(196, 158, 86, 0.55) !important;
    font-weight: 500 !important;
}

.table tbody tr:hover {
    background: rgba(22, 63, 115, 0.02) !important;
}

/* Inputs y selects */
.filter-group input,
.filter-group select,
.form-group input,
.form-group select,
.form-group textarea {
    background: rgba(255, 255, 255, 0.7) !important;
    color: #0A1A31 !important;
    border: 1px solid rgba(196, 158, 86, 0.55) !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
}

.filter-group input:focus,
.filter-group select:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #163F73 !important;
    box-shadow: 0 0 0 4px rgba(22, 63, 115, 0.08) !important;
    outline: none !important;
}

.filter-group label,
.form-group label {
    color: #64748B !important;
    font-weight: 700 !important;
}

/* Badges */
.badge {
    font-weight: 700 !important;
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.02em !important;
    border-radius: 20px !important;
}

.badge-active,
.badge-activa,
.badge-pagado,
.badge-presente {
    background: rgba(16, 185, 129, 0.1) !important;
    color: #059669 !important;
    border: none !important;
}

.badge-inactive,
.badge-inactiva {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #DC2626 !important;
    border: none !important;
}

.badge-admin {
    background: rgba(61, 127, 194, 0.15) !important;
    color: #4E7A6F !important;
    border: none !important;
}

.badge-user,
.badge-usuario,
.badge-confirmado {
    background: rgba(22, 63, 115, 0.1) !important;
    color: #163F73 !important;
    border: none !important;
}

.badge-pendiente,
.badge-ausente,
.badge-no-pagado {
    background: rgba(245, 158, 11, 0.1) !important;
    color: #D97706 !important;
    border: none !important;
}

.badge-cancelado {
    background: rgba(100, 116, 139, 0.1) !important;
    color: #64748B !important;
    border: none !important;
}

.badge-consulta {
    background: rgba(22, 63, 115, 0.1) !important;
    color: #163F73 !important;
    border: none !important;
}

.badge-control {
    background: rgba(6, 182, 212, 0.1) !important;
    color: #0891B2 !important;
    border: none !important;
}

.badge-otros {
    background: rgba(61, 127, 194, 0.15) !important;
    color: #4E7A6F !important;
    border: none !important;
}

/* Botones de acción */
.btn-edit {
    background: linear-gradient(135deg, #1F5A99 0%, #163F73 100%) !important;
    color: white !important;
    border-radius: 10px !important;
    width: 36px !important;
    height: 36px !important;
    box-shadow: 0 4px 12px rgba(22, 63, 115, 0.2) !important;
}

.btn-delete {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%) !important;
    color: white !important;
    border-radius: 10px !important;
    width: 36px !important;
    height: 36px !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2) !important;
}

.btn-pago.pagado {
    background: #10B981 !important;
    color: white !important;
}

.btn-pago.no-pagado {
    background: #F59E0B !important;
    color: white !important;
}

/* Botones de filtro/exportar en módulos */
.btn-filter,
.btn-export {
    background: linear-gradient(135deg, #163F73 0%, #3D7FC2 100%) !important;
    color: white !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    border: none !important;
    box-shadow: 0 6px 16px rgba(22, 63, 115, 0.18) !important;
}

.btn-clear,
.btn-cancel {
    background: white !important;
    color: #64748B !important;
    border: 1px solid rgba(196, 158, 86, 0.55) !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
}

.btn-confirm {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%) !important;
    color: white !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    border: none !important;
}

/* Alertas */
.alert-success {
    background: rgba(16, 185, 129, 0.08) !important;
    border-color: rgba(16, 185, 129, 0.15) !important;
    color: #059669 !important;
}

.alert-error {
    background: rgba(239, 68, 68, 0.08) !important;
    border-color: rgba(239, 68, 68, 0.15) !important;
    color: #DC2626 !important;
}

/* Stat cards genéricas de módulos */
.stat-card {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(196, 158, 86, 0.55) !important;
    border-radius: 20px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03) !important;
}

.stat-card h3 {
    color: #0A1A31 !important;
}

.stat-card p {
    color: #64748B !important;
}

/* Preservar gradientes pasteles del dashboard */
.stat-card.blue {
    background: linear-gradient(135deg, rgba(219, 234, 254, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%) !important;
}

.stat-card.cyan {
    background: linear-gradient(135deg, rgba(207, 250, 254, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%) !important;
}

.stat-card.pink {
    background: linear-gradient(135deg, rgba(252, 231, 243, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%) !important;
}

.stat-card.purple {
    background: linear-gradient(135deg, rgba(237, 233, 254, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%) !important;
}

.stat-card.green {
    background: linear-gradient(135deg, rgba(209, 250, 229, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%) !important;
}

.stat-card.orange {
    background: linear-gradient(135deg, rgba(254, 243, 199, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%) !important;
}

.stat-card.blue h3,
.stat-card.cyan h3,
.stat-card.pink h3,
.stat-card.purple h3,
.stat-card.green h3,
.stat-card.orange h3 {
    color: #0A1A31 !important;
}

/* Sección de permisos en usuario_form.php */
.permissions-section {
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

.permissions-title {
    color: #0A1A31 !important;
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.permissions-subtitle {
    color: #64748B !important;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
}

.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.permission-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem !important;
    background: rgba(255, 255, 255, 0.7) !important;
    border: 1px solid rgba(196, 158, 86, 0.55) !important;
    border-radius: 14px !important;
    cursor: pointer;
    transition: all 0.25s ease;
}

.permission-item:hover {
    border-color: #163F73 !important;
    box-shadow: 0 4px 12px rgba(22, 63, 115, 0.08);
}

.permission-item.checked {
    background: rgba(22, 63, 115, 0.06) !important;
    border-color: #163F73 !important;
}

.permission-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #163F73;
    cursor: pointer;
    flex-shrink: 0;
}

.permission-item label {
    color: #0A1A31 !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 !important;
    cursor: pointer;
}

.permission-item label i {
    color: #163F73 !important;
    width: 20px;
    text-align: center;
}

/* Textos */
.page-title,
.card-title {
    color: #0A1A31 !important;
}

.card-subtitle,
.stat-card p,
.valor-peso {
    color: #64748B !important;
}

.valor-peso {
    font-weight: 700 !important;
}

/* Paginación (si existe) */
.pagination a,
.pagination span {
    background: white !important;
    color: #0A1A31 !important;
    border: 1px solid rgba(196, 158, 86, 0.55) !important;
    border-radius: 10px !important;
}

.pagination .active span,
.pagination .current {
    background: linear-gradient(135deg, #163F73 0%, #3D7FC2 100%) !important;
    color: white !important;
}

/* Modales */
.modal {
    background: rgba(10, 26, 49, 0.4) !important;
    backdrop-filter: blur(4px) !important;
}

/* Quitar fondos oscuros heredados de estilos inline */
[style*="background: #11294A"],
[style*="background:#11294A"],
[style*="background: #0A1A31"],
[style*="background:#0A1A31"] {
    background: rgba(255, 255, 255, 0.85) !important;
}

/* Textos claros que deberían ser oscuros */
[style*="color: #e2e8f0"],
[style*="color:#e2e8f0"],
[style*="color: #f1f5f9"],
[style*="color:#f1f5f9"] {
    color: #0A1A31 !important;
}

[style*="color: #94a3b8"],
[style*="color:#94a3b8"],
[style*="color: #cbd5e1"],
[style*="color:#cbd5e1"] {
    color: #64748B !important;
}
