* { margin: 0; padding: 0; box-sizing: border-box; }

/* Estilos para badge de comentarios */
.comentarios-badge {
    min-width: 18px;
    height: 18px;
    line-height: 1.2;
    padding: 0.15em 0.4em !important;
    font-size: 0.65rem !important;
    font-weight: 600;
    border-radius: 9px;
    z-index: 10;
}

.btn.position-relative .comentarios-badge {
    top: -5px;
    right: -5px;
}

/* Prevenir TODOS los tooltips del navegador */
[role="tooltip"],
.tooltip,
[class*="tooltip"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.tab-btn[title],
.sub-tab-btn[title] {
    position: relative;
}

.tab-btn[title]::before,
.tab-btn[title]::after,
.sub-tab-btn[title]::before,
.sub-tab-btn[title]::after {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    content: "" !important;
    pointer-events: none !important;
}

/* Estilos para fecha del dashboard - Tamaño aumentado */
#dashboard-fecha {
    font-size: 1.1rem !important;
    padding: 0.5rem !important;
    font-weight: 500;
    flex: 1;
    min-width: 0;
    max-width: 100%;
}

/* Ajustar botones de fecha en la línea de filtros */
#tab-dashboard .filters-card .d-flex.gap-2 {
    flex-wrap: nowrap;
    gap: 0.5rem !important;
    align-items: stretch;
}

#tab-dashboard .filters-card .d-flex.gap-2 button {
    white-space: nowrap;
    flex-shrink: 0;
}

/* Asegurar que los filtros tengan espacio adecuado */
#tab-dashboard .filters-card .row {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

#tab-dashboard .filters-card .row > [class*="col-"] {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

/* Estilos para modal de edición de contacto - Tamaño aumentado */
#modalEditarContacto .modal-dialog {
    max-width: 90% !important;
}

#modalEditarContacto .modal-body {
    padding: 2rem;
    font-size: 1.1rem;
}

#modalEditarContacto .form-label {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #495057;
}

#modalEditarContacto .form-control,
#modalEditarContacto .form-select {
    font-size: 1.1rem;
    padding: 0.75rem 1rem;
    line-height: 1.5;
}

#modalEditarContacto .input-group-text {
    font-size: 1.1rem;
    padding: 0.75rem 1rem;
}

#modalEditarContacto .modal-header {
    padding: 1.5rem 2rem;
}

#modalEditarContacto .modal-header .modal-title {
    font-size: 1.5rem;
    font-weight: 600;
}

#modalEditarContacto .modal-footer {
    padding: 1.5rem 2rem;
}

#modalEditarContacto .modal-footer .btn {
    font-size: 1.1rem;
    padding: 0.75rem 1.5rem;
}

#modalEditarContacto .row.g-3 {
    --bs-gutter-y: 1.5rem;
    --bs-gutter-x: 1.5rem;
}

#modalEditarContacto textarea.form-control {
    font-size: 1.1rem;
    padding: 0.75rem 1rem;
}

/* Estilos para información del contacto */
.contact-info-container {
    padding: 1rem 0;
}

.contact-info-container .info-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.contact-info-container .info-item:last-child {
    border-bottom: none;
}

.contact-info-container .info-item strong {
    display: block;
    color: #495057;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.contact-info-container .info-item div {
    color: #212529;
    font-size: 1rem;
    word-wrap: break-word;
}

.contact-info-container .info-item div:empty::before {
    content: "-";
    color: #6c757d;
    font-style: italic;
}

/* Desactivar tooltips nativos del navegador completamente */
.tab-btn,
.sub-tab-btn {
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
}

.tab-btn[title],
.sub-tab-btn[title] {
    position: relative;
}

/* Prevenir cualquier tooltip */
.tab-btn:hover,
.tab-btn:focus,
.tab-btn:active,
.sub-tab-btn:hover,
.sub-tab-btn:focus,
.sub-tab-btn:active {
    text-decoration: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    color: #2c3e50;
}

/* Login */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(30, 58, 95, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: moveBackground 20s linear infinite;
    opacity: 0.5;
}

@keyframes moveBackground {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.login-card {
    background: #ffffff;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.1);
    width: 100%;
    max-width: 380px;
    position: relative;
    z-index: 1;
    animation: slideInUp 0.6s ease-out;
    backdrop-filter: blur(10px);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #1e3a5f, #007bff, #1e3a5f);
    border-radius: 20px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: borderGlow 3s ease-in-out infinite;
}

@keyframes borderGlow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}

.login-card:hover::before {
    opacity: 0.6;
}

.login-card h2 {
    color: #1e3a5f;
    text-align: center;
    font-weight: 700;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    letter-spacing: -0.5px;
    position: relative;
}

.login-card h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #1e3a5f, #007bff);
    border-radius: 2px;
    animation: expandLine 0.8s ease-out 0.3s both;
}

@keyframes expandLine {
    from {
        width: 0;
    }
    to {
        width: 60px;
    }
}

.login-card .form-label {
    color: #1e3a5f;
    font-weight: 600;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    letter-spacing: 0.3px;
}

.login-card .form-control {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    color: #1e3a5f;
    border-radius: 10px;
    padding: 0.6rem 0.9rem;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.login-card .form-control:focus {
    background: #ffffff;
    border-color: #007bff;
    color: #1e3a5f;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.15), 0 4px 12px rgba(0, 123, 255, 0.1);
    transform: translateY(-2px);
    outline: none;
}

.login-card .form-control::placeholder {
    color: #adb5bd;
}

.login-card .btn-primary {
    background: linear-gradient(135deg, #1e3a5f 0%, #007bff 100%);
    border: none;
    font-weight: 600;
    border-radius: 10px;
    padding: 0.6rem;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.login-card .btn-primary::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;
}

.login-card .btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.login-card .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 123, 255, 0.3);
}

.login-card .btn-primary:active {
    transform: translateY(0);
}

.login-card .btn-outline-secondary {
    border: 2px solid #1e3a5f;
    color: #1e3a5f;
    border-radius: 10px;
    padding: 0.6rem;
    font-weight: 600;
    font-size: 0.9rem;
    background: transparent;
    transition: all 0.3s ease;
}

.login-card .btn-outline-secondary:hover {
    background: #1e3a5f;
    border-color: #1e3a5f;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.2);
}

