body {
    font-family: Arial, sans-serif;
    background-color: #f4f7f9;
    color: #333;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 98vw;
    margin: auto;
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.header-with-logo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.header-with-logo h1 {
    margin: 0;
    color: #000;
    font-size: 2em;
    border-bottom: none; /* Quitamos el borde de aquí para que solo esté en el contenedor */
}

.logo {
    max-height: 50px; /* Ajusta el tamaño del logo */
    width: auto;
}


h2 {
    color: #000;
    font-size: 1.2em;
    margin-bottom: 15px;
    text-align: center;
}

h3 {
    color: #000;
    font-size: 1.1em;
    margin-bottom: 10px;
}

/* --- Layout de secciones principales --- */
.main-header-charts {
    display: flex;
    justify-content: space-between;
    align-items: stretch; /* Asegura que las cajas tengan la misma altura */
    margin-bottom: 20px;
    gap: 20px;
}

.chart-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 20px;
    flex-wrap: wrap; /* Permite que las gráficas se envuelvan en pantallas pequeñas */
}

/* --- Estilos de las cajas de gráficos --- */
.chart-box {
    background: #fff; /* Fondo blanco para las cajas de gráficos */
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1; /* Permite que las cajas se expandan y contraigan */
}

.chart-box-small {
    min-width: 250px;
    max-width: 30%; /* Tamaño fijo para los gráficos pequeños en el header */
}

.chart-box-large {
    min-width: 45%; /* Para dos gráficos por fila */
}

.chart-box-full {
    min-width: 100%; /* Para un solo gráfico por fila */
}


.chart {
    flex-grow: 1; /* Permite que el canvas del gráfico ocupe el espacio disponible */
    min-height: 150px; /* Altura mínima para los gráficos */
    display: flex; /* Asegura que el canvas se centre si es más pequeño */
    justify-content: center;
    align-items: center;
}

/* --- Barras de progreso de la meta --- */
.progress-container-wrapper {
    flex: 1.5; /* Ocupa más espacio que los gráficos pequeños */
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 300px;
}

