/* ===================================
   DISEÑO SOBRIO MODERNO - APP TRAZABILIDAD PAP
   Cards, Etiquetas, Botones con Colores Sólidos
   =================================== */

/* ===================================
   VARIABLES PARA DISEÑO SOBRIO
   =================================== */
:root {
    /* Colores sólidos profesionales */
    --primary-solid: #2c5aa0;
    --primary-light: #4a7bc8;
    --primary-dark: #1e3a6f;
    
    --secondary-solid: #6c757d;
    --success-solid: #198754;
    --warning-solid: #fd7e14;
    --danger-solid: #dc3545;
    --info-solid: #0dcaf0;
    
    /* Colores médicos sólidos */
    --medical-blue: #2c5aa0;
    --medical-teal: #20c997;
    --medical-purple: #6f42c1;
    --medical-orange: #fd7e14;
    
    /* Grises profesionales */
    --gray-50: #f8f9fa;
    --gray-100: #e9ecef;
    --gray-200: #dee2e6;
    --gray-300: #ced4da;
    --gray-400: #adb5bd;
    --gray-500: #6c757d;
    --gray-600: #495057;
    --gray-700: #343a40;
    --gray-800: #212529;
    
    /* Sombras sutiles */
    --shadow-subtle: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-card: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-card-hover: 0 8px 15px rgba(0, 0, 0, 0.1);
    --shadow-button: 0 2px 4px rgba(44, 90, 160, 0.2);
    
    /* Bordes */
    --border-color: #e9ecef;
    --border-radius-card: 12px;
    --border-radius-button: 8px;
}

/* ===================================
   LAYOUT PRINCIPAL SOBRIO
   =================================== */
body {
    background-color: var(--gray-50);
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
}

.container-fluid {
    padding: var(--spacing-lg);
}

/* ===================================
   CARDS SOBRIOS Y PROFESIONALES
   =================================== */
.card-modern {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-card);
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card-modern:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--primary-solid);
}

.card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-solid);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.card-modern:hover::before {
    transform: scaleX(1);
}

/* Cards por categoría médica con colores sólidos */
.card-patient {
    border-left: 4px solid var(--medical-blue);
    background: white;
}

.card-patient:hover {
    border-left-color: var(--primary-dark);
    background: #f8fafc;
}

.card-procedure {
    border-left: 4px solid var(--medical-purple);
    background: white;
}

.card-procedure:hover {
    border-left-color: #5a2d91;
    background: #f9f8fc;
}

.card-product {
    border-left: 4px solid var(--medical-teal);
    background: white;
}

.card-product:hover {
    border-left-color: #17a085;
    background: #f7fcfb;
}

.card-stats {
    border-left: 4px solid var(--medical-orange);
    background: white;
}

.card-stats:hover {
    border-left-color: #e55a00;
    background: #fef9f5;
}

/* ===================================
   BOTONES SOBRIOS Y PROFESIONALES
   =================================== */
.btn-modern {
    position: relative;
    padding: 0.625rem 1.5rem;
    border: none;
    border-radius: var(--border-radius-button);
    font-weight: 500;
    letter-spacing: 0.025em;
    transition: all 0.2s ease;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-medical {
    background-color: var(--primary-solid);
    color: white;
    box-shadow: var(--shadow-button);
    border: 1px solid var(--primary-solid);
}

.btn-medical:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(44, 90, 160, 0.3);
    color: white;
}

.btn-medical:active {
    transform: translateY(0);
    box-shadow: var(--shadow-button);
}

.btn-success-modern {
    background-color: var(--success-solid);
    color: white;
    box-shadow: 0 2px 4px rgba(25, 135, 84, 0.2);
    border: 1px solid var(--success-solid);
}

.btn-success-modern:hover {
    background-color: #146c43;
    border-color: #146c43;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(25, 135, 84, 0.3);
    color: white;
}