.login-card .text-danger {
    color: #dc3545 !important;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Header */
.dashboard-header {
    background: #1e3a5f;
    color: white;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
}

.subtitle {
    font-size: 0.8rem;
    opacity: 0.9;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    font-size: 0.9rem;
}

/* Notificaciones */
.notifications-container {
    position: relative;
}

.notification-bell {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.5rem;
    position: relative;
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-bell:hover {
    transform: scale(1.1);
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #1e3a5f;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.notifications-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 400px;
    max-height: 500px;
    display: none;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
}

.notifications-dropdown.show {
    display: flex;
}

.notifications-header {
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.notifications-header h6 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1e3a5f;
}

.btn-mark-all-read {
    background: #007bff;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-mark-all-read:hover {
    background: #0056b3;
}

.notifications-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.notification-item {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.notification-item:hover {
    background: #f8f9fa;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 0.5rem;
}

.notification-expediente {
    font-weight: 600;
    color: #1e3a5f;
    font-size: 0.95rem;
}

.notification-fuente {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.notification-tipo {
    color: #495057;
    font-size: 0.9rem;
    font-weight: 500;
}

.notification-fecha {
    color: #6c757d;
    font-size: 0.8rem;
}

.notification-observaciones {
    color: #6c757d;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    line-height: 1.4;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-empty {
    padding: 2rem;
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
}

/* Scrollbar personalizado para la lista de notificaciones */
.notifications-list::-webkit-scrollbar {
    width: 6px;
}

.notifications-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.notifications-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.notifications-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Tiles para Modo Judicial/Extrajudicial */
.form-check-tile {
    position: relative;
}

.tile-label {
    width: 100%;
    cursor: pointer;
    margin: 0;
}

.tile-option {
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-height: 80px;
    justify-content: center;
}

.tile-option i {
    font-size: 1.5rem;
    color: #6c757d;
}

.tile-option span {
    font-weight: 500;
    color: #495057;
}

.form-check-input:checked ~ .tile-label .tile-option {
    border-color: #007bff;
    background: #e7f3ff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-check-input:checked ~ .tile-label .tile-option i,
.form-check-input:checked ~ .tile-label .tile-option span {
    color: #007bff;
}

.form-check-tile .form-check-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Columna Estado en Historial de Consultas: asegurar que el switch sea visible */
#consultations-table th:nth-child(8),
#consultations-table td:nth-child(8) {
    min-width: 90px;
    white-space: nowrap;
}

/* Asegurar que solo uno esté seleccionado */
.form-check-tile:has(.form-check-input:checked) ~ .form-check-tile .form-check-input:checked {
    /* Si el otro está seleccionado, deseleccionar este */
}

/* Responsables y co-responsables tags */
.responsable-tag,
.co-responsable-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.responsable-tag .btn-close,
.co-responsable-tag .btn-close {
    font-size: 0.7rem;
    padding: 0.2rem;
}

/* Tabs */
.tabs-nav {
    background: linear-gradient(120deg, rgba(10, 16, 32, 0.9), rgba(16, 28, 54, 0.9));
    border-bottom: 1px solid rgba(0, 173, 255, 0.35);
    padding: 0.5rem 2rem;
    display: flex;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
}

.tabs-nav::before {
    content: "";
    position: absolute;
    inset: -60% -30%;
    background: radial-gradient(circle at 20% 20%, rgba(0, 221, 255, 0.12), transparent 45%),
                radial-gradient(circle at 80% 20%, rgba(0, 119, 255, 0.1), transparent 40%);
    filter: blur(18px);
    z-index: 0;
    animation: nebulaShift 18s ease-in-out infinite alternate;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(0, 173, 255, 0.25);
    padding: 0.75rem 1.3rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: #d8e9ff;
    letter-spacing: 0.4px;
    border-radius: 10px;
    transition: transform 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    position: relative;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
    overflow: hidden;
    z-index: 1;
}

.tab-btn::before {
    content: "";
    position: absolute;
    inset: 2px;
    background: linear-gradient(120deg, rgba(0, 173, 255, 0.08), rgba(0, 255, 214, 0.05));
    border-radius: 8px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tab-btn::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 6px;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #00e0ff, #7cf3ff, #00ffd5);
    box-shadow: 0 0 12px rgba(0, 224, 255, 0.7);
    transform: translateX(-50%);
    transition: width 0.25s ease;
}

.tab-btn span {
    pointer-events: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    display: inline-block;
}

.tab-btn:focus,
.tab-btn:active {
    outline: none;
    box-shadow: none;
}

.tab-btn:hover {
    color: #00e0ff;
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(0, 224, 255, 0.65);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 224, 255, 0.12);
}

.tab-btn.active {
    color: #00ffd5;
    font-weight: 700;
    background: linear-gradient(135deg, rgba(0, 224, 255, 0.15), rgba(0, 173, 255, 0.08));
    border-color: rgba(0, 224, 255, 0.85);
    box-shadow: 0 10px 30px rgba(0, 224, 255, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    animation: tabPulse 1.6s ease-in-out infinite;
}

.tab-btn:hover::before,
.tab-btn.active::before {
    opacity: 1;
}

.tab-btn:hover::after {
    width: 70%;
}

.tab-btn.active::after {
    width: 90%;
    height: 3px;
    bottom: 4px;
    box-shadow: 0 0 18px rgba(0, 255, 213, 0.8);
}

/* Main Content */
.main-content {
    padding: 1.5rem;
    max-width: 100%; /* Usar todo el ancho disponible */
    margin: 0 auto;
    width: 100%;
}

.main-tab-content {
    display: none !important;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.main-tab-content.active {
    display: block !important;
    opacity: 1;
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes tabPulse {
    0%, 100% { box-shadow: 0 10px 30px rgba(0, 224, 255, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
    50% { box-shadow: 0 15px 40px rgba(0, 255, 213, 0.32), inset 0 0 0 1px rgba(255, 255, 255, 0.14); }
}

@keyframes nebulaShift {
    0% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(-12px, -10px, 0); }
    100% { transform: translate3d(10px, 12px, 0); }
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    width: 100%;
    padding-left: 1rem;
}

/* Ajustar la barra de fecha para que se alinee mejor */
.content-header > div:first-child {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.content-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
}

/* Estilo específico para el botón de nuevo contacto */
#btn-nuevo-contacto {
    margin-left: 0;
}

/* Ajustes para el dashboard */
#tab-dashboard {
    padding-left: 2rem;
}

#tab-dashboard .sub-tabs-nav,
#tab-dashboard .filters-card,
#tab-dashboard .sub-tab-content {
    margin-left: 0;
}

/* Ajustar botón agendar */
#btn-agendar {
    margin-right: 10% !important;
}

/* Cards */
.filters-card, .table-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Agrandar barra de filtros del dashboard */
#tab-dashboard .filters-card {
    padding: 2rem;
}

#tab-dashboard .filters-card .form-label {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

#tab-dashboard .filters-card .form-select {
    font-size: 1rem;
    padding: 0.5rem 0.75rem;
    height: auto;
}

/* Table */
.table {
    margin-bottom: 0;
}

.table thead th {
    border-bottom: 2px solid #e9ecef;
    font-weight: 600;
    color: #495057;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table thead th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 25px;
}

.table thead th.sortable:hover {
    background-color: #f8f9fa;
}

.table thead th.sortable i {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85em;
    color: #6c757d;
    opacity: 0.6;
}

.table thead th.sortable:hover i {
    opacity: 1;
    color: #495057;
}

/* Fecha y Tipo en una sola línea */
.table tbody td:nth-child(2),
.table tbody td:nth-child(6) {
    white-space: nowrap;
}

.table tbody td:nth-child(2) {
    min-width: 140px;
}

.table tbody td:nth-child(6) {
    min-width: 120px;
}

.table tbody tr {
    transition: background 0.2s;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

/* Badges */
.badge-consulta {
    background: #d1f7d6;
    color: #198754;
    padding: 0.35rem 0.65rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-caso {
    background: #cff4fc;
    color: #036781;
    padding: 0.35rem 0.65rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-cliente-amplia {
    background: #fff3cd;
    color: #856404;
    padding: 0.35rem 0.65rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Buttons */
.btn {
    border-radius: 6px;
    font-weight: 500;
    padding: 0.45rem 0.9rem;
    font-size: 0.875rem;
}

.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
}

.card-title {
    font-size: 1rem;
}

h5 {
    font-size: 1rem;
}

h4 {
    font-size: 1.1rem;
}

h3 {
    font-size: 1.25rem;
}

.btn-success {
    background: #28a745;
    border-color: #28a745;
}

.btn-outline-primary {
    border-color: #1e3a5f;
    color: #1e3a5f;
}

.btn-outline-primary:hover {
    background: #1e3a5f;
    border-color: #1e3a5f;
}

/* Pagination */
.pagination .page-link {
    color: #1e3a5f;
    border-color: #dee2e6;
}

.pagination .page-item.active .page-link {
    background: #1e3a5f;
    border-color: #1e3a5f;
    color: #ffffff !important;
}

/* Sub-tabs */
.sub-tabs-nav {
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    padding: 0.5rem 2rem;
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-radius: 8px 8px 0 0;
}

.sub-tab-btn {
    background: none;
    border: none;
    padding: 0.85rem 1.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: #6c757d;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    position: relative;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
    font-weight: 500;
}

.sub-tab-btn span {
    pointer-events: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    display: inline-block;
}

.sub-tab-btn[aria-label=""] {
    position: relative;
}

.sub-tab-btn[aria-label=""]::before,
.sub-tab-btn[aria-label=""]::after {
    display: none !important;
    content: "" !important;
}

.sub-tab-btn::after,
.sub-tab-btn::before {
    display: none !important;
    content: none !important;
}

.sub-tab-btn:focus,
.sub-tab-btn:active {
    outline: none;
    box-shadow: none;
}

.sub-tab-btn:hover {
    color: #1e3a5f;
    background: white;
}

.sub-tab-btn.active {
    color: #1e3a5f;
    border-bottom-color: #1e3a5f;
    border-bottom-width: 3px;
    font-weight: 600;
    background-color: rgba(30, 58, 95, 0.05);
}

.sub-tab-content {
    display: none !important;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.sub-tab-content.active {
    display: block !important;
    opacity: 1;
    animation: fadeIn 0.2s ease-in-out;
}

/* Integrations Grid */
.integrations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.integration-card {
    background: white;
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
}

.integration-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e9ecef;
}

.integration-header h5 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #2c3e50;
}

.integration-body {
    min-height: 200px;
}

.integration-logo {
    text-align: center;
}

.logo-placeholder {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.integration-form .form-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.integration-form .form-control {
    font-size: 0.9rem;
}

.integration-form small {
    font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .tabs-nav {
        padding: 0 1rem;
        overflow-x: auto;
    }
    
    .sub-tabs-nav {
        padding: 0.5rem 1rem;
        overflow-x: auto;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .integrations-grid {
        grid-template-columns: 1fr;
    }
}

/* Estilos para búsqueda de clientes en expedientes */
#cliente-search-results {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

#cliente-search-results .list-group-item {
    border: none;
    border-bottom: 1px solid #dee2e6;
    cursor: pointer;
    padding: 0.75rem 1rem;
}

#cliente-search-results .list-group-item:last-child {
    border-bottom: none;
}

#cliente-search-results .list-group-item:hover {
    background-color: #f8f9fa;
}

#cliente-search-results .list-group-item:active {
    background-color: #e9ecef;
}

/* Estilos para Agenda/Dashboard */
.agenda-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.agenda-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem;
    transition: box-shadow 0.2s;
}

