/* =============================================================================
   SICIF - UX Enhanced Styles
   Mejoras de experiencia de usuario: animaciones, toasts, efectos modernos
   ============================================================================= */

/* =============================================================================
   VARIABLES ADICIONALES
   ============================================================================= */
:root {
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glow-primary: rgba(26, 84, 144, 0.4);
    --glow-gold: rgba(212, 160, 23, 0.4);
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --text-light: #9ca3af;
}

/* =============================================================================
   BASE TEXT COLOR SAFETY
   Ensures all elements have readable text by default
   ============================================================================= */
.main-content,
.main-content * {
    color: inherit;
}

.main-content {
    color: var(--text-primary);
}

/* =============================================================================
   LOGIN PAGE - MEJORADO
   ============================================================================= */
.login-page {
    min-height: 100vh;
    background: linear-gradient(-45deg, #0d3b66, #1a5490, #0d3b66, #2e86de);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(212, 160, 23, 0.1) 0%, transparent 50%);
    animation: rotateGlow 20s linear infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes rotateGlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Floating particles effect */
.login-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.login-particles span {
    position: absolute;
    display: block;
    width: 20px;
    height: 20px;
    background: rgba(212, 160, 23, 0.2);
    animation: floatUp 25s linear infinite;
    bottom: -150px;
}

.login-particles span:nth-child(1) { left: 25%; width: 80px; height: 80px; animation-delay: 0s; }
.login-particles span:nth-child(2) { left: 10%; width: 20px; height: 20px; animation-delay: 2s; animation-duration: 12s; }
.login-particles span:nth-child(3) { left: 70%; width: 20px; height: 20px; animation-delay: 4s; }
.login-particles span:nth-child(4) { left: 40%; width: 60px; height: 60px; animation-delay: 0s; animation-duration: 18s; }
.login-particles span:nth-child(5) { left: 65%; width: 20px; height: 20px; animation-delay: 0s; }
.login-particles span:nth-child(6) { left: 75%; width: 110px; height: 110px; animation-delay: 3s; }
.login-particles span:nth-child(7) { left: 35%; width: 150px; height: 150px; animation-delay: 7s; }
.login-particles span:nth-child(8) { left: 50%; width: 25px; height: 25px; animation-delay: 15s; animation-duration: 45s; }
.login-particles span:nth-child(9) { left: 20%; width: 15px; height: 15px; animation-delay: 2s; animation-duration: 35s; }
.login-particles span:nth-child(10) { left: 85%; width: 150px; height: 150px; animation-delay: 0s; animation-duration: 11s; }

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
        border-radius: 0;
    }
    100% {
        transform: translateY(-1000px) rotate(720deg);
        opacity: 0;
        border-radius: 50%;
    }
}

