.my-local-mlm-dashboard .mlm-section,
.my-local-mlm-dashboard .mlm-tab-pane {
    background-color: #fdfdfd;
    border: 1px solid #ddd;
    padding: 20px;
    margin-bottom: 25px;
    border-radius: 5px;
}

/* Estilos para la navegación de pestañas */
.mlm-tabs-nav {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 20px 0 -1px 0; /* Añadido margen superior */
    border-bottom: 1px solid #ddd;
}
.mlm-tabs-nav a {
    padding: 10px 20px;
    display: block;
    text-decoration: none !important; /* Quita el subrayado */
    color: #555;
    border: 1px solid #ddd;
    border-bottom: none;
    margin-right: 5px;
    border-radius: 5px 5px 0 0;
    background-color: #f1f1f1;
    transition: all 0.2s ease-in-out;
}
.mlm-tabs-nav a:hover {
    background-color: #e9e9e9;
}
.mlm-tabs-nav a.active {
    background-color: #f56a00; /* Color naranja vivo */
    border-color: #f56a00;
    color: white; /* Texto blanco para contraste */
    font-weight: bold;
}

/* Ocultar paneles de pestañas inactivos */
.mlm-tab-pane {
    display: none;
}
.mlm-tab-pane.active {
    display: block;
}

/* Mejoras para el área de copiar link */
.mlm-copy-wrapper {
    display: flex;
    cursor: pointer;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 5px;
    transition: all 0.2s ease-in-out;
}
.mlm-copy-wrapper:hover {
    border-color: #f56a00;
}
.mlm-copy-wrapper.copied {
    border-color: #4CAF50;
    background-color: #e8f5e9;
}
.mlm-copy-wrapper input[type="text"] {
    flex-grow: 1;
    border: none;
    box-shadow: none;
    outline: none;
    background: transparent;
    cursor: pointer;
}
.copy-icon::after {
    content: 'Copiar';
    padding: 5px 10px;
    color: #555;
    font-size: 0.9em;
}
.mlm-copy-wrapper.copied .copy-icon::after {
    content: '¡Copiado!';
    color: #4CAF50;
    font-weight: bold;
}