.btn-outline-modern {
    background: white;
    border: 2px solid var(--primary-solid);
    color: var(--primary-solid);
    position: relative;
    overflow: hidden;
}

.btn-outline-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--primary-solid);
    transition: left 0.3s ease;
    z-index: -1;
}

.btn-outline-modern:hover::before {
    left: 0;
}

.btn-outline-modern:hover {
    color: white;
    border-color: var(--primary-solid);
}

/* Botones flotantes */
.btn-floating {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--primary-solid);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-floating:hover {
    background-color: var(--primary-dark);
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(44, 90, 160, 0.4), 0 3px 6px rgba(0, 0, 0, 0.15);
    color: white;
}

/* Botones específicos de formulario */
.btn-group .btn-sm {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.btn-group .btn-sm:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

/* File inputs mejorados */
.form-control[type="file"] {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-button);
    padding: 0.5rem;
    background: white;
    transition: all 0.2s ease;
}

/* ===================================
   Indicador azul para checkboxes (PAP/VPH y Persona Trans)
   Centralizado para reutilizar en plantillas
   =================================== */
.form-check-custom .form-check-label::after,
.form-check.form-switch .form-check-label::after {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-left: 0.5rem;
    vertical-align: middle;
    background: transparent;
    border: 2px solid rgba(13,110,253,0.35);
    box-sizing: border-box;
    transition: background-color .12s ease, border-color .12s ease, transform .12s ease, opacity .12s ease;
    opacity: 1;
    transform: scale(1);
}

.form-check-custom input.form-check-input:checked + .form-check-label::after,
.form-check.form-switch input.form-check-input:checked + .form-check-label::after {
    background: #0d6efd;
    border-color: #0d6efd;
    transform: scale(1.05);
}

.form-check-custom .form-check-label,
.form-check.form-switch .form-check-label {
    padding-right: 0.25rem;
}

.form-control[type="file"]:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.06);
    border-color: var(--gray-400);
}

.form-control[type="file"]:focus {
    box-shadow: 0 0 0 0.2rem rgba(44, 90, 160, 0.15), 0 2px 6px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-solid);
}

/* ===================================
   BADGES Y ETIQUETAS SOBRIOS
   =================================== */
.badge-modern {
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.75rem;
    position: relative;
    display: inline-flex;
    align-items: center;
}

.badge-gradient-primary {
    background-color: var(--primary-solid);
    color: white;
}

.badge-gradient-success {
    background-color: var(--success-solid);
    color: white;
}

.badge-gradient-warning {
    background-color: var(--warning-solid);
    color: white;
}

.badge-gradient-danger {
    background-color: var(--danger-solid);
    color: white;
}

/* Estados médicos con iconos */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.75rem;
    border: 1px solid;
}

.status-pendiente {
    background-color: #fff3cd;
    color: #664d03;
    border-color: #ffecb5;
}

.status-procesando {
    background-color: #cff4fc;
    color: #055160;
    border-color: #b6effb;
}

.status-completado {
    background-color: #d1e7dd;
    color: #0f5132;
    border-color: #badbcc;
}

.status-cancelado {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c2c7;
}

/* ===================================
   ALERTAS SOBRIAS
   =================================== */
.alert-modern {
    border: none;
    border-radius: var(--border-radius-card);
    padding: 1rem 1.25rem;
    position: relative;
    box-shadow: var(--shadow-subtle);
    border-left: 4px solid;
}

.alert-primary-modern {
    background-color: #e7f1ff;
    border-left-color: var(--primary-solid);
    color: var(--primary-dark);
}

.alert-success-modern {
    background-color: #d1e7dd;
    border-left-color: var(--success-solid);
    color: #0f5132;
}

.alert-warning-modern {
    background-color: #fff3cd;
    border-left-color: var(--warning-solid);
    color: #664d03;
}

.alert-danger-modern {
    background-color: #f8d7da;
    border-left-color: var(--danger-solid);
    color: #721c24;
}

