:root {
    --hp-green: #17745b;
    --hp-green-dark: #0f5945;
    --hp-mint: #e8f6f0;
    --hp-gold: #c89b45;
    --hp-ink: #17332b;
}

.asx-herbalandplants .navbar-logo { width: 100%; }
.asx-herbalandplants .menu-categories .menu > a { color: #506690; }
.asx-herbalandplants .menu-categories .menu.active > a,
.asx-herbalandplants .menu-categories .menu > a:hover { color: var(--hp-green); }
.hp-menu-icon { display: inline-flex; width: 24px; font-size: 22px; justify-content: center; margin-right: 10px; }
.hp-page-heading, .hp-section-toolbar, .hp-widget-title, .hp-progress-copy {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}
.hp-page-heading { padding: 26px 0 14px; }
.hp-page-heading h2, .hp-section-toolbar h3 { margin: 0; color: var(--hp-ink); font-weight: 800; }
.hp-eyebrow { margin: 0 0 4px; color: var(--hp-green); font-size: 11px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.hp-period { padding: 8px 14px; border-radius: 999px; color: var(--hp-green); background: var(--hp-mint); font-weight: 800; }
.hp-kpi {
    min-height: 150px;
    border: 0;
    border-radius: 16px;
    padding: 23px;
    box-shadow: 0 8px 25px rgba(26, 66, 55, .07);
}
.hp-kpi span { color: #718096; font-size: 13px; font-weight: 700; }
.hp-kpi strong { display: block; margin-top: 14px; color: var(--hp-ink); font-size: 27px; line-height: 1; }
.hp-kpi small { display: block; margin-top: 12px; color: #8993a4; }
.hp-kpi.accent { color: white; background: linear-gradient(135deg, var(--hp-green), #2b9c79); }
.hp-kpi.accent span, .hp-kpi.accent strong, .hp-kpi.accent small { color: white; }
.hp-widget { border-radius: 16px; padding: 24px; box-shadow: 0 8px 25px rgba(26, 66, 55, .06); }
.hp-widget h4 { margin: 0 0 16px; color: var(--hp-ink); font-weight: 800; }
.hp-widget-title h4 { margin: 0; }
.hp-widget-title .badge { padding: 8px 12px; border-radius: 999px; color: var(--hp-green); background: var(--hp-mint); }
.hp-progress-track { height: 12px; margin-top: 26px; border-radius: 99px; overflow: hidden; background: #e8edf4; }
.hp-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--hp-green), var(--hp-gold)); transition: width .35s ease; }
.hp-progress-copy { margin-top: 10px; color: #718096; font-size: 12px; }
.hp-activity { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #edf0f5; }
.hp-activity:last-child { border-bottom: 0; }
.hp-activity-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--hp-green); background: var(--hp-mint); font-weight: 900; }
.hp-activity-copy { flex: 1; min-width: 0; }
.hp-activity-copy strong, .hp-activity-copy span { display: block; }
.hp-activity-copy span { overflow: hidden; color: #8993a4; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.hp-activity-amount { font-weight: 800; }
.hp-section-toolbar { margin: 24px 0; }
.hp-section-toolbar .form-select { max-width: 240px; }
.hp-product { height: 100%; overflow: hidden; border: 0; border-radius: 16px; background: #fff; box-shadow: 0 8px 25px rgba(26, 66, 55, .08); }
.hp-product-media { display: grid; place-items: center; height: 210px; overflow: hidden; color: var(--hp-green); background: var(--hp-mint); font-size: 55px; }
.hp-product-media img { width: 100%; height: 100%; object-fit: cover; }
.hp-product-body { padding: 20px; }
.hp-product-category { color: var(--hp-green); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.hp-product h4 { min-height: 48px; margin: 7px 0; color: var(--hp-ink); font-weight: 800; }
.hp-product-description { min-height: 63px; color: #718096; font-size: 13px; }
.hp-product-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; }
.hp-product-price { color: var(--hp-ink); font-size: 20px; font-weight: 900; }
.hp-level-card { padding: 18px; border-radius: 14px; text-align: center; background: #fff; box-shadow: 0 5px 18px rgba(26,66,55,.06); }
.hp-level-card strong { display: block; color: var(--hp-green); font-size: 25px; }
.hp-tree-node { margin: 7px 0; }
.hp-tree-row { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border: 1px solid #e8edf2; border-radius: 11px; }
.hp-tree-toggle { width: 28px; height: 28px; border: 0; border-radius: 8px; color: var(--hp-green); background: var(--hp-mint); font-weight: 900; }
.hp-tree-children { margin-left: 38px; border-left: 1px dashed #bdcfca; padding-left: 12px; }
.hp-tree-name { flex: 1; font-weight: 800; color: var(--hp-ink); }
.hp-tree-code { color: #8993a4; font-size: 11px; }
.hp-wallet-total { color: var(--hp-green); font-size: 27px; }
.hp-table th { color: #718096; font-size: 11px; text-transform: uppercase; }
.hp-table td { vertical-align: middle; }
.hp-money-positive { color: var(--hp-green); font-weight: 800; }
.hp-money-negative { color: #c0392b; font-weight: 800; }
.hp-referral-card { max-width: 760px; margin: 40px auto; padding: 48px; text-align: center; }
.hp-leaf { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 16px; border-radius: 50%; color: white; background: var(--hp-green); font-size: 34px; }
.hp-message { padding: 10px 12px; border-radius: 9px; color: var(--hp-green-dark); background: var(--hp-mint); }
.hp-message.is-error { color: #9e2b21; background: #fdecea; }
.hp-access-page { min-height: 100vh; display: grid; place-items: center; padding: 25px; background: radial-gradient(circle at top left, #effbf6, #f4f7fb 48%, #eef2f7); }
.hp-access-card { width: min(520px, 100%); padding: 46px; border-radius: 22px; text-align: center; background: white; box-shadow: 0 24px 70px rgba(25, 62, 52, .14); }
.hp-access-card > a:first-child img { width: 116px; margin-bottom: 28px; }
.hp-access-card h1 { color: var(--hp-ink); font-weight: 900; }
.hp-access-card [data-access-sponsor] { margin-top: 22px; padding: 14px; border-radius: 12px; background: var(--hp-mint); }
.hp-access-card [data-access-sponsor] span, .hp-access-card [data-access-sponsor] strong { display: block; }
.hp-access-card [data-access-sponsor] span { color: #718096; font-size: 11px; text-transform: uppercase; }
.hp-access-card [data-access-sponsor] strong { color: var(--hp-green); font-size: 18px; }

body.dark .hp-page-heading h2, body.dark .hp-section-toolbar h3,
body.dark .hp-widget h4, body.dark .hp-kpi strong, body.dark .hp-product h4,
body.dark .hp-product-price, body.dark .hp-tree-name { color: #e8eef6; }
body.dark .hp-kpi:not(.accent), body.dark .hp-product, body.dark .hp-level-card { background: #1b2e34; }
body.dark .hp-tree-row { border-color: #33454b; }
body.dark .hp-progress-track { background: #33454b; }

@media (max-width: 767px) {
    .hp-page-heading, .hp-section-toolbar { align-items: flex-start; flex-direction: column; }
    .hp-section-toolbar .form-select { max-width: none; }
    .hp-referral-card, .hp-access-card { padding: 28px 20px; }
    .hp-product-description { min-height: 0; }
}

/* ===================================================================
   Vigencia
   La calificación es por unidades de producto compradas, cada una con su
   ventana de días naturales. Estas tarjetas muestran qué niveles están
   abiertos y hasta cuándo.
   =================================================================== */

.hp-vigencia-copy {
    margin: 0 0 16px;
    color: #6b7a8f;
    font-size: 14px;
    line-height: 1.55;
}

.hp-vigencia {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.hp-vigencia-nivel {
    padding: 14px 16px;
    border: 1px solid #e3e8ef;
    border-radius: 12px;
    background: #f8fafc;
    /* El nivel bloqueado se ve apagado, pero legible: sigue siendo
       información útil, no un error. */
    color: #8a93a6;
}

.hp-vigencia-nivel.is-on {
    border-color: #b6e0c6;
    background: #f1faf4;
    color: #17251c;
}

.hp-vigencia-cab {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.hp-vigencia-cab strong { font-size: 15px; }

.hp-vigencia-pct {
    font-size: 13px;
    font-weight: 800;
    color: #2e7d4f;
}

.hp-vigencia-nivel:not(.is-on) .hp-vigencia-pct { color: inherit; }

.hp-vigencia-hasta {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #2e7d4f;
}

.hp-vigencia-hasta small {
    display: block;
    font-weight: 400;
    font-size: 12px;
    color: #6b7a8f;
}

.hp-vigencia-bloqueado {
    display: block;
    font-size: 12px;
    line-height: 1.45;
}

.hp-vigencia-nota {
    margin: 14px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff7e6;
    color: #8a5b00;
    font-size: 13px;
    line-height: 1.5;
}

.badge.hp-badge-on { background: #e6f5ec; color: #1f6b3f; }
.badge.hp-badge-off { background: #eef1f5; color: #6b7a8f; }

.hp-level-card em {
    display: block;
    margin-top: 2px;
    font-style: normal;
    font-size: 11px;
    color: #8a93a6;
}

.hp-level-card.is-on em { color: #2e7d4f; font-weight: 700; }

@media (max-width: 480px) {
    .hp-vigencia { grid-template-columns: 1fr; }
}

/* --- Vigencia en modo oscuro ---
   Sin esto las tarjetas se quedaban claras sobre el fondo oscuro: un bloque
   blanco en medio del panel. Se mantiene el verde para lo vigente y el gris
   apagado para lo bloqueado, pero sobre superficies oscuras. */
body.dark .hp-vigencia-copy { color: #9fb3ad; }

body.dark .hp-vigencia-nivel {
    background: #1b2e34;
    border-color: #2c4249;
    color: #7f9a97;
}

body.dark .hp-vigencia-nivel.is-on {
    background: #17302a;
    border-color: #2f6b4d;
    color: #e6f2ec;
}

body.dark .hp-vigencia-pct { color: #5fcf94; }
body.dark .hp-vigencia-hasta { color: #5fcf94; }
body.dark .hp-vigencia-hasta small { color: #9fb3ad; }

body.dark .hp-vigencia-nota {
    background: #33291a;
    color: #e8c98a;
}

body.dark .badge.hp-badge-on { background: #17302a; color: #5fcf94; }
body.dark .badge.hp-badge-off { background: #263239; color: #9fb3ad; }
body.dark .hp-level-card em { color: #7f9a97; }
body.dark .hp-level-card.is-on em { color: #5fcf94; }
