/* ============================================================
   DASHBOARD CSS — FASE 3: Dashboard 360° Potenciado
   ============================================================ */

/* --- Dashboard Tabs --- */
.dash-tabs-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    gap: 4px;
}

.dash-tab {
    padding: 14px 32px;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    background: rgba(15, 23, 42, 0.4);
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: 'Inter', -apple-system, sans-serif;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.3px;
}

.dash-tab:hover {
    color: #e2e8f0;
    background: rgba(15, 23, 42, 0.6);
}

.dash-tab.active {
    background: rgba(15, 23, 42, 0.85);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.15);
    font-weight: 600;
    box-shadow: 0 -2px 8px rgba(56, 189, 248, 0.25);
}

.dash-tab-panel {
    display: none;
    animation: dashFadeIn 0.35s ease-out;
}

.dash-tab-panel.active {
    display: block;
}

@keyframes dashFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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


/* --- Header del Dashboard --- */
.dashboard-header {
    max-width: 1400px;
    margin: 0 auto 1.5rem auto;
    padding: 1.25rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--border-radius-main);
    border: 1px solid rgba(56, 189, 248, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dashboard-header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.header-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
    font-style: italic;
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

.btn-secondary:hover {
    background: var(--border-color);
}

/* --- Contenedor de Filtros Inteligentes --- */
.filtros-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 1.25rem;
    align-items: flex-end;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(12px);
    padding: 1.25rem 1.5rem;
    border-radius: var(--border-radius-main);
    border: 1px solid rgba(56, 189, 248, 0.05);
}

.filtros-container .form-group {
    margin-bottom: 0;
}

/* --- Secciones KPI --- */
.kpi-section {
    max-width: 1400px;
    margin: 1.5rem auto 0;
}

.section-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
    border-left: 3px solid var(--accent-color-primary);
    font-weight: 600;
}

/* --- Grid KPI --- */
.kpi-grid {
    display: grid;
    gap: 1rem;
}

.kpi-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.kpi-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* --- Tarjetas KPI (Bento Style) --- */
.kpi-card {
    background: rgba(30, 41, 59, 0.5);
    /* Slate 800 glass */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--border-radius-main);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    text-align: left;
    /* Alineación izquierda tipo dashboard moderno */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.kpi-card:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(56, 189, 248, 0.2);
    background: rgba(30, 41, 59, 0.7);
}

.kpi-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, var(--accent-color-glow) 0%, transparent 70%);
    opacity: 0;
    transform: translate(20px, -20px);
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.kpi-card:hover::after {
    opacity: 0.6;
}

.kpi-icon {
    font-size: 1.2rem;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 10px;
    margin-bottom: auto;
    /* Empuja el texto hacia abajo */
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.1);
}

.kpi-card h3 {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    margin-top: 1rem;
    text-transform: none;
    /* Mejor legibilidad sin uppercase */
    font-weight: 500;
}

.kpi-card p {
    font-size: 2rem;
    font-weight: 700;
    color: #f8fafc;
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

/* Variante: card con accent */
.kpi-card-accent {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.6), rgba(14, 165, 233, 0.1));
    border: 1px solid rgba(56, 189, 248, 0.15);
}

/* Variante: card de costos (Amber) */
.kpi-card-cost {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.6), rgba(245, 158, 11, 0.05));
    border-color: rgba(245, 158, 11, 0.1);
}

.kpi-card-cost p {
    color: var(--color-warning);
}

.kpi-card-cost .kpi-icon {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.2);
}

.kpi-card-cost::after {
    background: radial-gradient(circle, rgba(245, 158, 11, 0.2) 0%, transparent 70%);
}

.kpi-card-cost:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(245, 158, 11, 0.3);
}

/* Barra de progreso para % tiempo productivo */
.kpi-bar-container {
    margin-top: 1rem;
    height: 4px;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 2px;
    overflow: hidden;
}

.kpi-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color-secondary), var(--accent-color-primary));
    border-radius: 2px;
    transition: width 1.2s cubic-bezier(0.1, 0.9, 0.2, 1);
    /* Animación más dramática */
}

/* --- Grid de Gráficos --- */
.charts-grid {
    max-width: 1400px;
    margin: 1.5rem auto 0;
    display: grid;
    gap: 1.5rem;
}

.charts-grid-2 {
    grid-template-columns: 1fr 1fr;
}

.chart-full-width {
    max-width: 1400px;
    margin: 1.5rem auto 0;
}

/* --- Contenedor de Gráfico --- */
.chart-container {
    position: relative;
}

.chart-container h2 {
    font-size: 1.1rem;
}

.chart-wrapper {
    position: relative;
    height: 350px;
    width: 100%;
}

.chart-wrapper-pie {
    height: 320px;
}

.chart-wrapper-wide {
    height: 400px;
}

/* --- Tabla de Datos --- */
.tabla-container {
    max-width: 1400px;
    margin: 1.5rem auto;
}

.table-scroll {
    overflow-x: auto;
}

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

.tabla-container th,
.tabla-container td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    white-space: nowrap;
}