/* ===================================
   TABLAS SOBRIAS
   =================================== */
.table-modern {
    background: white;
    border-radius: var(--border-radius-card);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
}

.table-modern thead {
    background-color: var(--gray-100);
    border-bottom: 2px solid var(--border-color);
}

.table-modern thead th {
    border: none;
    padding: 1rem;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* ===================================
   SWITCH 'TRANS' - estilo personalizado
   =================================== */
.trans-switch {
    position: relative; /* ensure absolutely positioned checkbox aligns with the visual track */
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.trans-switch .switch-track {
    position: relative;
    width: 56px;
    height: 32px;
    background: var(--gray-300);
    border-radius: 999px;
    transition: background 0.18s ease, box-shadow 0.18s ease;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.06);
}

.trans-switch .switch-thumb {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    transition: transform 0.18s cubic-bezier(.2,.9,.2,1), background 0.18s ease;
}

.trans-switch input[type="checkbox"].form-check-input {
    /* Make the native checkbox invisible but interactive by covering the visual track */
    position: absolute;
    top: 0;
    left: 0;
    width: 56px; /* matches .switch-track width */
    height: 32px; /* matches .switch-track height */
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
    pointer-events: auto; /* allow clicks on the invisible checkbox */
}

.trans-switch .switch-track.on {
    background: linear-gradient(90deg, var(--primary-light), var(--primary-solid));
}

.trans-switch .switch-track.on .switch-thumb {
    transform: translateX(24px);
}

.trans-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--gray-700);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.trans-badge {
    font-size: 0.78rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: var(--gray-100);
    color: var(--gray-700);
    box-shadow: var(--shadow-subtle);
}

/* Small responsive tweak */
@media (max-width: 576px) {
    .trans-switch { gap: 0.5rem; }
    .trans-switch .switch-track { width: 48px; height: 28px; }
    .trans-switch .switch-thumb { width: 20px; height: 20px; top: 4px; left: 4px; }
    .trans-switch .switch-track.on .switch-thumb { transform: translateX(20px); }
}

.table-modern tbody tr {
    transition: all 0.2s ease;
    border: none;
}

.table-modern tbody tr:hover {
    background-color: var(--gray-50);
}

.table-modern tbody td {
    padding: 1rem;
    border: none;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

/* ===================================
   FORMULARIOS SOBRIOS CON SOMBRAS TENUES
   =================================== */
.form-modern {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius-card);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
}

.form-control-modern {
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-button);
    padding: 0.625rem 0.875rem;
    background: white;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.form-control-modern:focus {
    border-color: var(--primary-solid);
    box-shadow: 0 0 0 0.2rem rgba(44, 90, 160, 0.15), 0 2px 6px rgba(0, 0, 0, 0.1);
    background-color: #fafbfc;
    transform: translateY(-1px);
}

.form-control-modern:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.06);
    border-color: var(--gray-400);
}

/* Select dropdowns */
.form-select.form-control-modern {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");
}

.form-select.form-control-modern:focus {
    box-shadow: 0 0 0 0.2rem rgba(44, 90, 160, 0.15), 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Textareas */
textarea.form-control-modern {
    resize: vertical;
    min-height: 80px;
}

/* Checkboxes y radios */
.form-check-input {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-400);
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(44, 90, 160, 0.15), 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-check-input:checked {
    box-shadow: 0 1px 3px rgba(44, 90, 160, 0.3);
}

/* ===================================
   NAVEGACIÓN SOBRIA
   =================================== */
.navbar-modern {
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-subtle);
}

.nav-link-modern {
    position: relative;
    color: var(--gray-600);
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-button);
    transition: all 0.2s ease;
    text-decoration: none;
}

.nav-link-modern::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-solid);
    transition: all 0.2s ease;
    transform: translateX(-50%);
}