.agenda-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.agenda-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.75rem;
}

.agenda-item-title {
    font-weight: 600;
    font-size: 1rem;
    color: #212529;
    flex: 1;
    margin-right: 1rem;
}

.agenda-item-expediente {
    font-size: 0.85rem;
    color: #6c757d;
    font-family: monospace;
}

.agenda-item-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}.agenda-item-body {
    color: #495057;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.agenda-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.agenda-item-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.agenda-item-responsable {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.agenda-item-vencimiento {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #dc3545;
    font-weight: 500;
}

.agenda-item-vencimiento.vencido {
    color: #dc3545;
}

.agenda-item-vencimiento.proximo {
    color: #ffc107;
}

.agenda-item-acciones {
    display: flex;
    gap: 0.5rem;
}

.agenda-item-acciones button {
    background: none;
    border: none;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    color: #6c757d;
    transition: color 0.2s;
}

.agenda-item-acciones button:hover {
    color: #212529;
}

.badge-importante {
    background-color: #0d6efd;
    color: white;
}

.badge-judicial {
    background-color: #6f42c1;
    color: white;
}

.badge-pendiente {
    background-color: #dc3545;
    color: white;
}

.badge-hecho {
    background-color: #6c757d;
    color: white;
}
/* ============================================
   REDUCCIÓN GENERAL DEL 40% (Multiplicar por 0.6)
   ============================================ */

/* Tamaño de fuente base - usar 78% del tamaño normal (agrandado 30% desde 60%) */
html {
    font-size: 78%;
}

/* Reducir header - agrandado 30% más */
.dashboard-header {
    padding: 0.702rem 1.404rem; /* Agrandado 30% desde 0.54rem 1.08rem */
}

.logo {
    font-size: 1.3104rem; /* Agrandado 30% desde 1.008rem (1.008 * 1.3) */
}

.subtitle {
    font-size: 0.7488rem; /* Agrandado 30% desde 0.576rem (0.576 * 1.3) */
}

.user-info {
    font-size: 0.8424rem; /* Agrandado 30% desde 0.648rem (0.648 * 1.3) */
}

/* Reducir tabs - agrandado 30% más */
.tabs-nav {
    padding: 0.468rem 1.872rem; /* Agrandado 30% desde 0.36rem 1.44rem */
    gap: 0.702rem; /* Agrandado 30% desde 0.54rem (0.54 * 1.3) */
}

.tab-btn {
    padding: 0.702rem 1.2168rem; /* Agrandado 30% desde 0.54rem 0.936rem */
    font-size: 0.7956rem; /* Agrandado 30% desde 0.612rem (0.612 * 1.3) */
}

/* Reducir contenido principal - agrandado 30% más */
.main-content {
    padding: 0.936rem; /* Agrandado 30% desde 0.72rem (0.72 * 1.3) */
    max-width: 100%; /* Usar todo el ancho */
    width: 100%;
}

.content-header {
    margin-bottom: 0.9rem;
}

.content-header h2 {
    font-size: 1.404rem; /* Agrandado 30% desde 1.08rem (1.08 * 1.3) */
}

/* Reducir cards - agrandado 30% más */
.filters-card, .table-card {
    padding: 0.936rem; /* Agrandado 30% desde 0.72rem (0.72 * 1.3) */
    margin-bottom: 0.936rem; /* Agrandado 30% desde 0.72rem */
}

/* Tabla responsive - usar todo el ancho */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    table-layout: auto; /* Permitir que las columnas se ajusten automáticamente al contenido */
}

/* Asegurar que las filas no hagan wrap */
.table tbody tr {
    white-space: nowrap;
}

.table tbody tr td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Ajustar ancho de columnas según el contenido - solo mínimos razonables */
.table thead th:nth-child(1),
.table tbody td:nth-child(1) { /* N° */
    width: 1%; /* Ancho mínimo, se ajusta al contenido */
    min-width: 45px; /* Agrandado 30% desde 35px */
    text-align: center;
}

.table thead th:nth-child(2),
.table tbody td:nth-child(2) { /* NÚMERO */
    width: auto; /* Se ajusta al contenido */
    min-width: 156px; /* Agrandado 30% desde 120px */
}

.table thead th:nth-child(3),
.table tbody td:nth-child(3) { /* CARÁTULA */
    width: auto; /* Se ajusta al contenido, puede expandirse */
    min-width: 195px; /* Agrandado 30% desde 150px */
}

.table thead th:nth-child(4),
.table tbody td:nth-child(4) { /* TRIBUNAL/JUZGADO */
    width: auto; /* Se ajusta al contenido */
    min-width: 195px; /* Agrandado 30% desde 150px */
}

.table thead th:nth-child(5),
.table tbody td:nth-child(5) { /* CARPETA */
    width: 1%; /* Ancho mínimo */
    min-width: 78px; /* Agrandado 30% desde 60px */
    text-align: center;
}

.table thead th:nth-child(6),
.table thead th:nth-child(7),
.table thead th:nth-child(8),
.table tbody td:nth-child(6),
.table tbody td:nth-child(7),
.table tbody td:nth-child(8) { /* Fechas */
    width: auto; /* Se ajusta al contenido */
    min-width: 117px; /* Agrandado 30% desde 90px */
}

.table thead th:nth-child(9),
.table tbody td:nth-child(9) { /* ESTADO */
    width: 1%; /* Ancho mínimo */
    min-width: 91px; /* Agrandado 30% desde 70px */
    text-align: center;
}

.table thead th:nth-child(10),
.table tbody td:nth-child(10) { /* PROVIENE */
    width: 1%; /* Ancho mínimo */
    min-width: 91px; /* Agrandado 30% desde 70px */
    text-align: center;
}

.table thead th:nth-child(11),
.table tbody td:nth-child(11) { /* DAMNIFICADO */
    width: auto; /* Se ajusta al contenido */
    min-width: 156px; /* Agrandado 30% desde 120px */
}

.table thead th:nth-child(12),
.table tbody td:nth-child(12) { /* ACCIONES */
    width: 1%; /* Ancho mínimo */
    min-width: 130px; /* Agrandado 30% desde 100px */
    text-align: center;
}

/* Reducir tabla - agrandado 30% más */
.table thead th {
    font-size: 0.702rem; /* Agrandado 30% desde 0.54rem (0.54 * 1.3) */
    padding: 0.39rem 0.78rem; /* Agrandado 30% desde 0.3rem 0.6rem */
    white-space: nowrap; /* Sin wrap */
}

