
/* ==========================================================================
   Deal detail · Detalle de empresa objetivo con pestañas
   ========================================================================== */
.deal-detail {
    max-width: 1080px;
    margin: 0 auto;
}

.deal-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1rem 0 1.25rem;
    flex-wrap: wrap;
}

.deal-hero-main {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    min-width: 0;
}

.deal-back {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #ececf3;
    background: #fff;
    color: #4b4b63;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
    flex-shrink: 0;
}

    .deal-back:hover {
        background: #f4f3fb;
        color: #4f46e5;
    }

.deal-title {
    font-size: clamp(1.5rem, 2.6vw, 1.9rem);
    font-weight: 700;
    color: #1e1f2b;
    margin: 0;
    letter-spacing: -0.01em;
    line-height: 1.15;
}

.deal-sublink {
    display: inline-block;
    margin-top: .25rem;
    color: #4f46e5;
    font-size: .9rem;
    text-decoration: underline;
}

    .deal-sublink:hover {
        color: #3d34c7;
    }

.deal-hero-actions {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    flex-wrap: wrap;
}

.deal-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #ececf3;
    background: #fff;
    color: #4b4b63;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color .15s ease;
}

    .deal-icon-btn:hover {
        background: #f4f3fb;
    }

/* Tabs */
.deal-tabs .rz-tabview-nav {
    border-bottom: 1px solid #ececf3;
    background: transparent;
    padding: 0;
}

    .deal-tabs .rz-tabview-nav li {
        margin: 0 .25rem 0 0;
    }

        .deal-tabs .rz-tabview-nav li a,
        .deal-tabs .rz-tabview-nav li .rz-tabview-title {
            padding: .85rem 1.1rem;
            color: #6b6b85;
            font-weight: 500;
            border: none !important;
            background: transparent !important;
            border-radius: 0;
            border-bottom: 2px solid transparent !important;
            transition: color .15s ease, border-color .15s ease;
        }

        .deal-tabs .rz-tabview-nav li.rz-tabview-selected a,
        .deal-tabs .rz-tabview-nav li.rz-tabview-selected .rz-tabview-title {
            color: #1e1f2b !important;
            border-bottom-color: #4f46e5 !important;
            font-weight: 600;
        }

.deal-tabs .rz-tabview-panels {
    background: transparent;
    padding: 1.25rem 0 0;
    border: none;
}

.deal-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.deal-section {
    background: #fff;
    border: 1px solid #ececf3;
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 1px 2px rgba(30, 31, 43, .04);
}

    .deal-section h2 {
        font-size: 1.2rem;
        font-weight: 700;
        color: #1e1f2b;
        margin: 0 0 .35rem;
    }

.deal-section-sub {
    color: #6b6b85;
    font-size: .92rem;
    margin: 0 0 1.25rem;
}

.deal-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.deal-subheading {
    font-size: .9rem;
    font-weight: 600;
    color: #4f46e5;
    margin: 1.25rem 0 .5rem;
    text-transform: none;
    letter-spacing: 0;
}

.deal-divider {
    border: none;
    border-top: 1px solid #ececf3;
    margin: 0 0 1rem;
}

.deal-paragraph {
    color: #3b3b52;
    font-size: .95rem;
    line-height: 1.6;
    margin: 0;
}

/* Meta grid (Localización + Año) */
.deal-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin: 1rem 0 1.5rem;
}

.deal-meta {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.deal-meta-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f0eefd;
    color: #4f46e5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.deal-meta-label {
    display: block;
    font-size: .78rem;
    color: #8a8aa3;
    margin-bottom: .1rem;
}

.deal-meta strong {
    font-size: 1rem;
    color: #1e1f2b;
    font-weight: 600;
}

/* Sectores */
.deal-sector-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #f8f7fb;
    border: 1px solid #ececf3;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: .75rem;
}

.deal-sector-tag {
    display: block;
    font-size: .78rem;
    color: #6b6b85;
    margin-bottom: .3rem;
}

.deal-sector-title {
    color: #4f46e5;
    font-weight: 600;
    font-size: .98rem;
    line-height: 1.4;
    display: block;
}

.deal-sector-card .rzi {
    color: #c8c6e6;
    font-size: 2rem;
}

/* Métricas financieras */
.deal-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .85rem;
}

.deal-metric-card {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: .35rem .75rem;
    background: #f8f7fb;
    border: 1px solid #ececf3;
    border-radius: 12px;
    padding: 1rem 1.15rem;
}

.deal-metric-value {
    grid-column: 1;
    grid-row: 1;
    font-size: 1.35rem;
    font-weight: 700;
    color: #1e1f2b;
    letter-spacing: -0.01em;
}