.nav-link-modern:hover::after,
.nav-link-modern.active::after {
    width: 80%;
}

.nav-link-modern:hover,
.nav-link-modern.active {
    color: var(--primary-solid);
    background-color: rgba(44, 90, 160, 0.05);
}

/* ===================================
   SIDEBAR MODERNO
   =================================== */
.sidebar-modern {
    background: var(--gradient-card);
    backdrop-filter: var(--backdrop-blur);
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-lg);
    min-height: 100vh;
    position: relative;
}

.sidebar-item {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--border-radius-lg);
    margin: 0.25rem 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.sidebar-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 100%;
    background: var(--gradient-medical);
    transition: width 0.3s ease;
    z-index: -1;
}

.sidebar-item:hover::before,
.sidebar-item.active::before {
    width: 100%;
}

.sidebar-item:hover,
.sidebar-item.active {
    color: white;
    transform: translateX(5px);
}

/* ===================================
   EFECTOS DE ENTRADA SUAVES
   =================================== */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-slide-up {
    animation: slideInUp 0.6s ease-out;
}

.animate-slide-left {
    animation: slideInLeft 0.6s ease-out;
}

.animate-fade-scale {
    animation: fadeInScale 0.6s ease-out;
}

/* ===================================
   RESPONSIVO MODERNO
   =================================== */
@media (max-width: 768px) {
    .card-modern {
        margin-bottom: 1rem;
    }
    
    .btn-floating {
        bottom: 1rem;
        right: 1rem;
        width: 50px;
        height: 50px;
    }
    
    .table-modern {
        font-size: 0.8rem;
    }
    
    .form-modern {
        padding: 1.5rem;
    }
}

/* ===================================
   INPUTS Y GRUPOS DE INPUTS MODERNOS CON SOMBRAS
   =================================== */
.input-group-modern {
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
    background: white;
}

.input-group-modern:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.06);
}

.input-group-modern:focus-within {
    box-shadow: 0 0 0 0.2rem rgba(44, 90, 160, 0.15), 0 2px 8px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.input-group-modern .input-group-text {
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    font-weight: 500;
    box-shadow: none;
}

.input-group-modern .form-control-modern {
    border: 1px solid var(--gray-300);
    font-weight: 500;
    box-shadow: none;
    background: white;
}

/* Estados focused para input groups */
.input-group-modern.focused {
    box-shadow: 0 0 0 0.2rem rgba(44, 90, 160, 0.15), 0 2px 8px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.input-group-modern.focused .input-group-text {
    border-color: var(--primary-solid);
    background: rgba(44, 90, 160, 0.05);
}

.input-group-modern.focused .form-control-modern {
    border-color: var(--primary-solid);
}

/* ===================================
   CHECKBOXES Y RADIOS MODERNOS CON SOMBRAS
   =================================== */
.form-check-custom {
    padding-left: 2rem;
}

.form-check-custom .form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 0.375rem;
    border: 2px solid var(--gray-300);
    background-color: white;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.form-check-custom .form-check-input:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.06);
    border-color: var(--gray-400);
}

.form-check-custom .form-check-input:checked {
    background-color: var(--primary-solid);
    border-color: var(--primary-solid);
    box-shadow: 0 0 0 0.2rem rgba(44, 90, 160, 0.15), 0 1px 3px rgba(44, 90, 160, 0.3);
}

.form-check-custom .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(44, 90, 160, 0.15), 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Labels de formulario mejorados */
.form-label {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    display: block;
}

/* Grupos de formulario con mejor espaciado */
.mb-4 {
    margin-bottom: 1.5rem !important;
}

.mb-4.focused {
    transform: translateY(-1px);
    transition: transform 0.2s ease;
}

/* Mensajes de ayuda y error con sombras */
.form-text {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-top: 0.25rem;
}

.alert-danger-modern.py-2 {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(220, 53, 69, 0.2);
    border-left: 3px solid var(--danger-solid);
}

