/* Modern Design System for Intranet HAGP - Refined V5 (Iteration 7) */

:root {
    --primary-color: #4361ee;
    --primary-light: #4895ef;
    --secondary-color: #3f37c9;
    --success-color: #2ec4b6;
    --warning-color: #ff9f1c;
    --danger-color: #e71d36;
    --text-main: #2b2d42;
    --text-muted: #6c757d;
    --bg-card: #ffffff;
    --bg-page: #f8f9fa;
    --border-radius-lg: 12px;
    --border-radius-md: 8px;
    --shadow-soft: 0 4px 6px rgba(0, 0, 0, 0.04);
}

/* Page Background */
body {
    background-color: var(--bg-page);
    font-size: 0.85rem;
    color: var(--text-main);
}

/* Premium Card Styles */
.modern-card,
.modern-table-container {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    border: 1px solid #dee2e6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    margin-bottom: 1.5rem;
}

/* Card Header: Spacing Fixes */
.modern-card-header {
    background-color: #f8f9fa;
    padding: 12px 25px;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
    flex-shrink: 0;
    margin-bottom: 0 !important;
}

/* Card Body Areas */
.modern-card-body,
.modern-stepper,
.table-responsive {
    padding: 15px 25px;
    /* Slightly more compact */
    flex-grow: 1;
}

/* ==========================================================================
   STEPPER STYLES
   ========================================================================== */
.modern-stepper {
    list-style: none;
    padding: 15px 25px;
    margin: 0;
}

.step-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 2rem;
    position: relative;
}

.step-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 17px;
    top: 40px;
    width: 2px;
    height: calc(100% - 15px);
    background: #e9ecef;
}

.step-number {
    width: 35px;
    height: 35px;
    font-size: 0.95rem;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-right: 1.2rem;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(67, 97, 238, 0.2);
    z-index: 1;
}

.step-content h5 {
    margin: 0 0 0.3rem 0;
    font-weight: 600;
    color: var(--text-main);
    font-size: 1rem;
}

.step-content p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.4;
}

/* ==========================================================================
   GRID & DATATABLES REFINE
   ========================================================================== */

.dataTables_wrapper {
    padding: 5px 0 15px 0;
    /* REDUCED TOP PADDING, REMOVED SIDE PADDING (Handled by container) */
}

/* GROUP CONTROLS ON ONE LINE */
.dataTables_wrapper .row:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    /* SPACE BEFORE TABLE */
    flex-wrap: nowrap;
    gap: 15px;
    padding: 5px 0;
    /* REDUCED TOP PADDING */
}

/* Search Fixes */
.dataTables_filter {
    text-align: left !important;
    float: none !important;
    margin: 0 !important;
}

.dataTables_filter label {
    margin: 0 15px 0 0;
    /* Add right margin to separate from buttons */
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
}

.dataTables_filter input {
    height: 36px;
    border-radius: 6px;
    border: 1px solid #ced4da;
    padding: 0 10px;
    margin: 0 !important;
    width: 180px !important;
}

/* Length Fixes */
.dataTables_length {
    float: none !important;
    margin: 0 !important;
}

.dataTables_length label {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 12px;
    white-space: nowrap;
}

/* Export Buttons */
.dt-buttons {
    display: inline-flex;
    gap: 8px;
    margin: 0 15px 0 0 !important;
    /* Add right margin to separate from length if needed */
    flex-shrink: 0;
}

/* Grid Typography and Borders */
table.dataTable thead th,
table.dataTable tbody td {
    font-size: 12px !important;
    padding: 10px 12px !important;
    vertical-align: middle;
}

table.dataTable {
    border-collapse: collapse !important;
    border-bottom: 1px solid #dee2e6 !important;
    margin-top: 0 !important;
    border-top: none !important;
}

table.dataTable.no-footer {
    border-bottom: 1px solid #dee2e6 !important;
}

/* THE FIX: Remove all possible double-borders between header and body */
table.dataTable tbody td {
    border-top: none !important;
    white-space: normal !important;
    /* Allow text wrap */
}

