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

/* 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;
}

/* 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;
}

/* 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: 1400px;
    margin: 0 auto;
}

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

.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;
}

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

/* 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);
}

/* 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.6rem 1rem;
    cursor: pointer;
    font-size: 0.8rem;
    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;
}

.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;
}
