body {
    font-family: "Poppins", "Segoe UI", sans-serif;
    background-color: #f3f7f4;
    color: #22313f;
}

.ambiental-sidebar {
    width: 280px;
    background: linear-gradient(180deg, #134e4a 0%, #1c9d6d 100%);
    color: #ffffff;
    z-index: 1030;
}

.ambiental-sidebar.sidebar-static .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    margin-bottom: 0.35rem;
    transition: all 0.2s ease-in-out;
}

.ambiental-sidebar.sidebar-static .nav-link i {
    font-size: 1.1rem;
}

.ambiental-sidebar.sidebar-static .brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.ambiental-sidebar.sidebar-static .sidebar-user-avatar {
    width: 48px;
    height: 48px;
}

.ambiental-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.85);
}

.ambiental-sidebar .nav-link.active,
.ambiental-sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.ambiental-sidebar .brand-logo-img {
    filter: brightness(0) invert(1);
    max-width: 100%;
}

.ambiental-sidebar .brand-logo {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.08rem;
}

.ambiental-content {
    margin-left: 0;
}

@media (min-width: 992px) {
    .ambiental-content {
        margin-left: 280px;
    }
}

body.sidebar-collapsed .sidebar-static {
    width: 88px;
}

body.sidebar-collapsed .sidebar-static .brand-text,
body.sidebar-collapsed .sidebar-static .nav-link-text,
body.sidebar-collapsed .sidebar-static .sidebar-user-meta {
    display: none;
}

body.sidebar-collapsed .sidebar-static .nav-link {
    justify-content: center;
    padding: 0.75rem 0;
}

body.sidebar-collapsed .sidebar-static .nav-link i {
    margin: 0;
}

body.sidebar-collapsed .sidebar-static .sidebar-user-avatar {
    margin: 0 auto;
}

@media (min-width: 992px) {
    body.sidebar-collapsed .ambiental-content {
        margin-left: 88px;
    }
}

body.sidebar-collapsed .sidebar-static .brand-logo {
    justify-content: center;
}

.ambiental-card {
    border: none;
    border-radius: 18px;
    box-shadow: 0 25px 45px -25px rgba(19, 78, 74, 0.35);
    background: #ffffff;
    transition: all 0.3s ease;
}

.ambiental-card:hover {
    box-shadow: 0 30px 50px -25px rgba(19, 78, 74, 0.4);
    transform: translateY(-2px);
}

.ambiental-card .card-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(28, 157, 109, 0.15) 0%, rgba(28, 157, 109, 0.25) 100%);
    color: #1c9d6d;
    font-size: 1.75rem;
}

.ambiental-progress .progress {
    height: 8px;
    border-radius: 999px;
    background-color: rgba(19, 78, 74, 0.15);
}

