/*
 * ARCHIVO: /css/modules/workload-planning.css
 * DESCRIPCIÓN: Estilos específicos para el módulo de planificación de carga de trabajo
 * SINCRONIZADO CON: /js/modules/workload-planning.js
 */

/* =============================================================================
   VARIABLES CSS ESPECÍFICAS DEL MÓDULO
   ============================================================================= */

:root {
    --workload-primary: #2563eb;
    --workload-secondary: #64748b;
    --workload-success: #059669;
    --workload-warning: #d97706;
    --workload-danger: #dc2626;
    --workload-info: #0891b2;
    
    /* Risk Colors */
    --risk-low: #10b981;
    --risk-medium: #f59e0b;
    --risk-high: #ef4444;
    --risk-critical: #991b1b;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-control-tower: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    --gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    
    /* Shadows */
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-card-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-control-tower: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* =============================================================================
   CONTROL TOWER - DASHBOARD PRINCIPAL
   ============================================================================= */

.control-tower {
    background: var(--gradient-control-tower);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-control-tower);
    color: white;
    position: relative;
    overflow: hidden;
}

.control-tower::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
    pointer-events: none;
}

.control-tower-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.control-tower-header h2 {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.live-indicator i {
    color: #10b981;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.dashboard-actions {
    display: flex;
    gap: 0.75rem;
}

.dashboard-actions .btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.dashboard-actions .btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* =============================================================================
   SMART INSIGHTS - TARJETAS DE MÉTRICAS
   ============================================================================= */

.smart-insights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.insight-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    color: #1f2937;
}

.insight-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.15);
}

.insight-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.insight-card.critical .insight-icon {
    background: var(--gradient-danger);
}

.insight-card.revenue .insight-icon {
    background: var(--gradient-success);
}

.insight-card.efficiency .insight-icon {
    background: var(--gradient-primary);
}

.insight-card.capacity .insight-icon {
    background: var(--gradient-info);
}

.insight-content h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.insight-content p {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

/* =============================================================================
   ALERTAS DEL DASHBOARD
   ============================================================================= */

.dashboard-alerts {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 1;
}

.dashboard-alerts h4 {
    margin: 0 0 1rem 0;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 500;
}

.alert-item.critical {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border-left: 4px solid #dc2626;
}

.alert-item.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border-left: 4px solid #d97706;
}

.alert-item.info {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
    border-left: 4px solid #2563eb;
}

/* =============================================================================
   TARJETAS DE ABOGADOS - DISEÑO MEJORADO
   ============================================================================= */

.abogado-card {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    margin-bottom: 1.5rem;
}

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

.abogado-card.selected {
    border-color: var(--workload-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.abogado-card.enhanced {
    /* Clase adicional para tarjetas mejoradas */
}

/* Estados de riesgo */
.abogado-card.low-risk {
    border-top: 4px solid var(--risk-low);
}

.abogado-card.medium-risk {
    border-top: 4px solid var(--risk-medium);
}

.abogado-card.high-risk {
    border-top: 4px solid var(--risk-high);
}

.abogado-card.critical-risk {
    border-top: 4px solid var(--risk-critical);
    animation: critical-pulse 2s infinite;
}

@keyframes critical-pulse {
    0%, 100% { box-shadow: var(--shadow-card); }
    50% { box-shadow: 0 0 20px rgba(153, 27, 27, 0.3); }
}

/* =============================================================================
   HEADER DE LA TARJETA
   ============================================================================= */

.card-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid #f3f4f6;
}

.abogado-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.abogado-details h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
}

.risk-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.risk-badge.low-risk {
    background: rgba(16, 185, 129, 0.1);
    color: var(--risk-low);
}

.risk-badge.medium-risk {
    background: rgba(245, 158, 11, 0.1);
    color: var(--risk-medium);
}

.risk-badge.high-risk {
    background: rgba(239, 68, 68, 0.1);
    color: var(--risk-high);
}