.progress-bar-container {
    background: #f0f0f0;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.prospeccion-progress-container {
    background: linear-gradient(to right, #007bff, #0056b3);
    color: white;
}

.ventas-progress-container {
    background: linear-gradient(to right, #28a745, #218838);
    color: white;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.progress-bar-goal {
    background: rgba(255, 255, 255, 0.3); /* Fondo semitransparente para la barra */
    border-radius: 5px;
    height: 25px;
    overflow: hidden;
    margin: 10px 0;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.progress-bar-fill {
    height: 100%;
    background: #fff; /* La barra de llenado es blanca */
    width: 0%; /* Se controla con JS */
    transition: width 0.5s ease;
}

.prospeccion-progress-container .progress-bar-fill {
    background: white;
}

.ventas-progress-container .progress-bar-fill {
    background: white;
}

#prospeccion-goal-description-text,
#ventas-goal-description-text {
    text-align: center;
    margin-top: 15px;
    font-size: 0.9em;
    color: white;
    font-weight: normal;
}


/* --- Sección de Meta y Origen de Contactos --- */
.meta-origin-section {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 20px;
    flex-wrap: wrap;
}

.goal-selection-bar {
    background-color: #f0f0f0;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    flex: 1;
    min-width: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.goal-selection-bar h3 {
    margin: 0;
    color: #333;
}

.goal-selection-bar #active-sales-goal-amount {
    color: #007bff;
    font-weight: bold;
}

.origin-bars-container {
    background-color: #f0f0f0;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    flex: 2; /* Ocupa más espacio */
    min-width: 350px;
}

.origin-bars-container h3 {
    text-align: center;
    margin-bottom: 15px;
}

.origin-bar-warm, .origin-bar-cold {
    height: 30px;
    border-radius: 5px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.9em;
    width: 100%; /* Por defecto */
}

.origin-bar-warm {
    background-color: #ff9800; /* Naranja */
}

.origin-bar-cold {
    background-color: #ff5722; /* Rojo-Naranja */
}


/* --- Embudo de Ventas --- */
.sales-funnel-container {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    text-align: center;
}

.sales-funnel-container h3 {
    color: #28a745;
    margin-bottom: 25px;
}

.funnel-steps {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    flex-wrap: wrap;
}

.funnel-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 150px;
}

.funnel-step span {
    font-size: 2.5em;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 5px;
    line-height: 1;
}

.funnel-step p {
    margin: 0;
    font-size: 0.9em;
    color: #666;
}

/* --- Formulario de Gestión de Contactos --- */
.form-section {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.form-section h3 {
    text-align: center;
    color: #007bff;
    font-size: 1.5em;
    margin-bottom: 20px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.form-row {
    display: flex;
    flex-direction: column;
}

.form-row label {
    font-weight: bold;
    margin-bottom: 5px;
    color: #555;
}

.form-row input, .form-row select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 0.9em;
}

button[type="submit"] {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 25px;
}

button[type="submit"]:hover {
    background-color: #0056b3;
}

/* --- Tabla de Prospectos --- */
.prospect-table {
    margin-top: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow-x: auto; /* Permite scroll horizontal en tablas grandes */
}

.prospect-table table {
    width: 100%;
    border-collapse: collapse;
}

.prospect-table th {
    background-color: #ff6347; /* Color naranja fuerte */
    color: #fff;
    padding: 12px 15px;
    text-align: left;
    text-transform: uppercase;
    font-size: 0.9em;
}

.prospect-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    font-size: 0.9em;
}

.prospect-table tbody tr:nth-child(even) {
    background-color: #f8f8f8;
}

.prospect-table tbody tr:hover {
    background-color: #f2f2f2;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.action-buttons button {
    padding: 6px 12px;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    color: white;
    font-size: 0.85em;
    transition: background-color 0.2s;
}

.edit-btn {
    background-color: #17a2b8; /* Azul claro */
}

.edit-btn:hover {
    background-color: #138496;
}

.delete-btn {
    background-color: #dc3545; /* Rojo */
}

.delete-btn:hover {
    background-color: #c82333;
}

.duplicate-btn {
    background-color: #ffc107; /* Amarillo */
    color: #212529;
}

.duplicate-btn:hover {
    background-color: #e0a800;
}


/* --- Línea de tiempo de cumpleaños --- */
.birthday-timeline-container {
    margin-top: 20px;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.birthday-timeline-container h3 {
    text-align: center;
    color: #007bff;
    margin-bottom: 20px;
}

#birthday-timeline {
    display: flex;
    overflow-x: auto;
    padding-bottom: 15px;
    gap: 20px; /* Espacio entre los elementos de la línea de tiempo */
    justify-content: center; /* Centra los elementos si no hay suficiente para llenar */
}

.timeline-item {
    position: relative;
    flex: 0 0 150px; /* Ancho fijo para cada elemento */
    text-align: center;
    padding: 15px 0;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.timeline-item::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -10px; /* Ajusta la posición del marcador */
    transform: translateX(-50%);
    width: 2px;
    height: 10px;
    background-color: #007bff;
}

.timeline-date {
    font-weight: bold;
    color: #555;
    white-space: nowrap;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.timeline-name {
    font-weight: bold;
    color: #007bff;
    white-space: nowrap;
    font-size: 1em;
}

/* --- Sección de Gestión de Metas (inferior) --- */
.meta-management-section {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.meta-management-section h2 {
    text-align: center;
    color: #007bff;
    margin-bottom: 20px;
}

.meta-management-section .goal-form-section {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end; /* Alinea los elementos a la parte inferior */
    gap: 15px;
    margin-bottom: 20px;
    justify-content: center;
}

.meta-management-section .form-row {
    flex: 1; /* Permite que los inputs se expandan */
    min-width: 200px;
}

.meta-management-section .goal-form-section button {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    background-color: #007bff;
    font-size: 0.95em;
    transition: background-color 0.2s;
}

.meta-management-section #cancel-goal-edit-btn-manage {
    background-color: #dc3545;
}

.meta-management-section #save-goal-btn-manage:hover {
    background-color: #0056b3;
}

.meta-management-section #cancel-goal-edit-btn-manage:hover {
    background-color: #c82333;
}

.goal-table-container {
    margin-top: 20px;
}

.goal-table {
    width: 100%;
    border-collapse: collapse;
}

.goal-table th, .goal-table td {
    padding: 10px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 0.9em;
}

.goal-table th {
    background-color: #e9ecef;
    color: #333;
    font-weight: bold;
}

.goal-table tbody tr:nth-child(even) {
    background-color: #f8f8f8;
}

.goal-table tbody tr:hover {
    background-color: #f2f2f2;
}

.goal-table-actions button {
    margin-right: 8px;
    padding: 5px 10px;
    font-size: 0.8em;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: white;
    transition: background-color 0.2s;
}

.select-goal-btn {
    background-color: #28a745;
}

.select-goal-btn:hover {
    background-color: #218838;
}

.edit-goal-btn {
    background-color: #17a2b8;
}

.edit-goal-btn:hover {
    background-color: #138496;
}

.delete-goal-btn {
    background-color: #dc3545;
}

.delete-goal-btn:hover {
    background-color: #c82333;
}

/* Clases para filas de metas seleccionadas */
.goal-table tbody tr.selected-prospeccion {
    background-color: #e0f7fa; /* Un color suave para la meta de prospección seleccionada */
    font-weight: bold;
}

.goal-table tbody tr.selected-ventas {
    background-color: #e8f5e9; /* Un color suave para la meta de ventas seleccionada */
    font-weight: bold;
}


/* Responsividad */
@media (max-width: 768px) {
    .main-header-charts, .meta-origin-section, .chart-row {
        flex-direction: column;
        gap: 15px;
    }

    .chart-box-small, .chart-box-large, .progress-bar-container, 
    .goal-selection-bar, .origin-bars-container, 
    .meta-management-section .goal-form-section .form-row {
        min-width: 100%;
        max-width: 100%;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
    
    #birthday-timeline {
        justify-content: flex-start; /* Alinea a la izquierda en móviles */
    }

    .timeline-item {
        flex: 0 0 120px; /* Reduce un poco el ancho en móviles */
    }
    
    .header-with-logo {
        flex-direction: column;
        text-align: center;
    }

    .header-with-logo h1 {
        margin-bottom: 10px;
    }
}