.table tbody td {
    padding: 0.39rem 0.78rem; /* Agrandado 30% desde 0.3rem 0.6rem */
    font-size: 0.702rem; /* Agrandado 30% desde 0.54rem */
    white-space: nowrap; /* Sin wrap - cada fila en un solo renglón */
    overflow: hidden;
    text-overflow: ellipsis;
    /* Sin max-width para permitir que use más espacio */
}

/* Permitir que la celda de carátula se expanda cuando se muestra el texto completo */
.table tbody td:nth-child(3) {
    position: relative;
}

.table tbody td:nth-child(3).expanded {
    white-space: normal !important;
    word-wrap: break-word;
    max-width: none;
}

.table thead th.sortable {
    padding-right: 15px;
}

.table thead th.sortable i {
    right: 4.8px;
    font-size: 0.51em;
}

/* Reducir botones - agrandado 30% más */
.btn {
    padding: 0.4212rem 0.8424rem; /* Agrandado 30% desde 0.324rem 0.648rem */
    font-size: 0.819rem; /* Agrandado 30% desde 0.63rem (0.63 * 1.3) */
    border-radius: 5.616px; /* Agrandado 30% desde 4.32px */
}

.btn-sm {
    padding: 0.3276rem 0.6552rem; /* Agrandado 30% desde 0.252rem 0.504rem */
    font-size: 0.7488rem; /* Agrandado 30% desde 0.576rem (0.576 * 1.3) */
}

/* Reducir badges - agrandado 30% más */
.badge {
    padding: 0.3276rem 0.6084rem; /* Agrandado 30% desde 0.252rem 0.468rem */
    font-size: 0.7488rem; /* Agrandado 30% desde 0.576rem (0.576 * 1.3) */
}

.badge-consulta,
.badge-caso,
.badge-cliente-amplia {
    padding: 0.3276rem 0.6084rem; /* Agrandado 30% desde 0.252rem 0.468rem */
    font-size: 0.7488rem; /* Agrandado 30% desde 0.576rem */
}

/* Reducir títulos */
h3 {
    font-size: 0.75rem;
}

h4 {
    font-size: 0.66rem;
}

h5 {
    font-size: 0.6rem;
}

.card-title {
    font-size: 0.6rem;
}

/* Sub-tabs más grandes */
.sub-tabs-nav {
    padding: 0.6rem 1.5rem;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
}

.sub-tab-btn {
    padding: 0.85rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
}

/* Reducir formularios */
.form-control {
    padding: 0.36rem 0.54rem;
    font-size: 0.525rem;
}

.form-label {
    font-size: 0.51rem;
    margin-bottom: 0.24rem;
}

.form-select {
    padding: 0.36rem 0.54rem;
    font-size: 0.525rem;
}

/* Reducir paginación */
.pagination {
    font-size: 0.51rem;
}

.pagination .page-link {
    padding: 0.3rem 0.6rem;
}

/* Reducir modales */
/* Prevenir scroll del body cuando el modal está abierto */
body.modal-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
}

/* Asegurar que el modal fullscreen ocupe el 90% de la pantalla */
.modal-fullscreen {
    width: 90vw !important;
    max-width: 90vw !important;
    height: 90vh !important;
    max-height: 90vh !important;
    margin: 5vh auto !important;
    padding: 0 !important;
}

.modal-fullscreen .modal-content {
    height: 90vh !important;
    max-height: 90vh !important;
    border: 0 !important;
    border-radius: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}

.modal-fullscreen .modal-body {
    flex: 1 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    min-height: 600px !important;
    height: auto !important;
}

/* Asegurar que los paneles de tabs sean visibles cuando están activos */
#panel-movimientos.show.active,
#panel-comentarios.show.active,
#panel-formularios.show.active,
#panel-adjuntos.show.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
}

/* Asegurar que el modal-body tenga altura */
/* Mejorar el manejo del contenido en el modal */
#modalDetalleExpedienteCompleto .container-fluid {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Asegurar que las celdas de la tabla manejen bien el texto largo */
#panel-movimientos table td {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    max-width: 100%;
}

#panel-movimientos table th {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

/* Mejorar el panel izquierdo */
#modalDetalleExpedienteCompleto .col-lg-4 {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

#modalDetalleExpedienteCompleto .col-lg-4 p,
#modalDetalleExpedienteCompleto .col-lg-4 label {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

/* Asegurar que el panel de movimientos sea visible */
#panel-movimientos {
    display: block !important;
    position: relative !important;
}

#panel-movimientos.show {
    display: block !important;
    visibility: visible !important;
    position: relative !important;
}

/* Asegurar que el panel derecho sea visible */
#modalDetalleExpedienteCompleto .col-lg-8 {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Asegurar que el tab-content sea visible */
#detalle-expediente-tab-content {
    display: block !important;
    visibility: visible !important;
}

/* Mejorar el tamaño del modal */
#modalDetalleExpedienteCompleto .modal-dialog {
    max-width: 95vw;
    width: 95vw;
    margin: 0.5rem auto;
    max-height: calc(100vh - 1rem);
    display: flex !important;
    flex-direction: column !important;
    height: calc(100vh - 1rem) !important;
}

#modalDetalleExpedienteCompleto .modal-content {
    max-height: calc(100vh - 1rem) !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    border-radius: 0.5rem;
}

#modalDetalleExpedienteCompleto .modal-body {
    overflow-y: auto !important;
    overflow-x: visible !important; /* Cambiar de hidden a visible */
    flex: 1 1 auto !important;
    min-height: 0 !important;
    padding: 1.5rem;
    padding-bottom: 0.5rem;
    /* Asegurar que el body tenga suficiente altura */
    max-height: calc(100vh - 200px) !important;
    position: relative !important; /* Asegurar posicionamiento relativo */
}

#modalDetalleExpedienteCompleto .modal-header {
    flex-shrink: 0 !important;
    border-bottom: 1px solid rgba(0,0,0,0.125);
    min-height: 60px;
}

#modalDetalleExpedienteCompleto .modal-footer {
    flex-shrink: 0 !important;
    border-top: 1px solid rgba(0,0,0,0.125);
    background-color: #f8f9fa !important;
    padding: 1rem !important;
    position: relative !important;
    z-index: 10 !important;
    min-height: 70px !important;
    /* Asegurar que el footer siempre sea visible */
    margin-top: auto !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Asegurar que el contenido interno del modal no se corte */
#modalDetalleExpedienteCompleto .container-fluid {
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#modalDetalleExpedienteCompleto .container-fluid > .row {
    flex: 1 1 auto;
    min-height: 0;
    align-items: flex-start;
    overflow: visible !important; /* Cambiar de hidden a visible */
}

#modalDetalleExpedienteCompleto .col-lg-4 {
    overflow-y: auto;
    overflow-x: visible !important; /* Cambiar de hidden a visible */
    padding-right: 1rem;
    max-height: calc(100vh - 250px) !important; /* Limitar altura para scroll */
}

#modalDetalleExpedienteCompleto .col-lg-8 {
    overflow-y: visible !important; /* Cambiar de auto a visible para permitir que el contenido sea visible */
    overflow-x: visible !important; /* Cambiar de hidden a visible */
    padding-left: 1rem;
    min-height: 400px !important;
    max-height: none !important; /* Permitir que crezca según el contenido */
}

/* Asegurar que el panel de movimientos sea completamente visible */
#panel-movimientos {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    min-height: 500px !important; /* Aumentar altura mínima */
    height: auto !important;
    overflow: visible !important;
    z-index: 1000 !important; /* Asegurar z-index alto */
    background-color: white !important; /* Asegurar fondo blanco */
}

#panel-movimientos.show.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    min-height: 500px !important; /* Aumentar altura mínima */
    height: auto !important;
    overflow: visible !important;
    z-index: 1000 !important; /* Asegurar z-index alto */
    background-color: white !important; /* Asegurar fondo blanco */
}