/* Zebra Striping */
table.dataTable tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Hover effect */
table.dataTable tbody tr:hover {
    background-color: rgba(67, 97, 238, 0.08) !important;
}

/*
    Estilos Modernos para DataTables.
    Estas reglas se aplican a las tablas de validación y carga de horarios para proporcionar
    una apariencia más limpia y profesional. Se definen colores de fondo, tipografía en mayúsculas
    y bordes sutiles para la cabecera, así como correcciones específicas para el alineamiento
    cuando se utiliza scrollX.
*/
table.dataTable thead th {
    background-color: #f8fafc !important;
    /* Light slate background */
    color: #475569 !important;
    /* Modern slate grey */
    font-weight: 700 !important;
    font-size: 11px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.01em !important;
    /*padding: 8px 1px !important;*/
    text-align: center !important;
    /* Centered headers as requested */
    box-shadow: none !important;
    white-space: nowrap !important;
    border-top: none !important;
    border-bottom: 1px solid #edf2f7 !important;
    /* Subtle separator */
}

/* Fix for ScrollX Gap/Lines: Nuke the height of the hidden cloned header */
.dataTables_scrollHead {
    border-bottom: none !important;
}

.dataTables_scrollHeadInner table {
    margin-bottom: 0 !important;
}

/* Aggressive fix for ScrollX Gap: Ensure absolute collapse and pull body up */
.dataTables_scrollBody thead,
.dataTables_scrollBody thead tr,
.dataTables_scrollBody thead th {
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    line-height: 0 !important;
    visibility: hidden !important;
}

.dataTables_scrollBody table {
    border-top: none !important;
    margin-top: -1px !important;
    /* Negative margin to bridge any sub-pixel gap */
}

/* Pagination Row Fix: Added space at the bottom */
.dataTables_wrapper .row:last-child {
    margin-top: 20px;
    padding-top: 10px;
}

/* ==========================================================================
   COMPACT COMPONENTS & BADGES
   ========================================================================== */

/* Modern Sleek File Input Indicators */
#file-list {
    transition: all 0.3s ease;
    border-radius: 4px;
    background: rgba(67, 97, 238, 0.05);
    padding: 5px;
}

.badge-modern {
    padding: 0.5em 1em;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    display: inline-block;
}