.ambiental-progress .progress-bar {
    background: linear-gradient(90deg, #1c9d6d 0%, #2fbd85 100%);
    border-radius: 999px;
    transition: width 0.6s ease;
}

.ambiental-table th {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.72rem;
    color: #6c7a89;
}

.ambiental-table td {
    vertical-align: middle;
}

.ambiental-pill {
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.ambiental-badge {
    font-size: 0.75rem;
    font-weight: 500;
}

.ambiental-timeline-item {
    position: relative;
    padding-left: 2.75rem;
    margin-bottom: 1.5rem;
}

.ambiental-timeline-item:last-child {
    margin-bottom: 0;
}

.ambiental-timeline-item::before {
    content: "";
    position: absolute;
    left: 1.15rem;
    top: 0.4rem;
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 999px;
    border: 3px solid #ffffff;
    background: linear-gradient(135deg, #1c9d6d 0%, #2fbd85 100%);
    box-shadow: 0 6px 15px rgba(19, 78, 74, 0.25);
}

.ambiental-alert-card {
    background: linear-gradient(90deg, #f7fbf9 0%, #e1f7eb 100%);
    border: none;
    border-radius: 18px;
}

.ambiental-alert-card .icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.65);
    color: #22a06b;
    box-shadow: inset 0 0 0 1px rgba(34, 160, 107, 0.12);
}

.ambiental-table tbody tr {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ambiental-table tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -15px rgba(19, 78, 74, 0.35);
}

.badge-teal {
    background-color: rgba(28, 157, 109, 0.12);
    color: #1c9d6d;
}

.ambiental-dropdown .dropdown-item {
    border-radius: 12px;
    padding: 0.5rem 0.9rem;
    transition: background 0.2s ease;
}

.ambiental-dropdown .dropdown-item:hover {
    background: rgba(28, 157, 109, 0.12);
}

.requerimientos-tree-wrapper {
    margin-top: 1rem;
    background: #ffffff;
    border-radius: 16px;
    padding: 0.85rem 1.1rem;
    box-shadow: 0 20px 38px -28px rgba(19, 78, 74, 0.45);
    border: 1px solid rgba(19, 78, 74, 0.08);
}

.requerimientos-root,
.requerimientos-root ul {
    list-style: none;
    margin: 0;
    padding-left: 0;
}

.requerimientos-root > li {
    margin-bottom: 0.6rem;
}

.requerimiento-node > ul {
    margin-top: 0.5rem;
    padding-left: 1.25rem;
    border-left: 1px dashed rgba(28, 157, 109, 0.22);
    margin-left: 0.65rem;
}

.node-card {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    background: #ffffff;
    border-radius: 12px;
    padding: 0.65rem 0.85rem;
    box-shadow: 0 16px 32px -26px rgba(19, 78, 74, 0.55);
    border: 1px solid rgba(19, 78, 74, 0.08);
}

.node-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    justify-content: flex-end;
}

.node-actions .btn {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.node-actions .btn i {
    font-size: 0.85rem;
}

.drag-handle {
    cursor: grab;
    color: var(--ambiental-secondary);
    display: flex;
    align-items: center;
    font-size: 1rem;
    padding-right: 0.35rem;
}

.drag-handle:active {
    cursor: grabbing;
}

.node-header .badge {
    font-size: 0.7rem;
    padding: 0.35rem 0.45rem;
    border-radius: 10px;
}

.node-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
}

.node-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.1rem;
    font-size: 0.75rem;
}

.node-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.node-meta i {
    color: var(--ambiental-secondary);
}

.requerimientos-tree-empty {
    background: rgba(28, 157, 109, 0.05);
    border-radius: 12px;
}

.requerimientos-tree-wrapper .badge {
    font-size: 0.72rem;
}

.ambiental-acto-progress {
    background: linear-gradient(135deg, rgba(28, 157, 109, 0.08), rgba(15, 118, 110, 0.08));
    border-radius: 20px;
    padding: 1.25rem 1.5rem;
}

/* Notificaciones */
.ambiental-notificaciones-dropdown {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: none;
    border-radius: 12px;
    overflow: hidden;
}

.notificacion-item {
    transition: all 0.2s ease;
    background: #ffffff;
}

.notificacion-item:hover {
    background: #f8f9fa;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.notificacion-item.border-danger {
    background: linear-gradient(90deg, rgba(220, 53, 69, 0.05) 0%, #ffffff 10%);
}

.notificacion-item.border-warning {
    background: linear-gradient(90deg, rgba(255, 193, 7, 0.05) 0%, #ffffff 10%);
}

.notificacion-item.border-info {
    background: linear-gradient(90deg, rgba(13, 202, 240, 0.05) 0%, #ffffff 10%);
}

#badgeNotificaciones {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.ambiental-acto-progress .display-5 {
    font-size: 2.5rem;
}

.ambiental-progress-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.ambiental-progress-stats .badge {
    padding: 0.4rem 0.65rem;
    font-size: 0.72rem;
    border-radius: 999px;
}

.ambiental-progress-bar {
    height: 0.55rem;
    background: rgba(28, 157, 109, 0.12);
    border-radius: 999px;
}

.ambiental-progress-bar .progress-bar {
    border-radius: 999px;
}

@media (max-width: 576px) {
    .ambiental-progress-stats {
        justify-content: flex-start;
    }
}

/* Estilos para Dashboard Principal */
.cursor-pointer {
    cursor: pointer;
    transition: all 0.2s ease;
}

.cursor-pointer:hover {
    transform: translateY(-2px);
}

.ambiental-card.cursor-pointer:hover {
    box-shadow: 0 35px 55px -25px rgba(19, 78, 74, 0.45);
}

/* Timeline para bitácora */
.ambiental-timeline .timeline {
    position: relative;
    padding-left: 0;
}

.ambiental-timeline .timeline-item {
    position: relative;
    padding-left: 2rem;
    width: 100%;
    min-width: 0; /* Permite que el contenido se ajuste */
}

.ambiental-timeline .timeline-marker {
    position: absolute;
    left: 0;
    top: 0.25rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px currentColor;
}

.ambiental-timeline .timeline-item::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 1.25rem;
    bottom: -1rem;
    width: 2px;
    background: linear-gradient(180deg, currentColor 0%, transparent 100%);
    opacity: 0.3;
}

.ambiental-timeline .timeline-item:last-child::before {
    display: none;
}

.ambiental-timeline .timeline-item .flex-grow-1 {
    min-width: 0;
    width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.ambiental-timeline .timeline-item .d-flex {
    width: 100%;
    min-width: 0;
}

.ambiental-timeline .timeline-item p,
.ambiental-timeline .timeline-item small {
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* List group items mejorados */
.list-group-item-action {
    transition: all 0.2s ease;
    border-radius: 12px !important;
    margin-bottom: 0.5rem;
}

.list-group-item-action:hover {
    background-color: rgba(28, 157, 109, 0.05);
    transform: translateX(4px);
}

/* Scrollbar personalizado para alertas */
#alertasDashboard::-webkit-scrollbar,
#bitacoraDashboard::-webkit-scrollbar {
    width: 6px;
}

#alertasDashboard::-webkit-scrollbar-track,
#bitacoraDashboard::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

#alertasDashboard::-webkit-scrollbar-thumb,
#bitacoraDashboard::-webkit-scrollbar-thumb {
    background: rgba(28, 157, 109, 0.3);
    border-radius: 10px;
}

#alertasDashboard::-webkit-scrollbar-thumb:hover,
#bitacoraDashboard::-webkit-scrollbar-thumb:hover {
    background: rgba(28, 157, 109, 0.5);
}