/* ===================================
   CARD HEADER MODERNOS ADICIONALES
   =================================== */
.card-modern .card-header {
    border-bottom: none;
    background: transparent;
    padding: 1.5rem 1.5rem 0;
}

.card-modern .card-header.bg-gradient {
    margin: -1.5rem -1.5rem 1.5rem;
    padding: 1.5rem;
    border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0;
}

/* ===================================
   MEJORAS ADICIONALES PARA FORMULARIOS
   =================================== */

/* Filtros y búsqueda */
.card .card-body form .row .col-md-8 input[type="text"],
.card .card-body form .row .col-md-3 select,
.card .card-body form .row .col-md-1 button {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--gray-300);
    transition: all 0.2s ease;
}

.card .card-body form .row .col-md-8 input[type="text"]:focus,
.card .card-body form .row .col-md-3 select:focus {
    box-shadow: 0 0 0 0.2rem rgba(44, 90, 160, 0.15), 0 2px 6px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-solid);
    transform: translateY(-1px);
}

/* Cards de filtro mejorados */
.card .card-header {
    background-color: var(--gray-50);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Input search específico */
input[name="busqueda"] {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    border: 1px solid var(--gray-300) !important;
    background: white;
    transition: all 0.2s ease;
}

input[name="busqueda"]:focus {
    box-shadow: 0 0 0 0.2rem rgba(44, 90, 160, 0.15), 0 3px 8px rgba(0, 0, 0, 0.12) !important;
    border-color: var(--primary-solid) !important;
    background-color: #fafbfc;
    transform: translateY(-1px);
}

input[name="busqueda"]:hover {
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.06) !important;
    border-color: var(--gray-400) !important;
}

/* Botones de filtro */
button[type="submit"].btn {
    box-shadow: 0 2px 4px rgba(44, 90, 160, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
}

button[type="submit"].btn:hover {
    box-shadow: 0 3px 8px rgba(44, 90, 160, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

/* Campos disabled con mejor estilo */
.form-control:disabled,
.form-select:disabled {
    background-color: var(--gray-100);
    opacity: 0.7;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Placeholder mejorado */
.form-control::placeholder {
    color: var(--gray-500);
    opacity: 0.8;
    font-style: italic;
}

/* Estados de validación mejorados */
.is-valid {
    border-color: var(--success-solid) !important;
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.15), 0 1px 3px rgba(25, 135, 84, 0.2) !important;
}

.is-invalid {
    border-color: var(--danger-solid) !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.15), 0 1px 3px rgba(220, 53, 69, 0.2) !important;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-3px); }
    20%, 40%, 60%, 80% { transform: translateX(3px); }
}

/* ===================================
   EFECTOS HOVER ESPECIALES
   =================================== */
.hover-scale {
    transition: transform 0.3s ease;
}

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

.hover-lift {
    transition: transform 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-3px);
}

/* ===================================
   LOADING STATES
   =================================== */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: inherit;
}

