/* ==========================================================================
   assets/css/panel.css — Estilos para el Panel de Copiloto y Multimedia (2A)
   ========================================================================== */

/* Layout de 3 columnas en la vista de Chats */
.live-chat-container,
.chats-layout-3col {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr) 350px;
    height: calc(100vh - 120px);
    min-height: 580px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    width: 100%;
}

@media (max-width: 1100px) {
    .live-chat-container,
    .chats-layout-3col {
        grid-template-columns: 260px minmax(0, 1fr);
        position: relative;
    }

    .copiloto-pane {
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 320px;
        background: #ffffff;
        box-shadow: -4px 0 16px rgba(0, 0, 0, 0.15);
        z-index: 100;
        transform: translateX(100%);
        transition: transform 0.25s ease-in-out;
    }

    .copiloto-pane.open {
        transform: translateX(0);
    }
}

/* Panel de Copiloto */
.copiloto-pane {
    border-left: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    overflow-y: auto;
}

.copiloto-header {
    padding: 14px 16px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.copiloto-section {
    padding: 14px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
    margin-bottom: 8px;
}

.copiloto-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Ficha de Datos Financieros */
.ficha-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ficha-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    padding: 4px 0;
    border-bottom: 1px dashed #f1f5f9;
}

.ficha-label {
    color: #475569;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ficha-value-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ficha-value {
    color: #0f172a;
    font-weight: 600;
    text-align: right;
}

.ficha-value.empty {
    color: #94a3b8;
    font-style: italic;
    font-weight: normal;
}

.ficha-fuente-badge {
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 4px;
    background: #e2e8f0;
    color: #475569;
}

.ficha-fuente-ia_texto { background: #e0f2fe; color: #0369a1; }
.ficha-fuente-ia_audio { background: #fef3c7; color: #b45309; }
.ficha-fuente-asesor { background: #dcfce7; color: #15803d; }
.ficha-fuente-regex { background: #f3e8ff; color: #7e22ce; }

/* Badges de Estado y Origen */
.badge-origen {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-whatsapp { background: #25D366; color: #ffffff; }
.badge-simulador { background: #6366f1; color: #ffffff; }

.badge-requiere-atencion {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #f87171;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    animation: pulse 2s infinite;
}

/* Reproductor de Audio y Notas de Voz */
.audio-bubble-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 4px 0;
}

.audio-player-custom {
    width: 100%;
    max-width: 280px;
    height: 36px;
}

.audio-transcription {
    font-size: 12px;
    color: #334155;
    background: rgba(0, 0, 0, 0.03);
    padding: 6px 8px;
    border-radius: 6px;
    border-left: 2px solid #0ea5e9;
    font-style: italic;
}

/* Documentos en Chat y Copiloto */
.doc-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    margin-bottom: 6px;
    font-size: 12px;
}

.doc-status-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}
.doc-status-pendiente { background: #fef3c7; color: #b45309; }
.doc-status-recibido { background: #e0f2fe; color: #0369a1; }
.doc-status-validado { background: #dcfce7; color: #15803d; }
.doc-status-rechazado { background: #fee2e2; color: #b91c1c; }

/* Puntaje y Precalificación por Banco (Fase 2B) */
.bancos-precalif-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.banco-precalif-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: 11px;
    cursor: help;
}

/* Sugerencias del Asesor (Fase 2B) */
.sugerencia-item {
    padding: 8px;
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    margin-bottom: 6px;
}

/* Timeline de Eventos */
.eventos-timeline {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 250px;
    overflow-y: auto;
}

.evento-item {
    display: flex;
    gap: 8px;
    font-size: 11px;
    padding: 4px 0;
    border-left: 2px solid #cbd5e1;
    padding-left: 8px;
}

.evento-time {
    color: #94a3b8;
    white-space: nowrap;
}

.evento-tipo {
    font-weight: 600;
    color: #334155;
}

/* Grabadora de Voz en Simulador */
.voice-recorder-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fee2e2;
    border-radius: 8px;
    border: 1px solid #fca5a5;
    margin-bottom: 8px;
}

.recording-indicator {
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

/* ==========================================================================
   Estilos de Rediseño de Entrenamiento, Búsqueda y Tablas Compactas (Fase 2D)
   ========================================================================== */

:root {
    --color-bg-light: #f8fafc;
    --color-card-bg: #ffffff;
    --color-border: #e2e8f0;
    --color-text-main: #0f172a;
    --color-text-muted: #64748b;
    --color-primary-brand: #0284c7;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --radius-sm: 6px;
    --radius-md: 10px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --color-bg-light: #0f172a;
        --color-card-bg: #1e293b;
        --color-border: #334155;
        --color-text-main: #f8fafc;
        --color-text-muted: #94a3b8;
    }
}

/* Grid de Salud del Conocimiento */
.health-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.health-stat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.health-stat-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.health-stat-val {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
}

.health-stat-lbl {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Tablas Compactas */
.compact-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.compact-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    padding: 10px 12px;
    border-bottom: 2px solid #e2e8f0;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.compact-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    vertical-align: middle;
}

.compact-table tbody tr:hover {
    background: #f8fafc;
}

/* Switches para Toggle de Estado */
.switch-toggle {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 18px;
}

.switch-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-toggle .slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: .2s;
    border-radius: 18px;
}

.switch-toggle .slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .2s;
    border-radius: 50%;
}

.switch-toggle input:checked + .slider {
    background-color: #10b981;
}

.switch-toggle input:checked + .slider:before {
    transform: translateX(16px);
}

/* Badges Tags */
.badge-tag {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
}
.badge-tag.badge-info { background: #e0f2fe; color: #0284c7; }
.badge-tag.badge-success { background: #dcfce7; color: #16a34a; }
.badge-tag.badge-warning { background: #fef3c7; color: #d97706; }
.badge-tag.badge-danger { background: #fee2e2; color: #dc2626; }

.btn-icon-action {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.15s;
}
.btn-icon-action:hover {
    background: #f1f5f9;
}

/* Empty States */
.empty-state-box {
    text-align: center;
    padding: 36px 20px;
    color: #64748b;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
}