/* Lista de contactos (reutilizada) */
.mlm-contact-list { list-style: none; padding: 0; }
.mlm-contact-list li { display: flex; justify-content: space-between; align-items: center; padding: 15px; border-bottom: 1px solid #eee; }
.mlm-contact-list li:last-child { border-bottom: none; }
.mlm-contact-list .contact-info { display: flex; flex-direction: column; }
.mlm-contact-list .contact-info span { color: #555; font-size: 0.9em; }
.mlm-contact-list .contact-actions { white-space: nowrap; }
.mlm-contact-list .contact-actions .button { margin-left: 10px; padding: 5px 10px; font-size: 0.9em; color: white; text-decoration: none; border-radius: 3px; }
.contact-actions .contact-button { background-color: #6c757d; }
.contact-actions .button-whatsapp { background-color: #25D366; }

/* Botones de compartir */
.button-whatsapp { background-color: #25D366; color: white !important; }
.button-facebook { background-color: #1877F2; color: white !important; }

/* Estilos para las cajas de resumen */
.mlm-summary-boxes {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}
.summary-box {
    flex-grow: 1;
    background-color: #f1f1f1;
    padding: 20px;
    border-radius: 5px;
    text-align: center;
}
.summary-box h4 {
    margin: 0 0 10px 0;
    font-size: 1em;
    color: #555;
}
.summary-box span {
    font-size: 1.8em;
    font-weight: bold;
    color: #000;
}

/* Estilos para la tabla de comisiones */
.mlm-commissions-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
.mlm-commissions-table th, 
.mlm-commissions-table td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid #ddd;
}
.mlm-commissions-table th {
    background-color: #f8f8f8;
}
.commission-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
    color: white;
}
.commission-status.status-pending { background-color: #ffc107; color: #000; }
.commission-status.status-paid { background-color: #28a745; }
.commission-status.status-cancelled { background-color: #dc3545; }

/* Estilos para la lista de resumen de red */
.mlm-summary-list {
    list-style: none;
    padding: 0;
    max-width: 400px;
}
.mlm-summary-list li {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid #eee;
}
.mlm-summary-list li:nth-child(odd) {
    background-color: #f9f9f9;
}

/* Estilos para el resumen de la red */
.network-total {
    background-color: #eef7ff;
    text-align: center;
    padding: 20px;
    margin-bottom: 30px;
}
.mlm-level-summary {
    margin-bottom: 25px;
}
.mlm-level-summary h4 {
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
    margin-bottom: 10px;
}
.mlm-level-summary .member-count {
    font-weight: normal;
    font-size: 0.9em;
    color: #666;
}

/* Estilos para el formulario de pago */
.mlm-payout-form p {
    margin-bottom: 15px;
}
.mlm-payout-form label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}
.mlm-payout-form input[type="text"] {
    width: 100%;
    max-width: 400px;
    padding: 8px;
}
.mlm-notice {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    border: 1px solid;
}
.mlm-notice.success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

/* Estilos para la pestaña de Finanzas */
#tab-finances .mlm-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}
#tab-finances h4 {
    margin-top: 0;
}

.commission-status.status-withdrawn { background-color: #6c757d; }

/* Estilo para el nuevo estado */
.commission-status.status-processing_withdrawal { background-color: #17a2b8; }

/* Estilos para la vista en celulares */
@media (max-width: 768px) {
    /* Apila las cajas de resumen verticalmente */
    .mlm-summary-boxes {
        flex-direction: column;
    }
    /* Mejora la tabla en móviles */
    .mlm-commissions-table thead {
        display: none;
    }
    .mlm-commissions-table, .mlm-commissions-table tbody, .mlm-commissions-table tr, .mlm-commissions-table td {
        display: block;
        width: 100%;
    }
    .mlm-commissions-table tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 5px;
    }
    .mlm-commissions-table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
        border-bottom: 1px solid #eee;
    }
    .mlm-commissions-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        width: 45%;
        padding-right: 10px;
        font-weight: bold;
        text-align: left;
    }
}

/* Nuevos estilos para la grilla financiera */
.mlm-finance-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
}
.main-balance-box {
    flex-basis: 100%;
    background-color: #eef7ff;
    padding: 20px;
    text-align: center;
    border-radius: 5px;
}
.main-balance-box h4 {
    margin: 0 0 10px 0;
}
.main-balance-box span {
    font-size: 2.2em;
    font-weight: bold;
}
.secondary-balance-boxes {
    display: flex;
    flex-basis: 100%;
    gap: 20px;
}
.secondary-balance-boxes .summary-box {
    flex-grow: 1;
    flex-basis: 0; /* Asegura que se repartan el espacio por igual */
}
.secondary-balance-boxes .summary-box span {
    font-size: 1.5em;
}
@media (max-width: 768px) {
    .secondary-balance-boxes {
        flex-direction: column;
    }
}

/* --- ESTILOS PARA EL ÁRBOL DE RED v5 (CORREGIDO Y OPTIMIZADO) --- */

#mlm-chart-container {
    transform: rotate(180deg);
    direction: ltr;
    overflow: auto;
    padding: 20px;
    background-color: #fcfcfc; /* Un fondo muy suave para el área del gráfico */
}

/* Selector MÁS POTENTE para todos los nodos. Esto asegura que los estilos base se apliquen. */
#tab-visual-tree #mlm-chart-container .google-visualization-orgchart-node {
    transform: rotate(-180deg) !important; /* Esencial para enderezar el texto */
    direction: ltr;
    box-shadow: 0 3px 7px rgba(0,0,0,0.15);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px !important;
    line-height: 1.4 !important;
    border-radius: 8px !important;
    padding: 12px 16px !important;
    border: 1px solid #ccc !important; /* Borde por defecto para todos */
    background: #ffffff !important; /* Fondo blanco por defecto */
}

/* Estilo específico para el NODO DEL USUARIO ACTUAL (el "tronco") */
#tab-visual-tree #mlm-chart-container .mlm-trunk-node {
    background-color: #004a7c !important; /* Un azul corporativo oscuro */
    color: white !important;
    border-color: #002d4a !important;
}

#tab-visual-tree #mlm-chart-container .mlm-trunk-node div {
    font-weight: bold !important;
    font-size: 16px !important;
    color: white !important;
}

#tab-visual-tree #mlm-chart-container .mlm-trunk-node small {
    color: #a9d1ec !important; /* Un azul claro para el subtítulo */
}


/* Estilo específico para los REFERIDOS (las "hojas") */
#tab-visual-tree #mlm-chart-container .mlm-leaf-node {
    background-color: #0e5c23 !important; /* Un verde menta muy pálido */
    color: #333 !important;
    border-color: #46b450 !important; /* Borde verde para destacar */
}

#tab-visual-tree #mlm-chart-container .mlm-leaf-node small {
    font-size: 12px !important;
    color: #555 !important;
    font-weight: normal;
}


/* Estilo para las "ramas" (las líneas conectoras) */
#tab-visual-tree #mlm-chart-container .google-visualization-orgchart-line-h,
#tab-visual-tree #mlm-chart-container .google-visualization-orgchart-line-v {
    stroke: #b0b0b0 !important; /* Un gris más oscuro y visible para las líneas */
    stroke-width: 2px !important;
}


/* --- ESTILOS PARA EL CENTRO DE NOTIFICACIONES --- */