/* Asegurar que la tabla de movimientos sea visible */
#panel-movimientos .table-responsive {
    display: block !important;
    visibility: visible !important;
}

#panel-movimientos table {
    display: table !important;
    visibility: visible !important;
    width: 100% !important;
}

#panel-movimientos tbody {
    display: table-row-group !important;
    visibility: visible !important;
}

#panel-movimientos tbody tr {
    display: table-row !important;
    visibility: visible !important;
}

/* Asegurar que el panel tenga altura mínima */
#panel-movimientos {
    min-height: 300px !important;
}

#panel-movimientos .table-responsive {
    min-height: 200px !important;
}

/* Asegurar que las filas tengan contenido visible */
#panel-movimientos tbody td {
    padding: 0.5rem !important;
    border: 1px solid #dee2e6 !important;
    display: table-cell !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    min-height: 30px !important;
    line-height: 1.5 !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    max-width: 100% !important;
}

/* Asegurar que los botones sean visibles */
#btn-actualizar-movimientos-detalle,
#btn-nuevo-movimiento-detalle {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 1000 !important;
    position: relative !important;
    min-width: 120px !important;
    min-height: 32px !important;
}

/* Asegurar que el contenedor de botones sea visible */
#botones-movimientos-container {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    gap: 0.5rem !important;
    align-items: center !important;
    overflow: visible !important;
    position: relative !important;
    z-index: 101 !important;
}

/* Asegurar que el contenedor padre de los botones no oculte nada */
#panel-movimientos .d-flex.justify-content-between {
    overflow: visible !important;
    position: relative !important;
    z-index: 100 !important;
    background-color: white !important;
}

/* Asegurar que el panel de movimientos no oculte contenido */
#panel-movimientos {
    overflow: visible !important;
    position: relative !important;
}

/* Forzar visibilidad de los botones en el footer - REGLAS MÁS AGRESIVAS */
#btn-actualizar-movimientos-detalle,
#btn-nuevo-movimiento-detalle {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    min-width: 120px !important;
    min-height: 32px !important;
    pointer-events: auto !important;
    height: auto !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0.25rem 0.5rem !important;
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
    border: 1px solid transparent !important;
    border-radius: 0.25rem !important;
}

/* Forzar que el botón Nuevo Movimiento SIEMPRE sea visible */
#btn-nuevo-movimiento-detalle {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* El botón Actualizar se muestra solo para PJN via JS, pero asegurar que sea visible cuando se muestre */
#btn-actualizar-movimientos-detalle:not(.d-none) {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Asegurar que el contenedor de botones en el footer sea visible */
#botones-movimientos-footer {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    gap: 0.5rem !important;
    align-items: center !important;
    overflow: visible !important;
    position: relative !important;
    width: auto !important;
    height: auto !important;
}

/* Asegurar que el modal-footer muestre los botones correctamente */
#modalDetalleExpedienteCompleto .modal-footer {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
    /* Forzar visibilidad del footer */
    position: sticky !important;
    bottom: 0 !important;
    width: 100% !important;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1) !important;
}

/* Asegurar que los botones del footer sean visibles */
#modalDetalleExpedienteCompleto .modal-footer button {
    visibility: visible !important;
    opacity: 1 !important;
    display: inline-block !important;
}

/* Asegurar que el contenedor de botones sea visible */
#modalDetalleExpedienteCompleto #botones-movimientos-footer {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Asegurar que las filas de la tabla sean visibles */
#panel-movimientos tbody tr {
    display: table-row !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    min-height: 30px !important;
}

/* Asegurar que el tbody sea visible */
#detalle-movimientos-body {
    display: table-row-group !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 1003 !important;
}

/* Asegurar que el contador sea visible */
#movimientos-total-count {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 2000 !important;
    font-size: 1rem !important;
    padding: 0.6rem 1rem !important;
    font-weight: bold !important;
    background-color: #0d6efd !important;
    color: white !important;
}

/* Asegurar que el modal tenga z-index correcto */
#modalDetalleExpedienteCompleto {
    z-index: 1055 !important;
}

#modalDetalleExpedienteCompleto.modal.show {
    z-index: 1055 !important;
    display: block !important;
}

/* Asegurar que el panel de movimientos tenga z-index alto */
#panel-movimientos {
    position: relative !important;
    z-index: 1000 !important;
}

#panel-movimientos.show.active {
    position: relative !important;
    z-index: 1000 !important;
}

/* ===== Modal Detalle Expediente (PJN/MEV/SRT) - Estilo moderno y colorido ===== */
#modalDetalleExpedienteCompleto .modal-content.modal-exp-content {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 24px 64px rgba(0,0,0,0.18), 0 0 1px rgba(0,0,0,0.08);
    overflow: hidden;
}

#modalDetalleExpedienteCompleto .modal-header.modal-exp-header {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 50%, #084298 100%);
    color: #fff;
    border-bottom: none;
    padding: 1rem 1.5rem;
    min-height: 60px;
}

#modalDetalleExpedienteCompleto .modal-header.modal-exp-header .modal-title {
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#modalDetalleExpedienteCompleto .modal-body.modal-exp-body {
    background: linear-gradient(180deg, #f0f4ff 0%, #f8fafc 100%);
}

/* Número de expediente destacado */
#modalDetalleExpedienteCompleto .modal-exp-numero-badge {
    display: inline-block;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0d6efd;
    background: linear-gradient(135deg, rgba(13,110,253,0.12) 0%, rgba(13,110,253,0.06) 100%);
    padding: 0.6rem 1.2rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(13,110,253,0.25);
    letter-spacing: 0.02em;
}

/* Panel izquierdo: cards con acentos de color */
#modalDetalleExpedienteCompleto .modal-exp-panel-left {
    border-right: 1px solid #e2e8f0 !important;
}

#modalDetalleExpedienteCompleto .modal-exp-card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
    transition: box-shadow 0.2s;
}

#modalDetalleExpedienteCompleto .modal-exp-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

#modalDetalleExpedienteCompleto .modal-exp-card-header {
    font-weight: 600;
    font-size: 1rem;
    padding: 0.65rem 1rem;
    border-bottom: none;
}

#modalDetalleExpedienteCompleto .modal-exp-card-info .modal-exp-card-header {
    background: linear-gradient(135deg, #0dcaf0 0%, #0aa2c0 100%);
    color: #fff;
}

#modalDetalleExpedienteCompleto .modal-exp-card-person .modal-exp-card-header {
    background: linear-gradient(135deg, #198754 0%, #146c43 100%);
    color: #fff;
}

#modalDetalleExpedienteCompleto .modal-exp-card-calendar .modal-exp-card-header {
    background: linear-gradient(135deg, #fd7e14 0%, #e8590c 100%);
    color: #fff;
}

#modalDetalleExpedienteCompleto .modal-exp-card-link .modal-exp-card-header {
    background: linear-gradient(135deg, #6f42c1 0%, #5a32a3 100%);
    color: #fff;
}

#modalDetalleExpedienteCompleto .modal-exp-card-chat .modal-exp-card-header {
    background: linear-gradient(135deg, #20c997 0%, #1aa179 100%);
    color: #fff;
}

#modalDetalleExpedienteCompleto .modal-exp-card .card-body {
    background: #fff;
    padding: 1rem 1.1rem;
}

#modalDetalleExpedienteCompleto .modal-exp-label {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    display: block;
    margin-bottom: 0.2rem;
}

#modalDetalleExpedienteCompleto .modal-exp-value {
    font-size: 1.05rem;
    color: #1e293b;
    line-height: 1.4;
    word-break: break-word;
}

#modalDetalleExpedienteCompleto .modal-exp-select {
    border-radius: 0.5rem;
    border: 1px solid #cbd5e1;
    font-size: 1.05rem;
    max-width: 20rem;
    min-height: 2.5rem;
    padding: 0.5rem 0.75rem;
}

#modalDetalleExpedienteCompleto .modal-exp-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13,110,253,0.2);
}

#modalDetalleExpedienteCompleto #detalle-tipo {
    max-height: 5rem;
    overflow-y: auto;
    padding-right: 0.25rem;
}