/* Estilos para gestión de usuarios */
.componente-card {
    transition: all 0.2s ease;
    border: 2px solid #e9ecef;
    background: #ffffff;
    position: relative;
}

.componente-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: rgba(28, 157, 109, 0.4);
}

.componente-card.selected {
    border: 3px solid var(--ambiental-primary) !important;
    background: linear-gradient(135deg, rgba(28, 157, 109, 0.12) 0%, rgba(28, 157, 109, 0.05) 100%) !important;
    box-shadow: 0 6px 20px rgba(28, 157, 109, 0.3) !important;
    transform: translateY(-2px);
}

.componente-card.selected::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: var(--ambiental-primary);
    border-radius: 4px 0 0 4px;
    box-shadow: 2px 0 8px rgba(28, 157, 109, 0.4);
}

.componente-card .form-check-input {
    width: 1.5rem;
    height: 1.5rem;
    margin-top: 0.125rem;
    border: 2.5px solid #dee2e6;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
}

.componente-card .form-check-input:checked {
    border-color: var(--ambiental-primary) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='4' d='M5 10l3 3l7-7'/%3e%3c/svg%3e") !important;
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 0 0 3px rgba(28, 157, 109, 0.2);
}

.componente-card .form-check-input:focus {
    border-color: var(--ambiental-primary);
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(28, 157, 109, 0.25);
}

.componente-card .form-check-label {
    cursor: pointer;
    width: 100%;
}

.componente-card.selected .form-check-label {
    font-weight: 600;
    color: var(--ambiental-primary);
}

.componente-card.selected .form-check-label strong {
    color: var(--ambiental-primary);
    font-size: 1.05rem;
}

.componente-card .rounded-circle {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.componente-card.selected .rounded-circle {
    width: 16px;
    height: 16px;
    box-shadow: 0 0 0 2px rgba(28, 157, 109, 0.3);
}

#tablaUsuarios {
    font-size: 0.9rem;
}

#tablaUsuarios thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: #6c757d;
    border-bottom: 2px solid #e9ecef;
}

#tablaUsuarios tbody tr {
    transition: background-color 0.2s ease;
}

#tablaUsuarios tbody tr:hover {
    background-color: #f8f9fa;
}

/* Barras de progreso de vencimiento */
.vencimiento-progress-container {
    min-width: 200px;
}

.vencimiento-progress {
    border-radius: 10px;
    background-color: #e9ecef;
    overflow: hidden;
    position: relative;
}

.vencimiento-progress .progress-bar {
    border-radius: 10px;
    transition: width 0.3s ease-out;
    position: relative;
}