.deal-metric-icon {
    grid-column: 2;
    grid-row: 1 / span 2;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ecebfa;
    color: #4f46e5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.deal-metric-label {
    grid-column: 1;
    grid-row: 2;
    font-size: .85rem;
    color: #6b6b85;
}

/* KPIs Clientes */
.deal-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: .85rem;
    margin-bottom: 1.25rem;
}

.deal-kpi {
    background: #f8f7fb;
    border: 1px solid #ececf3;
    border-radius: 12px;
    padding: 1rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: .3rem;
}

.deal-kpi-label {
    font-size: .78rem;
    color: #8a8aa3;
}

.deal-kpi strong {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1e1f2b;
}

/* Grid rows clickables en DealFlow */
.deal-grid .rz-data-row {
    cursor: pointer;
}

    .deal-grid .rz-data-row:hover {
        background: #f4f3fb !important;
    }

/* ==========================================================================
   Chatbot flotante (FAB + panel lateral)
   ========================================================================== */
.chatbot-fab-container {
    position: fixed;
    right: clamp(.75rem, 2vw, 1.5rem);
    bottom: clamp(.75rem, 2vw, 1.5rem);
    z-index: 1500;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .75rem;
    pointer-events: none;
}

    .chatbot-fab-container > * {
        pointer-events: auto;
    }

.chatbot-fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(79, 70, 229, .35), 0 2px 6px rgba(30, 31, 43, .12);
    transition: transform .2s ease, box-shadow .2s ease;
}

    .chatbot-fab:hover {
        transform: translateY(-2px);
        box-shadow: 0 16px 30px rgba(79, 70, 229, .42);
    }

    .chatbot-fab .rzi {
        font-size: 1.6rem;
    }

.chatbot-panel {
    width: min(380px, calc(100vw - 2rem));
    height: min(560px, calc(100vh - 6rem));
    background: #fff;
    border: 1px solid #ececf3;
    border-radius: 18px;
    box-shadow: 0 24px 48px rgba(30, 31, 43, .18), 0 4px 12px rgba(30, 31, 43, .08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: chatbot-in .18s ease-out;
}

@keyframes chatbot-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .85rem 1rem;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #fff;
}

.chatbot-header-title {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    min-width: 0;
}

    .chatbot-header-title .rzi {
        font-size: 1.4rem;
    }

    .chatbot-header-title strong {
        display: block;
        font-size: .95rem;
        font-weight: 600;
        line-height: 1.2;
    }

.chatbot-header-sub {
    display: block;
    font-size: .75rem;
    opacity: .85;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
}

.chatbot-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color .15s ease;
}

    .chatbot-close:hover {
        background: rgba(255, 255, 255, .28);
    }

.chatbot-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1rem;
    background: #f8f7fb;
    display: flex;
    flex-direction: column;
    gap: .55rem;
}

.chatbot-msg {
    display: flex;
    max-width: 85%;
}

.chatbot-msg--bot {
    align-self: flex-start;
}

.chatbot-msg--user {
    align-self: flex-end;
}

.chatbot-msg-bubble {
    padding: .6rem .85rem;
    border-radius: 14px;
    font-size: .9rem;
    line-height: 1.4;
    box-shadow: 0 1px 2px rgba(30, 31, 43, .05);
    white-space: pre-wrap;
    word-break: break-word;
}

.chatbot-msg--bot .chatbot-msg-bubble {
    background: #fff;
    color: #1e1f2b;
    border: 1px solid #ececf3;
    border-bottom-left-radius: 4px;
}

.chatbot-msg--user .chatbot-msg-bubble {
    background: #4f46e5;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chatbot-msg-bubble--thinking {
    font-style: italic;
    color: #8a8aa3;
    background: #fff !important;
    color: #8a8aa3 !important;
}

.chatbot-input {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .65rem .75rem;
    border-top: 1px solid #ececf3;
    background: #fff;
}

    .chatbot-input input[type="text"] {
        flex: 1;
        border: 1px solid #ececf3;
        border-radius: 999px;
        padding: .55rem .9rem;
        font: inherit;
        font-size: .9rem;
        outline: none;
        color: #1e1f2b;
        background: #f8f7fb;
        transition: border-color .15s ease, background-color .15s ease;
    }

        .chatbot-input input[type="text"]:focus {
            border-color: #4f46e5;
            background: #fff;
        }

.chatbot-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: #4f46e5;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color .15s ease, transform .15s ease;
}

    .chatbot-send:hover:not(:disabled) {
        background: #3d34c7;
    }

    .chatbot-send:disabled {
        background: #c8c6e6;
        cursor: not-allowed;
    }