.spinner-medical {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid var(--medical-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===================================
   TOOLTIPS MODERNOS
   =================================== */
.tooltip-modern {
    background: var(--gradient-medical);
    color: white;
    border-radius: var(--border-radius-lg);
    padding: 0.5rem 1rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
}

/* ===================================
   EFECTOS DE SCROLL
   =================================== */
.scroll-smooth {
    scroll-behavior: smooth;
}

/* ===================================
   MEJORA ESPECÍFICA DE VISIBILIDAD DE FORMULARIOS
   =================================== */

/* Override para TODOS los controles de formulario */
.form-control, 
.form-select {
    border: 1px solid var(--gray-300) !important;
    background-color: white !important;
    color: var(--gray-800) !important;
    padding: 0.625rem 1rem !important;
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
    border-radius: 6px !important;
    box-shadow: 
        inset 0 1px 2px rgba(0, 0, 0, 0.075),
        0 1px 3px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.15s ease-in-out !important;
    background: linear-gradient(145deg, #ffffff 0%, #fafbfc 100%) !important;
}

/* Estados hover para mejor feedback visual */
.form-control:hover,
.form-select:hover {
    border-color: var(--gray-400) !important;
    box-shadow: 
        inset 0 1px 2px rgba(0, 0, 0, 0.075),
        0 2px 6px rgba(0, 0, 0, 0.15) !important;
    transform: translateY(-1px);
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%) !important;
}

/* Estados focus con sombra coloreada */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-solid) !important;
    outline: 0 !important;
    box-shadow: 
        inset 0 1px 2px rgba(44, 90, 160, 0.1),
        0 0 0 0.2rem rgba(44, 90, 160, 0.2),
        0 3px 8px rgba(0, 0, 0, 0.15) !important;
    background: linear-gradient(145deg, #ffffff 0%, #f0f7ff 100%) !important;
    transform: translateY(-1px);
}

/* Input groups con sombra container */
.input-group {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06) !important;
    border-radius: 6px !important;
    overflow: hidden;
    background: white;
    border: 1px solid var(--gray-300);
}

.input-group .form-control {
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
}

.input-group-text {
    background: linear-gradient(145deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border: none !important;
    color: var(--gray-600) !important;
    font-weight: 500;
    border-right: 1px solid var(--gray-300) !important;
}

.input-group:hover {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-1px);
    border-color: var(--gray-400);
}

.input-group:focus-within {
    box-shadow: 
        0 0 0 0.2rem rgba(44, 90, 160, 0.2),
        0 4px 12px rgba(0, 0, 0, 0.15) !important;
    transform: translateY(-1px);
    border-color: var(--primary-solid);
}

/* Checkboxes y radios más visibles */
.form-check-input {
    border: 2px solid var(--gray-400) !important;
    box-shadow: 
        inset 0 1px 2px rgba(0, 0, 0, 0.075),
        0 1px 3px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.15s ease !important;
    background-color: white !important;
    width: 1.2em !important;
    height: 1.2em !important;
}

.form-check-input:hover {
    border-color: var(--primary-solid) !important;
    box-shadow: 
        inset 0 1px 2px rgba(44, 90, 160, 0.075),
        0 2px 6px rgba(44, 90, 160, 0.2) !important;
    transform: translateY(-1px);
}

.form-check-input:checked {
    background-color: var(--primary-solid) !important;
    border-color: var(--primary-solid) !important;
    box-shadow: 
        inset 0 1px 2px rgba(0, 0, 0, 0.1),
        0 0 0 0.2rem rgba(44, 90, 160, 0.2),
        0 2px 6px rgba(44, 90, 160, 0.3) !important;
}

.form-check-input:focus {
    border-color: var(--primary-solid) !important;
    outline: 0 !important;
    box-shadow: 
        inset 0 1px 2px rgba(44, 90, 160, 0.075),
        0 0 0 0.2rem rgba(44, 90, 160, 0.2),
        0 2px 6px rgba(0, 0, 0, 0.15) !important;
}

/* Botones mejorados */
.btn {
    font-weight: 500 !important;
    border-radius: 6px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06) !important;
    transition: all 0.15s ease !important;
    border-width: 1px !important;
}

.btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08) !important;
}