/* Efecto hover sutil en las barras */
.vencimiento-progress-container:hover .progress-bar {
    filter: brightness(1.05);
    transition: filter 0.2s ease;
}

/* Estilos para selección de responsables */
#containerResponsables {
    min-height: 120px;
}

.responsable-checkbox-item {
    padding: 0.75rem;
    border-radius: 10px;
    border: 2px solid #e9ecef;
    background-color: #ffffff;
    transition: all 0.25s ease;
    cursor: pointer;
    margin-bottom: 0.5rem;
    position: relative;
}

.responsable-checkbox-item:hover {
    border-color: rgba(28, 157, 109, 0.4);
    background-color: rgba(28, 157, 109, 0.03);
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.responsable-checkbox-item.selected {
    border-color: var(--ambiental-primary) !important;
    background: linear-gradient(135deg, rgba(28, 157, 109, 0.12) 0%, rgba(28, 157, 109, 0.05) 100%) !important;
    box-shadow: 0 4px 12px rgba(28, 157, 109, 0.2) !important;
    transform: translateX(5px);
}

.responsable-checkbox-item.selected::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--ambiental-primary);
    border-radius: 10px 0 0 10px;
}

.responsable-checkbox-item .form-check-input {
    width: 1.5rem;
    height: 1.5rem;
    margin-top: 0.5rem;
    cursor: pointer;
    border: 2.5px solid #dee2e6;
    flex-shrink: 0;
}

.responsable-checkbox-item .form-check-input:checked {
    border-color: var(--ambiental-primary) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M5 10l3 3l7-7'/%3e%3c/svg%3e") !important;
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 0 0 4px rgba(28, 157, 109, 0.2);
}

.responsable-checkbox-item.selected .responsable-nombre {
    color: var(--ambiental-primary) !important;
    font-weight: 600 !important;
}

.responsable-checkbox-item.selected .responsable-rol {
    color: rgba(28, 157, 109, 0.8) !important;
}

.responsable-check-icon {
    color: var(--ambiental-primary) !important;
    animation: checkPop 0.3s ease;
}

@keyframes checkPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Scrollbar personalizado para el contenedor de responsables */
#containerResponsables::-webkit-scrollbar {
    width: 8px;
}

#containerResponsables::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#containerResponsables::-webkit-scrollbar-thumb {
    background: var(--ambiental-primary);
    border-radius: 10px;
}

#containerResponsables::-webkit-scrollbar-thumb:hover {
    background: #158a5f;
}

/* Estilos para campos de formulario dinámico */
.campo-formulario-item {
    border-left: 4px solid var(--ambiental-primary);
    transition: all 0.2s ease;
    position: relative;
}

.campo-formulario-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateX(2px);
}

.campo-formulario-item.dragging {
    opacity: 0.5;
    border: 2px dashed var(--ambiental-primary);
}

.campo-formulario-item.campo-dragging {
    cursor: move;
}

.campo-header {
    transition: background-color 0.2s ease;
    padding: 0.75rem;
    margin: -0.75rem;
    border-radius: 8px;
}

.campo-header:hover {
    background-color: rgba(28, 157, 109, 0.05);
}

.campo-contenido {
    transition: all 0.3s ease;
}

.campo-btn-guardar.btn-success {
    animation: pulseSuccess 0.5s ease;
}

@keyframes pulseSuccess {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.campo-drag-handle {
    cursor: move;
    color: #6c757d;
    transition: color 0.2s ease;
}

.campo-drag-handle:hover {
    color: var(--ambiental-primary);
}

.campo-preview-container {
    border: 1px dashed #dee2e6;
    background-color: #ffffff !important;
}

.campo-preview input,
.campo-preview select,
.campo-preview textarea {
    pointer-events: none;
    opacity: 0.7;
}

/* ========== MÓDULO PROCESOS (BIBLIOTECA) ========== */

/* Cards de carpetas y documentos - Diseño compacto y llamativo */
.proceso-item {
    transition: all 0.25s ease !important;
    border: none !important;
    border-radius: 10px !important;
    overflow: hidden;
}

/* Hover fuerte solo para tarjetas de carpeta (grid) */
.proceso-item.proceso-carpeta:hover {
    transform: translateY(-5px) scale(1.02) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2) !important;
}

.proceso-item[data-tipo="carpeta"] {
    border-left: 5px solid #28a745 !important;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
}

.proceso-item[data-tipo="carpeta"]:hover {
    border-left-width: 6px !important;
}