/* Login card mejorada */
.login-card {
    width: 100%;
    max-width: 440px;
    background: var(--glass-bg);
    color: #2c3e50;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    position: relative;
    z-index: 10;
    animation: cardEntrance 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardEntrance {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-header {
    background: linear-gradient(135deg, #0d3b66 0%, #1a5490 100%);
    padding: 2.5rem 2rem;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.login-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(212, 160, 23, 0.3) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #d4a017 0%, #f4d03f 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 10px 30px rgba(212, 160, 23, 0.4);
    position: relative;
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.login-logo i {
    font-size: 2.5rem;
    color: #0d3b66;
}

.login-header h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
    position: relative;
}

.login-header p {
    font-size: 0.9rem;
    color: #d4a017;
    margin: 0;
    font-weight: 500;
    position: relative;
}

.login-body {
    padding: 2.5rem;
    color: #2c3e50;
}

.login-body .form-label {
    font-weight: 600;
    color: #0d3b66;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.login-body .form-control {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
    color: #2c3e50;
}

.login-body .form-control:focus {
    border-color: #1a5490;
    background: white;
    box-shadow: 0 0 0 4px rgba(26, 84, 144, 0.1);
}

.login-body .input-group .form-control {
    border-right: none;
}

.login-body .input-group .btn {
    border: 2px solid #e9ecef;
    border-left: none;
    border-radius: 0 12px 12px 0;
    background: #f8f9fa;
    color: #6c757d;
    transition: all 0.3s ease;
}

.login-body .input-group:focus-within .btn {
    border-color: #1a5490;
    background: white;
}

.btn-login {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #1a5490 0%, #0d3b66 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(26, 84, 144, 0.4);
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:active {
    transform: translateY(0);
}

.login-footer {
    padding: 1.5rem 2rem;
    background: #f8f9fa;
    text-align: center;
    font-size: 0.8rem;
    color: #6c757d;
    border-top: 1px solid #e9ecef;
}

.login-footer .division-name {
    font-weight: 600;
    color: #0d3b66;
    margin-bottom: 0.25rem;
}

/* =============================================================================
   TOAST NOTIFICATIONS
   ============================================================================= */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
}

.toast-notification {
    display: flex;
    align-items: flex-start;
    padding: 1rem 1.25rem;
    background: white;
    color: #2c3e50;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 4px solid;
    position: relative;
    overflow: hidden;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-notification.toast-exit {
    animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideOut {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.toast-notification.success {
    border-left-color: #27ae60;
}

.toast-notification.error {
    border-left-color: #e74c3c;
}

.toast-notification.warning {
    border-left-color: #f39c12;
}

.toast-notification.info {
    border-left-color: #3498db;
}

.toast-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

.toast-notification.success .toast-icon {
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
}

.toast-notification.error .toast-icon {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.toast-notification.warning .toast-icon {
    background: rgba(243, 156, 18, 0.1);
    color: #f39c12;
}

.toast-notification.info .toast-icon {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.toast-message {
    color: #6c757d;
    font-size: 0.875rem;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: #adb5bd;
    cursor: pointer;
    padding: 0.25rem;
    margin-left: 0.5rem;
    transition: color 0.2s;
}

.toast-close:hover {
    color: #6c757d;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    animation: toastProgress 5s linear forwards;
}

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* =============================================================================
   STAT CARDS MEJORADAS
   ============================================================================= */
.stat-card {
    background: white;
    color: #2c3e50;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, currentColor 0%, transparent 70%);
    opacity: 0.05;
    transform: translate(30%, -30%);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.stat-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.stat-card.primary .stat-card-icon {
    background: linear-gradient(135deg, #1a5490 0%, #2e86de 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(26, 84, 144, 0.3);
}

.stat-card.success .stat-card-icon {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(39, 174, 96, 0.3);
}

.stat-card.warning .stat-card-icon {
    background: linear-gradient(135deg, #f39c12 0%, #f1c40f 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(243, 156, 18, 0.3);
}

.stat-card.danger .stat-card-icon {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(231, 76, 60, 0.3);
}

.stat-card-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: #0d3b66;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-card-label {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
}

.stat-card-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.stat-card-trend.up {
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
}

.stat-card-trend.down {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

/* =============================================================================
   QUICK ACTIONS
   ============================================================================= */
.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 16px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #2c3e50 !important;
    min-height: 120px;
}

.quick-action-btn:hover {
    border-color: #1a5490;
    background: linear-gradient(135deg, rgba(26, 84, 144, 0.05) 0%, rgba(26, 84, 144, 0.1) 100%);
    transform: translateY(-3px);
    color: #1a5490;
}

.quick-action-btn i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    color: #1a5490;
}

.quick-action-btn span {
    font-weight: 600;
    font-size: 0.875rem;
    text-align: center;
}

/* =============================================================================
   ACTIVITY LIST
   ============================================================================= */
.activity-item {
    display: flex;
    align-items: flex-start;
    padding: 1rem;
    border-radius: 12px;
    transition: all 0.2s ease;
    margin-bottom: 0.5rem;
}

.activity-item:hover {
    background: #f8f9fa;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
    font-size: 1rem;
}

.activity-icon.case {
    background: rgba(26, 84, 144, 0.1);
    color: #1a5490;
}

.activity-icon.alert {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.activity-icon.complete {
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-text {
    font-size: 0.9rem;
    color: #2c3e50;
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.activity-time {
    font-size: 0.75rem;
    color: #adb5bd;
}

/* =============================================================================
   NOTIFICATION BADGE PULSE
   ============================================================================= */
.notification-badge {
    position: relative;
}

.notification-badge .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    font-size: 0.65rem;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* =============================================================================
   TABLE IMPROVEMENTS
   ============================================================================= */
.table-modern {
    border-collapse: separate;
    border-spacing: 0;
}

.table-modern thead th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid #d4a017;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem;
}

.table-modern tbody tr {
    transition: all 0.2s ease;
}

.table-modern tbody tr:hover {
    background: linear-gradient(135deg, rgba(26, 84, 144, 0.02) 0%, rgba(26, 84, 144, 0.05) 100%);
}

.table-modern tbody td {
    padding: 1rem;
    border-bottom: 1px solid #f1f3f4;
    vertical-align: middle;
}

/* =============================================================================
   BUTTON RIPPLE EFFECT
   ============================================================================= */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-ripple:active::after {
    width: 300px;
    height: 300px;
}

/* =============================================================================
   LOADING OVERLAY
   ============================================================================= */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner-large {
    width: 60px;
    height: 60px;
    border: 4px solid #e9ecef;
    border-top-color: #1a5490;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

/* =============================================================================
   SIDEBAR IMPROVEMENTS
   ============================================================================= */
.sidebar .nav-link {
    position: relative;
    overflow: hidden;
}

.sidebar .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, rgba(26, 84, 144, 0.1) 0%, transparent 100%);
    transition: width 0.3s ease;
}

.sidebar .nav-link:hover::before {
    width: 100%;
}

/* =============================================================================
   CARD HOVER EFFECTS
   ============================================================================= */
.card-hover-lift {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

/* =============================================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================================= */
@media (max-width: 768px) {
    .toast-container {
        left: 20px;
        right: 20px;
        max-width: none;
    }

    .stat-card-value {
        font-size: 2rem;
    }

    .login-card {
        margin: 1rem;
        border-radius: 20px;
    }

    .login-header {
        padding: 2rem 1.5rem;
    }

    .login-body {
        padding: 2rem 1.5rem;
    }

    .login-logo {
        width: 70px;
        height: 70px;
    }
}

/* =============================================================================
   FORM ENHANCEMENTS
   ============================================================================= */

/* Form input animations */
.form-control, .form-select {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: #2c3e50 !important;
    background-color: #fff;
}

.form-control::placeholder {
    color: #9ca3af !important;
}

.form-control:disabled, .form-select:disabled {
    color: #6c757d !important;
    background-color: #e9ecef;
}

.form-control:focus, .form-select:focus {
    border-color: #1a5490;
    box-shadow: 0 0 0 4px rgba(26, 84, 144, 0.1);
    transform: translateY(-1px);
}

.form-control:hover:not(:focus), .form-select:hover:not(:focus) {
    border-color: #adb5bd;
}

/* Form labels with animation */
.form-label {
    font-weight: 600;
    color: #2c3e50 !important;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    transition: color 0.2s ease;
}

.form-label.text-muted {
    color: #6c757d !important;
}

.form-control:focus ~ .form-label,
.form-select:focus ~ .form-label {
    color: #1a5490;
}

/* Required field indicator */
.form-label .text-danger {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Textarea enhancement */
textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

textarea.form-control:focus {
    min-height: 150px;
}

/* Form check custom styling */
.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #adb5bd;
    transition: all 0.2s ease;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: #1a5490;
    border-color: #1a5490;
}

.form-check-input:focus {
    box-shadow: 0 0 0 4px rgba(26, 84, 144, 0.15);
}

.form-check-input:checked + .form-check-label {
    color: #1a5490;
    font-weight: 500;
}

/* Form text helper */
.form-text {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.375rem;
}

/* Input group enhancements */
.input-group .form-control {
    border-radius: 10px 0 0 10px;
}

.input-group .btn {
    border-radius: 0 10px 10px 0;
    border: 2px solid #e9ecef;
    border-left: none;
}

.input-group:focus-within .btn {
    border-color: #1a5490;
}

/* Select with custom arrow */
.form-select {
    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='%231a5490' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-size: 16px 12px;
}

/* Card form sections */
.card-institucional .card-header,
.card .card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid #d4a017;
    font-weight: 600;
    color: #0d3b66;
    padding: 1rem 1.25rem;
}

.card-institucional .card-header i,
.card .card-header i {
    color: #1a5490;
    margin-right: 0.5rem;
}

/* Form section cards with animation */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
    animation: cardSlideIn 0.5s ease-out;
    overflow: hidden;
    color: #2c3e50;
}

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.2s; }
.card:nth-child(4) { animation-delay: 0.3s; }

.card .card-body {
    padding: 1.5rem;
}

/* Submit button enhancement */
.btn-primary.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    background: linear-gradient(135deg, #1a5490 0%, #0d3b66 100%);
    color: white !important;
    border: none;
    box-shadow: 0 8px 20px rgba(26, 84, 144, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary.btn-lg::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary.btn-lg:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(26, 84, 144, 0.4);
}

.btn-primary.btn-lg:hover::before {
    left: 100%;
}

.btn-primary.btn-lg:active {
    transform: translateY(-1px);
}

/* Cancel button */
.btn-outline-secondary {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #495057 !important;
    background: white;
}

.btn-outline-secondary:hover {
    background: #f8f9fa;
    border-color: #6c757d;
    color: #2c3e50 !important;
    transform: translateY(-2px);
}

/* =============================================================================
   BUTTON COLOR FIXES - Ensure text visibility
   ============================================================================= */
.btn-primary {
    color: white !important;
}

.btn-secondary {
    color: white !important;
}

.btn-success {
    color: white !important;
}

.btn-danger {
    color: white !important;
}

.btn-warning {
    color: #212529 !important;
}

.btn-info {
    color: white !important;
}

.btn-light {
    color: #212529 !important;
    background: #f8f9fa;
    border-color: #e9ecef;
}

.btn-dark {
    color: white !important;
}

.btn-outline-primary {
    color: #1a5490 !important;
    border-color: #1a5490;
    background: transparent;
}

.btn-outline-primary:hover {
    color: white !important;
    background: #1a5490;
}

.btn-outline-danger {
    color: #dc3545 !important;
    border-color: #dc3545;
    background: transparent;
}

.btn-outline-danger:hover {
    color: white !important;
    background: #dc3545;
}

.btn-outline-success {
    color: #28a745 !important;
    border-color: #28a745;
    background: transparent;
}

.btn-outline-success:hover {
    color: white !important;
    background: #28a745;
}

.btn-outline-warning {
    color: #ffc107 !important;
    border-color: #ffc107;
    background: transparent;
}

.btn-outline-warning:hover {
    color: #212529 !important;
    background: #ffc107;
}

.btn-outline-info {
    color: #17a2b8 !important;
    border-color: #17a2b8;
    background: transparent;
}

.btn-outline-info:hover {
    color: white !important;
    background: #17a2b8;
}

/* Form validation states */
.form-control.is-valid {
    border-color: #27ae60;
    background-image: none;
    padding-right: 1rem;
}

.form-control.is-valid:focus {
    box-shadow: 0 0 0 4px rgba(39, 174, 96, 0.15);
}

.form-control.is-invalid {
    border-color: #e74c3c;
    background-image: none;
    animation: shake 0.4s ease;
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.15);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* Alert enhancements */
.alert {
    border: none;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    animation: alertSlideIn 0.4s ease;
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-info {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1) 0%, rgba(52, 152, 219, 0.05) 100%);
    border-left: 4px solid #3498db;
}

.alert-success {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.1) 0%, rgba(39, 174, 96, 0.05) 100%);
    border-left: 4px solid #27ae60;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.1) 0%, rgba(243, 156, 18, 0.05) 100%);
    border-left: 4px solid #f39c12;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1) 0%, rgba(231, 76, 60, 0.05) 100%);
    border-left: 4px solid #e74c3c;
}

/* Page header */
.page-header {
    margin-bottom: 2rem;
    animation: fadeInDown 0.5s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-header h1 {
    font-weight: 700;
    color: #0d3b66;
    margin-bottom: 0.5rem;
}

.page-header .breadcrumb {
    background: none;
    padding: 0;
    margin-bottom: 0.5rem;
}

.page-header .breadcrumb-item a {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.2s;
}

.page-header .breadcrumb-item a:hover {
    color: #1a5490;
}

.page-header .breadcrumb-item.active {
    color: #1a5490;
    font-weight: 500;
}

/* Sticky sidebar card */
.sticky-top {
    z-index: 100;
}

/* Badge enhancements */
.badge {
    font-weight: 600;
    padding: 0.5em 0.75em;
    border-radius: 8px;
}

.badge-estado-recibido {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

.badge-estado-asignado {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.badge-estado-eninvestigacion {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.badge-estado-cerrado {
    background: linear-gradient(135deg, #27ae60 0%, #1e8449 100%);
}

/* =============================================================================
   SKELETON LOADING
   ============================================================================= */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-card {
    height: 150px;
    margin-bottom: 1rem;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

/* =============================================================================
   LOADING BUTTON STATE
   ============================================================================= */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading .btn-text {
    visibility: hidden;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* =============================================================================
   PROGRESS STEPS
   ============================================================================= */
.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: #e9ecef;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.progress-step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 2px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #6c757d;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
}

.progress-step.active .progress-step-icon {
    background: #1a5490;
    border-color: #1a5490;
    color: white;
    box-shadow: 0 4px 12px rgba(26, 84, 144, 0.3);
}

.progress-step.completed .progress-step-icon {
    background: #27ae60;
    border-color: #27ae60;
    color: white;
}

.progress-step-label {
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 500;
    text-align: center;
}

.progress-step.active .progress-step-label {
    color: #1a5490;
}

/* =============================================================================
   EMPTY STATE
   ============================================================================= */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d !important;
    background: transparent;
}

.empty-state-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2.5rem;
    color: #adb5bd;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.empty-state-text {
    color: #6c757d;
    margin-bottom: 1.5rem;
}

/* =============================================================================
   CONTEXT MENU (Right-click)
   ============================================================================= */
.context-menu {
    position: fixed;
    background: white;
    color: #2c3e50;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
    min-width: 180px;
    z-index: 9999;
    animation: contextMenuIn 0.2s ease;
}

@keyframes contextMenuIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.context-menu-item {
    display: flex;
    align-items: center;
    padding: 0.625rem 1rem;
    color: #2c3e50;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.context-menu-item:hover {
    background: rgba(26, 84, 144, 0.05);
    color: #1a5490;
}

.context-menu-item i {
    margin-right: 0.75rem;
    width: 16px;
    text-align: center;
}

.context-menu-divider {
    height: 1px;
    background: #e9ecef;
    margin: 0.5rem 0;
}

/* =============================================================================
   PRIORITY BADGES
   ============================================================================= */
.badge-prioridad-urgente {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    animation: urgentPulse 2s ease-in-out infinite;
}

@keyframes urgentPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(231, 76, 60, 0); }
}

.badge-prioridad-alta {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    color: white;
}

.badge-prioridad-normal {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.badge-prioridad-baja {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: white;
}

/* Estado investigacion */
.badge-estado-investigacion {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
}

/* =============================================================================
   ACTION BUTTONS
   ============================================================================= */
.btn-group-sm .btn {
    padding: 0.375rem 0.625rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-group-sm .btn:first-child {
    border-radius: 8px 0 0 8px;
}

.btn-group-sm .btn:last-child {
    border-radius: 0 8px 8px 0;
}

.btn-group-sm .btn:only-child {
    border-radius: 8px;
}

.btn-group-sm .btn:hover {
    transform: translateY(-2px);
    z-index: 2;
}

.btn-group-sm .btn-outline-primary:hover {
    box-shadow: 0 4px 12px rgba(26, 84, 144, 0.3);
}

.btn-group-sm .btn-outline-secondary:hover {
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.btn-group-sm .btn-outline-danger:hover {
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

/* =============================================================================
   DROPDOWN ENHANCEMENTS
   ============================================================================= */
.dropdown-menu {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 0.5rem;
    animation: dropdownFadeIn 0.2s ease;
    color: #2c3e50;
    background: white;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    border-radius: 8px;
    padding: 0.625rem 1rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, rgba(26, 84, 144, 0.05) 0%, rgba(26, 84, 144, 0.1) 100%);
    color: #1a5490;
}

.dropdown-item i {
    color: #1a5490;
}

/* =============================================================================
   CASO ID LINK STYLE
   ============================================================================= */
.table-caso-id {
    font-weight: 700;
    color: #1a5490;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    background: rgba(26, 84, 144, 0.05);
    border-radius: 6px;
    transition: all 0.2s ease;
    display: inline-block;
}

.table-caso-id:hover {
    background: rgba(26, 84, 144, 0.1);
    color: #0d3b66;
    transform: translateY(-1px);
}

/* =============================================================================
   SEARCH BAR ENHANCEMENT
   ============================================================================= */
.input-group-text {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-right: none;
    border-radius: 10px 0 0 10px;
    color: #6c757d;
}

.input-group:focus-within .input-group-text {
    border-color: #1a5490;
    color: #1a5490;
}

/* =============================================================================
   MODAL ENHANCEMENTS
   ============================================================================= */
.modal-content {
    border: none;
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    color: #2c3e50;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    border-bottom: 2px solid #d4a017;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px 20px 0 0;
    padding: 1.25rem 1.5rem;
}

.modal-header .modal-title {
    font-weight: 700;
    color: #0d3b66;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 1rem 1.5rem;
    border-radius: 0 0 20px 20px;
}

/* =============================================================================
   ROW HOVER EFFECTS
   ============================================================================= */
.table tbody tr {
    transition: all 0.2s ease;
}

.table-hover tbody tr:hover {
    background: linear-gradient(135deg, rgba(26, 84, 144, 0.02) 0%, rgba(26, 84, 144, 0.05) 100%);
    transform: scale(1.005);
}

.table-hover tbody tr:hover td {
    color: #0d3b66;
}

/* =============================================================================
   TOOLTIP CUSTOM
   ============================================================================= */
.tooltip-inner {
    background: #0d3b66;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
}

.tooltip.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: #0d3b66;
}

.tooltip.bs-tooltip-bottom .tooltip-arrow::before {
    border-bottom-color: #0d3b66;
}

/* =============================================================================
   PULSE ANIMATION FOR NOTIFICATIONS
   ============================================================================= */
@keyframes notificationPulse {
    0% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(231, 76, 60, 0); }
    100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}

.notification-pulse {
    animation: notificationPulse 2s infinite;
}

/* =============================================================================
   SCROLL INDICATOR
   ============================================================================= */
.scroll-indicator {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #1a5490 0%, #0d3b66 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(26, 84, 144, 0.3);
    z-index: 1000;
}

.scroll-indicator.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-indicator:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(26, 84, 144, 0.4);
}

/* =============================================================================
   CODE/REFERENCE STYLING
   ============================================================================= */
code {
    background: rgba(26, 84, 144, 0.08);
    color: #0d3b66;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85em;
}

/* =============================================================================
   KEYBOARD SHORTCUT STYLING
   ============================================================================= */
kbd {
    display: inline-block;
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    color: #2c3e50 !important;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    font-family: inherit;
    font-weight: 600;
    box-shadow: 0 2px 0 #d1d5db;
    line-height: 1.4;
    vertical-align: middle;
}

.text-muted kbd {
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    color: #2c3e50 !important;
    border-color: #d1d5db;
}