.badge-validado {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.badge-pendiente {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.badge-rechazado {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.btn-modern {
    border-radius: 6px;
    padding: 0 15px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 36px;
    font-size: 0.9rem !important;
    transition: all 0.2s;
}

.btn-modern-primary {
    background: var(--primary-color);
    color: white;
    border: none;
}

.btn-modern-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
}

/* time-capsule-modern styles */
.time-capsule-modern {
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.time-capsule-modern.entry { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; margin-bottom: 2px; }
.time-capsule-modern.exit { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* Botón Consultar Moderno */
.btn-consultar-modern {
    background: linear-gradient(135deg, #17a2b8 0%, #117a8b 100%);
    border: none;
    color: white !important;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 15px;
    height: 36px;
    border-radius: 6px;
    font-size: 11px;
    box-shadow: 0 4px 6px rgba(23, 162, 184, 0.2);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-consultar-modern:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 6px 12px rgba(23, 162, 184, 0.3); }
.btn-consultar-modern:active { transform: translateY(0); }

/* ==========================================================================
   STRICT OVERRIDES
   ========================================================================== */

/* Hide DataTables Sorting */
table.dataTable thead .sorting:before,
table.dataTable thead .sorting:after,
table.dataTable thead .sorting_asc:before,
table.dataTable thead .sorting_asc:after,
table.dataTable thead .sorting_desc:before,
table.dataTable thead .sorting_desc:after {
    display: none !important;
}

table.dataTable thead th {
    background-image: none !important;
    cursor: default !important;
}

/* Blocker Overlay */
.card-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-lg);
    z-index: 100;
}

/* ==========================================================================
   ALERTIFY NOTIFICATIONS OVERRIDES
   ========================================================================== */
.alertify-notifier.ajs-top {
    top: 80px !important;
    /* Push down to avoid covering the blue header */
    z-index: 99999 !important;
}

.alertify-notifier .ajs-message {
    border-radius: 8px !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
    font-family: inherit !important;
    font-weight: 600 !important;
    padding: 15px 30px !important;
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    background-image: none !important;
    /* Remove gradients if any */
    font-size: 14px !important;
    border: none !important;
}

/* Success Theme */
.alertify-notifier .ajs-message.ajs-success {
    background-color: var(--success-color, #2ec4b6) !important;
}

/* Error Theme */
.alertify-notifier .ajs-message.ajs-error {
    background-color: var(--danger-color, #e71d36) !important;
}

/* Warning Theme */
.alertify-notifier .ajs-message.ajs-warning {
    background-color: var(--warning-color, #ff9f1c) !important;
}

/* Base Dialog Overrides for Modern Look */
.alertify .ajs-dialog {
    border-radius: var(--border-radius-lg, 12px) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2) !important;
}

.alertify .ajs-header {
    background: transparent !important;
    border-bottom: none !important;
    font-weight: 700 !important;
    color: var(--text-main, #2b2d42) !important;
}

.alertify .ajs-footer {
    background: transparent !important;
    border-top: none !important;
}

/* Buttons inside Alertify */
.alertify .ajs-footer .ajs-button {
    border-radius: 6px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    font-size: 11px !important;
}

.alertify .ajs-footer .ajs-button.ajs-ok {
    background-color: var(--primary-color, #4361ee) !important;
    color: white !important;
}

.alertify .ajs-footer .ajs-button.ajs-cancel {
    background-color: #e9ecef !important;
    color: var(--text-muted, #6c757d) !important;
}

/* ==========================================================================
   MODERN LOGIN PAGE & PASS CHANGE DESIGN SYSTEM
   ========================================================================== */

/* Outer Login Page Layout */
.login-page-body {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%) !important;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    margin: 0;
    padding: 20px;
}

/* Centered container for login and footer */
.login-page-container {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Premium Login Card */
.modern-login-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    overflow: hidden;
    min-height: 520px;
    position: relative;
    width: 100%;
}

/* Left Column: Image Banner */
.login-banner-side {
    width: 50%;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 40px;
    color: #ffffff;
}



.login-banner-content {
    position: relative;
    z-index: 2;
}

.login-banner-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #ffffff !important;
}

.login-banner-text {
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.5;
    color: #e2e8f0 !important;
}

/* Right Column: Form Side */
.login-form-side {
    width: 50%;
    padding: 40px 45px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: #ffffff;
}

/* Logo container */
.login-logo-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
}

.login-logo-img {
    height: 75px;
    object-fit: contain;
}

/* Form Title */
.login-title-text {
    color: #0f172a;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    margin-top: 0;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

/* Firefox Message styling */
.firefox-warning-box {
    background-color: #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
}

.firefox-warning-box i {
    color: #d97706;
    font-size: 18px;
    flex-shrink: 0;
}

.firefox-warning-box span {
    color: #92400e;
    font-size: 12px;
    line-height: 1.4;
    font-weight: 500;
}

/* Modern inputs & forms */
.modern-form-group {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.modern-form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin: 0;
}

.modern-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.modern-input-icon {
    position: absolute;
    left: 14px;
    color: #94a3b8;
    font-size: 15px;
    pointer-events: none;
    transition: color 0.2s ease;
    z-index: 10;
}

.modern-input-field {
    width: 100% !important;
    height: 44px !important;
    padding: 10px 14px 10px 42px !important;
    border-radius: 8px !important;
    border: 1px solid #cbd5e1 !important;
    font-size: 14px !important;
    color: #0f172a !important;
    background-color: #ffffff !important;
    box-shadow: none !important;
    transition: all 0.2s ease !important;
}

.modern-input-field:focus {
    border-color: #4361ee !important;
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.15) !important;
}

.modern-input-field:focus + .modern-input-icon {
    color: #4361ee;
}

/* Field Instruction Text */
.modern-field-hint {
    font-size: 11px;
    color: #64748b;
    display: flex;
    align-items: flex-start;
    gap: 4px;
    line-height: 1.4;
    margin-top: 4px;
}

.modern-field-hint i {
    font-size: 12px;
    margin-top: 2px;
    color: #94a3b8;
}

/* Actions and Buttons */
.modern-form-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 25px;
}

.btn-modern-submit {
    background-color: #1e293b !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    height: 46px;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.btn-modern-submit:hover {
    background-color: #0f172a !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-modern-submit:active {
    transform: translateY(0);
}

.btn-modern-submit:disabled {
    background-color: #94a3b8 !important;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-modern-home {
    background-color: transparent !important;
    color: #64748b !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    height: 44px;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all 0.2s ease !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none !important;
    width: 100%;
}

.btn-modern-home:hover {
    background-color: #f8fafc !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

.forgot-pass-wrapper {
    text-align: center;
    margin-top: 15px;
}

.forgot-pass-link {
    color: #4361ee !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: color 0.2s ease;
}

.forgot-pass-link:hover {
    color: #3f37c9 !important;
    text-decoration: underline !important;
}

/* Footer Section */
.modern-login-footer {
    text-align: center;
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    margin-top: 5px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .modern-login-card {
        flex-direction: column;
        min-height: auto;
    }
    
    .login-banner-side {
        width: 100%;
        height: 180px;
        padding: 24px;
    }
    
    .login-banner-title {
        font-size: 20px;
    }
    
    .login-form-side {
        width: 100%;
        padding: 30px 24px;
    }
}

/* ==========================================================================
   MODERN PASSWORD RECOVERY POPUP (MODAL)
   ========================================================================== */

.modal-content-modern {
    background-color: #ffffff;
    border-radius: 16px !important;
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
    overflow: hidden;
}

.modal-header-modern {
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title-modern {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
}

.close-modal-modern {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0;
    line-height: 1;
}

.close-modal-modern:hover {
    color: #0f172a;
}

.modal-body-modern {
    padding: 24px;
    text-align: left;
}

.modal-description-modern {
    font-size: 15px !important;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Custom Alert Styles for Login Page */
.login-page-container .alert {
    font-size: 15px !important;
    border-radius: 8px !important;
    padding: 14px 20px !important;
    margin-bottom: 20px !important;
    border: none !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03) !important;
}

.login-page-container .alert-danger {
    background-color: #fef2f2 !important;
    color: #991b1b !important;
    border-left: 4px solid #ef4444 !important;
}

.login-page-container .alert-success {
    background-color: #f0fdf4 !important;
    color: #166534 !important;
    border-left: 4px solid #22c55e !important;
}

.login-page-container .alert .close {
    color: inherit !important;
    opacity: 0.6 !important;
    font-size: 20px !important;
    outline: none !important;
    background: none !important;
    border: none !important;
    margin-top: -2px !important;
}

.login-page-container .alert .close:hover {
    opacity: 1 !important;
}

.modal-footer-modern {
    background-color: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 16px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-modal-submit-modern {
    background-color: #4361ee !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 6px !important;
    height: 38px;
    padding: 0 18px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-modal-submit-modern:hover {
    background-color: #3f37c9 !important;
}

.btn-modal-close-modern {
    background-color: #ffffff !important;
    color: #475569 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    height: 38px;
    padding: 0 18px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-modal-close-modern:hover {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}

/* Fullscreen Loader Overlay */
.login-loading-overlay-full {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    color: #ffffff;
    gap: 15px;
}

.spinner-modern {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text-modern {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hosvital Checkbox styling */
.hosvital-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 10px 12px;
    background-color: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 6px;
}

.hosvital-checkbox-wrapper input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.hosvital-checkbox-wrapper span {
    font-size: 13px;
    font-weight: 600;
    color: #991b1b;
}

/* Custom styles for select profile modal */
#perfil .modal-content {
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
    border: none;
}
#perfil .modal-header {
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}
#perfil .modal-title {
    font-size: 18px !important;
    font-weight: 700;
    color: #0f172a;
}
#perfil .modal-footer {
    border-top: 1px solid #e2e8f0;
    background-color: #f8fafc;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}
#perfil .btn-primary {
    background-color: #1e293b !important;
    border-color: #1e293b !important;
    font-weight: 600;
}
#perfil .btn-primary:hover {
    background-color: #0f172a !important;
    border-color: #0f172a !important;
}
#perfil .table {
    font-size: 15px !important;
}
#perfil .table th {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #475569 !important;
    background-color: #f8fafc !important;
    border-bottom: 2px solid #e2e8f0 !important;
}
#perfil .table td {
    font-size: 15px !important;
    color: #334155 !important;
    vertical-align: middle !important;
}
#perfil .modal-footer .btn {
    font-size: 14px !important;
    font-weight: 600 !important;
    padding: 8px 18px !important;
    border-radius: 6px !important;
}
#perfil input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Custom AlertifyJS Dialog styling for larger, readable text */
.alertify .ajs-dialog,
.alertify-dialog,
.alertify-inner {
    border-radius: 12px !important;
}

.alertify .ajs-header {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
}

.alertify .ajs-content,
.alertify-message,
.alertify-dialog .alertify-message,
.ajs-content {
    font-size: 16px !important;
    line-height: 1.6 !important;
    color: #334155 !important;
}

.alertify .ajs-footer .ajs-buttons .ajs-button,
.alertify-buttons button {
    font-size: 15px !important;
    font-weight: 600 !important;
    padding: 8px 16px !important;
    border-radius: 6px !important;
}

/* ==========================================================================
   LEGACY BROWSER FALLBACK STYLES (Firefox 45.8.0 / IE)
   ========================================================================== */
.legacy-browser .modern-card,
.legacy-browser .modern-table-container,
.legacy-browser .modern-card-header,
.legacy-browser .step-item,
.legacy-browser .step-number,
.legacy-browser .dataTables_wrapper .row:first-child,
.legacy-browser .dataTables_filter label,
.legacy-browser .dataTables_length label,
.legacy-browser .dt-buttons,
.legacy-browser .hosvital-checkbox-wrapper,
.legacy-browser .login-loading-overlay-full,
.legacy-browser body,
.legacy-browser input,
.legacy-browser button,
.legacy-browser select,
.legacy-browser textarea,
.legacy-browser .login-box-modern,
.legacy-browser .login-btn-modern {
    transition: none !important;
    transform: none !important;
    animation: none !important;
    box-shadow: none !important;
    font-family: Arial, Helvetica, sans-serif !important;
}

/* Fallback para variables CSS en navegadores antiguos */
.legacy-browser body {
    background-color: #f8f9fa !important;
    color: #2b2d42 !important;
}

.legacy-browser .modern-card,
.legacy-browser .modern-table-container {
    background: #ffffff !important;
}

.legacy-browser .modern-card-header {
    color: #2b2d42 !important;
}

.legacy-browser .step-number {
    background: #4361ee !important;
}

.legacy-browser .step-content h5 {
    color: #2b2d42 !important;
}

.legacy-browser .step-content p {
    color: #6c757d !important;
}

/* Fallbacks de espaciado para Flex gap en formularios y Datatables */
.legacy-browser .modern-card-header i {
    margin-right: 12px !important;
}

.legacy-browser .step-number {
    margin-right: 20px !important;
}

.legacy-browser .dataTables_filter label input {
    margin-left: 8px !important;
}

.legacy-browser .dataTables_length label select {
    margin-left: 8px !important;
    margin-right: 8px !important;
}

.legacy-browser .dt-buttons .btn {
    margin-right: 8px !important;
}

.legacy-browser .hosvital-checkbox-wrapper input[type="checkbox"] {
    margin-right: 8px !important;
}

.legacy-browser .login-loading-overlay-full {
    background: #0f172a !important; /* Quitar transparencia con desenfoque */
}

.legacy-browser .spinner-modern {
    border-top-color: #4361ee !important;
}