.proceso-item[data-tipo="documento"] {
    /* Borde lateral sutil y separación entre filas */
    border-left: 3px solid rgba(0, 123, 255, 0.4) !important;
    background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%) !important;
    margin-bottom: 6px !important;
}

/* Para documentos el hover se maneja desde JS con estilos específicos,
   aquí solo evitamos el zoom vertical global */
.proceso-item.proceso-documento:hover {
    transform: none !important;
}

.proceso-item .card-body {
    padding: 0.75rem !important;
}

.proceso-item .card-footer {
    padding: 0.5rem !important;
    border-top: 1px solid rgba(0,0,0,0.05) !important;
    background: transparent !important;
}

/* Breadcrumb personalizado */
#breadcrumbNavegacion .breadcrumb-item a {
    color: var(--ambiental-primary);
    transition: color 0.2s;
}

#breadcrumbNavegacion .breadcrumb-item a:hover {
    color: var(--ambiental-primary-dark);
    text-decoration: underline;
}

/* Tabla de historial de versiones */
#contenidoHistorialVersiones .table {
    font-size: 0.9rem;
}

#contenidoHistorialVersiones .table-success {
    background-color: rgba(25, 135, 84, 0.1);
}

#contenidoHistorialVersiones .table td {
    vertical-align: middle;
}

/* Animación de carga */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.proceso-item {
    animation: fadeIn 0.3s ease-out;
}

/* Badges de estado mejorados */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Badges clicables en cumplimiento (Programadas / Completadas / Pendientes) */
#tablaCumplimiento .btn-cumplimiento {
    cursor: pointer;
    transition: opacity 0.15s;
}
#tablaCumplimiento .btn-cumplimiento:hover {
    opacity: 0.85;
}

/* Iconos grandes en cards */
.proceso-item .bi {
    transition: transform 0.2s;
}

.proceso-item:hover .bi {
    transform: scale(1.1);
}

/* Botones de acción en cards - Compactos */
.proceso-item .btn-group-sm .btn {
    padding: 0.2rem 0.4rem !important;
    font-size: 0.7rem !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
}

.proceso-item .btn-group-sm .btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.proceso-item .btn-group {
    gap: 2px !important;
}

/* Modal de historial */
#contenidoHistorialVersiones {
    max-height: 60vh;
    overflow-y: auto;
}

/* Estilos para vista vacía */
.card.shadow-sm.text-center {
    border: 2px dashed #dee2e6;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

/* Asegurar que el header no interfiera con modales */
header.bg-white.shadow-sm {
    z-index: 1020;
    position: relative;
}

/* Asegurar que los modales aparezcan por encima de todo */
.modal {
    z-index: 1060 !important;
}

.modal-backdrop {
    z-index: 1055 !important;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-backdrop.show {
    z-index: 1055 !important;
}

/* Asegurar que modales anidados tengan z-index más alto */
.modal.show {
    z-index: 1060 !important;
    display: block !important;
}

/* Asegurar que el modal-dialog esté por encima */
.modal-dialog {
    z-index: 1061 !important;
    position: relative;
    margin: 1.75rem auto;
}

/* Asegurar que el modal-content esté por encima */
.modal-content {
    z-index: 1062 !important;
    position: relative;
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Si hay múltiples modales, incrementar z-index */
.modal.show ~ .modal {
    z-index: 1070 !important;
}

.modal.show ~ .modal .modal-dialog {
    z-index: 1071 !important;
}

.modal.show ~ .modal .modal-content {
    z-index: 1072 !important;
}

/* Asegurar que dropdowns no interfieran */
.dropdown-menu {
    z-index: 1000;
}

/* Context menu debe estar por encima pero debajo de modales */
#contextMenu {
    z-index: 1050 !important;
}

/* Ocultar backdrop del offcanvas - se maneja con JavaScript */
.offcanvas-backdrop {
    display: none !important;
}

/* Ajustes para modales en responsive */
@media (max-width: 991.98px) {
    .modal-xl {
        max-width: calc(100vw - 1rem);
    }
    
    .modal-lg {
        max-width: calc(100vw - 1rem);
    }
    
    /* Hacer que el modal-body tenga scroll cuando sea necesario */
    .modal-body {
        max-height: calc(100vh - 250px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 575.98px) {
    .modal-body {
        max-height: calc(100vh - 200px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

