/* ========== TOAST NOTIFICATIONS ========== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    width: 100%;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
    position: relative;
    overflow: hidden;
    min-width: 300px;
    backdrop-filter: blur(10px);
}

.toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: currentColor;
}

.toast-success {
    color: var(--success);
    border-left-color: var(--success);
}

.toast-error {
    color: var(--error);
    border-left-color: var(--error);
}

.toast-warning {
    color: var(--warning);
    border-left-color: var(--warning);
}

.toast-info {
    color: var(--info);
    border-left-color: var(--info);
}

.toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.toast-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(400px);
    }
}

/* ========== LOADING OVERLAY ========== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--color-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner p {
    color: var(--text-primary);
    font-weight: 500;
    margin: 0;
}

/* ========== SKELETON LOADERS ========== */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-primary) 0%,
        var(--border-color) 50%,
        var(--bg-primary) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-card {
    padding: 25px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    margin-bottom: 15px;
}

.skeleton-line {
    height: 16px;
    margin-bottom: 12px;
    border-radius: 4px;
}

.skeleton-line.short {
    width: 60%;
}

.skeleton-line.medium {
    width: 80%;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-bottom: 12px;
}

/* ========== MEJORAS EN MODAL ========== */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.4rem;
    font-weight: 600;
}

.modal-body {
    padding: 30px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 30px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.modal-small {
    max-width: 500px;
}

.modal-content .close {
    position: static;
    width: 36px;
    height: 36px;
    margin: 0;
    background: var(--bg-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-content .close:hover {
    background: var(--error-light);
    color: var(--error);
}

/* ========== TOOLTIPS ========== */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    background: var(--color-dark-navy);
    color: white;
    text-align: center;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    white-space: nowrap;
    box-shadow: var(--shadow-md);
}

.tooltip .tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--color-dark-navy);
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* ========== MEJORAS EN FORMULARIOS ========== */
.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: var(--error);
}

.form-group.error .error-message {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--error);
    font-size: 0.85rem;
    margin-top: 6px;
}

.error-message {
    display: none;
}

.form-group.success input,
.form-group.success select,
.form-group.success textarea {
    border-color: var(--success);
}

.form-group.success::after {
    content: '✓';
    position: absolute;
    right: 12px;
    top: 42px;
    color: var(--success);
    font-weight: 700;
    font-size: 1.2rem;
}

/* ========== MEJORAS EN BOTONES ========== */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ========== MEJORAS EN CARDS ========== */
.card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-cyan), var(--color-dark-teal));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

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

/* ========== MEJORAS EN RADICADOS ========== */
.radicado-item {
    position: relative;
}

.radicado-item::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: var(--color-cyan);
    transition: width 0.3s ease;
    opacity: 0.1;
}

.radicado-item:hover::after {
    width: 4px;
}

/* ========== BREADCRUMBS ========== */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 25px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.breadcrumbs a {
    color: var(--color-cyan);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumbs a:hover {
    color: var(--color-dark-teal);
    text-decoration: underline;
}

.breadcrumbs span {
    color: var(--text-light);
}

/* ========== MEJORAS EN BÚSQUEDA ========== */
.search-wrapper {
    position: relative;
    flex: 1;
}

.search-wrapper i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}

.search-wrapper input {
    padding-left: 40px;
}

/* ========== MEJORAS EN ESTADOS VACÍOS ========== */
.empty-state-icon {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ========== MEJORAS EN TABS ========== */
.tab-btn {
    position: relative;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--color-cyan);
    border-radius: 3px;
}

/* ========== ACCESIBILIDAD ========== */
*:focus-visible {
    outline: 2px solid var(--color-cyan);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ========== ANIMACIONES MEJORADAS ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.4s ease;
}

/* ========== MEJORAS RESPONSIVE ========== */
@media (max-width: 768px) {
    .toast-container {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

