/* =============================================================================
   SILVA & ASOCIADOS - CSS PRINCIPAL OPTIMIZADO
   ============================================================================= */

/* Variables CSS Globales */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --background-color: #f5f5f5;
    --text-dark: #2c3e50;
    --text-muted: #7f8c8d;
    --border-color: #e0e0e0;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

/* =============================================================================
   RESET Y BASE
   ============================================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    line-height: 1.6;
    color: var(--text-dark);
}

/* =============================================================================
   LOADING Y ANIMACIONES
   ============================================================================= */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--secondary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes successBounce {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

/* =============================================================================
   ALERTAS Y MENSAJES
   ============================================================================= */

.alert {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: var(--border-radius);
    border: 1px solid transparent;
    animation: slideIn 0.3s ease-out;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-error,
.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* =============================================================================
   LAYOUT PRINCIPAL
   ============================================================================= */

/* Login */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.login-form {
    background: white;
    padding: 3rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-form h1 {
    color: var(--primary-color);
    margin-bottom: 2rem;
    font-size: 2rem;
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 250px;
    right: 0;
    height: 70px;
    background: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header h1 {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100vh;
    background: var(--primary-color);
    color: white;
    z-index: 200;
    transition: var(--transition);
}

.sidebar-menu {
    list-style: none;
    padding: 2rem 0;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar-menu a i {
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    margin-left: 250px;
    margin-top: 70px;
    padding: 2rem;
    min-height: calc(100vh - 70px);
}

.view {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.view.active {
    display: block;
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
}

.page-header h2 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-muted);
}

/* =============================================================================
   CARDS Y CONTENEDORES
   ============================================================================= */

.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    overflow: hidden;
}

.card-header {
    padding: 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
}

.card-body {
    padding: 1.5rem;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    
    /* ✨ LA MAGIA ESTÁ AQUÍ: Usamos Flexbox para organizar el contenido ✨ */
    display: flex;
    flex-direction: column; /* Apila los elementos verticalmente */
    justify-content: center; /* Centra verticalmente */
    align-items: center;     /* Centra horizontalmente */
    height: 120px; /* O una altura fija que te guste */
}

.metric-value {
    font-size: 2.5rem; /* Hazlo grande */
    font-weight: 700;
    margin: 0;
    line-height: 1;
}

.metric-label {
    font-size: 0.9rem;
    margin-top: 8px; /* Un poco de espacio entre el número y la etiqueta */
    opacity: 0.8;
    text-transform: uppercase;
}

/* =============================================================================
   FORMULARIOS Y CONTROLES
   ============================================================================= */

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1.5rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.search-box {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    width: 300px;
}

/* =============================================================================
   BOTONES
   ============================================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition);
    gap: 0.5rem;
    text-decoration: none;
}

.btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary {
    background-color: #007bff;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
}

.btn-success {
    background: var(--success-color);
}

.btn-warning {
    background: var(--warning-color);
}

.btn-danger {
    background: var(--accent-color);
}

.btn-info {
    background: var(--secondary-color);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* =============================================================================
   TABLAS
   ============================================================================= */

.table-container {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
}

.table-header h3 {
    margin: 0;
    color: var(--primary-color);
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

table th {
    background: #f8f9fa;
    font-weight: 600;
    color: var(--text-dark);
}

table tbody tr:hover {
    background: #f8f9fa;
}

/* =============================================================================
   MODALES
   ============================================================================= */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 900px;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
    animation: successBounce 0.4s ease-out;
}

.modal-content-large {
    max-width: 900px;
    width: 95%;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    color: var(--primary-color);
}

.close {
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.close:hover {
    color: #333;
    background: #f0f0f0;
}

/* =============================================================================
   PESTAÑAS (TABS)
   ============================================================================= */

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: #f8f9fa;
}

.tab {
    padding: 1rem 1.5rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    font-weight: 500;
}

.tab:hover {
    background: #e9ecef;
}

.tab.active {
    border-bottom-color: var(--secondary-color);
    background: white;
    color: var(--secondary-color);
}

.tab-content {
    display: none;
    padding: 2rem;
}

.tab-content.active {
    display: block;
}

/* =============================================================================
   PLANTILLAS Y CONTRATOS (NUEVOS ESTILOS)
   ============================================================================= */

/* Preview de Plantillas */
.plantilla-preview {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border: 2px solid var(--secondary-color);
    border-radius: var(--border-radius);
    background: #f8f9ff;
    animation: slideIn 0.3s ease-out;
}

.plantilla-preview .card-header {
    background: var(--secondary-color);
    color: white;
    margin: -1.5rem -1.5rem 1.5rem -1.5rem;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.plantilla-preview .card-header h5 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preview-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.preview-list {
    list-style: none;
    padding: 0;
}

.preview-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preview-list li:last-child {
    border-bottom: none;
}

.preview-list.requisitos li::before {
    content: '📋';
    font-size: 1.2em;
}

.preview-list.tareas li::before {
    content: '✓';
    color: var(--success-color);
    font-weight: bold;
    font-size: 1.2em;
}

/* Detalles de Contratos */
.contract-details {
    margin-top: 1rem;
    padding: 1.5rem;
    background: white;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.contract-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: var(--border-radius);
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
}

.contract-info.warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.contract-info.error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.selected-contract-details {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    background-color: #f8f9fa;
    margin-top: 1rem;
}

.contract-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.contract-body {
    display: grid;
    gap: 0.75rem;
}

.contract-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

.contract-row:last-child {
    border-bottom: none;
}

.contract-row .label {
    font-weight: 500;
    color: var(--text-muted);
}

.contract-row .value {
    font-weight: 600;
    color: var(--text-dark);
}

/* Gestión de Equipos */
.team-section {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.team-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
}

.team-header h3 {
    margin: 0;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.team-list {
    padding: 1.5rem;
}

.team-member {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    background: #fafafa;
    transition: var(--transition);
}

.team-member:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.team-member:last-child {
    margin-bottom: 0;
}

.team-member-info h4 {
    margin: 0 0 0.25rem 0;
    color: var(--primary-color);
}

.team-member-info p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.team-member-actions {
    display: flex;
    gap: 0.5rem;
}

/* =============================================================================
   BADGES Y ESTADOS
   ============================================================================= */

.badge {
    display: inline-block;
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    border-radius: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background-color: var(--secondary-color);
    color: white;
}

.badge-success {
    background-color: var(--success-color);
    color: white;
}

.badge-warning {
    background-color: var(--warning-color);
    color: white;
}

.badge-danger {
    background-color: var(--accent-color);
    color: white;
}

.badge-info {
    background-color: #17a2b8;
    color: white;
}

.badge-secondary {
    background-color: #6c757d;
    color: white;
}

/* =============================================================================
   LISTAS Y CHECKLIST
   ============================================================================= */

.checklist {
    list-style: none;
    padding: 0;
}

.checklist li {
    padding: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.checklist li:last-child {
    border-bottom: none;
}

.checklist li::before {
    content: '✓';
    color: var(--success-color);
    font-weight: bold;
    font-size: 1.2em;
}

/* Info Box */
.info-box {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.info-box i {
    color: var(--secondary-color);
    font-size: 1.2em;
}

/* =============================================================================
   CALENDARIO
   ============================================================================= */

.calendar-container {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: var(--primary-color);
    color: white;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-day-header {
    padding: 1rem;
    background: #f8f9fa;
    font-weight: 600;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

/* =============================================================================
   UTILIDADES
   ============================================================================= */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }
.text-danger { color: var(--accent-color); }
.text-primary { color: var(--secondary-color); }

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mr-1 { margin-right: 1rem; }
.ml-1 { margin-left: 1rem; }

.p-1 { padding: 1rem; }
.p-2 { padding: 2rem; }

.hidden { display: none; }
.visible { display: block; }

.flex { display: flex; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.align-end { align-items: flex-end; }

.gap-1 { gap: 1rem; }
.gap-2 { gap: 2rem; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.rounded { border-radius: var(--border-radius); }
.shadow { box-shadow: var(--shadow); }

/* =============================================================================
   RESPONSIVE DESIGN
   ============================================================================= */

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .header {
        left: 0;
    }
    
    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0 1rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .search-box {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .table-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .modal-content {
        width: 98%;
        margin: 1rem auto;
        padding: 1rem;
    }
    
    .modal-content-large {
        width: 98%;
        margin: 1rem auto;
    }
    
    .preview-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .team-member {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .team-member-actions {
        align-self: flex-end;
        margin-top: 1rem;
    }
    
    .contract-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab {
        flex: 1;
        min-width: 120px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .login-form {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }
    
    .metric-card {
        padding: 1.5rem;
    }
    
    .metric-value {
        font-size: 2rem;
    }
    
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .btn-sm {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}
/* =============================================================================
   MEJORAS PARA LA AGENDA - AGREGAR AL FINAL DE main.css
   ============================================================================= */

/* Variables adicionales para la agenda */
:root {
    --agenda-primary: #667eea;
    --agenda-secondary: #764ba2;
    --audiencia-color: #e74c3c;
    --reunion-color: #f39c12;
    --vencimiento-color: #27ae60;
    --cita-color: #17a2b8;
}

/* =============================================================================
   MEJORAS PARA EL HEADER DE AGENDA
   ============================================================================= */

#agenda .page-header {
    background: linear-gradient(135deg, var(--agenda-primary), var(--agenda-secondary));
    color: white;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    transform: perspective(1000px) rotateX(5deg);
    transition: all 0.3s ease;
}

#agenda .page-header:hover {
    transform: perspective(1000px) rotateX(0deg);
}

#agenda .page-header h2 {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

#agenda .page-header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* =============================================================================
   TOOLBAR MEJORADO PARA AGENDA
   ============================================================================= */

.agenda-toolbar {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.agenda-view-controls {
    display: flex;
    gap: 0.5rem;
    background: var(--light-gray);
    padding: 0.3rem;
    border-radius: 25px;
    border: 1px solid var(--border-color);
}

.agenda-view-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 500;
}

.agenda-view-btn.active {
    background: var(--secondary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.agenda-view-btn:hover:not(.active) {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* =============================================================================
   MEJORAS PARA LA NAVEGACIÓN DEL CALENDARIO
   ============================================================================= */

.calendar-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 1.5rem;
    border-radius: 15px 15px 0 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.calendar-nav-enhanced {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.nav-btn-enhanced {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    backdrop-filter: blur(10px);
}

.nav-btn-enhanced:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.month-year-enhanced {
    font-size: 1.8rem;
    font-weight: 300;
    color: white;
    min-width: 250px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* =============================================================================
   MEJORAS PARA EL GRID DEL CALENDARIO
   ============================================================================= */

.calendar-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 2rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border-color);
}

.calendar-day-header {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    text-align: center;
    padding: 1.2rem 0.5rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-day {
    background: white;
    min-height: 120px;
    padding: 1rem;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.calendar-day:hover {
    background: #f8f9fa;
    border-color: var(--secondary-color);
    transform: scale(1.02);
    z-index: 2;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.calendar-day.today {
    background: linear-gradient(135deg, var(--agenda-primary), var(--agenda-secondary));
    color: white;
    border-color: var(--agenda-primary);
}

.calendar-day.today .day-number {
    font-weight: 700;
    font-size: 1.3rem;
}

.calendar-day.today:hover {
    background: linear-gradient(135deg, var(--agenda-secondary), var(--agenda-primary));
}

.calendar-day.other-month {
    background: #f8f9fa;
    color: #ccc;
}

.day-number {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    position: relative;
}

.calendar-day.today .day-number::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: rgba(255,255,255,0.8);
    border-radius: 1px;
}

/* =============================================================================
   EVENTOS MEJORADOS
   ============================================================================= */

.day-events {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.event {
    background: var(--secondary-color);
    color: white;
    padding: 0.4rem 0.6rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.event:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 10;
}

.event.audiencia {
    background: linear-gradient(135deg, var(--audiencia-color), #c0392b);
}

.event.reunion {
    background: linear-gradient(135deg, var(--reunion-color), #d68910);
}

.event.vencimiento {
    background: linear-gradient(135deg, var(--vencimiento-color), #1e8449);
}

.event.cita {
    background: linear-gradient(135deg, var(--cita-color), #138496);
}

.event::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: rgba(255,255,255,0.5);
    border-radius: 15px 0 0 15px;
}

/* =============================================================================
   SIDEBAR LATERAL PARA AGENDA
   ============================================================================= */

.agenda-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.agenda-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.mini-calendar {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.mini-calendar h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 600;
}

.mini-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    text-align: center;
}

.mini-day-header {
    font-weight: 600;
    color: var(--secondary-color);
    font-size: 0.75rem;
    padding: 0.5rem;
    text-transform: uppercase;
}

.mini-day {
    padding: 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.mini-day:hover {
    background: var(--secondary-color);
    color: white;
    transform: scale(1.1);
}

.mini-day.today {
    background: var(--warning-color);
    color: white;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.4);
}

.mini-day.has-events {
    background: var(--success-color);
    color: white;
    position: relative;
}

.mini-day.has-events::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
}

/* =============================================================================
   LISTA DE EVENTOS PRÓXIMOS
   ============================================================================= */

.upcoming-events {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.upcoming-events h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.upcoming-event-item {
    padding: 1rem;
    border-left: 4px solid var(--secondary-color);
    background: var(--light-gray);
    margin-bottom: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upcoming-event-item:hover {
    transform: translateX(8px);
    background: #e3f2fd;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.upcoming-event-item.audiencia {
    border-color: var(--audiencia-color);
}

.upcoming-event-item.audiencia:hover {
    background: #ffeaea;
}

.upcoming-event-item.reunion {
    border-color: var(--reunion-color);
}

.upcoming-event-item.reunion:hover {
    background: #fff3e0;
}

.upcoming-event-item.vencimiento {
    border-color: var(--vencimiento-color);
}

.upcoming-event-item.vencimiento:hover {
    background: #e8f5e8;
}

.upcoming-event-title {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
}

.upcoming-event-date {
    color: #666;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.upcoming-event-date i {
    color: var(--secondary-color);
}

/* =============================================================================
   BOTÓN NUEVO EVENTO MEJORADO
   ============================================================================= */

.btn-nuevo-evento {
    background: linear-gradient(135deg, var(--success-color), #1e8449);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.btn-nuevo-evento:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.4);
    background: linear-gradient(135deg, #1e8449, var(--success-color));
}

.btn-nuevo-evento i {
    font-size: 1.1rem;
}

/* =============================================================================
   FILTROS Y LEYENDA
   ============================================================================= */

.agenda-legend {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.agenda-legend h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 600;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.9rem;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    flex-shrink: 0;
}

.legend-color.audiencia {
    background: var(--audiencia-color);
}

.legend-color.reunion {
    background: var(--reunion-color);
}

.legend-color.vencimiento {
    background: var(--vencimiento-color);
}

.legend-color.cita {
    background: var(--cita-color);
}

/* =============================================================================
   RESPONSIVE PARA AGENDA
   ============================================================================= */

@media (max-width: 768px) {
    .agenda-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .agenda-sidebar {
        order: 2;
    }

    .agenda-toolbar {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .calendar-nav-enhanced {
        order: 1;
        gap: 1rem;
    }

    .agenda-view-controls {
        order: 2;
    }

    .btn-nuevo-evento {
        order: 3;
        align-self: center;
    }

    .calendar-day {
        min-height: 80px;
        padding: 0.5rem;
    }

    .day-number {
        font-size: 1rem;
    }

    .event {
        font-size: 0.65rem;
        padding: 0.3rem 0.5rem;
    }

    .mini-grid {
        gap: 2px;
    }

    .mini-day {
        padding: 0.4rem;
        font-size: 0.8rem;
    }

    #agenda .page-header {
        transform: none;
        margin-bottom: 1rem;
    }

    #agenda .page-header h2 {
        font-size: 2rem;
    }
}

/* =============================================================================
   ANIMACIONES PARA AGENDA
   ============================================================================= */

@keyframes eventPulse {
    0% {
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    50% {
        box-shadow: 0 4px 20px rgba(52, 152, 219, 0.4);
    }
    100% {
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
}

.event.urgent {
    animation: eventPulse 2s infinite;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.upcoming-event-item {
    animation: slideInUp 0.5s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.calendar-day {
    animation: fadeInScale 0.3s ease-out;
}

/* =============================================================================
   EFECTOS ESPECIALES
   ============================================================================= */

.calendar-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg,
        transparent,
        rgba(102, 126, 234, 0.1),
        transparent,
        rgba(118, 75, 162, 0.1),
        transparent
    );
    animation: rotate 20s linear infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

.agenda-container {
    position: relative;
    overflow: hidden;
}

/* Efecto glassmorphism para elementos flotantes */
.glass-effect {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}
/* =============================================================================
   ESTILOS PARA PESTAÑA DE ACTIVIDADES (VERSIÓN ACTUALIZADA)
   ============================================================================= */

/* Contenedor principal de la pestaña */
.actividades-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Header con tarjetas de estadísticas y botones */
.actividades-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

/* Contenedor de las tarjetas de estadísticas */
.actividades-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    flex-grow: 1;
}

/* Tarjeta individual de estadística */
.stat-card {
    background-color: #fff;
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    text-align: center;
    min-width: 120px;
    border-top: 4px solid var(--secondary-color);
}
.stat-card.stat-pendiente { border-color: var(--warning-color); }
.stat-card.stat-proceso { border-color: var(--secondary-color); }
.stat-card.stat-completada { border-color: var(--success-color); }
.stat-card.stat-horas { border-color: var(--primary-color); }

.stat-number {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Contenedor de los botones de acción */
.actividades-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Contenedor de los filtros */
.actividades-filters {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    padding: 1rem;
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.actividades-filters select,
.actividades-filters input {
    padding: 0.6rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}
.actividades-filters input {
    flex-grow: 1; /* Para que el buscador ocupe más espacio */
}


/* Lista de actividades y tarjetas */
.actividades-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

/* El resto de estilos para .actividad-card, etc., que te di antes, están bien.
   Si ya los pegaste, perfecto. Si no, pégalos aquí. */

.actividad-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.12);
}
.actividad-header { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-color); display:flex; justify-content: space-between; align-items:center; }
.actividad-info { display: flex; align-items: center; gap: 0.5rem; }
.actividad-tipo { font-size: 0.8rem; font-weight: 500; padding: 0.2rem 0.5rem; border-radius: 1rem; }
.actividad-tipo.manual { background-color: #e9ecef; color: #495057; }
.actividad-tipo.cronometro { background-color: var(--success-color); color: white; }
.actividad-fecha { font-size: 0.8rem; color: var(--text-muted); }
.estado-badge { color: white; padding: 0.3rem 0.6rem; border-radius: 1rem; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }
.actividad-content { padding: 1rem; flex-grow: 1; }
.actividad-tarea { font-weight: 600; color: var(--primary-color); margin-bottom: 0.5rem; }
.actividad-descripcion { font-size: 0.9rem; line-height: 1.5; margin-bottom: 1rem; white-space: pre-wrap; }
.actividad-abogado { font-size: 0.85rem; color: var(--text-muted); }
.actividad-footer { padding: 0.75rem 1rem; border-top: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.actividad-tiempo { font-weight: bold; }
.actividad-actions .btn { padding: 0.3rem 0.6rem; font-size: 0.8rem; }
/* Estilos para el módulo de actividades */
.actividades-container {
    padding: 20px;
}

.actividades-stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.stat-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px 20px;
    text-align: center;
    min-width: 120px;
}

.stat-card .stat-number {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.stat-card .stat-label {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
}

.stat-card.stat-pendiente .stat-number { color: #ffc107; }
.stat-card.stat-proceso .stat-number { color: #17a2b8; }
.stat-card.stat-completada .stat-number { color: #28a745; }
.stat-card.stat-horas .stat-number { color: #6610f2; }

.actividades-actions {
    display: flex;
    gap: 10px;
}

.actividades-filters select,
.actividades-filters input {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.actividades-list {
    min-height: 200px;
}

.actividad-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.actividad-card:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.actividad-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.actividad-info {
    display: flex;
    gap: 15px;
    align-items: center;
}

.actividad-tipo {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #6c757d;
}

.actividad-tipo.cronometro { color: #17a2b8; }
.actividad-tipo.manual { color: #6c757d; }

.cronometro-active {
    background: #dc3545;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    margin-left: 5px;
}

.actividad-fecha {
    font-size: 13px;
    color: #6c757d;
}

.actividad-estado {
    display: flex;
    align-items: center;
    gap: 10px;
}

.estado-select {
    padding: 4px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 13px;
}

.estado-badge {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    color: white;
    font-weight: 500;
}

.actividad-content {
    margin-bottom: 15px;
}

.actividad-tarea {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.actividad-descripcion {
    color: #555;
    margin-bottom: 8px;
    line-height: 1.5;
}

.actividad-abogado {
    font-size: 13px;
    color: #6c757d;
}

.actividad-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.actividad-tiempo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #6c757d;
    font-size: 14px;
}

.actividad-actions {
    display: flex;
    gap: 5px;
}

.empty-state,
.loading-state,
.error-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i,
.loading-state i,
.error-state i {
    font-size: 48px;
    margin-bottom: 20px;
    display: block;
}

.empty-state h3,
.error-state h3 {
    color: #333;
    margin-bottom: 10px;
}

.loading-state i {
    color: #007bff;
}

.error-state i {
    color: #dc3545;
}
/* ESTILOS PARA CHECKLIST CON ACCIONES */
.checklist li {
    display: flex;
    justify-content: space-between; /* Alinea los elementos a los extremos */
    align-items: center;
    gap: 1rem;
}

.checklist-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.checklist-actions {
    /* El botón se alineará a la derecha */
}
/* FIX DEADLINE - VERSIÓN SÚPER ESPECÍFICA */
html body div.planificacion div.abogado-card div.metric div.metric-icon.deadline div.metric-content span.metric-label {
    font-size: 1rem !important;
    color: #6b7280 !important;
    font-weight: 600 !important;
    margin-bottom: 0.15rem !important;
    line-height: 1 !important;
}

html body div.planificacion div.abogado-card div.metric div.metric-icon.deadline div.metric-content span.metric-value.neutral {
    font-size: 1rem !important;
    color: #9ca3af !important;
    font-style: italic !important;
    font-weight: 500 !important;
    line-height: 1.1 !important;
    margin: 0 !important;
}

html body div.planificacion div.abogado-card div.metric div.metric-icon.deadline div.metric-content span.metric-value {
    font-size: 1rem !important;
    font-weight: 600 !important;
    line-height: 1.1 !important;
    margin: 0 !important;
}

html body div.planificacion div.abogado-card div.metric div.metric-icon.deadline {
    background: #f9fafb !important;
    border-radius: 6px !important;
    padding: 0.4rem !important;
    min-height: auto !important;
}

/* VERSIÓN AÚN MÁS AGRESIVA - por si acaso */
* .metric-value.neutral {
    font-size: 1rem !important;
    color: #9ca3af !important;
    font-style: italic !important;
}

* .metric-label {
    font-size: 0.5rem !important;
    color: #6b7280 !important;
}
/* ===================================================================
   FUNCIONALIDADES PREMIUM - WORKLOAD
   =================================================================== */

/* Modo Comparación */
.comparison-mode .usuario-card {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.comparison-mode .usuario-card:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.usuario-card.selected-for-comparison {
    border-color: #28a745 !important;
    background: linear-gradient(135deg, #f8fff8 0%, #e8f5e8 100%);
    transform: translateY(-3px);
}

.comparison-instructions {
    position: fixed;
    top: 80px;
    right: 20px;
    background: #007bff;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: slideInRight 0.3s ease;
}

.selection-counter {
    margin-top: 8px;
    font-weight: bold;
    font-size: 1.1em;
}

/* Modal de Comparación */
.comparison-modal .modal-content {
    max-width: 1200px;
    width: 95vw;
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.comparison-column {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #dee2e6;
}

.comparison-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.usuario-avatar img,
.abogado-avatar img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
}

.avatar-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    margin: 0 auto 10px;
}

.comparison-metrics .metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.metric .label {
    font-weight: 500;
    color: #495057;
}

.metric .value {
    font-weight: bold;
    color: #212529;
}

.metric .value.over-limit {
    color: #dc3545;
}

.metric .value.alert {
    color: #dc3545;
    background: #fff5f5;
    padding: 2px 6px;
    border-radius: 4px;
}

.metric .value.revenue {
    color: #28a745;
}

.metric-bar {
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    margin-top: 5px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 3px;
}

.bar-fill.low-risk { background: #28a745; }
.bar-fill.medium-risk { background: #ffc107; }
.bar-fill.high-risk { background: #fd7e14; }
.bar-fill.critical-risk { background: #dc3545; }

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.analytic-item {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #007bff;
}

.recommendations-list {
    list-style: none;
    padding: 0;
}

.recommendations-list li {
    padding: 10px;
    margin: 8px 0;
    background: #f8f9fa;
    border-left: 4px solid #17a2b8;
    border-radius: 4px;
}

/* Export Modal */
.export-modal .modal-content {
    max-width: 800px;
}

.export-options {
    margin-bottom: 30px;
}

.format-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.format-buttons .btn {
    padding: 15px;
    text-align: center;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.format-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.checkbox-label:hover {
    background: #f8f9fa;
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
}

.report-preview {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #dee2e6;
}

.preview-content {
    background: white;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    max-height: 300px;
    overflow-y: auto;
}

.preview-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.preview-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.summary-metric {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    border-left: 3px solid #007bff;
}

/* AI Modal */
.enhanced-modal .modal-content {
    max-width: 900px;
}

.ai-content-advanced {
    max-height: 600px;
    overflow-y: auto;
}

.ai-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #6f42c1;
}

.ai-section h5 {
    color: #6f42c1;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.ai-loading .fa-robot {
    font-size: 48px;
    margin-bottom: 15px;
    color: #6f42c1;
}

.spinning {
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.trends-analysis {
    display: grid;
    gap: 15px;
}

.trend-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    border-radius: 6px;
    background: white;
}

.trend-item.positive {
    border-left: 4px solid #28a745;
}

.trend-item.warning {
    border-left: 4px solid #ffc107;
}

.trend-item.neutral {
    border-left: 4px solid #6c757d;
}

.trend-impact {
    margin-left: auto;
    font-weight: bold;
    font-size: 0.9em;
}

.insights-advanced {
    display: grid;
    gap: 20px;
}

.insight-item {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #17a2b8;
}

.insight-item.critical {
    border-left-color: #dc3545;
}

.insight-item.warning {
    border-left-color: #ffc107;
}

.insight-item.optimization {
    border-left-color: #28a745;
}

.insight-header h6 {
    margin: 0 0 10px 0;
    color: #495057;
}

.insight-recommendation {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
    font-style: italic;
    color: #6c757d;
}

.auto-recommendations {
    display: grid;
    gap: 15px;
}

.recommendation-item {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #007bff;
}

.recommendation-item.priority-high {
    border-left-color: #dc3545;
}

.recommendation-item.priority-medium {
    border-left-color: #ffc107;
}

.recommendation-item.priority-low {
    border-left-color: #6c757d;
}

.recommendation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.priority-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
    text-transform: uppercase;
}

.priority-badge.high {
    background: #dc3545;
    color: white;
}

.priority-badge.medium {
    background: #ffc107;
    color: #212529;
}

.priority-badge.low {
    background: #6c757d;
    color: white;
}

/* Filtros Avanzados */
.quick-filters {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.quick-filter {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.quick-filter:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.quick-filter.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.filter-results {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 6px;
    padding: 10px 15px;
    margin: 15px 0;
}

.results-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.results-info i {
    color: #1976d2;
}

.btn-clear-filters {
    background: none;
    border: 1px solid #1976d2;
    color: #1976d2;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.btn-clear-filters:hover {
    background: #1976d2;
    color: white;
}

/* Notificaciones */
.notification-permission-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    padding: 20px;
    max-width: 350px;
    z-index: 9999;
    animation: slideInRight 0.3s ease;
}

.permission-content {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.permission-content i {
    font-size: 24px;
    color: #007bff;
    margin-top: 5px;
}

.permission-text h4 {
    margin: 0 0 5px 0;
    color: #212529;
}

.permission-text p {
    margin: 0 0 15px 0;
    color: #6c757d;
    font-size: 14px;
}

.permission-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.permission-actions .btn {
    font-size: 12px;
    padding: 6px 12px;
}

/* Estados de Riesgo */
.risk-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.risk-badge.low-risk {
    background: #d4edda;
    color: #155724;
}

.risk-badge.medium-risk {
    background: #fff3cd;
    color: #856404;
}

.risk-badge.high-risk {
    background: #f8d7da;
    color: #721c24;
}

.risk-badge.critical-risk {
    background: #dc3545;
    color: white;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 20px;
    color: #dee2e6;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #495057;
}

.empty-state p {
    margin-bottom: 20px;
}

/* Animaciones */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .comparison-grid {
        grid-template-columns: 1fr;
    }
    
    .analytics-grid {
        grid-template-columns: 1fr;
    }
    
    .format-buttons {
        grid-template-columns: 1fr;
    }
    
    .quick-filters {
        justify-content: center;
    }
    
    .comparison-modal .modal-content,
    .export-modal .modal-content,
    .enhanced-modal .modal-content {
        width: 95vw;
        max-width: none;
        margin: 10px;
    }
}
/* ===================================================================
   ESTILOS FALTANTES PARA PLANIFICACIÓN - PARTE 1
   AGREGAR AL FINAL DE main.css
   =================================================================== */

/* Header específico para planificación */
.main-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.header-left h1 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: white;
}

.header-subtitle {
    opacity: 0.9;
    font-size: 0.95rem;
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-right .user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.95;
    color: white;
}

/* Page Header para planificación */
.page-info h2 {
    font-size: 1.75rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-description {
    color: var(--text-muted);
    font-size: 1rem;
    margin: 0;
}

/* Summary Cards específicas */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
    border-left: 4px solid var(--secondary-color);
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.summary-card.success {
    border-left-color: var(--success-color);
}

.summary-card.warning {
    border-left-color: var(--warning-color);
}

.summary-card.info {
    border-left-color: var(--secondary-color);
}

.summary-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background-color);
    color: var(--secondary-color);
    font-size: 1.5rem;
}

.summary-card.success .summary-icon {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.summary-card.warning .summary-icon {
    background: rgba(255, 193, 7, 0.1);
    color: var(--warning-color);
}

.summary-card.info .summary-icon {
    background: rgba(52, 152, 219, 0.1);
    color: var(--secondary-color);
}

.summary-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.summary-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}
/* ===================================================================
   ESTILOS FALTANTES PARA PLANIFICACIÓN - PARTE 2
   AGREGAR DESPUÉS DE LA PARTE 1
   =================================================================== */

/* Controls Section */
.controls-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-input-group {
    position: relative;
    flex: 1;
    min-width: 300px;
}

.search-input-group i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input-group input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    transition: var(--transition);
}

.search-input-group input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.25);
}

.search-clear {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    transition: var(--transition);
}

.search-clear:hover {
    background: var(--background-color);
    color: var(--text-dark);
}

/* View Options */
.view-options {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.view-toggle {
    display: flex;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.view-btn {
    padding: 0.5rem 0.75rem;
    background: white;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-muted);
}

.view-btn.active,
.view-btn:hover {
    background: var(--secondary-color);
    color: white;
}

.sort-options select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    background: white;
    font-size: 0.9rem;
}

/* Content Section */
.content-section {
    position: relative;
    min-height: 400px;
}

/* Loading States mejorados */
.loading-state,
.error-state,
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.loading-spinner i {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    animation: spin 1s linear infinite;
}

.error-content i {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.empty-content i {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.loading-state h3,
.error-state h3,
.empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.loading-state p,
.error-state p,
.empty-state p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Usuarios Grid */
.usuarios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.usuarios-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
/* ===================================================================
   ESTILOS FALTANTES PARA PLANIFICACIÓN - PARTE 3
   TARJETAS DE USUARIO - AGREGAR DESPUÉS DE LA PARTE 2
   =================================================================== */

/* Usuario Cards */
.usuario-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border-left: 4px solid var(--success-color);
    position: relative;
    overflow: hidden;
}

.usuario-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.usuario-card.low-risk {
    border-left-color: var(--success-color);
}

.usuario-card.medium-risk {
    border-left-color: var(--warning-color);
}

.usuario-card.high-risk {
    border-left-color: #fd7e14;
}

.usuario-card.critical-risk {
    border-left-color: var(--accent-color);
}

/* Card Header específico para usuario */
.usuario-card .card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    position: relative;
    padding: 0;
    background: transparent;
    border: none;
}

.user-avatar {
    flex-shrink: 0;
}

.user-avatar img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar .avatar-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--background-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.25rem;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
    word-wrap: break-word;
}

.user-role {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0;
}

/* Risk Badge específico */
.usuario-card .risk-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    position: absolute;
    top: 0;
    right: 0;
}

.usuario-card .risk-badge.low-risk {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.usuario-card .risk-badge.medium-risk {
    background: rgba(255, 193, 7, 0.1);
    color: var(--warning-color);
}

.usuario-card .risk-badge.high-risk {
    background: rgba(253, 126, 20, 0.1);
    color: #fd7e14;
}

.usuario-card .risk-badge.critical-risk {
    background: rgba(220, 53, 69, 0.1);
    color: var(--accent-color);
}

/* Workload Summary */
.workload-summary {
    margin-bottom: 1rem;
}

.workload-info {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.workload-hours {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.workload-percentage {
    font-size: 1rem;
    color: var(--text-muted);
}

.load-bar {
    width: 100%;
    height: 8px;
    background: var(--background-color);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.load-progress {
    height: 100%;
    transition: width 0.6s ease;
    border-radius: 4px;
}

.load-progress.low-risk {
    background: linear-gradient(90deg, var(--success-color), #20c997);
}

.load-progress.medium-risk {
    background: linear-gradient(90deg, var(--warning-color), #ffca2c);
}

.load-progress.high-risk {
    background: linear-gradient(90deg, #fd7e14, #ff922b);
}

.load-progress.critical-risk {
    background: linear-gradient(90deg, var(--accent-color), #e55353);
}

/* User Details */
.user-details {
    margin-bottom: 1rem;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.detail-item i {
    width: 16px;
    color: var(--secondary-color);
}

.detail-item.text-danger {
    color: var(--accent-color);
}

.detail-item.text-danger i {
    color: var(--accent-color);
}

/* Card Actions */
.card-actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--background-color);
}

/* Insights Section */
.insights-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-top: 2rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--secondary-color);
}

.insights-section h3 {
    color: var(--text-dark);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.insights-content {
    display: grid;
    gap: 1rem;
}
/* ===================================================================
   ESTILOS FALTANTES PARA PLANIFICACIÓN - PARTE 4 FINAL
   RESPONSIVE Y AJUSTES - AGREGAR AL FINAL
   =================================================================== */

/* Responsive Design específico para planificación */
@media (max-width: 768px) {
    .main-header {
        padding: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .header-left h1 {
        font-size: 1.5rem;
    }
    
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .page-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .usuarios-grid {
        grid-template-columns: 1fr;
    }
    
    .controls-section {
        padding: 1rem;
    }
    
    .search-input-group {
        min-width: 100%;
    }
    
    .view-options {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .card-actions {
        flex-direction: column;
    }
    
    .usuario-card {
        padding: 1rem;
    }
    
    .workload-hours {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .header-left h1 {
        font-size: 1.25rem;
    }
    
    .page-info h2 {
        font-size: 1.5rem;
    }
    
    .page-actions {
        flex-direction: column;
    }
    
    .btn {
        justify-content: center;
        width: 100%;
    }
    
    .summary-content h3 {
        font-size: 1.5rem;
    }
    
    .summary-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .user-info h3 {
        font-size: 1rem;
    }
    
    .workload-hours {
        font-size: 1.1rem;
    }
}

/* Correcciones específicas para elementos que pueden estar duplicados */
.main-content .page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    gap: 2rem;
}

/* Asegurar que el loading overlay funcione correctamente */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    flex-direction: column;
}

.loading-overlay .loading-spinner {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.loading-overlay .loading-spinner i {
    font-size: 2rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

/* Ajustes para que los botones se vean consistentes */
.page-actions .btn {
    white-space: nowrap;
    min-width: auto;
}

/* Corrección para el texto del loading */
#loadingMessage {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Estilos específicos para cuando la vista está cargando */
.content-section .loading-state {
    min-height: 300px;
}

/* Corrección para el spacing del main content cuando hay header personalizado */
body.planificacion-view {
    background-color: var(--background-color);
}

body.planificacion-view .main-content {
    margin-left: 0;
    margin-top: 0;
    padding: 0;
    min-height: 100vh;
}

/* Asegurar que las variables estén disponibles si no están definidas */
:root {
    --light-gray: #f8f9fa;
}

/* Último ajuste para garantizar compatibilidad con el CSS existente */
.planificacion-container {
    width: 100%;
    min-height: 100vh;
    background-color: var(--background-color);
}

.planificacion-container .main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* =============================================================== */
/* ESTILOS PARA SISTEMA DE CRONÓMETROS Y ACTIVIDADES */
/* =============================================================== */

/* Estilos básicos para actividades */
.actividades-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.actividades-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.actividades-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    flex-grow: 1;
}

.stat-card {
    background-color: #fff;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    text-align: center;
    min-width: 120px;
    border-top: 4px solid #6c757d;
}

.stat-card.stat-pendiente { border-color: #ffc107; }
.stat-card.stat-proceso { border-color: #17a2b8; }
.stat-card.stat-completada { border-color: #28a745; }
.stat-card.stat-horas { border-color: #007bff; }

.stat-number {
    font-size: 2rem;
    font-weight: 600;
    color: #343a40;
}

.stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    text-transform: uppercase;
}

.actividades-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.actividades-filters {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    padding: 1rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.actividades-filters select,
.actividades-filters input {
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid #ced4da;
}

.actividades-filters input {
    flex-grow: 1;
    min-width: 200px;
}

.actividades-list {
    min-height: 200px;
    background: #fff;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.empty-state, .error-state, .loading-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i, .error-state i, .loading-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.radio-group label:hover {
    background-color: #f8f9fa;
}

/* Ocultar la pestaña por defecto hasta que esté completamente implementada */
.tab-nav-link[data-tab="actividades"] {
    opacity: 0.6;
    pointer-events: auto;
}
/* Ajustes para las tarjetas de actividades */
.actividad-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border-left: 5px solid var(--secondary-color);
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease-in-out;
    margin-bottom: 1rem;
}

.actividad-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.12);
}

.actividad-card.pendiente {
    border-left-color: #ffc107;
}

.actividad-card.en-proceso {
    border-left-color: #17a2b8;
}

.actividad-card.completada {
    border-left-color: #28a745;
}

/* Header de la actividad */
.actividad-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.actividad-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.actividad-tipo {
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.2rem 0.5rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.actividad-tipo.manual {
    background-color: #e9ecef;
    color: #495057;
}

.actividad-tipo.cronometro {
    background-color: var(--success-color);
    color: white;
}

.cronometro-active {
    background: #dc3545;
    color: white;
    padding: 0.1rem 0.4rem;
    border-radius: 0.5rem;
    font-size: 0.7rem;
    margin-left: 0.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

.actividad-fecha {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Estado select */
.estado-select {
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.8rem;
    background: white;
    cursor: pointer;
}

.estado-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Contenido de la actividad */
.actividad-content {
    padding: 1rem;
    flex-grow: 1;
}

.actividad-tarea {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.actividad-descripcion {
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    white-space: pre-wrap;
}

.actividad-abogado {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Footer de la actividad */
.actividad-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.actividad-tiempo {
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cronometro-tiempo {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    color: #dc3545;
    font-weight: bold;
    background: #f8f9fa;
    padding: 0.2rem 0.5rem;
    border-radius: var(--border-radius);
    border: 1px solid #dee2e6;
}

/* Acciones de la actividad */
.actividad-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.actividad-actions .btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

/* Botones específicos del cronómetro */
.actividad-actions .btn-success {
    background-color: #28a745;
    color: white;
}

.actividad-actions .btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.actividad-actions .btn-danger {
    background-color: #dc3545;
    color: white;
}

.actividad-actions .btn-primary {
    background-color: #007bff;
    color: white;
}

/* Header de actividades sin cronómetro global */
.actividades-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.actividades-stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.stat-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px 20px;
    text-align: center;
    min-width: 120px;
}

.stat-card .stat-number {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.stat-card .stat-label {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
}

.stat-card.stat-pendiente .stat-number { color: #ffc107; }
.stat-card.stat-proceso .stat-number { color: #17a2b8; }
.stat-card.stat-completada .stat-number { color: #28a745; }
.stat-card.stat-horas .stat-number { color: #6610f2; }

/* Filtros de actividades */
.actividades-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: var(--border-radius);
}

.actividades-filters select,
.actividades-filters input {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: white;
    flex: 1;
    min-width: 150px;
}

.actividades-filters input {
    min-width: 250px;
}

/* Lista de actividades */
.actividades-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Estado vacío */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.empty-state h3 {
    color: #495057;
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 1.5rem;
}

/* Ajustes para el modal de actividad */
#modalActividad .modal-content {
    max-width: 900px;
}

#modalActividad .form-group {
    margin-bottom: 1rem;
}

#modalActividad textarea {
    resize: vertical;
    min-height: 80px;
}

/* Animación para ocultar/mostrar campo de horas */
#horas-group {
    transition: all 0.3s ease-in-out;
    overflow: hidden;
}

#horas-group[style*="display: none"] {
    opacity: 0;
    height: 0;
    margin: 0;
    padding: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .actividades-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .actividades-stats {
        justify-content: space-between;
    }
    
    .stat-card {
        flex: 1;
        min-width: 0;
    }
    
    .actividades-filters {
        flex-direction: column;
    }
    
    .actividades-filters select,
    .actividades-filters input {
        width: 100%;
    }
    
    .actividad-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .actividad-footer {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }
    
    .actividad-actions {
        justify-content: flex-end;
    }
}
/* Indicador visual para cronómetros activos */
.cronometro-activo {
    font-weight: bold;
    color: #28a745;
    position: relative;
}

/* Efecto de pulso para cronómetros activos */
.cronometro-activo::before {
    content: "●";
    color: #28a745;
    position: absolute;
    left: -15px;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
    100% {
        opacity: 1;
    }
}

/* Estilo para cronómetros pausados */
.cronometro-pausado {
    color: #ffc107;
    font-weight: normal;
}
/* Al final de css/main.css */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}
.checkbox-grid label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
}
/* Al final de css/main.css */

/* Estilos para la vista previa de plantillas en el modal */
.plantilla-preview .preview-list {
    list-style: none;
    padding-left: 0;
    margin-top: 10px;
    max-height: 150px; /* Evita que la lista sea demasiado larga */
    overflow-y: auto;
    border: 1px solid #f0f0f0;
    padding: 10px;
    border-radius: 4px;
}

.plantilla-preview .preview-list li {
    display: flex;
    align-items: center;
    padding: 5px 0;
    font-size: 0.9em;
    color: #333;
}

.plantilla-preview .preview-list .preview-icon {
    margin-right: 10px;
    color: #007bff; /* Un color base para los íconos */
    width: 20px; /* Asegura que todos los íconos tengan el mismo ancho */
    text-align: center;
}

.plantilla-preview .preview-list .fa-check-square {
    color: #28a745; /* Verde para los checks */
}

.plantilla-preview .preview-list .fa-file-alt {
    color: #6c757d; /* Gris para los documentos */
}

.plantilla-preview .preview-list .fa-tasks {
    color: #17a2b8; /* Azul claro para las tareas */
}

.plantilla-preview .preview-list .preview-text {
    flex-grow: 1;
}
/* Ajustes para la clase 'active' que añadimos para mostrar el modal */
.modal.active {
    display: flex;
}
/* /css/main.css */

/* --- Estilos para el Modal de Vista Previa de Factura --- */

/* 1. Definimos el tamaño del modal en sí */
.modal-preview .modal-content {
    max-width: 850px; /* Ancho similar a una hoja A4 */
    width: 90%;       /* Ocupa el 90% del ancho de la pantalla, hasta un máximo de 850px */
    height: 90vh;     /* Ocupa el 90% de la altura de la pantalla */
    display: flex;    /* Usa flexbox para distribuir el espacio interior */
    flex-direction: column; /* Apila los elementos (header, body, footer) verticalmente */
}

/* 2. Hacemos que el cuerpo del modal crezca para ocupar el espacio */
.modal-body-preview {
    flex-grow: 1; /* Esto es crucial: le dice al body que ocupe todo el espacio vertical disponible */
    padding: 0;   /* Quitamos cualquier padding para que el iframe ocupe todo */
    overflow: hidden; /* Evita barras de scroll dobles */
    border: 1px solid #ccc; /* Un borde sutil para ver los límites del iframe */
    margin: 1rem 0; /* Un poco de espacio arriba y abajo */
}

/* 3. Hacemos que el iframe llene completamente su contenedor (el modal-body) */
.modal-body-preview iframe {
    width: 100%;
    height: 100%;
    border: none; /* Quitamos el borde por defecto del iframe */
}
/* /css/main.css */

/* Estilos para el Widget de Presupuesto */
.budget-widget {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.budget-widget h4 {
    margin-top: 0;
    margin-bottom: 1.25rem;
    color: #495057;
    font-size: 1.1rem;
    font-weight: 600;
}
.budget-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    text-align: center;
    margin-bottom: 1.25rem;
}
.budget-item .label {
    display: block;
    font-size: 0.85em;
    color: #6c757d;
    margin-bottom: 0.25rem;
}
.budget-item .value {
    font-size: 1.5em;
    font-weight: 700;
    line-height: 1.2;
    color: #343a40;
}
.budget-item.available .value {
    color: #28a745;
}
.progress-bar-container {
    background-color: #e9ecef;
    border-radius: 50px;
    height: 28px;
    overflow: hidden;
    position: relative;
}
.progress-bar {
    background: linear-gradient(90deg, #007bff 0%, #0056b3 100%);
    height: 100%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    font-weight: bold;
    white-space: nowrap;
    transition: width 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
    box-shadow: inset 0 -2px 4px rgba(0,0,0,0.15);
}
#main-content .view {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: static !important;
    width: 100%;
}
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.acuerdo-asignacion {
    margin-top: 8px;
}

.acuerdo-select {
    background: white;
    border: 2px solid #4285f4;
    border-radius: 6px;
    padding: 8px 12px;
    font-weight: 600;
    color: #202124;
    min-width: 200px;
}

.acuerdo-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.2);
}

.badge-acuerdo-estado {
    background: linear-gradient(135deg, #34a853, #7bed9f);
    color: white;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 15px;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.acuerdo-horas, .acuerdo-presupuesto {
    font-weight: 600;
    font-size: 1.1rem;
    color: #4285f4;
    text-align: center;
}

.fila-acuerdo-caso .btn {
    background: linear-gradient(135deg, #4285f4, #6c5ce7);
    border: none;
    color: white;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.3);
}

.fila-acuerdo-caso .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(66, 133, 244, 0.4);
}

.fila-acuerdo-caso .btn i {
    margin-right: 6px;
}

/* Espaciado adicional después de la fila de acuerdo */
.fila-acuerdo-caso + tr {
    border-top: 8px solid transparent;
}

/* Responsive */
@media (max-width: 768px) {
    .acuerdo-detalles {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .acuerdo-titulo {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .celda-acuerdo-caso {
        min-width: auto;
    }
    
    .acuerdo-select {
        min-width: 150px;
        font-size: 0.9rem;
    }
}

/* Animación de entrada */
.fila-acuerdo-caso {
    animation: slideInFromTop 0.5s ease-out;
}

@keyframes slideInFromTop {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Efecto hover para toda la fila */
.fila-acuerdo-caso:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 133, 244, 0.2);
    transition: all 0.3s ease;
}
/* ========================================================================
   ESTILOS PARA EL DASHBOARD REDISEÑADO
   Agregue estos estilos a su archivo main.css existente
   ======================================================================== */

/* --- SECCIÓN DE TRABAJO PLANEADO VS REALIZADO --- */
.workload-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e3e8ee;
}

.section-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #3498db;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title i {
    color: #3498db;
}

.workload-comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
}

@media (max-width: 768px) {
    .workload-comparison-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.workload-week-container {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    border: 2px solid #e9ecef;
    position: relative;
}

.week-title {
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    color: #495057;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.workload-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.workload-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #dee2e6;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.workload-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.workload-card.planned {
    border-left: 4px solid #ffc107;
}

.workload-card.realized {
    border-left: 4px solid #28a745;
}

.workload-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.workload-card.planned .workload-icon {
    color: #ffc107;
}

.workload-card.realized .workload-icon {
    color: #28a745;
}

.workload-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.workload-label {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
}

/* --- BARRAS DE PROGRESO --- */
.workload-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress-bar {
    flex: 1;
    height: 12px;
    background-color: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 6px;
    position: relative;
}

.progress-fill.success {
    background: linear-gradient(90deg, #28a745, #20c997);
}

.progress-fill.warning {
    background: linear-gradient(90deg, #ffc107, #fd7e14);
}

.progress-fill.danger {
    background: linear-gradient(90deg, #dc3545, #e74c3c);
}

.progress-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    min-width: 40px;
    text-align: right;
}

/* --- SECCIÓN DE BONOS --- */
.bonus-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    color: white;
}

.bonus-section .section-title {
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.3);
    margin-bottom: 1.5rem;
}

.bonus-section .section-title i {
    color: #ffd700;
}

.bonus-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.bonus-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, background 0.3s ease;
}

.bonus-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.25);
}

.bonus-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.bonus-avatar {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #ffd700;
}

.bonus-info h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.bonus-efficiency {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

.bonus-amount {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* --- ESTADOS ESPECIALES --- */
.bonus-empty, .bonus-error {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
}

.bonus-empty i, .bonus-error i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.7;
}

.bonus-error {
    background: rgba(220, 53, 69, 0.2);
    border-color: rgba(220, 53, 69, 0.5);
}

/* --- MEJORAS A LAS MÉTRICAS EXISTENTES --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.metric-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #e3e8ee;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2980b9);
}

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.metric-label {
    font-size: 0.9rem;
    color: #7f8c8d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- LISTADOS MEJORADOS --- */
.checklist-item {
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checklist-item:hover {
    background-color: #f8f9fa;
}

.checklist-item.clickable {
    cursor: pointer;
}

.checklist-item.clickable:hover {
    background-color: #e3f2fd;
}

/* --- BADGES Y ESTADOS --- */
.item-status, .item-priority {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-activo, .priority-alta {
    background-color: #d4edda;
    color: #155724;
}

.status-pendiente, .priority-media {
    background-color: #fff3cd;
    color: #856404;
}

.status-completado, .priority-baja {
    background-color: #d1ecf1;
    color: #0c5460;
}

.item-date {
    font-size: 0.8rem;
    color: #6c757d;
    margin-left: auto;
}

/* --- ESTADOS DE LOADING Y ERROR --- */
.loading-state, .error-state, .empty-state {
    padding: 2rem;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

.error-state {
    color: #dc3545;
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 1200px) {
    .bonus-container {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .workload-cards {
        grid-template-columns: 1fr;
    }
    
    .bonus-container {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .metric-value {
        font-size: 2rem;
    }
    
    .bonus-amount {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .workload-section, .bonus-section {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .workload-week-container {
        padding: 1rem;
    }
    
    .section-title {
        font-size: 1.1rem;
    }
    
    .workload-value {
        font-size: 1.5rem;
    }
}
/* ========================================================================
   CSS ADICIONAL PARA MEJORAS DEL DASHBOARD
   Agregar estas reglas a su archivo main.css existente
   ======================================================================== */

/* --- MEJORA DE CONTRASTE EN TARJETAS PRINCIPALES --- */
.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a202c !important; /* Color más oscuro para mejor contraste */
    margin-bottom: 0.5rem;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); /* Sombra sutil para mejor legibilidad */
}

.metric-label {
    font-size: 0.9rem;
    color: #4a5568 !important; /* Color más oscuro para mejor contraste */
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- ESTILOS PARA PAGINACIÓN EN TARJETAS --- */
.card-with-pagination {
    display: flex;
    flex-direction: column;
    height: 400px; /* Altura fija para todas las tarjetas */
}

.card-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.card-pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-btn {
    background: #e2e8f0;
    border: none;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 0.9rem;
    color: #4a5568;
}

.pagination-btn:hover:not(:disabled) {
    background: #cbd5e0;
}

.pagination-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.pagination-info {
    font-size: 0.8rem;
    color: #718096;
    min-width: 80px;
    text-align: center;
}

.card-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.paginated-list {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 1rem;
}

/* --- MEJORAS EN LOS ELEMENTOS DE LISTA --- */
.checklist {
    list-style: none;
    padding: 0;
    margin: 0;
}

.checklist-item {
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid transparent;
}

.checklist-item:hover {
    background-color: #f7fafc;
    border-color: #e2e8f0;
}

.checklist-item.clickable {
    cursor: pointer;
}

.checklist-item.clickable:hover {
    background-color: #e3f2fd;
    border-color: #bbdefb;
}

/* --- ESTADOS ESPECIALES PARA LISTAS --- */
.empty-state, .loading-state, .error-state {
    padding: 2rem;
    text-align: center;
    color: #718096;
    font-style: italic;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.empty-state i, .loading-state i, .error-state i {
    font-size: 2rem;
    opacity: 0.5;
}

.error-state {
    color: #e53e3e;
}

.loading-state {
    color: #3182ce;
}

/* --- BADGES MEJORADOS --- */
.item-status, .item-priority {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.status-activo, .priority-alta {
    background-color: #c6f6d5;
    color: #22543d;
}

.status-pendiente, .priority-media {
    background-color: #fef5e7;
    color: #744210;
}

.status-completado, .priority-baja {
    background-color: #bee3f8;
    color: #2a4365;
}

.status-finalizado {
    background-color: #e6fffa;
    color: #234e52;
}

.item-title {
    flex: 1;
    font-weight: 500;
    color: #2d3748;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-date {
    font-size: 0.8rem;
    color: #718096;
    white-space: nowrap;
}

/* --- RESPONSIVE PARA PAGINACIÓN --- */
@media (max-width: 768px) {
    .card-with-pagination {
        height: 300px;
    }
    
    .card-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }
    
    .card-pagination-controls {
        justify-content: center;
    }
    
    .pagination-info {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .card-with-pagination {
        height: 250px;
    }
    
    .pagination-btn {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .pagination-info {
        font-size: 0.7rem;
    }
}
/* Ocultar las sugerencias de autocompletado */
#inputEmailUsuario:-webkit-autofill,
#inputEmailUsuario:-webkit-autofill:hover,
#inputEmailUsuario:-webkit-autofill:focus,
#inputEmailUsuario:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px white inset !important;
    -webkit-text-fill-color: #333 !important;
}
/* /css/main.css */

/* Solución para el autocompletado de Chrome en inputs manipulados por JS */
/* Fuerza la visibilidad del background y box-shadow para que el valor asignado por JS no se oculte */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0px 1000px white inset !important;
    -webkit-text-fill-color: #333 !important; /* Color del texto del input */
    background-color: white !important; /* Color de fondo del input */
    background-image: none !important;
    color: #333 !important; /* Asegura el color del texto */
}

/* Si el input de email es de tipo "text" para evitar autocompletado, pero quieres validación de email */
input[data-real-type="email"] {
    /* Aquí puedes añadir estilos o validaciones específicas si es necesario */
}
/* --- Estilos para la Asistencia Inteligente en Modales (VERSIÓN FINAL) --- */

/* ... (las otras reglas como .ai-assistant-card, .ai-actions se mantienen igual) ... */

.ai-result-container {
    background-color: #ffffff;
    border: 1px solid #dde1e7;
    border-radius: 4px;
    padding: 1rem;
    
    /* --- CAMBIOS CLAVE --- */
    min-height: 100px; /* Altura mínima para que sea visible incluso vacío */
    max-height: 250px; /* Altura máxima para evitar que el modal crezca demasiado */
    overflow-y: auto;  /* AÑADE UNA BARRA DE SCROLL si el contenido es muy largo */
    display: block !important; /* Fuerza la visibilidad */
    
    white-space: pre-wrap;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    color: #333;
    line-height: 1.5;
    
    /* Transición suave para la aparición */
    transition: all 0.3s ease;
}

.ai-result-container.loading {
    display: flex !important; /* Fuerza la visibilidad del estado de carga */
    justify-content: center;
    align-items: center;
    color: #888;
}

.ai-result-container.loading::after {
    content: "Consultando al asistente...";
    animation: blinker 1.5s linear infinite;
}

/* Escondemos el <pre> que pusimos para el "Hola Mundo" si no lo necesitas más */
.ai-result-container pre {
    margin: 0;
    padding: 0;
    color: inherit; /* Hereda el color del padre */
    font-size: inherit; /* Hereda el tamaño de fuente */
    font-family: inherit; /* Hereda la fuente */
}

@keyframes blinker {
    50% { opacity: 0.5; }
}
/* Estilos para el ranking de IA */
.ai-ranking-list {
    list-style-type: none;
    padding: 0;
}
.ai-ranking-list li {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}
.pertinencia-bar-container {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 20px;
    background-color: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin: 4px 0;
}
.pertinencia-bar {
    height: 100%;
    transition: width 0.5s ease-in-out;
}
.pertinencia-bar-container span {
    font-size: 0.8em;
    font-weight: bold;
    color: #333;
    padding-right: 8px;
}
.justificacion {
    font-style: italic;
    color: #666;
    font-size: 0.85em;
}
.ai-consejo {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #e3f2fd;
    border-left: 4px solid #2196F3;
    border-radius: 4px;
}
.ai-consejo h6 {
    margin-top: 0;
    color: #1e88e5;
}

.text-viewer {
    white-space: pre-wrap; /* Mantiene saltos de línea y espacios */
    word-wrap: break-word; /* Evita que el texto se desborde */
    background-color: #f8f9fa;
    padding: 15px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    max-height: 60vh;
    overflow-y: auto;
    font-family: monospace;
}

/* --- Estilos para el Módulo de Reportes --- */
.report-nav {
  margin-bottom: 20px;
}

.tab-buttons {
  display: flex;
  gap: 10px;
  border-bottom: 2px solid #e1e5e9;
  padding-bottom: 10px;
}

.tab-btn {
  padding: 12px 24px;
  border: none;
  background: #f8f9fa;
  color: #6c757d;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.tab-btn.active {
  background: #007bff;
  color: white;
}

.tab-btn:hover:not(.active) {
  background: #e9ecef;
  color: #495057;
}

.report-content {
  display: none;
}

.report-content.active {
  display: block;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.metrics-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.metric-item {
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.metric-value {
  font-size: 2em;
  font-weight: bold;
  margin-bottom: 5px;
}

.metric-label {
  font-size: 0.9em;
  opacity: 0.9;
}

.chart-container {
  margin: 30px 0;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
}

.table-actions {
  margin-bottom: 15px;
  display: flex;
  gap: 10px;
}

.table-container table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.table-container th,
.table-container td {
  padding: 12px;
  border: 1px solid #dee2e6;
  text-align: left;
}

.table-container th {
  background: #f1f3f4;
  font-weight: 600;
}

.table-container tbody tr:hover {
  background: #f8f9fa;
}


/* Contenedores de gráficos con dimensiones FIJAS */
.chart-container {
    position: relative;
    height: 400px !important;
    width: 100% !important;
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

.chart-container canvas {
    max-height: 350px !important;
    max-width: 100% !important;
    display: block !important;
}

#chart-estados-casos {
    max-height: 300px !important;
    max-width: 500px !important;
    margin: 0 auto !important;
}

#chart-horas-abogados {
    max-height: 350px !important;
    max-width: 100% !important;
}

/* --- Aumentar altura del textarea de Descripción en la vista de Caso --- */
#casoDescripcion {
    min-height: 450px; /* Puedes ajustar este número a tu gusto (ej: 200px) */
    resize: vertical;  /* Opcional: permite al usuario cambiar el tamaño verticalmente */
}

/* --- Estilos para la Gestión de Tokens PQR en Configuración --- */
#tokens-list-container {
    margin-top: 20px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.status-active {
    background-color: #d4edda; /* Verde claro */
    color: #155724; /* Verde oscuro */
}

.status-badge.status-inactive {
    background-color: #fff3cd; /* Amarillo claro */
    color: #856404; /* Amarillo oscuro */
}

.token-preview {
    font-family: monospace;
    background-color: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: #e83e8c;
}

/* --- Estilos para el Modal de Consulta de Conformidad --- */
.document-checklist {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
}

.document-checklist-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.document-checklist-item:last-child {
    border-bottom: none;
}

.document-checklist-item:hover {
    background-color: #f8f9fa;
}

.document-checklist-item input[type="checkbox"] {
    margin-right: 12px;
    width: auto; /* Anular el width: 100% de los inputs generales */
}

.document-checklist-item label {
    margin-bottom: 0; /* Anular margen por defecto */
    font-weight: normal;
    flex-grow: 1;
    cursor: pointer;
}

.document-checklist-item .doc-icon {
    margin-right: 8px;
    color: #6c757d;
}

.document-checklist-item .doc-date {
    font-size: 0.8em;
    color: #999;
    margin-left: auto;
    padding-left: 10px;
}

/* CSS para la lista de actividades anidada */
.tarea-header {
    display: flex;
    align-items: center;
    gap: 8px;
}
.btn-expand-actividades {
    padding: 4px 8px;
    line-height: 1;
}
.fila-actividades td {
    padding: 0;
    background-color: #f8f9fa; /* Un color de fondo ligeramente diferente */
    border-top: 2px solid #6c757d; /* Un borde superior para separarla de la tarea */
}
.celda-actividades-container {
    padding: 15px 20px 15px 40px; /* Indentación para que se vea anidada */
}
.lista-actividades-interna {
    list-style: none;
    padding: 0;
    margin: 0;
}
.lista-actividades-interna li {
    display: grid;
    grid-template-columns: 3fr 2fr 1fr 1fr; /* 4 columnas */
    gap: 10px;
    padding: 8px 5px;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.9em;
}
.lista-actividades-interna li.header {
    font-weight: bold;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}
.lista-actividades-interna li:last-child {
    border-bottom: none;
}
.document-checklist {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 5px;
    background-color: #f9f9f9;
}
.document-checklist-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}
.document-checklist-item input {
    margin-right: 10px;
}
.vinculados-section {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px dashed #ddd;
}
.vinculados-section strong {
    font-size: 0.9em;
    color: #6c757d;
}
.vinculados-list {
    list-style: none;
    padding: 0;
    margin-top: 5px;
}
.vinculados-list li a {
    display: inline-block;
    padding: 4px 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    margin: 2px;
    font-size: 0.85em;
    color: #495057;
    text-decoration: none;
    transition: all 0.2s ease;
}
.vinculados-list li a:hover {
    background-color: #dee2e6;
    color: #212529;
}
.vinculados-list li a i {
    margin-right: 5px;
}

/* ============================================= */
/* == ESTILOS PARA EL LABORATORIO DE ACTIVIDADES == */
/* ============================================= */

.activities-lab-container {
    display: grid; /* Usamos Grid Layout */
    grid-template-columns: 450px 1fr; /* Columna 1: 450px fijos. Columna 2: el resto */
    gap: 20px;
    height: calc(100vh - 250px);
}

.activities-feed-column {
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Evita que los hijos se desborden */
}

.activities-lab-column {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0 15px 0;
    border-bottom: 1px solid #e9ecef;
}

.feed-filters {
    display: flex;
    gap: 10px;
    padding: 15px 0;
}
.feed-filters .form-control { /* Estilos básicos para los filtros */
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

.activities-list-feed {
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 10px; /* Para la barra de scroll */
}

/* Tarjeta de Actividad en el Feed */
.activity-card-feed {
    background-color: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    border-left: 4px solid #6c757d; /* Color por defecto */
}
.activity-card-feed:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-left-color: #007bff;
}
.activity-card-feed.active {
    border-left-color: #007bff;
    background-color: #f0f7ff;
}

.card-feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85em;
    margin-bottom: 8px;
}
.card-feed-header .fecha {
    font-weight: bold;
    color: #343a40;
}
.card-feed-header .tarea-tag {
    background-color: #e9ecef;
    padding: 3px 8px;
    border-radius: 12px;
    color: #495057;
}

.card-feed-descripcion {
    font-size: 0.95em;
    line-height: 1.5;
    margin-bottom: 12px;
}

.card-feed-footer {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.85em;
    color: #6c757d;
}
.card-feed-footer .docs-preview {
    margin-left: auto; /* Empuja a la derecha */
    background-color: #ffc107;
    color: #343a40;
    padding: 3px 8px;
    border-radius: 4px;
}
.card-feed-footer i {
    margin-right: 4px;
}

/* Panel del Laboratorio */
.lab-panel {
    padding: 25px;
    flex-grow: 1;
    overflow-y: auto;
}
.lab-panel-default {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #adb5bd;
}
.lab-panel-default i {
    font-size: 4em;
    margin-bottom: 20px;
}
.lab-panel-active {
    text-align: left;
    color: #343a40;
}

.lab-section {
    margin-bottom: 25px;
}
.lab-section h5 {
    margin-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 5px;
}
.lab-docs-list {
    list-style: none;
    padding: 0;
}
.lab-docs-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 5px;
}
.lab-docs-list .btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    color: #007bff;
    font-size: 1.1em;
}
.ia-result {
    margin-top: 15px;
    padding: 15px;
    background-color: #f0f7ff;
    border-left: 4px solid #007bff;
    border-radius: 4px;
    animation: fadeIn 0.5s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.ia-result h5 {
    margin-bottom: 10px;
}
.ia-actions-container { text-align: right; margin-top: 5px; }
.ia-results-container {
    margin-top: 10px;
    padding: 10px;
    background-color: #f0f7ff;
    border-left: 3px solid #007bff;
    border-radius: 4px;
    font-size: 0.9em;
}
.ia-result-item { margin-bottom: 8px; }
.ia-result-item ul { padding-left: 20px; margin-top: 5px; }
.ia-result-item .badge { margin: 2px; }
.alert-plazo {
    background-color: #fff3cd;
    border-color: #ffeeba;
    color: #856404;
    padding: 8px;
    border-radius: 4px;
}
.documento-contexto {
    font-size: 0.8em;
    font-style: italic;
    margin-top: 4px;
}
.documento-nombre-principal {
    font-weight: 500;
}
.documento-ia-detalles {
    margin-top: 8px;
    padding-left: 10px;
    border-left: 2px solid #007bff;
    font-size: 0.9em;
}
.documento-ia-detalles .ia-resumen {
    color: #555;
    margin-bottom: 5px;
}
.documento-ia-detalles ul {
    padding-left: 18px;
    margin: 0;
}
.ia-pills-container {
    margin-top: 5px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
@keyframes highlight-fade {
  from {
    background-color: rgba(255, 235, 59, 0.7); /* Amarillo brillante */
  }
  to {
    background-color: transparent;
  }
}

.highlight-animation {
  animation: highlight-fade 2.5s ease-out;
}

/* Tabs */
.tabs {
    width: 100%;
}

.tab-buttons {
    display: flex;
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 20px;
}

.tab-button {
    flex: 1;
    padding: 10px 15px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-button:hover {
    background: #f8f9fa;
}

.tab-button.active {
    color: #007bff;
    border-bottom-color: #007bff;
    font-weight: 600;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Formularios */
.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

.required {
    color: #dc3545;
}

.info-text {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
    color: #666;
}

/* Lista de recurrentes */
.recurrentes-container {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px 0;
}

.recurrente-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: background 0.2s;
}

.recurrente-item:hover {
    background: #e9ecef;
}

.recurrente-info h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    color: #333;
}

.recurrente-info p {
    margin: 5px 0;
    color: #666;
    font-size: 14px;
}

.recurrente-actions {
    display: flex;
    gap: 5px;
}

/* Lista de aplicar recurrentes */
.recurrentes-list {
    max-height: 300px;
    overflow-y: auto;
}

.recurrente-check-item {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.recurrente-check-item input[type="checkbox"] {
    margin-right: 15px;
}

.recurrente-check-info {
    flex: 1;
}

.recurrente-check-monto {
    width: 120px;
    margin-left: 15px;
}

.recurrente-check-monto input {
    width: 100%;
    padding: 5px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

/* Acciones del modal */
.modal-actions-top {
    margin-bottom: 20px;
    text-align: right;
}

/* Ajustes responsive */
@media (max-width: 768px) {
    .tab-buttons {
        flex-direction: column;
    }
    
    .tab-button {
        width: 100%;
        text-align: left;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .recurrente-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .recurrente-actions {
        margin-top: 10px;
        width: 100%;
        justify-content: flex-start;
    }
}

/* Estilos para el contenedor de módulos en la vista de Admin */
.admin-modules-container {
    padding: 10px;
}

.admin-module-item {
    display: flex;
    align-items: center;
    padding: 20px;
    border-radius: 8px;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s;
    margin-bottom: 10px;
}

.admin-module-item:hover {
    background-color: #e9ecef;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.module-icon {
    font-size: 24px;
    color: #007bff;
    margin-right: 20px;
    width: 40px;
    text-align: center;
}

.module-info {
    flex-grow: 1;
}

.module-info h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    color: #333;
}

.module-info p {
    margin: 0;
    font-size: 14px;
    color: #6c757d;
}

.module-arrow {
    font-size: 16px;
    color: #adb5bd;
}

a.summary-card-link { text-decoration: none; }

/* Regla principal para asegurar que el texto en la tabla de cartera sea visible */
#tbody-cartera-vencida td {
    color: #333; /* Un color de texto oscuro estándar */
    padding: 12px 10px; /* Ajusta el espaciado para mejor legibilidad */
    vertical-align: middle;
}

/* Estilo específico para la columna de días vencidos para que resalte más */
#tbody-cartera-vencida td.dias-vencidos {
    color: #CC0000; /* Rojo oscuro */
    font-weight: bold;
    text-align: center;
}

/* Estilo para las columnas de valores numéricos */
#tbody-cartera-vencida td.valor-moneda {
    text-align: right;
    font-family: monospace; /* Opcional: para alinear mejor los números */
}

/ ESTILOS CSS ADICIONALES NECESARIOS (agregar al archivo de estilos):

.status-badge.pago-sin-pago {
    background-color: #6c757d;
    color: white;
}

.status-badge.pago-parcial {
    background-color: #fd7e14;
    color: white;
}

.status-badge.pago-pagada {
    background-color: #28a745;
    color: white;
}

// ESTILOS CSS ADICIONALES
.status-badge.pago-sin-pago {
    background-color: #6c757d;
    color: white;
}

.status-badge.pago-parcial {
    background-color: #fd7e14;
    color: white;
}

.status-badge.pago-pagada {
    background-color: #28a745;
    color: white;
}

.badge-count {
    display: inline-block;
    background: #dc3545;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    margin-left: 3px;
}

.text-info {
    color: #17a2b8;
}

.status-badge.pago-sin-pago {
    background-color: #6c757d;
    color: white;
}

.status-badge.pago-parcial {
    background-color: #fd7e14;
    color: white;
}

.status-badge.pago-pagada {
    background-color: #28a745;
    color: white;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.resumen-financiero {
    display: flex;
    gap: 30px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    margin-top: 10px;
}

.resumen-financiero .item {
    display: flex;
    flex-direction: column;
}

.resumen-financiero .label {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    font-weight: 600;
}

.resumen-financiero .valor {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

.resumen-financiero .valor.positivo {
    color: #28a745;
}

.resumen-financiero .valor.negativo {
    color: #dc3545;
}

.estadisticas-casos {
    display: flex;
    gap: 20px;
    padding: 10px;
    font-size: 14px;
}

.estadisticas-casos .stat {
    display: flex;
    align-items: center;
    gap: 5px;
}

.estadisticas-casos .stat-label {
    color: #6c757d;
}

.estadisticas-casos .stat-value {
    font-weight: bold;
    color: #333;
}

.table-facturas tbody tr.detalle-pagos {
    background-color: #f8f9fa;
}

.detalle-pagos td {
    padding: 0 !important;
}

.pagos-container {
    padding: 15px 30px;
}

.pago-item {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    border-left: 3px solid #007bff;
    margin-bottom: 5px;
    background: white;
}

.btn-expandir {
    background: none;
    border: none;
    cursor: pointer;
    color: #007bff;
}

.paginacion-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

.paginacion-container button {
    padding: 5px 10px;
    border: 1px solid #dee2e6;
    background: white;
    cursor: pointer;
}

.paginacion-container button:hover {
    background: #f8f9fa;
}

.paginacion-container button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.paginacion-info {
    font-size: 14px;
    color: #6c757d;
}

.search-controls-casos {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.search-main-container {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.search-field-selector {
    padding: 10px 15px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    min-width: 150px;
}

.search-box-casos {
    position: relative;
    flex: 1;
    min-width: 300px;
    max-width: 600px; /* Ocupa más espacio horizontal */
}

.search-input-casos {
    width: 100%;
    padding: 10px 40px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    font-size: 14px;
    transition: all 0.3s;
}

.search-input-casos:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    pointer-events: none;
}

.btn-clear-search {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 5px 10px;
    transition: color 0.3s;
}

.btn-clear-search:hover {
    color: #dc3545;
}

.filter-state {
    padding: 10px 15px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    min-width: 150px;
}

.search-info-casos {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.contador-casos {
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}

.contador-casos span {
    font-weight: bold;
    color: #333;
}

.select-per-page {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

/* Estilos de paginación */
.paginacion-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 20px;
    padding: 15px;
    flex-wrap: wrap;
}

.paginacion-container button {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    background: white;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
    min-width: 40px;
}

.paginacion-container button:hover:not(:disabled) {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.paginacion-container button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.paginacion-container button.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.paginacion-container .paginacion-info {
    padding: 8px 15px;
    font-size: 14px;
    color: #6c757d;
}

/* Highlight de búsqueda */
.highlight-search {
    background-color: #fff3cd;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 500;
}

/* Mantener estilos de badges de estado */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.badge-warning { background: #ffc107; color: #333; }
.badge-success { background: #28a745; color: white; }
.badge-info { background: #17a2b8; color: white; }
.badge-danger { background: #dc3545; color: white; }
.badge-secondary { background: #6c757d; color: white; }

/* Responsive */
@media (max-width: 768px) {
    .search-main-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box-casos {
        max-width: 100%;
    }
    
    .search-info-casos {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
}
/* ========== INICIO: Estilos para el Módulo de Propuestas ========== */

#vista-propuestas .card-header .btn {
    font-size: 0.85rem;
}

#tabla-propuestas th, #tabla-propuestas td {
    vertical-align: middle;
}

#tabla-propuestas .badge {
    font-size: 0.8em;
    font-weight: 600;
}

#dashboard-propuestas .card-body .fa-2x {
    opacity: 0.3;
}

#modal-propuesta .form-label {
    font-weight: 600;
}

/* Fin de estilos del Módulo de Propuestas */

.modal {
   z-index: 1055; /* Valor estándar de Bootstrap */
}

.modal-backdrop {
   z-index: 1050;
}
/* Opción 1: Sobrescribir globalmente todos los .text-white */
.text-white {
  color: #131212 !important;
}

/* Opción 2 (más elegante): Usar para tus números específicos */
#vista-propuestas .card .stat-value,
.numero-propuesta {
  color: #131212 !important;
}

/* Paginación de casos */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 1rem 0;
}

.btn-pag {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.btn-pag:hover:not([disabled]) {
    background: #f0f0f0;
    border-color: #999;
}

.btn-pag.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.btn-pag:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-dots {
    padding: 0 0.5rem;
    color: #999;
}

.badge-principal {
    background-color: #007bff !important;
    color: white;
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
    font-weight: 600;
    border-radius: 12px;
}

/* WIDGET DE HORAS PARA TAREAS */
.celda-horas-widget {
    min-width: 140px;
}

.horas-widget-simple {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px;
}

.horas-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 500;
}

.horas-display .horas-consumidas {
    color: #2d3748;
    min-width: 35px;
    text-align: right;
}

.horas-display .horas-separator {
    color: #cbd5e0;
}

.horas-display .horas-totales {
    color: #718096;
    min-width: 35px;
    text-align: left;
}

.progress-bar-simple {
    width: 100%;
    height: 6px;
    background-color: #edf2f7;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-simple .progress-fill {
    height: 100%;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 3px;
}

/* ================================================================
   ESTILOS PARA SECCIÓN DE TIEMPO EN TARJETAS DE ACTIVIDADES
   ================================================================ */

.card-feed-body {
    padding: 0.75rem 0;
    border-top: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.responsable {
    font-size: 0.85rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ========== SECCIÓN DE TIEMPO GENERAL ========== */
.tiempo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background-color: #f5f5f5;
    border-radius: 4px;
}

/* ========== CRONÓMETRO ========== */
.tiempo-section.cronometro-section {
    flex-direction: column;
    align-items: flex-start;
}

.cronometro-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.cronometro-tiempo {
    font-size: 1.5rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    color: #007bff;
    min-width: 120px;
    text-align: center;
}

.cronometro-tiempo.cronometro-activo {
    color: #28a745;
    animation: pulse 1s infinite;
}

.cronometro-tiempo.cronometro-pausado {
    color: #ffc107;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.tipo-actividad {
    margin-left: auto;
    opacity: 0.5;
    font-size: 0.9rem;
}

.cronometro-botones {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    flex-wrap: wrap;
}

.btn.btn-xs {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    border-radius: 3px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-warning {
    background-color: #ffc107;
    color: #333;
}

.btn-warning:hover {
    background-color: #e0a800;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* ========== MANUAL (HORAS) ========== */
.tiempo-section.manual-section {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.horas-edit-group {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    align-items: center;
}

.horas-input {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 0.9rem;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #007bff;
}

.horas-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.horas-display {
    font-size: 0.9rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
}

.horas-display i {
    color: #007bff;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .cronometro-botones {
        flex-direction: column;
    }
    
    .btn.btn-xs {
        width: 100%;
        justify-content: center;
    }
    
    .tiempo-section {
        gap: 0.5rem;
    }
    
    .cronometro-tiempo {
        font-size: 1.25rem;
    }
}

/* ========== ESTILOS PARA VISTA ENRIQUECIDA DE CASOS ========== */

/* Fila principal de caso */
.fila-caso-principal {
    border-bottom: none;
}

/* Fila de información enriquecida */
.fila-caso-info-enriquecida td {
    padding: 10px 12px !important;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    font-size: 0.85rem;
}

/* Resaltar documento en actuación */
.badge-success i {
    margin-right: 3px;
}

/* Animación sutil para documentos */
@keyframes pulseLight {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

.fila-caso-info-enriquecida .badge-success {
    animation: pulseLight 2s infinite;
}

/* Responsive: Ajustar en pantallas pequeñas */
@media (max-width: 768px) {
    .fila-caso-info-enriquecida {
        font-size: 0.75rem;
    }
    
    .row.no-gutters > [class*="col-"] {
        margin-bottom: 8px;
    }
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 600px;
    overflow-y: auto;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.sin-mensajes {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
}

.separador-fecha {
    text-align: center;
    margin: 20px 0 15px;
    font-size: 12px;
    color: #999;
    font-weight: bold;
}

.mensaje-item {
    margin-bottom: 15px;
    padding: 10px 12px;
    border-radius: 8px;
    max-width: 70%;
    word-wrap: break-word;
}

.mensaje-cliente {
    align-self: flex-start;
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.mensaje-abogado {
    align-self: flex-end;
    background: #f0f0f0;
    border-right: 4px solid #4caf50;
}

.mensaje-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 12px;
}

.mensaje-header strong {
    color: #333;
}

.mensaje-header small {
    color: #999;
    margin: 0 10px;
}

.estado-mensaje {
    font-size: 11px;
    color: #2196f3;
}

.mensaje-cuerpo {
    line-height: 1.4;
    color: #333;
    font-size: 14px;
}

.formulario-respuesta {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.textarea-respuesta {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: Arial, sans-serif;
    resize: vertical;
}

.respuesta-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.contador {
    font-size: 12px;
    color: #999;
}

.btn-enviar-respuesta {
    padding: 8px 15px;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.btn-enviar-respuesta:hover:not(:disabled) {
    background: #45a049;
}

.btn-enviar-respuesta:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.error-mensaje {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #f44336;
}