/* Tabs derecho: estilo píldora moderno */
#modalDetalleExpedienteCompleto .nav-tabs-exp {
    border-bottom: 2px solid #e2e8f0;
    gap: 0.35rem;
}

#modalDetalleExpedienteCompleto .nav-tabs-exp .nav-link {
    color: #64748b;
    border: none;
    border-radius: 0.5rem;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s, background 0.2s;
}

#modalDetalleExpedienteCompleto .nav-tabs-exp .nav-link:hover {
    color: #0d6efd;
    background: rgba(13,110,253,0.08);
}

#modalDetalleExpedienteCompleto .nav-tabs-exp .nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    border: none;
}

#modalDetalleExpedienteCompleto .nav-tabs-exp .nav-link i {
    margin-right: 0.35rem;
    opacity: 0.95;
}

#modalDetalleExpedienteCompleto .modal-exp-tab-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
}

#modalDetalleExpedienteCompleto .modal-exp-badge-count {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem !important;
}

/* Tabla de movimientos */
#modalDetalleExpedienteCompleto .modal-exp-table-wrap {
    background: #fff !important;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

#modalDetalleExpedienteCompleto .modal-body .form-control,
#modalDetalleExpedienteCompleto .modal-body .form-select,
#modalDetalleExpedienteCompleto .modal-body .form-label {
    font-size: 1rem !important;
    min-height: 2.25rem;
    padding: 0.5rem 0.75rem;
}
#modalDetalleExpedienteCompleto .modal-body .form-control::placeholder {
    font-size: 1rem;
}

#modalDetalleExpedienteCompleto .modal-exp-thead {
    background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%) !important;
    color: #475569;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

#modalDetalleExpedienteCompleto .modal-exp-thead th {
    font-size: 0.95rem !important;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid #cbd5e1;
}

#modalDetalleExpedienteCompleto .modal-exp-table tbody tr:hover {
    background: rgba(13,110,253,0.04);
}

#modalDetalleExpedienteCompleto .modal-exp-table td {
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    vertical-align: middle;
}

/* Footer y botones */
#modalDetalleExpedienteCompleto .modal-footer.modal-exp-footer {
    background: #fff !important;
    border-top: 1px solid #e2e8f0 !important;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06) !important;
    padding: 1rem 1.5rem !important;
}

#modalDetalleExpedienteCompleto .modal-exp-btn {
    border-radius: 0.5rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    transition: transform 0.15s, box-shadow 0.15s;
}

#modalDetalleExpedienteCompleto .modal-exp-btn-actualizar {
    background: linear-gradient(135deg, #198754 0%, #146c43 100%);
    border: none;
    color: #fff;
}

#modalDetalleExpedienteCompleto .modal-exp-btn-actualizar:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(25,135,84,0.4);
}

#modalDetalleExpedienteCompleto .modal-exp-btn-nuevo {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    border: none;
    color: #fff;
}

#modalDetalleExpedienteCompleto .modal-exp-btn-nuevo:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13,110,253,0.4);
}

#modalDetalleExpedienteCompleto .modal-exp-btn-editar {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    border: none;
    color: #fff;
}

#modalDetalleExpedienteCompleto .modal-exp-btn-editar:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13,110,253,0.4);
}

#modalDetalleExpedienteCompleto .modal-exp-btn-cerrar {
    background: #fff;
    border: 2px solid #cbd5e1;
    color: #475569;
}

#modalDetalleExpedienteCompleto .modal-exp-btn-cerrar:hover {
    border-color: #0d6efd;
    color: #0d6efd;
    background: rgba(13,110,253,0.06);
}

/* Asegurar que el contenedor de tabla tenga z-index y sea visible */
#panel-movimientos .table-responsive,
#panel-movimientos #movimientos-table-container {
    position: relative !important;
    z-index: 1001 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    max-height: 60vh !important; /* Aumentar altura máxima */
    min-height: 500px !important; /* Aumentar altura mínima */
    overflow-y: auto !important;
    overflow-x: visible !important;
    background-color: white !important;
    border: 2px solid #dee2e6 !important; /* Añadir borde para debug */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important; /* Añadir sombra para visibilidad */
}

/* Asegurar que la tabla tenga z-index */
#panel-movimientos table {
    position: relative !important;
    z-index: 1002 !important;
}

.modal-header {
    padding: 0.6rem 0.9rem;
}

.modal-title {
    font-size: 0.9rem;
}

.modal-body {
    padding: 0.9rem;
}

.modal-footer {
    padding: 0.6rem 0.9rem;
}

/* Reducir listas */
.list-group-item {
    padding: 0.45rem 0.6rem;
    font-size: 0.51rem;
}

/* Reducir inputs de búsqueda */
#expedientes-search,
#cliente-search-results input {
    font-size: 0.51rem;
    padding: 0.36rem 0.54rem;
}

/* Reducir dropdowns */
.dropdown-menu {
    font-size: 0.51rem;
    padding: 0.3rem 0;
}

.dropdown-item {
    padding: 0.3rem 0.9rem;
    font-size: 0.51rem;
}

/* ============================================
   ESTILOS ESPECÍFICOS PARA TABLA DE EXPEDIENTES UNIFICADOS
   Sin scroll horizontal
   ============================================ */

/* Tabla de expedientes unificados - layout fijo sin scroll horizontal */
#expedientes-unified-table {
    table-layout: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    font-size: 0.75rem !important;
}

#expedientes-unified-table th {
    font-size: 0.7rem !important;
    padding: 0.4rem 0.3rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    word-break: break-word !important;
}

#expedientes-unified-table td {
    font-size: 0.75rem !important;
    padding: 0.4rem 0.3rem !important;
    vertical-align: middle !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    word-wrap: break-word !important;
    white-space: normal !important;
}

/* Badge de estado en columna ESTADO - colores por estado */
.expediente-estado-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}
.expediente-estado-nuevo-caso { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }
.expediente-estado-inicio { background: #e8f5e9; color: #2e7d32; border: 1px solid #81c784; }
.expediente-estado-en-tramite { background: #fff3e0; color: #e65100; border: 1px solid #ffb74d; }
.expediente-estado-en-prueba { background: #fce4ec; color: #c2185b; border: 1px solid #f48fb1; }
.expediente-estado-con-sentencia { background: #e8eaf6; color: #3949ab; border: 1px solid #9fa8da; }
.expediente-estado-conciliado { background: #e0f2f1; color: #00695c; border: 1px solid #80cbc4; }
.expediente-estado-archivado { background: #eceff1; color: #546e7a; border: 1px solid #b0bec5; }
.expediente-estado-activo { background: #e8f5e9; color: #1b5e20; border: 1px solid #66bb6a; }
.expediente-estado-n-a,
.expediente-estado-default { background: #f5f5f5; color: #616161; border: 1px solid #e0e0e0; }

/* Estilo para filas clickeables en la tabla de expedientes */
#expedientes-unified-table tbody tr {
    transition: background-color 0.2s ease;
}

#expedientes-unified-table tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.1) !important;
}

#expedientes-unified-table tbody tr:active {
    background-color: rgba(0, 123, 255, 0.2) !important;
}

/* Anchos flexibles para cada columna - usar min-width y max-width en lugar de width fijo */
#expedientes-unified-table th:nth-child(1),
#expedientes-unified-table td:nth-child(1) {
    min-width: 30px !important;
    width: auto !important;
    max-width: 50px !important;
    text-align: center !important;
}

#expedientes-unified-table th:nth-child(2),
#expedientes-unified-table td:nth-child(2) {
    min-width: 100px !important;
    width: auto !important;
    max-width: 12% !important;
    white-space: normal !important;
    word-break: break-word !important;
}

#expedientes-unified-table th:nth-child(3),
#expedientes-unified-table td:nth-child(3) {
    min-width: 120px !important;
    width: auto !important;
    max-width: 20% !important;
    white-space: normal !important;
}

#expedientes-unified-table th:nth-child(4),
#expedientes-unified-table td:nth-child(4) {
    min-width: 100px !important;
    width: auto !important;
    max-width: 15% !important;
}

#expedientes-unified-table th:nth-child(5),
#expedientes-unified-table td:nth-child(5) {
    min-width: 50px !important;
    width: auto !important;
    max-width: 60px !important;
    text-align: center !important;
}