.risk-badge.critical-risk {
    background: rgba(153, 27, 27, 0.1);
    color: var(--risk-critical);
    animation: badge-pulse 1.5s infinite;
}

@keyframes badge-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
}

.btn-icon:hover {
    background: #f9fafb;
    color: #374151;
    transform: scale(1.05);
}

/* =============================================================================
   RESUMEN DE CARGA DE TRABAJO
   ============================================================================= */

.workload-summary {
    padding: 1.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.load-display {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.load-numbers {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-family: 'JetBrains Mono', 'SF Mono', 'Monaco', monospace;
}

.current-load {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
}

.capacity-separator {
    font-size: 1.5rem;
    color: #9ca3af;
}

.max-capacity {
    font-size: 1.25rem;
    color: #6b7280;
}

.load-percentage {
    font-size: 1rem;
    color: #9ca3af;
    margin-left: 0.5rem;
}

.load-bar-container {
    position: relative;
}

.load-bar {
    height: 12px;
    background: #f3f4f6;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.load-progress {
    height: 100%;
    border-radius: 6px;
    transition: all 0.6s ease;
    position: relative;
}

.load-progress.low-risk {
    background: linear-gradient(90deg, var(--risk-low), #34d399);
}

.load-progress.medium-risk {
    background: linear-gradient(90deg, var(--risk-medium), #fbbf24);
}

.load-progress.high-risk {
    background: linear-gradient(90deg, var(--risk-high), #f87171);
}

.load-progress.critical-risk {
    background: linear-gradient(90deg, var(--risk-critical), #dc2626);
    animation: progress-pulse 1s infinite;
}

@keyframes progress-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.overload-indicator {
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        #dc2626,
        #dc2626 4px,
        #ffffff 4px,
        #ffffff 8px
    );
    position: absolute;
    top: 0;
    animation: overload-stripes 1s linear infinite;
}

@keyframes overload-stripes {
    from { background-position: 0 0; }
    to { background-position: 16px 0; }
}

/* =============================================================================
   GRID DE MÉTRICAS
   ============================================================================= */

.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 1.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.metric {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.metric:hover {
    background: #f3f4f6;
    transform: translateY(-1px);
}

.metric-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.metric-icon.revenue {
    background: var(--gradient-success);
}

.metric-icon.deadline {
    background: var(--gradient-primary);
}

.metric-content {
    flex: 1;
}

.metric-label {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.metric-value {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
}

.metric-value.urgent {
    color: var(--risk-high);
}

.metric-value.today {
    color: var(--risk-medium);
}

.metric-value.tomorrow {
    color: var(--workload-info);
}

.metric-value.soon {
    color: var(--risk-medium);
}

.metric-value.normal {
    color: var(--risk-low);
}

.metric-value.overdue {
    color: var(--risk-critical);
    animation: text-pulse 1s infinite;
}

@keyframes text-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* =============================================================================
   RESUMEN DE TAREAS
   ============================================================================= */

.task-summary {
    padding: 1.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.task-counters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.task-counter {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.task-counter.pending {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
    border-color: rgba(59, 130, 246, 0.2);
}

.task-counter.in-progress {
    background: rgba(16, 185, 129, 0.1);
    color: var(--risk-low);
    border-color: rgba(16, 185, 129, 0.2);
}

.task-counter.overdue {
    background: rgba(239, 68, 68, 0.1);
    color: var(--risk-high);
    border-color: rgba(239, 68, 68, 0.2);
    animation: counter-pulse 2s infinite;
}

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

/* =============================================================================
   FOOTER DE LA TARJETA - BOTONES DE ACCIÓN
   ============================================================================= */

.card-footer {
    padding: 1.5rem;
    background: #fafbfc;
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-outline {
    background: white;
    border-color: #d1d5db;
    color: #374151;
}

.btn-outline:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn-warning {
    background: var(--risk-medium);
    color: white;
    border-color: var(--risk-medium);
}

.btn-warning:hover {
    background: #d97706;
    transform: translateY(-1px);
}

.btn-ai {
    background: var(--gradient-primary);
    color: white;
    border: none;
}

.btn-ai:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

/* =============================================================================
   VISTA DE TABLA - ABOGADOS
   ============================================================================= */

.abogados-table-view {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.abogados-table {
    width: 100%;
    border-collapse: collapse;
}

.abogados-table th {
    background: #f8fafc;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.abogado-row {
    border-bottom: 1px solid #f3f4f6;
    transition: all 0.2s ease;
    cursor: pointer;
}

.abogado-row:hover {
    background: #f9fafb;
}

.abogado-row.low-risk {
    border-left: 4px solid var(--risk-low);
}

.abogado-row.medium-risk {
    border-left: 4px solid var(--risk-medium);
}

.abogado-row.high-risk {
    border-left: 4px solid var(--risk-high);
}

.abogado-row.critical-risk {
    border-left: 4px solid var(--risk-critical);
}

.abogado-row td {
    padding: 1rem;
    vertical-align: middle;
}

.abogado-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar-sm {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.avatar-sm img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.abogado-name {
    font-weight: 600;
    color: #1f2937;
}

.capacity-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.capacity-bar {
    width: 100px;
    height: 8px;
    background: #f3f4f6;
    border-radius: 4px;
    overflow: hidden;
}

.capacity-progress {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.capacity-text {
    font-weight: 600;
    font-size: 0.875rem;
}

.task-count {
    font-weight: 600;
    color: #1f2937;
}

.deadline {
    font-size: 0.875rem;
    color: #6b7280;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

/* =============================================================================
   SECCIÓN DE DETALLE DE TAREAS
   ============================================================================= */

.task-detail-section {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    margin-top: 2rem;
    overflow: hidden;
}

.detail-header {
    background: var(--gradient-primary);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
}

.detail-close {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.detail-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.task-detail-content {
    padding: 2rem;
}

.tasks-table-container {
    overflow-x: auto;
}

.tasks-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.tasks-table th {
    background: #f8fafc;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.tasks-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.case-link {
    color: var(--workload-primary);
    cursor: pointer;
    text-decoration: underline;
}

.case-link:hover {
    color: #1d4ed8;
}

.priority-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.priority-badge.alta {
    background: rgba(239, 68, 68, 0.1);
    color: var(--risk-high);
}

.priority-badge.media {
    background: rgba(245, 158, 11, 0.1);
    color: var(--risk-medium);
}

.priority-badge.baja {
    background: rgba(16, 185, 129, 0.1);
    color: var(--risk-low);
}

.hours {
    font-weight: 600;
    color: #1f2937;
}

.task-actions {
    display: flex;
    gap: 0.5rem;
}

/* =============================================================================
   ESTADOS VACÍOS Y LOADING
   ============================================================================= */

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #6b7280;
}

.empty-state i {
    font-size: 3rem;
    color: #d1d5db;
    margin-bottom: 1rem;
}

.empty-state h3 {
    margin: 0 0 0.5rem 0;
    color: #374151;
    font-size: 1.25rem;
}

.empty-state p {
    margin: 0 0 1.5rem 0;
    color: #6b7280;
}

.empty-tasks {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

.empty-tasks i {
    font-size: 2rem;
    color: #d1d5db;
    margin-bottom: 1rem;
}

.empty-tasks h4 {
    margin: 0 0 0.5rem 0;
    color: #374151;
}

.empty-tasks p {
    margin: 0;
    color: #6b7280;
}

/* =============================================================================
   FILTROS Y BÚSQUEDA
   ============================================================================= */

.filter-results {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.results-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #1e40af;
}

.btn-clear-filters {
    background: white;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: auto;
}

.btn-clear-filters:hover {
    background: #f0f9ff;
    border-color: #93c5fd;
}

/* =============================================================================
   ANIMACIONES Y TRANSICIONES
   ============================================================================= */

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

.abogado-card {
    animation: slideUp 0.3s ease-out;
}

.insight-card {
    animation: fadeIn 0.5s ease-out;
}

.task-detail-section {
    animation: slideDown 0.4s ease-out;
}

/* =============================================================================
   RESPONSIVE DESIGN
   ============================================================================= */

@media (max-width: 768px) {
    .control-tower {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .control-tower-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .control-tower-header h2 {
        font-size: 1.5rem;
    }
    
    .smart-insights {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .insight-card {
        padding: 1rem;
    }
    
    .insight-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .abogado-card {
        margin-bottom: 1rem;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    .workload-summary,
    .metrics-grid,
    .task-summary {
        padding: 1rem;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .load-numbers {
        flex-wrap: wrap;
    }
    
    .current-load {
        font-size: 1.5rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .task-detail-content {
        padding: 1rem;
    }
    
    .tasks-table-container {
        overflow-x: scroll;
    }
    
    .tasks-table {
        min-width: 600px;
    }
}

@media (max-width: 480px) {
    .control-tower {
        padding: 1rem;
    }
    
    .control-tower-header h2 {
        font-size: 1.25rem;
    }
    
    .live-indicator {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    .insight-card {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .insight-icon {
        width: 60px;
        height: 60px;
    }
    
    .abogado-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .avatar,
    .avatar-placeholder {
        width: 50px;
        height: 50px;
    }
    
    .card-actions {
        margin-top: 1rem;
    }
    
    .load-numbers {
        justify-content: center;
    }
    
    .task-counters {
        justify-content: center;
    }
}

/* =============================================================================
   UTILIDADES ESPECÍFICAS DEL MÓDULO
   ============================================================================= */

.spinning {
    animation: spin 1s linear infinite;
}

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

.gradient-danger {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.gradient-info {
    background: linear-gradient(135deg, #0891b2, #06b6d4);
}

/* Clases de visibilidad */
.hidden {
    display: none !important;
}

.invisible {
    visibility: hidden;
}

.visible {
    visibility: visible;
}

/* Clases de espaciado específicas */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }

/* Clases de texto */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

/* Estados de hover globales para el módulo */
.hover-scale:hover {
    transform: scale(1.02);
}

.hover-lift:hover {
    transform: translateY(-2px);
}

.transition-all {
    transition: all 0.2s ease;
}
/*
 * FIX DE VISIBILIDAD - NÚMEROS EN TARJETAS DEL DASHBOARD
 * Agregar al final del archivo workload-planning.css
 */

/* =============================================================================
   MEJORA DE VISIBILIDAD PARA TARJETAS DEL DASHBOARD
   ============================================================================= */

/* Mejoras para el Panel de Control principal */
.insight-card .insight-content p {
    color: #1f2937 !important;
    font-size: 2rem !important;
    font-weight: 800 !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    line-height: 1.2;
}

.insight-card .insight-content h4 {
    color: #374151 !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* Específico para tarjetas con fondo azul */
.insight-card.critical .insight-content p,
.insight-card.revenue .insight-content p,
.insight-card.efficiency .insight-content p,
.insight-card.capacity .insight-content p {
    color: #111827 !important;
    font-weight: 900 !important;
}

/* Mejoras para métricas en las tarjetas de abogados */
.metric-value {
    color: #1f2937 !important;
    font-weight: 700 !important;
    font-size: 2rem !important;
}

.metric-label {
    color: #4b5563 !important;
    font-weight: 600 !important;
}

/* Números en carga de trabajo */
.current-load {
    color: #111827 !important;
    font-weight: 900 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.max-capacity {
    color: #374151 !important;
    font-weight: 700 !important;
}

.load-percentage {
    color: #4b5563 !important;
    font-weight: 600 !important;
}

/* Para cualquier tarjeta del dashboard con fondo azul */
.dashboard .card,
.panel-card,
[class*="card"]:has(.card-body) {
    color: #212529;
}

.dashboard .card .card-title,
.panel-card .card-title,
.dashboard .metric-number,
.panel-card .metric-number {
    color: white !important;
    font-weight: 900 !important;
    font-size: 1.5rem !important;
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.2);
    line-height: 1;
}

.dashboard .card .card-subtitle,
.panel-card .card-subtitle,
.dashboard .metric-label,
.panel-card .metric-label {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Estilo específico para tarjetas del Panel de Control */
.control-panel .metric-card,
.dashboard-card,
.stats-card {
    position: relative;
    overflow: hidden;
}

.control-panel .metric-card::before,
.dashboard-card::before,
.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.1) 100%);
    pointer-events: none;
}

.control-panel .metric-number,
.dashboard-card .metric-number,
.stats-card .metric-number {
    position: relative;
    z-index: 2;
    color: white !important;
    font-size: 10rem !important;
    font-weight: 900 !important;
    text-shadow: 
        0 3px 6px rgba(0, 0, 0, 0.4),
        0 1px 3px rgba(0, 0, 0, 0.3);
    line-height: 0.9;
    margin: 0;
}

.control-panel .metric-label,
.dashboard-card .metric-label,
.stats-card .metric-label {
    position: relative;
    z-index: 2;
    color: rgba(255, 255, 255, 0.95) !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0.5rem 0 0 0;
}

/* Mejoras adicionales para elementos específicos del dashboard */
.dashboard-metric,
.metric-display,
.number-display {
    text-align: center;
    padding: 1rem;
}

.dashboard-metric .number,
.metric-display .number,
.number-display .number {
    display: block;
    font-size: 2rem !important;
    font-weight: 900 !important;
    color: white !important;
    text-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.3);
    line-height: 0.8;
    margin-bottom: 0.5rem;
}

.dashboard-metric .label,
.metric-display .label,
.number-display .label {
    display: block;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    color: rgba(255, 255, 255, 0.9) !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

/* Para números en elementos con ID específicos del dashboard */
#dashboard [class*="numero"],
#dashboard [class*="number"],
#dashboard [class*="metric"],
#panelControl [class*="numero"],
#panelControl [class*="number"],
#panelControl [class*="metric"] {
    color: #150b0b !important;
    font-weight: 900 !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Asegurar contraste en cualquier tarjeta azul */
.bg-primary, .bg-info, .bg-blue, [style*="background: blue"], [style*="background-color: blue"] {
    color: white !important;
}

.bg-primary *, .bg-info *, .bg-blue *, 
[style*="background: blue"] *, 
[style*="background-color: blue"] * {
    color: #2c2929 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Números grandes en cualquier contexto */
.big-number, .large-metric, .dashboard-number {
    font-size: 2rem !important;
    font-weight: 900 !important;
    color: white !important;
    text-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.4);
    line-height: 0.8;
    font-family: 'JetBrains Mono', 'SF Mono', 'Monaco', monospace;
}

/* Responsive - asegurar legibilidad en móviles */
@media (max-width: 768px) {
    .dashboard-metric .number,
    .metric-display .number,
    .number-display .number,
    .big-number, .large-metric, .dashboard-number {
        font-size: 2rem !important;
    }
    
    .control-panel .metric-number,
    .dashboard-card .metric-number,
    .stats-card .metric-number {
        font-size: 2rem !important;
    }
}
/*
 * FIX ESPECÍFICO - CLASES REALES DE CAPACIDAD DEL EQUIPO
 * Agregar al final del archivo workload-planning.css
 */

/* =============================================================================
   SECCIÓN ABOGADOS - REDISEÑO ESPECÍFICO PARA LAS CLASES REALES
   ============================================================================= */

/* Contenedor principal de abogados */
.abogados-section {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    margin-top: 2rem;
    overflow: hidden;
}

/* Header de la sección */
.section-header {
    background: var(--gradient-primary);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: none;
}

.section-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
}

.section-title {
    color: white !important;
    font-weight: 600;
}

/* Controles de la sección */
.section-controls {
    background: #f8fafc;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 1rem;
    align-items: end;
}

/* Contenedor de búsqueda */
.search-container {
    position: relative;
}

.search-container input[type="text"] {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: white;
}

.search-container input[type="text"]:focus {
    outline: none;
    border-color: var(--workload-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-container::before {
    content: "🔍";
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

/* Grupo de filtros */
.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
}

/* Selects mejorados */
.form-select,
select {
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    background: white;
    transition: all 0.2s ease;
    cursor: pointer;
    min-width: 120px;
}

.form-select:focus,
select:focus {
    outline: none;
    border-color: var(--workload-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Opciones de ordenamiento */
.sort-options {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-options label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
}

/* Opciones de vista */
.view-options {
    display: flex;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.view-options button,
.btn-view {
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-options button.active,
.btn-view.active {
    background: var(--workload-primary);
    color: white;
}

.view-options button:hover:not(.active),
.btn-view:hover:not(.active) {
    background: #f3f4f6;
    color: #374151;
}

/* =============================================================================
   GRID DE ABOGADOS MEJORADO
   ============================================================================= */

.abogados-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1rem;
    padding: 1rem;
    background: #f9fafb;
}

/* Tarjetas de abogados existentes - REDISEÑO COMPLETO */
.abogado-card {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
}

.abogado-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
    border-color: rgba(37, 99, 235, 0.2);
}

/* Header de la tarjeta de abogado */
.abogado-card .card-header {
    padding: 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e5e7eb;
}

/* Avatar del abogado */
.abogado-card .avatar,
.abogado-card .avatar-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background: var(--gradient-primary);
}

.abogado-card .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Información del abogado */
.abogado-card .abogado-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.abogado-card .abogado-details h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
}

/* Badge de disponibilidad mejorado */
.abogado-card .disponible-badge,
.abogado-card .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.disponible-badge,
.status-badge {
    background: rgba(16, 185, 129, 0.1);
    color: var(--risk-low);
}

/* Métricas de la tarjeta */
.abogado-card .workload-summary {
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.abogado-card .load-numbers {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-family: 'JetBrains Mono', 'SF Mono', 'Monaco', monospace;
}

.abogado-card .current-load {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
}

.abogado-card .capacity-separator {
    font-size: 1rem;
    color: #9ca3af;
}

.abogado-card .max-capacity {
    font-size: 1.25rem;
    color: #6b7280;
}

.abogado-card .load-percentage {
    font-size: 1rem;
    color: #9ca3af;
    margin-left: 0.5rem;
}

/* Barra de progreso mejorada */
.abogado-card .load-bar {
    height: 12px;
    background: #f3f4f6;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    margin-top: 1rem;
}

.abogado-card .load-progress {
    height: 100%;
    border-radius: 6px;
    transition: all 0.6s ease;
    background: linear-gradient(90deg, var(--risk-low), #34d399);
}

.abogado-card .load-progress.medium-risk {
    background: linear-gradient(90deg, var(--risk-medium), #fbbf24);
}

.abogado-card .load-progress.high-risk {
    background: linear-gradient(90deg, var(--risk-high), #f87171);
}

.abogado-card .load-progress.critical-risk {
    background: linear-gradient(90deg, var(--risk-critical), #dc2626);
    animation: progress-pulse 1s infinite;
}

/* Footer de acciones */
.abogado-card .card-footer {
    padding: 1rem;
    background: #fafbfc;
}

.abogado-card .action-buttons {
    display: flex;
    gap: 0.75rem;
}

.abogado-card .btn {
    flex: 1;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.abogado-card .btn-outline {
    background: white;
    border: 1px solid #e5e7eb;
    color: #374151;
}

.abogado-card .btn-outline:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    transform: translateY(-1px);
}

.abogado-card .btn-primary {
    background: var(--workload-primary);
    border: 1px solid var(--workload-primary);
    color: white;
}

.abogado-card .btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

/* =============================================================================
   VISTA TABLA MEJORADA
   ============================================================================= */

.abogados-table-view {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    overflow: hidden;
    margin: 1rem;
}

.abogados-table {
    width: 100%;
    border-collapse: collapse;
}

.abogados-table thead {
    background: #f8fafc;
}

.abogados-table th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
    border-bottom: 2px solid #e5e7eb;
}

.abogados-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.abogados-table tbody tr:hover {
    background: #f9fafb;
}

/* =============================================================================
   ELEMENTOS ESPECÍFICOS
   ============================================================================= */

/* Resultados de filtros */
.filter-results {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 1rem 2rem;
    margin: 0 2rem;
    color: #1e40af;
}

.filter-results .results-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.filter-results .btn-clear-filters {
    background: white;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: auto;
}

.filter-results .btn-clear-filters:hover {
    background: #f0f9ff;
    border-color: #93c5fd;
}

/* Estados vacíos */
.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: #6b7280;
}

.empty-state i {
    font-size: 3rem;
    color: #d1d5db;
    margin-bottom: 1rem;
}

.empty-state h3 {
    margin: 0 0 0.5rem 0;
    color: #374151;
    font-size: 1.25rem;
}

.empty-state p {
    margin: 0 0 1.5rem 0;
    color: #6b7280;
}

/* =============================================================================
   RESPONSIVE DESIGN
   ============================================================================= */

@media (max-width: 768px) {
    .section-controls {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .abogados-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 1rem;
    }
    
    .view-options {
        justify-self: stretch;
    }
    
    .abogado-card .action-buttons {
        flex-direction: column;
    }
    
    .filter-results {
        margin: 0 1rem;
    }
    
    .abogados-table-view {
        margin: 1rem;
    }
}

@media (max-width: 480px) {
    .section-header {
        padding: 1rem;
    }
    
    .section-controls {
        padding: 1rem;
    }
    
    .abogado-card .abogado-info {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .abogado-card .avatar,
    .abogado-card .avatar-placeholder {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
}
/* CSS DEFINITIVO - MÁS ESPECÍFICO QUE MAIN.CSS */
.abogado-card .metric .metric-icon.deadline .metric-content .metric-label {
    font-size: 0.5rem !important;
    color: #6b7280 !important;
    font-weight: 600 !important;
    margin-bottom: 0.15rem !important;
    line-height: 1 !important;
}

.abogado-card .metric .metric-icon.deadline .metric-content .metric-value.neutral {
    font-size: 0.6rem !important;
    color: #9ca3af !important;
    font-style: italic !important;
    font-weight: 500 !important;
    line-height: 1.1 !important;
    margin: 0 !important;
}

/* Para otros estados de deadline también */
.abogado-card .metric .metric-icon.deadline .metric-content .metric-value {
    font-size: 0.65rem !important;
    font-weight: 600 !important;
    line-height: 1.1 !important;
    margin: 0 !important;
}

/* Asegurar que el contenedor también sea más pequeño */
.abogado-card .metric .metric-icon.deadline {
    background: #f9fafb !important;
    border-radius: 6px !important;
    padding: 0.4rem !important;
    min-height: auto !important;
}

.abogado-card .metric .metric-icon.deadline .metric-content {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.1rem !important;
    text-align: center !important;
}
/* Ejemplo: Regla general para todos los elementos con clase .numero-destacado */
.numero-destacado {
    color: #131212 !important;
}

/* Si quieres sobreescribir alguna utilidad de Bootstrap */
.text-success {
    color: #131212 !important;
}