.tabla-container th {
    background-color: rgba(0, 119, 182, 0.15);
    color: var(--accent-color-primary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.tabla-container tbody tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.1);
}

.tabla-container tbody tr:hover {
    background-color: rgba(0, 180, 216, 0.05);
}

/* --- Footer --- */
.dashboard-footer {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 1rem 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
}

/* --- Spinner --- */
.spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    border: 5px solid var(--border-color);
    border-top-color: var(--accent-color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 10;
}

.spinner.loading {
    display: block;
}

@keyframes spin {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* --- No Data Message --- */
.no-data-message {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
    .charts-grid-2 {
        grid-template-columns: 1fr;
    }

    .kpi-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .filtros-container {
        grid-template-columns: 1fr 1fr;
    }

    .kpi-grid-3 {
        grid-template-columns: 1fr;
    }

    .kpi-grid-4 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
    }

    .filtros-container {
        grid-template-columns: 1fr;
    }

    .kpi-grid-3,
    .kpi-grid-4 {
        grid-template-columns: 1fr;
    }

    .kpi-card p {
        font-size: 1.5rem;
    }

    .ddh-ficha-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    .ddh-costos-grid {
        grid-template-columns: 1fr !important;
    }

    .proyecto-selector {
        flex-wrap: wrap;
    }
}

/* ============================================================
   FASE 4B: Detalle DDH — Estilos
   ============================================================ */

/* Selector */
.proyecto-section {
    max-width: 1400px;
    margin: 1.5rem auto 0;
    animation: fadeSlide 0.3s ease-out;
}

@keyframes fadeSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.proyecto-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.proyecto-selector label {
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
}

.proyecto-selector select {
    min-width: 300px;
    padding: 0.6rem 1rem;
    background: var(--bg-section);
    border: 1px solid rgba(0, 180, 216, 0.3);
    border-radius: 6px;
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.9rem;
}

/* Ficha del Proyecto */
.ddh-ficha {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(0, 180, 216, 0.08), rgba(99, 102, 241, 0.06));
    border: 1px solid rgba(0, 180, 216, 0.25);
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(0, 180, 216, 0.06);
}

.ddh-ficha-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ddh-ficha-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #38bdf8;
    letter-spacing: 1px;
}

.badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-info {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-success {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.ddh-ficha-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

.ddh-stat {
    display: flex;
    flex-direction: column;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: border-color 0.2s;
}

.ddh-stat:hover {
    border-color: rgba(56, 189, 248, 0.2);
}

.ddh-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #94a3b8;
    margin-bottom: 4px;
}

.ddh-value {
    font-size: 1.05rem;
    font-weight: 600;
    color: #e2e8f0;
}

.ddh-value.accent {
    color: #38bdf8;
    font-size: 1.15rem;
}

.ddh-value.cost {
    color: #34d399;
    font-size: 1.15rem;
}

/* Panels dentro del detalle */
.ddh-panel {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: var(--bg-section);
    border: 1px solid rgba(0, 180, 216, 0.12);
    border-radius: 12px;
}

.ddh-panel h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #38bdf8;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* ---- Tablas Premium (DDH + Dashboard global) ---- */
.ddh-panel table,
.tabla-container table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.84rem;
}

.ddh-panel table thead th,
.tabla-container table thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #94a3b8;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 2px solid rgba(56, 189, 248, 0.25);
    white-space: nowrap;
}

.ddh-panel table thead th:first-child,
.tabla-container table thead th:first-child {
    border-radius: 8px 0 0 0;
}

.ddh-panel table thead th:last-child,
.tabla-container table thead th:last-child {
    border-radius: 0 8px 0 0;
}

.ddh-panel table tbody td,
.tabla-container table tbody td {
    padding: 11px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
    color: #cbd5e1;
    transition: background 0.15s;
}

/* Filas alternas */
.ddh-panel table tbody tr:nth-child(even),
.tabla-container table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

/* Hover en filas */
.ddh-panel table tbody tr:hover,
.tabla-container table tbody tr:hover {
    background: rgba(56, 189, 248, 0.05);
}

/* Bordes laterales sutiles entre columnas */
.ddh-panel table tbody td+td,
.ddh-panel table thead th+th,
.tabla-container table tbody td+td,
.tabla-container table thead th+th {
    border-left: 1px solid rgba(255, 255, 255, 0.04);
}

.ddh-panel tfoot td {
    padding: 12px 16px;
    font-weight: 700;
    border-top: 2px solid rgba(56, 189, 248, 0.3);
    background: rgba(56, 189, 248, 0.04);
}

.ddh-panel tfoot td:first-child {
    border-radius: 0 0 0 8px;
}

.ddh-panel tfoot td:last-child {
    border-radius: 0 0 8px 0;
}

/* Table scroll container */
.table-scroll {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Resumen de Costos */
.ddh-costos-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    width: 100%;
}

/* Chart wrappers centrados */
.chart-wrapper {
    position: relative;
}

.chart-wrapper-wide {
    max-width: 900px;
    margin: 0 auto;
}

.chart-wrapper-pie {
    max-width: 400px;
    margin: 0 auto;
}