.mlm-notification-center {
    position: relative;
    display: inline-block;
    float: right; /* Lo posiciona a la derecha */
    margin: 15px;
}

#mlm-notification-bell {
    font-size: 24px;
    color: #555;
    text-decoration: none;
    position: relative;
    display: block;
}

#mlm-notification-bell:hover {
    color: #000;
}

/* El contador de notificaciones no leídas */
.mlm-notification-count {
    position: absolute;
    top: -5px;
    right: -10px;
    background-color: #d63638; /* Rojo de alerta */
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
    line-height: 1;
    border: 1px solid white;
}

/* El menú desplegable */
.mlm-notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 350px;
    max-height: 400px;
    overflow-y: auto;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
}

.mlm-notification-header {
    padding: 10px 15px;
    font-weight: bold;
    border-bottom: 1px solid #eee;
    background-color: #f9f9f9;
}

/* La lista de notificaciones */
.mlm-notification-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mlm-notification-list li {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mlm-notification-list li:last-child {
    border-bottom: none;
}

/* Estilo para notificaciones no leídas */
.mlm-notification-list li.unread {
    background-color: #eef7ff; /* Un azul muy pálido */
}

.mlm-notification-list li .icon {
    font-size: 18px;
    color: #0073aa;
}

.mlm-notification-list li .message {
    font-size: 14px;
    color: #333;
}

/* --- INICIO DE ESTILOS RESPONSIVE PARA MÓVILES --- */

@media (max-width: 768px) {

    /* --- Pestañas de Navegación --- */
    /* Hacemos que las pestañas dejen de estar en una fila y se comporten como bloques */
    .mlm-tabs-nav {
        flex-direction: column; /* Apila las pestañas verticalmente */
        margin-bottom: 20px; /* Espacio antes del contenido */
    }
    .mlm-tabs-nav a {
        margin-right: 0;
        margin-bottom: 5px; /* Espacio entre cada pestaña */
        border-radius: 5px !important; /* Bordes redondeados por completo */
    }

    /* --- Cajas de Resumen Financiero --- */
    /* Apila las cajas una encima de la otra */
    .mlm-finance-grid,
    .secondary-balance-boxes {
        flex-direction: column;
    }

    /* --- Ajuste General de Espaciado --- */
    .my-local-mlm-dashboard .mlm-section,
    .my-local-mlm-dashboard .mlm-tab-pane {
        padding: 15px; /* Reduce el padding en móviles para dar más espacio */
    }

    /* --- Tabla de Comisiones (Revisión de tu código existente) --- */
    /* Tu código actual para la tabla es bueno, solo me aseguro de que esté aquí */
    .mlm-commissions-table {
        border: 0;
    }
    .mlm-commissions-table thead {
        display: none; /* Oculta los encabezados de la tabla */
    }
    .mlm-commissions-table tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 5px;
        padding: 10px;
    }
    .mlm-commissions-table td {
        display: block;
        text-align: right; /* Alinea el valor a la derecha */
        font-size: 14px;
        border-bottom: 1px dotted #ccc;
        padding: 10px 0;
    }
    .mlm-commissions-table td:last-child {
        border-bottom: 0;
    }
    .mlm-commissions-table td::before {
        content: attr(data-label); /* Muestra la etiqueta del dato (si la tienes en el HTML) */
        float: left; /* Pone la etiqueta a la izquierda */
        font-weight: bold;
        text-transform: uppercase;
    }
}

/* --- FIN DE ESTILOS RESPONSIVE --- */

/* --- ESTILOS MEJORADOS PARA BOTONES DE COMPARTIR --- */

.mlm-share-buttons {
    display: flex;
    flex-wrap: wrap; /* Para que se apilen en móviles si no caben */
    gap: 15px; /* Espacio de separación entre los botones */
    margin-top: 15px;
}

.mlm-share-buttons .button {
    display: inline-flex; /* Alinear icono y texto */
    align-items: center;
    gap: 8px; /* Espacio entre el icono y el texto */
    text-decoration: none !important;
    color: white !important;
    padding: 12px 20px !important;
    border-radius: 8px !important;
    font-weight: bold;
    transition: transform 0.2s ease;
    border: none; /* Quitamos cualquier borde del tema */
}

.mlm-share-buttons .button:hover {
    transform: scale(1.05); /* Efecto de crecimiento al pasar el ratón */
}

/* Colores específicos para cada botón con !important para ganar la batalla al tema */
.mlm-share-buttons .button-whatsapp {
    background-color: #25D366 !important;
}

.mlm-share-buttons .button-facebook {
    background-color: #1877F2 !important;
}

.mlm-share-buttons .button-icon {
    font-size: 1.2em; /* Hace el emoji un poco más grande */
}