#expedientes-unified-table th:nth-child(6),
#expedientes-unified-table th:nth-child(7),
#expedientes-unified-table th:nth-child(8),
#expedientes-unified-table td:nth-child(6),
#expedientes-unified-table td:nth-child(7),
#expedientes-unified-table td:nth-child(8) {
    min-width: 80px !important;
    width: auto !important;
    max-width: 90px !important;
    white-space: nowrap !important;
    text-align: center !important;
}

#expedientes-unified-table th:nth-child(9),
#expedientes-unified-table th:nth-child(10),
#expedientes-unified-table td:nth-child(9),
#expedientes-unified-table td:nth-child(10) {
    min-width: 60px !important;
    width: auto !important;
    max-width: 80px !important;
    text-align: center !important;
}

#expedientes-unified-table th:nth-child(11),
#expedientes-unified-table td:nth-child(11) {
    min-width: 80px !important;
    width: auto !important;
    max-width: 12% !important;
}

#expedientes-unified-table th:nth-child(12),
#expedientes-unified-table td:nth-child(12) {
    min-width: 80px !important;
    width: auto !important;
    max-width: 12% !important;
}

#expedientes-unified-table th:nth-child(13),
#expedientes-unified-table td:nth-child(13) {
    min-width: 90px !important;
    width: auto !important;
    max-width: 100px !important;
    text-align: center !important;
}

/* Asegurar que table-responsive no tenga scroll horizontal */
.table-card .table-responsive {
    overflow-x: hidden !important;
    max-width: 100% !important;
}

/* Badges más pequeños en la tabla */
#expedientes-unified-table .badge {
    font-size: 0.65rem !important;
    padding: 0.2rem 0.35rem !important;
    white-space: nowrap !important;
}

/* Botones de acciones más pequeños */
#expedientes-unified-table .btn-group .btn {
    padding: 0.15rem 0.3rem !important;
    font-size: 0.7rem !important;
}

#expedientes-unified-table .btn-group .btn i {
    font-size: 0.75rem !important;
}

/* Estilos para colores de sistemas y abogados en la tabla de expedientes */
#expedientes-unified-table td:nth-child(10) {
    /* Columna PROVIENE - Sistema */
    text-align: center !important;
    vertical-align: middle !important;
    transition: all 0.2s ease;
}

#expedientes-unified-table td:nth-child(11) {
    /* Columna ABOGADO */
    text-align: center !important;
    vertical-align: middle !important;
    transition: all 0.2s ease;
}

/* Hover effect para las celdas con colores */
#expedientes-unified-table tr:hover td:nth-child(10),
#expedientes-unified-table tr:hover td:nth-child(11) {
    transform: scale(1.02);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Estilos para dropdown con submenús en cascada */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu > .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -1px;
    margin-left: 0.125rem;
    position: absolute;
    z-index: 1000;
    min-width: 200px;
}

.dropdown-submenu:hover > .dropdown-menu {
    display: block !important;
}

.dropdown-submenu > .dropdown-item::after {
    content: "▶";
    float: right;
    margin-left: 0.5rem;
    font-size: 0.75rem;
}

@media (max-width: 768px) {
    .dropdown-submenu > .dropdown-menu {
        position: static;
        float: none;
        width: 100%;
        margin-top: 0.5rem;
        margin-left: 1rem;
    }
}

/* Estilos para alertas pequeñas en exportación de abogados */
.alert-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

/* Estilos para inputs y selects de filtros de expedientes */
.expedientes-search-input,
.expedientes-filter-select {
    font-size: 1rem !important;
}

.expedientes-search-input::placeholder {
    font-size: 1rem !important;
}

/* Estilos para el dropdown de abogados - aumentar tamaño de fuente */
#expedientes-filtro-abogado-menu .dropdown-item {
    font-size: 1rem !important;
    padding: 0.5rem 1rem !important;
}

#expedientes-filtro-abogado-menu .dropdown-submenu {
    position: relative;
}

#expedientes-filtro-abogado-menu .dropdown-submenu > .dropdown-item {
    font-size: 1rem !important;
    padding-right: 2rem !important;
}

#expedientes-filtro-abogado-menu .dropdown-submenu > .dropdown-item::after {
    content: "▶";
    position: absolute;
    right: 0.5rem;
    font-size: 0.8rem;
    color: #6c757d;
}

#expedientes-filtro-abogado-menu .dropdown-submenu > .dropdown-menu {
    position: absolute;
    left: 100%;
    top: 0;
    margin-top: 0;
    margin-left: 0.125rem;
    min-width: 200px;
    display: none;
}

#expedientes-filtro-abogado-menu .dropdown-submenu > .dropdown-menu.show {
    display: block;
}

#expedientes-filtro-abogado-menu .dropdown-submenu .dropdown-menu .dropdown-item {
    font-size: 1rem !important;
    padding-left: 1.5rem !important;
}

/* Hotfix: Asegurar que Bootstrap tabs funcionen en el modal */
#modalDetalleExpedienteCompleto .tab-content {
    display: block !important;
    opacity: 1 !important;
}

#modalDetalleExpedienteCompleto .tab-pane {
    display: none;
}

#modalDetalleExpedienteCompleto .tab-pane.show.active {
}

/* ===== Modal Detalle EJE Completo - Estilo moderno ===== */
#modalDetalleEJECompleto .modal-dialog.modal-eje-detalle {
    max-width: 95%;
    margin: 1rem auto;
}

#modalDetalleEJECompleto .modal-content.modal-eje-content {
    height: 90vh;
    display: flex;
    flex-direction: column;
    border: none;
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2), 0 0 1px rgba(0,0,0,0.1);
    overflow: hidden;
}

#modalDetalleEJECompleto .modal-header.modal-eje-header {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: #fff;
    padding: 1rem 1.5rem;
    border-bottom: none;
}

#modalDetalleEJECompleto .modal-header .modal-title {
    font-size: 1.15rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#modalDetalleEJECompleto .modal-header .badge-cache {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.35rem 0.65rem;
    background: rgba(255,255,255,0.25) !important;
    border: 1px solid rgba(255,255,255,0.4);
}

#modalDetalleEJECompleto .modal-body.modal-eje-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 1.75rem;
    background: #f8fafc;
}

/* Tabs modernos */
#modalDetalleEJECompleto .nav-tabs-eje {
    border-bottom: 2px solid #e2e8f0;
    gap: 0.25rem;
}

#modalDetalleEJECompleto .nav-tabs-eje .nav-link {
    color: #64748b;
    border: none;
    border-radius: 0.5rem;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s, background 0.2s;
}

#modalDetalleEJECompleto .nav-tabs-eje .nav-link:hover {
    color: #0d6efd;
    background: rgba(13, 110, 253, 0.08);
}

#modalDetalleEJECompleto .nav-tabs-eje .nav-link.active {
    color: #0d6efd;
    background: rgba(13, 110, 253, 0.12);
    border-bottom: none;
}

#modalDetalleEJECompleto .nav-tabs-eje .nav-link i {
    margin-right: 0.35rem;
    opacity: 0.9;
}

/* Ficha: campos tipo card */
#modalDetalleEJECompleto .eje-ficha-content .row {
    margin: 0 -0.5rem;
}

#modalDetalleEJECompleto .eje-ficha-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

#modalDetalleEJECompleto .eje-ficha-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    min-height: 3.5rem;
    transition: box-shadow 0.2s;
}

#modalDetalleEJECompleto .eje-ficha-field:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

#modalDetalleEJECompleto .eje-ficha-label {
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
}

#modalDetalleEJECompleto .eje-ficha-value {
    font-size: 1.05rem;
    color: #1e293b;
    line-height: 1.4;
    word-break: break-word;
}

#modalDetalleEJECompleto .eje-ficha-select {
    font-size: 1.05rem;
    min-height: 2.5rem;
    padding: 0.5rem 0.75rem;
}

#modalDetalleEJECompleto .tab-content {
    min-height: 400px;
    background: transparent;
}