.ddh-costo-card {
    padding: 16px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.ddh-costo-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.ddh-costo-card .icon {
    font-size: 1.6rem;
    margin-bottom: 6px;
}

.ddh-costo-card .label {
    font-size: 0.72rem;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.ddh-costo-card .value {
    font-size: 1.3rem;
    font-weight: 700;
}

.ddh-costo-card .pct {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 4px;
}

.costo-brocas {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.08), rgba(56, 189, 248, 0.03));
}

.costo-brocas .value {
    color: #38bdf8;
}

.costo-materiales {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.08), rgba(168, 85, 247, 0.03));
}

.costo-materiales .value {
    color: #a855f7;
}

.costo-total {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.08), rgba(52, 211, 153, 0.03));
}

.costo-total .value {
    color: #34d399;
}

.costo-metro {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.08), rgba(251, 191, 36, 0.03));
}

.costo-metro .value {
    color: #fbbf24;
}

/* Badge en tablas */
.ddh-panel .badge-nueva {
    background: rgba(52, 211, 153, 0.12);
    color: #34d399;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
}

.ddh-panel .badge-recorte {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
}

/* ============================================================
   CHAT IA — Estilos del Asistente
   ============================================================ */

.chat-container {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 180px);
    min-height: 500px;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 16px;
    border: 1px solid rgba(56, 189, 248, 0.1);
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* --- Chat Header --- */
.chat-header {
    padding: 16px 24px;
    background: rgba(15, 23, 42, 0.7);
    border-bottom: 1px solid rgba(56, 189, 248, 0.1);
}

.chat-bot-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.chat-bot-icon {
    font-size: 1.8rem;
    background: rgba(56, 189, 248, 0.1);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(56, 189, 248, 0.15);
}

.chat-bot-info h3 {
    margin: 0;
    color: #e2e8f0;
    font-size: 1rem;
    font-weight: 600;
}

.chat-status {
    color: #34d399;
    font-size: 0.78rem;
    font-weight: 500;
}

.chat-status.thinking {
    color: #fbbf24;
}

/* --- Suggested Chips --- */
.chat-suggestions {
    padding: 12px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 1px solid rgba(56, 189, 248, 0.05);
    background: rgba(15, 23, 42, 0.3);
}

.chat-chip {
    background: rgba(56, 189, 248, 0.06);
    color: #94a3b8;
    border: 1px solid rgba(56, 189, 248, 0.12);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', -apple-system, sans-serif;
}

.chat-chip:hover {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.3);
    transform: translateY(-1px);
}

/* --- Messages Area --- */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.15);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(56, 189, 248, 0.3);
}

/* --- Message Bubble --- */
.chat-msg {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: chatMsgIn 0.35s ease-out;
}

.chat-msg-ai {
    align-self: flex-start;
}

.chat-msg-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.chat-msg-ai .chat-avatar {
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.1);
}

.chat-msg-user .chat-avatar {
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.1);
}

.chat-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.88rem;
    line-height: 1.7;
    color: #e2e8f0;
    word-break: break-word;
}

.chat-msg-ai .chat-bubble {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(56, 189, 248, 0.08);
    border-top-left-radius: 4px;
}

.chat-msg-user .chat-bubble {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(14, 165, 233, 0.2));
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-top-right-radius: 4px;
}

.chat-bubble strong {
    color: #38bdf8;
}

.chat-bubble code {
    background: rgba(56, 189, 248, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.84rem;
    color: #7dd3fc;
}

/* --- Typing indicator --- */
.chat-typing {
    display: flex;
    gap: 5px;
    padding: 4px 0;
    align-items: center;
}

.chat-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #38bdf8;
    animation: typingPulse 1.4s infinite ease-in-out;
}

.chat-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingPulse {

    0%,
    80%,
    100% {
        transform: scale(0.5);
        opacity: 0.3;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes chatMsgIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* --- Input Bar --- */
.chat-input-bar {
    padding: 16px 20px;
    background: rgba(15, 23, 42, 0.7);
    border-top: 1px solid rgba(56, 189, 248, 0.1);
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input-bar input {
    flex: 1;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(56, 189, 248, 0.12);
    border-radius: 12px;
    padding: 13px 18px;
    color: #e2e8f0;
    font-size: 0.9rem;
    font-family: 'Inter', -apple-system, sans-serif;
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.chat-input-bar input:focus {
    border-color: rgba(56, 189, 248, 0.35);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.08);
}

.chat-input-bar input::placeholder {
    color: #64748b;
}

.chat-input-bar button {
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
    border: none;
    border-radius: 12px;
    width: 48px;
    height: 48px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.chat-input-bar button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(56, 189, 248, 0.35);
}

.chat-input-bar button:active {
    transform: scale(0.97);
}

.chat-input-bar button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* --- Chat Responsive --- */
@media (max-width: 768px) {
    .chat-container {
        height: calc(100vh - 140px);
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .chat-msg {
        max-width: 92%;
    }

    .chat-suggestions {
        padding: 10px 14px;
        gap: 6px;
    }

    .chat-chip {
        font-size: 0.72rem;
        padding: 5px 10px;
    }
}