/* File inputs más distintivos */
.form-control[type="file"] {
    padding: 0.75rem !important;
    background: linear-gradient(145deg, #f8f9fa 0%, #ffffff 100%) !important;
    border: 2px dashed var(--gray-400) !important;
    box-shadow: 
        inset 0 1px 2px rgba(0, 0, 0, 0.075),
        0 2px 4px rgba(0, 0, 0, 0.1) !important;
    border-radius: 8px !important;
}

.form-control[type="file"]:hover {
    border-color: var(--primary-solid) !important;
    background: linear-gradient(145deg, #ffffff 0%, #f0f7ff 100%) !important;
    box-shadow: 
        inset 0 1px 2px rgba(44, 90, 160, 0.075),
        0 3px 8px rgba(44, 90, 160, 0.15) !important;
}

.form-control[type="file"]:focus {
    border-color: var(--primary-solid) !important;
    box-shadow: 
        inset 0 1px 2px rgba(44, 90, 160, 0.1),
        0 0 0 0.2rem rgba(44, 90, 160, 0.2),
        0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Labels más prominentes */
.form-label {
    font-weight: 600 !important;
    color: var(--gray-700) !important;
    margin-bottom: 0.5rem !important;
    font-size: 0.875rem !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.form-label.required::after {
    content: ' *';
    color: #dc3545;
    font-weight: 600;
    margin-left: 2px;
}

/* Placeholder mejorado */
.form-control::placeholder,
.form-select::placeholder {
    color: var(--gray-500) !important;
    opacity: 0.8 !important;
    font-style: italic;
}

/* Textarea específico */
.form-control[rows] {
    resize: vertical !important;
    min-height: 100px !important;
    background: linear-gradient(145deg, #ffffff 0%, #fafbfc 100%) !important;
}

/* Estados disabled más claros */
.form-control:disabled,
.form-select:disabled {
    background: linear-gradient(145deg, #f8f9fa 0%, #e9ecef 100%) !important;
    opacity: 0.7 !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1) !important;
    border-color: var(--gray-300) !important;
}

/* Búsqueda específica */
input[name="busqueda"],
input[name="q"] {
    box-shadow: 
        inset 0 1px 2px rgba(0, 0, 0, 0.075),
        0 2px 6px rgba(44, 90, 160, 0.1) !important;
    border: 2px solid var(--primary-solid) !important;
    background: linear-gradient(145deg, #ffffff 0%, #f0f7ff 100%) !important;
}

input[name="busqueda"]:focus,
input[name="q"]:focus {
    box-shadow: 
        inset 0 1px 2px rgba(44, 90, 160, 0.1),
        0 0 0 0.25rem rgba(44, 90, 160, 0.25),
        0 4px 12px rgba(44, 90, 160, 0.2) !important;
    border-color: var(--primary-dark) !important;
}

/* Estados de validación mejorados */
.is-valid {
    border-color: var(--success-solid) !important;
    box-shadow: 
        inset 0 1px 2px rgba(25, 135, 84, 0.075),
        0 0 0 0.2rem rgba(25, 135, 84, 0.2),
        0 2px 6px rgba(25, 135, 84, 0.15) !important;
}

.is-invalid {
    border-color: var(--danger-solid) !important;
    box-shadow: 
        inset 0 1px 2px rgba(220, 53, 69, 0.075),
        0 0 0 0.2rem rgba(220, 53, 69, 0.2),
        0 2px 6px rgba(220, 53, 69, 0.15) !important;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-3px); }
    20%, 40%, 60%, 80% { transform: translateX(3px); }
}

.sticky-top-modern {
    position: sticky;
    top: 1rem;
    z-index: 1020;
}

/* ===================================
   MEJORAS PARA DISPOSITIVOS MÓVILES
   =================================== */
@media (max-width: 576px) {
    .card-modern {
        border-radius: var(--border-radius-lg);
        margin-bottom: 1rem;
    }
    
    .btn-floating {
        width: 50px;
        height: 50px;
        bottom: 1rem;
        right: 1rem;
    }
    
    .input-group-modern {
        flex-direction: column;
    }
    
    .input-group-modern .input-group-text {
        border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
        border-bottom: none;
    }
    
    .input-group-modern .form-control-modern {
        border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
        border-top: none;
    }
}

/* ===================================
   PRINT STYLES
   =================================== */
@media print {
    .card-modern {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .btn-floating,
    .navbar-modern {
        display: none !important;
    }
}