#modalDetalleEJECompleto .tab-pane {
    padding: 0;
}

#modalDetalleEJECompleto #eje-ficha-content {
    padding: 0.25rem 0 !important;
}

/* Tablas en paneles */
#modalDetalleEJECompleto .table {
    font-size: 1rem;
}

#modalDetalleEJECompleto .table th {
    background: #f1f5f9;
    font-weight: 600;
    white-space: nowrap;
    color: #475569;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

#modalDetalleEJECompleto .table-responsive {
    max-height: 60vh;
    overflow-y: auto;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

#modalDetalleEJECompleto .badge {
    font-size: 0.8rem;
    padding: 0.35rem 0.6rem;
    font-weight: 500;
}

#modalDetalleEJECompleto .spin {
    animation: spin 1s linear infinite;
}

/* Footer */
#modalDetalleEJECompleto .modal-footer.modal-eje-footer {
    background: #fff;
    border-top: 1px solid #e2e8f0;
    padding: 1rem 1.5rem;
}

#modalDetalleEJECompleto .btn-nuevo-mov-eje {
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: transform 0.15s, box-shadow 0.15s;
}

#modalDetalleEJECompleto .btn-nuevo-mov-eje:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.35);
}

#modalDetalleEJECompleto .btn-cerrar-eje {
    border-radius: 0.5rem;
    font-weight: 500;
}

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

#modalDetalleExpedienteCompleto .tab-pane.show.active {
    display: block;
}

/* Modal Nuevo Movimiento: texto legible (evitar herencia de .form-control 0.525rem) */
#modalNuevoMovimiento .modal-title { font-size: 1.25rem; font-weight: 600; }
#modalNuevoMovimiento .form-label,
#modalNuevoMovimiento label.form-label { font-size: 1rem !important; margin-bottom: 0.35rem; }
#modalNuevoMovimiento .form-control,
#modalNuevoMovimiento .form-select,
#modalNuevoMovimiento input:not([type="radio"]):not([type="checkbox"]),
#modalNuevoMovimiento select,
#modalNuevoMovimiento textarea {
    font-size: 1rem !important;
    padding: 0.5rem 0.75rem !important;
    min-height: 2.5rem !important;
}
#modalNuevoMovimiento .form-control::placeholder,
#modalNuevoMovimiento textarea::placeholder { font-size: 1rem; opacity: 0.8; }
#modalNuevoMovimiento textarea.form-control { min-height: 4rem; }
#modalNuevoMovimiento small,
#modalNuevoMovimiento .text-muted { font-size: 0.95rem !important; }
#modalNuevoMovimiento .btn { font-size: 1rem; padding: 0.5rem 1rem; }
#modalNuevoMovimiento .tile-option span,
#modalNuevoMovimiento .btn-group .btn { font-size: 1rem; }
#modalNuevoMovimiento .form-check-label { font-size: 1rem; }

/* Asegurar que el modal de nuevo movimiento aparezca sobre el modal de EJE */
/* Bootstrap 5 incrementa automáticamente el z-index para modales anidados */
#modalNuevoMovimiento.modal.show {
    z-index: 1056 !important;
    display: block !important;
}

/* Cuando hay múltiples modales abiertos, asegurar orden correcto */
body.modal-open .modal.show {
    z-index: auto;
}

/* El modal de nuevo movimiento debe estar siempre encima cuando está abierto */
body.modal-open #modalNuevoMovimiento.modal.show {
    z-index: 1056 !important;
}

/* Asegurar que los backdrops estén en el orden correcto */
.modal-backdrop.show {
    z-index: 1040;
}

.modal-backdrop.show + .modal-backdrop.show {
    z-index: 1050;
}

/* Asegurar que el modal de EJE tenga un z-index base */
#modalDetalleEJECompleto.modal.show {
    z-index: 1055 !important;
}

/* Modales Escritos: por encima del backdrop */
#modalEscritoForm.modal.show,
#modalEscritoPreview.modal.show {
    z-index: 1060 !important;
}
#modalEscritoForm .modal-dialog,
#modalEscritoPreview .modal-dialog {
    z-index: 1061 !important;
}

/* Solapa Escritos: texto y opciones más grandes */
#tab-escritos .content-header h5 { font-size: 1.35rem; }
#tab-escritos .card-title { font-size: 1.1rem; font-weight: 600; }
#tab-escritos .form-select { font-size: 1rem; padding: 0.5rem 0.75rem; min-height: 2.5rem; }
#tab-escritos #escritos-btn-amparo,
#tab-escritos #escritos-btn-apelacion-srt { font-size: 1.05rem; font-weight: 500; }

/* Modales Escritos: formulario y vista previa más legibles */
#modalEscritoForm .modal-title,
#modalEscritoPreview .modal-title { font-size: 1.25rem; }
#modalEscritoForm .modal-body .form-label { font-size: 1rem; }
#modalEscritoForm .modal-body .form-control { font-size: 1rem; padding: 0.5rem 0.75rem; min-height: 2.5rem; }
#modalEscritoForm .modal-footer .btn,
#modalEscritoPreview .modal-footer .btn { font-size: 1rem; padding: 0.5rem 1rem; }
#modalEscritoPreview #escrito-preview-text { font-size: 0.95rem; line-height: 1.5; padding: 1rem !important; }

/* Modal Expedientes del Contacto: tabla que cabe y columna Abogado con nombre */
#modalExpedientesContacto .table-responsive {
    overflow-x: auto;
    max-width: 100%;
}
#modalExpedientesContacto .table {
    table-layout: fixed;
    width: 100%;
}
#modalExpedientesContacto .table th:nth-child(1),
#modalExpedientesContacto .table td:nth-child(1) { width: 12%; min-width: 90px; }
#modalExpedientesContacto .table th:nth-child(2),
#modalExpedientesContacto .table td:nth-child(2) { width: 8%; min-width: 60px; }
#modalExpedientesContacto .table th:nth-child(3),
#modalExpedientesContacto .table td:nth-child(3) { width: 28%; word-break: break-word; }
#modalExpedientesContacto .table th:nth-child(4),
#modalExpedientesContacto .table td:nth-child(4) { width: 18%; min-width: 100px; }
#modalExpedientesContacto .table th:nth-child(5),
#modalExpedientesContacto .table td:nth-child(5) { width: 12%; min-width: 80px; }
#modalExpedientesContacto .table th:nth-child(6),
#modalExpedientesContacto .table td:nth-child(6) { width: 12%; min-width: 90px; }
#modalExpedientesContacto .table th:nth-child(7),
#modalExpedientesContacto .table td:nth-child(7) { width: 10%; min-width: 90px; }

/* Combobox cliente (búsqueda en desplegable de cliente del expediente) */
.combobox-cliente-wrapper .combobox-cliente-input {
    font-size: 1rem;
    color: #212529;
    min-height: 2.25rem;
}
.combobox-cliente-item:hover { background-color: #f1f5f9; }
.combobox-cliente-item:active { background-color: #e2e8f0; }

/* Modal asignar expediente desde caché (contactos): más legible */
.selector-exp-cache .alert { font-size: 1rem; }
.selector-exp-cache .form-control,
.selector-exp-cache .form-select { font-size: 1rem; min-height: 2.75rem; }
.selector-exp-cache #select-exp-cache option { font-size: 1rem; padding: 0.35rem 0.5rem; }
.selector-exp-cache .btn { font-size: 1.05rem; }

/* Overlay de carga global */
.global-loading-overlay {
    position: fixed; inset: 0; z-index: 99999; background: rgba(0,0,0,0.6);
    display: flex; align-items: center; justify-content: center;
}
.global-loading-overlay:not(.d-none) { display: flex !important; }
.global-loading-box { text-align: center; color: #fff; }
.global-loading-spinner { font-size: 3rem; animation: global-spin 1.2s linear infinite; }
.global-loading-msg { font-size: 1.2rem; margin-top: 0.75rem; }
.global-loading-brand { font-size: 0.95rem; opacity: 0.9; margin-top: 0.25rem; }
@keyframes global-spin { to { transform: rotate(360deg); } }
