/*
 * Karrera · panel de afiliados y administración
 * Réplica de docs/diseno/Karrera Afiliados *.dc.html y Karrera Admin *.dc.html.
 * Colores en config/design.php ("panel" → --p-*); claro por defecto, oscuro con
 * data-theme="dark" o si el teléfono lo usa. Computador desde 1024 px.
 */

html, body { margin: 0; }
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font-family: inherit; }
a { color: #7545F5; }
a:hover { color: #5B2FE0; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #9B72FF; outline-offset: 2px; }
[hidden] { display: none !important; }
form { margin: 0; }

@keyframes kIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes kToast { 0% { opacity: 0; transform: translate(-50%, 6px); } 10%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -4px); } }
@keyframes kFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

.p-body { background: var(--p-bg); color: var(--p-ink); font-family: var(--font-sans); }
.p-app { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.p-wide { display: none !important; }
.p-grow { flex: 1; min-width: 0; }

/* ---------- menú lateral (computador) ---------- */

.p-side { flex: none; width: 276px; align-self: stretch; background: var(--p-side-bg); border-right: 1px solid var(--p-panel-bd); transition: width .25s cubic-bezier(.2, .8, .2, 1); }
.p-side-in { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; padding: 18px 12px; overflow: hidden auto; width: 100%; }
.p-side-head { display: flex; align-items: center; gap: 10px; }
.p-icon-btn { width: 40px; height: 40px; flex: none; border: 0; border-radius: 12px; background: transparent; color: var(--p-ink); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.p-icon-btn:hover { background: var(--p-hover); }
.p-brand { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--p-ink); }
.p-brand:hover { color: var(--p-ink); }
.p-brand img { width: 34px; height: 34px; object-fit: contain; flex: none; }
.p-brand > span { display: flex; flex-direction: column; line-height: 1; }
.p-brand b { font-weight: 800; font-size: 21px; letter-spacing: -.02em; }
.p-brand span span { font-size: 12px; font-weight: 800; color: #7545F5; }
.p-side-nav { display: flex; flex-direction: column; gap: 3px; }
.p-side-item { width: 100%; height: 44px; border: 0; border-radius: 12px; padding: 0 12px; display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 14px; font-weight: 500; background: transparent; color: var(--p-side-fg); text-align: left; white-space: nowrap; text-decoration: none; }
.p-side-item:hover { background: var(--p-hover); color: var(--p-side-fg); }
.p-side-item.is-on { background: var(--p-side-active-bg); color: var(--p-side-active-fg); font-weight: 700; }
.p-side-item svg { flex: none; }
.p-side-item .p-open { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.p-side-sep { height: 1px; background: var(--p-panel-bd); margin: 8px 10px; }
.p-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 3px; }
.p-nav-form { display: contents; }
:root[data-side="closed"] .p-side { width: 72px; }
:root[data-side="closed"] .p-side-in { padding: 18px 10px; }
:root[data-side="closed"] .p-side-head { flex-direction: column; }
:root[data-side="closed"] .p-brand { flex: none; }
:root[data-side="closed"] .p-open { display: none !important; }
:root[data-side="closed"] .p-side-item { padding: 0; justify-content: center; }

/* ---------- barra superior ---------- */

.p-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.p-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px; padding: 10px 10px 4px; background: var(--p-bg); }
.p-brand-sm { flex: 1; justify-content: center; }
.p-brand-sm img { width: 30px; height: 30px; }
.p-brand-sm b { font-size: 19px; }
.p-brand-sm span span { font-size: 11px; }
.p-top-title { flex: 1; min-width: 0; flex-direction: column; }
.p-top.has-title .p-who-name { display: none !important; }
.p-top-title h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.p-top-title p { margin: 2px 0 0; font-size: 14px; color: var(--p-ink2); }
.p-top-btn { height: 42px; padding: 0 8px; border: 0; border-radius: 12px; background: transparent; color: var(--p-ink); display: flex; align-items: center; gap: 4px; cursor: pointer; font-size: 13px; font-weight: 800; }
.p-top-btn:hover { background: var(--p-hover); }
.p-theme { width: 40px; height: 40px; padding: 0; justify-content: center; }
.p-theme .p-sun { display: none; }
:root[data-theme="dark"] .p-theme .p-sun { display: block; }
:root[data-theme="dark"] .p-theme .p-moon { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .p-theme .p-sun { display: block; }
    :root:not([data-theme="light"]) .p-theme .p-moon { display: none; }
}
.p-lang { position: relative; }
.p-lang-menu { position: absolute; z-index: 71; top: calc(100% + 8px); right: 0; min-width: 220px; padding: 6px; border-radius: 14px; background: var(--p-sheet); border: 1px solid var(--p-panel-bd); box-shadow: var(--p-shadow); display: flex; flex-direction: column; gap: 2px; animation: kIn .18s both; }
.p-lang-menu > * { height: 44px; border-radius: 10px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14.5px; font-weight: 600; color: var(--p-ink); text-decoration: none; }
.p-lang-menu a:hover, .p-lang-menu .is-on { background: var(--p-hover); color: var(--p-ink); }
.p-lang-menu .is-off { color: var(--p-ink3); cursor: not-allowed; }
.p-lang-menu span span, .p-lang-menu a span { font-size: 11.5px; font-weight: 700; color: var(--p-ink3); }
.p-who { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--p-ink); }
.p-who:hover { color: var(--p-ink); }
.p-avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; background: linear-gradient(180deg, #B994FF, #7545F5); color: #fff; font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.p-top.has-title .p-avatar { width: 38px; height: 38px; }
.p-who-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; }

/* ---------- contenido ---------- */

.p-main { flex: 1; min-width: 0; padding: 6px 14px 24px; }
.p-affiliates .p-main { padding-bottom: 96px; }
.p-wrap { width: 100%; max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.p-head { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
.p-head > div:first-child { flex: 1; min-width: 0; }
.p-head h1 { margin: 0; font-size: 23px; font-weight: 800; letter-spacing: -.02em; }
.p-head p { margin: 3px 0 0; font-size: 14px; color: var(--p-ink2); }
.p-head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.p-head-range { display: block; margin-top: 6px; font-size: 12.5px; color: var(--p-ink3); text-align: right; }
.p-hello { display: block; }
.p-hello h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.p-hello p { margin: 2px 0 0; font-size: 13.5px; color: var(--p-ink2); }

.p-note { padding: 10px 14px; border-radius: 12px; background: var(--p-hover); border: 1px dashed var(--p-chip-bd); font-size: 13.5px; line-height: 1.5; color: var(--p-ink2); }
.p-note-info { background: var(--p-info-bg); border: 1px solid var(--p-info-bd); color: var(--p-info-fg); }
.p-note-warn { background: var(--p-info-bg); border: 1.5px solid #E0A82E; color: var(--p-info-fg); font-weight: 600; }
.p-note-warn a { font-weight: 800; color: inherit; }
.p-note-err { background: var(--p-err-bg); border: 1px solid var(--p-err-bd); color: var(--p-err-fg); }
.p-hint { margin: 0; font-size: 13px; line-height: 1.5; color: var(--p-ink2); }
.p-hint a { font-weight: 700; }

.p-card { background: var(--p-panel); border: 1px solid var(--p-panel-bd); border-radius: 18px; padding: 16px; min-width: 0; }
.p-card-h { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.p-card-h h2, .p-card > h2 { margin: 0; flex: 1; font-size: 17px; font-weight: 800; }
.p-card-h .p-link { font-size: 13.5px; }
.p-sec-h { display: flex; align-items: center; gap: 10px; }
.p-sec-h h2 { margin: 0; flex: 1; font-size: 18px; font-weight: 800; }
.p-sec-h span { font-size: 12.5px; color: var(--p-ink3); }
.p-grid { display: grid; gap: 12px; }
.p-cols-2, .p-cols-3, .p-cols-4, .p-cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.p-cols-1 { grid-template-columns: minmax(0, 1fr); }
.p-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }

/* Tarjetas de cifras */
.p-kpi { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border-radius: 16px; background: var(--p-panel); border: 1px solid var(--p-panel-bd); min-width: 0; }
.p-kpi-icon { width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--p-tag); color: #7545F5; display: flex; align-items: center; justify-content: center; }
.p-kpi > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.p-kpi-label { font-size: 13px; color: var(--p-ink2); line-height: 1.3; }
.p-kpi b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; line-height: 1.15; }
.p-kpi-note { font-size: 12px; color: var(--p-ink3); line-height: 1.35; }
.p-kpi-delta { font-size: 12px; font-weight: 700; color: #7545F5; }
.p-kpi-delta.is-down { color: var(--p-ink3); }
.p-kpi-stack { flex-direction: column; gap: 6px; }
.p-kpi-stack > div { gap: 4px; }
.p-kpi-row { justify-content: space-between; align-items: center; }
.p-kpi-row .p-kpi-icon { width: 36px; height: 36px; border-radius: 10px; }
.p-kpi-hero { background: #7545F5; border-color: #7545F5; color: #fff; }
.p-kpi-hero .p-kpi-label, .p-kpi-hero .p-kpi-note { color: rgba(255, 255, 255, .88); }
.p-kpi-hero .p-kpi-icon { background: rgba(255, 255, 255, .2); color: #fff; }
.p-kpi-hero b { font-size: 28px; }

/* Lista de saldos (celular) */
.p-dl { margin: 0; padding: 4px 14px; border-radius: 16px; background: var(--p-panel); border: 1px solid var(--p-panel-bd); }
.p-dl > div { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--p-panel-bd); }
.p-dl > div:last-child { border-bottom: 0; }
.p-dl svg { flex: none; color: var(--p-ink2); }
.p-dl dt { flex: 1; font-size: 14px; color: var(--p-ink2); }
.p-dl dd { margin: 0; font-size: 14.5px; font-weight: 800; text-align: right; overflow-wrap: anywhere; }

/* Botones */
.p-btn { min-height: 46px; padding: 0 18px; border: 0; border-radius: 12px; background: linear-gradient(180deg, #8456FF, #6A3CF0); color: #fff; font-weight: 700; font-size: 14.5px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; white-space: nowrap; }
.p-btn:hover { color: #fff; filter: brightness(1.05); }
.p-btn:active { transform: scale(.98); }
.p-btn-soft { background: var(--p-btn2); color: var(--p-btn2-fg); }
.p-btn-soft:hover { color: var(--p-btn2-fg); }
.p-btn-line { background: var(--p-panel); color: #5B2FE0; border: 1.5px solid #9B72FF; }
.p-btn-line:hover { color: #5B2FE0; background: var(--p-hover); }
:root[data-theme="dark"] .p-btn-line { color: #D9CCFF; }
.p-btn-plain { background: var(--p-panel); color: var(--p-ink); border: 1px solid var(--p-chip-bd); }
.p-btn-plain:hover { color: var(--p-ink); background: var(--p-hover); }
.p-btn-danger { background: var(--p-panel); color: var(--p-err-fg); border: 1.5px solid var(--p-err-bd); }
.p-btn-danger:hover { color: var(--p-err-fg); background: var(--p-err-bg); }
.p-btn-sm { min-height: 36px; padding: 0 14px; border-radius: 10px; font-size: 13.5px; }
.p-btn-block { width: 100%; }
.p-btn[disabled] { opacity: .5; cursor: default; }
.p-link { border: 0; background: none; padding: 0; color: #7545F5; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.p-link:hover { color: #5B2FE0; }

/* Etiquetas de estado */
.p-tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 8px; background: var(--p-tag); color: var(--p-tag-fg); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.p-tag-n { background: var(--p-tag-n); color: var(--p-tag-n-fg); }
.p-tag-ok { background: var(--p-ok-bg); color: var(--p-ok-c); }
.p-tag-warn { background: var(--p-pen-bg); color: var(--p-pen-c); }
.p-tag-err { background: var(--p-err-bg); color: var(--p-err-fg); }
.p-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; border: 1.5px solid #7545F5; color: #5B2FE0; background: transparent; font-size: 12px; font-weight: 700; white-space: nowrap; }
.p-pill-solid { background: #7545F5; color: #fff; }
.p-pill-n { border-color: var(--p-chip-bd); color: var(--p-ink2); background: var(--p-tag-n); }
.p-pill-dark { border-color: var(--p-ink); color: var(--p-ink); }
.p-pill-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
:root[data-theme="dark"] .p-pill { color: #D9CCFF; }

/* Filtros */
.p-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 16px; border-radius: 18px; background: var(--p-panel); border: 1px solid var(--p-panel-bd); }
.p-field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--p-ink2); min-width: 0; }
.p-field-grow { flex: 1 1 220px; }
.p-select, .p-input, .p-textarea { height: 42px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--p-field-bd); background: var(--p-field); color: var(--p-ink); font-size: 14px; min-width: 0; width: 100%; }
.p-textarea { height: auto; min-height: 96px; padding: 10px 12px; line-height: 1.45; resize: vertical; }
.p-input-big { height: 48px; padding: 0 14px; border-radius: 12px; font-size: 15px; }
.p-search { position: relative; display: flex; align-items: center; }
.p-search svg { position: absolute; left: 12px; color: var(--p-ink3); pointer-events: none; }
.p-search .p-input { padding-left: 38px; height: 44px; border-radius: 12px; }
.p-period { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--p-field-bd); background: var(--p-panel); }
.p-period svg { flex: none; color: var(--p-ink2); }
.p-period select { flex: 1; border: 0; background: transparent; color: var(--p-ink); font-size: 13.5px; font-weight: 700; min-width: 0; cursor: pointer; }
.p-period select option, .p-select option { color: var(--p-ink); background: var(--p-panel); }
.p-reset { height: 42px; display: inline-flex; align-items: center; font-size: 13.5px; font-weight: 700; color: #B9A3F5; text-decoration: none; padding: 0 6px; }
.p-reset.is-on { color: #7545F5; }
.p-err { font-size: 13px; font-weight: 600; color: var(--p-err-fg); }

/* Tablas */
.p-table-card { display: flex; flex-direction: column; border-radius: 18px; background: var(--p-panel); border: 1px solid var(--p-panel-bd); overflow: hidden; }
.p-table-wrap { overflow-x: auto; }
.p-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.p-table thead tr { text-align: left; background: var(--p-sub); }
.p-table th { padding: 12px 16px; font-weight: 700; font-size: 13px; white-space: nowrap; }
.p-table td { padding: 11px 16px; vertical-align: middle; }
.p-table tbody tr { border-top: 1px solid var(--p-panel-bd); }
.p-table .is-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.p-table .is-amount { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.p-table .is-muted { color: var(--p-ink2); white-space: nowrap; }
.p-table .is-right { text-align: right; }
.p-table td small { display: block; font-size: 12px; color: var(--p-ink3); margin-top: 2px; }
.p-table td b { font-weight: 700; }
.p-who-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.p-ini { width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--p-tag); color: #5B2FE0; font-size: 12.5px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
:root[data-theme="dark"] .p-ini { color: #D9CCFF; }
.p-site-ico { width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--p-tag); color: #7545F5; display: flex; align-items: center; justify-content: center; }
.p-empty { padding: 34px 20px; text-align: center; font-size: 14.5px; color: var(--p-ink2); }
.p-table-empty td { padding: 30px 16px; text-align: center; color: var(--p-ink2); }

/* Lista en tarjetas (celular) */
.p-rows { display: flex; flex-direction: column; }
.p-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--p-panel-bd); color: var(--p-ink); text-decoration: none; background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; font: inherit; cursor: pointer; }
.p-row:first-child { border-top: 0; }
button.p-row:not(.is-cta)::after { content: '›'; flex: none; font-size: 24px; line-height: 1; color: var(--p-ink3); }
.p-row > div > .p-pill { align-self: flex-start; margin-top: 4px; }
.p-row > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.p-row small { font-size: 12.5px; color: var(--p-ink2); }
.p-row b { font-size: 15px; font-weight: 700; }
.p-row .p-row-amt { flex: none; font-weight: 800; font-size: 15px; white-space: nowrap; }
.p-row-end { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.p-row > svg { flex: none; color: var(--p-ink3); }

/* Paginación */
.p-pages { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--p-panel-bd); }
.p-pages > span { flex: 1; min-width: 160px; font-size: 13.5px; color: var(--p-ink2); }
.p-pages nav { display: flex; gap: 6px; flex-wrap: wrap; }
.p-pages a, .p-pages strong, .p-pages em { min-width: 36px; height: 36px; padding: 0 6px; border-radius: 10px; border: 1px solid var(--p-chip-bd); background: var(--p-panel); color: var(--p-ink); font-weight: 700; font-size: 13.5px; font-style: normal; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.p-pages strong { background: #7545F5; border-color: #7545F5; color: #fff; }
.p-pages em { color: var(--p-ink3); opacity: .5; }

/* Ventanas */
.p-dialog { width: min(560px, calc(100% - 24px)); max-height: 88vh; padding: 0; border: 0; border-radius: 22px; background: var(--p-sheet); color: var(--p-ink); box-shadow: var(--p-shadow); }
.p-dialog::backdrop { background: var(--p-overlay); }
.p-dialog[open] { display: flex; flex-direction: column; animation: kIn .2s both; }
.p-dialog-h { flex: none; display: flex; align-items: center; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--p-panel-bd); }
.p-dialog-h h2 { margin: 0; flex: 1; font-size: 18px; font-weight: 800; }
.p-dialog-x { width: 40px; height: 40px; border: 0; border-radius: 12px; background: var(--p-hover); color: var(--p-ink); font-size: 20px; cursor: pointer; }
.p-dialog-b { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.p-dialog-big { display: flex; flex-direction: column; gap: 4px; }
.p-dialog-big span { font-size: 13px; color: var(--p-ink2); }
.p-dialog-big b { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.p-defs { margin: 0; display: flex; flex-direction: column; }
.p-defs > div { display: flex; gap: 12px; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--p-panel-bd); font-size: 14px; }
.p-defs > div:last-child { border-bottom: 0; }
.p-defs dt { color: var(--p-ink2); }
.p-defs dd { margin: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.p-dialog-acts { display: flex; gap: 10px; flex-wrap: wrap; }
.p-dialog-acts > * { flex: 1 1 140px; }
.p-form { display: flex; flex-direction: column; gap: 14px; }
.p-form label.p-field { font-size: 13.5px; font-weight: 700; color: var(--p-ink); gap: 6px; }

/* Toast */
.p-toast { position: fixed; left: 50%; top: 70px; z-index: 90; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 14px; background: #1A1446; color: #fff; font-size: 14px; font-weight: 600; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .5); animation: kToast 3s both; text-align: center; }

/* Gráficos */
.p-chart { position: relative; width: 100%; }
.p-chart svg { display: block; width: 100%; height: auto; }
.p-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--p-ink2); }
.p-legend span { display: inline-flex; align-items: center; gap: 6px; }
.p-legend i { width: 14px; height: 3px; border-radius: 2px; background: #7545F5; }
.p-bar { height: 7px; border-radius: 99px; background: var(--p-track); overflow: hidden; flex: 1; min-width: 60px; }
.p-bar i { display: block; height: 100%; border-radius: 99px; background: #7545F5; }

.p-wide-b { display: none !important; }
.p-narrow-b { display: block; }
div.p-narrow-b.ph-quick { display: flex; }
.p-top.has-period .p-theme, .p-top.has-period .p-who { display: none; }
.p-top-period .p-period { height: 42px; padding: 0 10px; border-radius: 12px; border: 1.5px solid var(--p-panel-bd); gap: 6px; }
.p-top-period .p-period select { max-width: 120px; }

/* Estado de la cuenta (sin aprobar, sin datos) */
.p-gate { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 40px 20px; border-radius: 24px; background: var(--p-panel); border: 1px solid var(--p-panel-bd); animation: kIn .25s both; }
.p-gate-icon { width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.p-gate h2 { margin: 0; font-size: 21px; font-weight: 800; }
.p-gate p { margin: 0; max-width: 460px; font-size: 14.5px; line-height: 1.55; color: var(--p-ink2); }
.p-gate .p-gate-small { font-size: 13.5px; color: var(--p-info-fg); }
.p-gate-acts { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }

/* 16 Panel principal */
.ph-inc { display: grid; grid-template-columns: 1fr; gap: 14px; }
.ph-total { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: 22px; background: linear-gradient(135deg, #8B5CFF 0%, #6A3CF0 55%, #5224D9 100%); color: #fff; box-shadow: 0 18px 40px -18px rgba(106, 60, 240, .8); overflow: hidden; }
.ph-total-ico { position: absolute; right: 18px; top: 18px; width: 46px; height: 46px; border-radius: 14px; background: rgba(255, 255, 255, .18); display: flex; align-items: center; justify-content: center; }
.ph-total-l { font-size: 16px; font-weight: 600; opacity: .95; }
.ph-total b { font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.ph-total-n { font-size: 13.5px; opacity: .9; }
.ph-break { display: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ph-bd { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; border: 1px solid; min-width: 0; }
.ph-bd-ico { width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--p-panel); display: flex; align-items: center; justify-content: center; }
.ph-bd div { min-width: 0; }
.ph-bd div span { display: block; font-size: 12.5px; color: var(--p-ink2); }
.ph-bd b { font-size: 19px; font-weight: 800; overflow-wrap: anywhere; }
.ph-ok { background: var(--p-ok-bg); border-color: var(--p-ok-bd); color: var(--p-ok-c); }
.ph-pen { background: var(--p-pen-bg); border-color: var(--p-pen-bd); color: var(--p-pen-c); }
.ph-ret { background: var(--p-ret-bg); border-color: var(--p-ret-bd); color: var(--p-ret-c); }
.ph-pag { background: var(--p-pag-bg); border-color: var(--p-pag-bd); color: var(--p-pag-c); }
.ph-bd div span { color: var(--p-ink2); }
.ph-ok-fg { color: var(--p-ok-c); } .ph-pen-fg { color: var(--p-pen-c); } .ph-ret-fg { color: var(--p-ret-c); } .ph-pag-fg { color: var(--p-pag-c); }
.ph-quick { flex-direction: column; gap: 10px; }
.ph-btn { height: 52px; border-radius: 14px; font-size: 15.5px; gap: 10px; }
.ph-btn.p-btn-soft { height: 50px; font-size: 15px; }
.ph-mid { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.ph-res { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ph-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ph-stat { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px; border-radius: 16px; background: var(--p-panel); border: 1px solid var(--p-panel-bd); min-width: 0; }
.ph-stat div { min-width: 0; }
.ph-stat div span { display: block; font-size: 12.5px; color: var(--p-ink2); }
.ph-stat b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.ph-stat-ico { width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--t); color: var(--f); display: flex; align-items: center; justify-content: center; }
:root[data-theme="dark"] .ph-stat-ico { background: rgba(155, 114, 255, .18); color: #C9B4FF; }
.ph-chart { display: flex; flex-direction: column; gap: 8px; }
.ph-chart h3 { margin: 0; font-size: 15.5px; font-weight: 800; }
.ph-chart-empty { margin: 0; padding: 6px 0; text-align: center; font-size: 13.5px; color: var(--p-ink3); }
.ph-qa { flex-direction: column; gap: 10px; }
.ph-qa h2 { margin: 0; font-size: 18px; font-weight: 800; }
.ph-qa .ph-btn { height: 50px; font-size: 14.5px; }
.ph-qa .ph-btn.p-btn-soft { height: 48px; }
.ph-tools-sec { display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 80px; }
.ph-tools-sec h2 { margin: 0; font-size: 18px; font-weight: 800; }
.ph-tools { display: grid; grid-template-columns: 1fr; gap: 10px; }
.ph-tool { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; border: 1px solid var(--p-panel-bd); background: var(--p-panel); color: var(--p-ink); text-align: left; cursor: pointer; min-width: 0; text-decoration: none; font: inherit; }
.ph-tool:hover { background: var(--p-hover); color: var(--p-ink); }
.ph-tool-ico { width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--p-icon-tile); color: #7545F5; display: flex; align-items: center; justify-content: center; }
.ph-tool-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ph-tool-t b { font-size: 14px; }
.ph-tool-t span { font-size: 12.5px; color: var(--p-ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-tool-tag { flex: none; font-size: 11px; font-weight: 700; color: #7545F5; border: 1px solid var(--p-chip-bd); border-radius: 99px; padding: 2px 7px; }

.p-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 17 Mis comisiones · 18 Mis pagos */
.pc-sum { display: grid; grid-template-columns: 1fr; gap: 12px; }
.pc-total { display: flex; flex-direction: column; gap: 4px; padding: 20px; border-radius: 18px; background: #7545F5; color: #fff; }
.pc-total span { font-size: 14.5px; font-weight: 600; }
.pc-total b { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.pc-total small { font-size: 12.5px; opacity: .85; }
.pc-bal { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 18px; background: var(--p-panel); border: 1px solid var(--p-panel-bd); min-width: 0; }
.pc-bal span { font-size: 13px; line-height: 1.3; color: var(--p-ink2); }
.pc-bal b { font-size: 20px; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
.pc-bal small { margin-top: auto; font-size: 11.5px; color: var(--p-ink3); }
.pc-st-available, .pc-st-paid { color: #7545F5; }
.pc-st-reversal { color: var(--p-err-fg); }
.pp-sum { display: grid; grid-template-columns: 1fr; gap: 12px; }
.pp-card { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: 18px; background: var(--p-panel); border: 1px solid var(--p-panel-bd); min-width: 0; }
.pp-card .p-kpi-icon { width: 46px; height: 46px; border-radius: 14px; }
.pp-card > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pp-card span { font-size: 13.5px; color: var(--p-ink2); }
.pp-card b { font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; overflow-wrap: anywhere; }
.pp-card small { font-size: 12.5px; color: var(--p-ink3); }
.pp-card.is-hero { background: #7545F5; border-color: #7545F5; color: #fff; }
.pp-card.is-hero span, .pp-card.is-hero small { color: rgba(255, 255, 255, .88); }
.pp-card.is-hero .p-kpi-icon { background: rgba(255, 255, 255, .2); color: #fff; }

/* 19 Estadísticas */
.ps-row { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.ps-pad { padding: 16px 16px 4px; margin: 0; }
.ps-conv { display: flex; flex-direction: column; gap: 12px; }
.ps-conv-item { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--p-panel-bd); background: var(--p-sub); }
.ps-conv-top { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.ps-conv-top b { font-size: 14.5px; }
.ps-conv-top strong { font-size: 22px; font-weight: 800; }
.ps-conv-item .p-bar { flex: none; width: 120px; }
.ps-conv-item small { font-size: 12.5px; color: var(--p-ink2); }
.ps-share { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--p-ink2); }
.ps-sources { display: flex; flex-direction: column; }
.ps-sources > div { display: grid; grid-template-columns: minmax(0, 1.4fr) 50px minmax(60px, 1.6fr) 48px; gap: 10px; align-items: center; padding: 11px 16px; border-top: 1px solid var(--p-panel-bd); font-size: 14px; }
.ps-sources em { font-style: normal; text-align: right; color: var(--p-ink2); }
.ps-sources b { text-align: right; }

/* 20 Mi enlace */
.pl-card { display: flex; flex-direction: column; gap: 14px; }
.pl-h { margin: 0; font-size: 17px; font-weight: 800; }
.pl-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pl-row .p-input { flex: 1 1 240px; }
.pl-copy { height: 48px; padding: 0 18px; border-radius: 12px; font-size: 15px; }
.pl-share { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pl-share > span { font-size: 13.5px; color: var(--p-ink2); margin-right: 4px; }
.pl-share a, .pl-share button { width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--p-tag); color: #5B2FE0; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.pl-share a:hover, .pl-share button:hover { background: var(--p-side-active-bg); color: #5B2FE0; }
.pl-steps { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.pl-steps li { display: flex; gap: 12px; }
.pl-steps li > span { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--p-tag); color: #5B2FE0; font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.pl-steps b { font-size: 14.5px; }
.pl-steps p { margin: 2px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--p-ink2); }
.pl-note { margin: 14px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--p-ink3); }
.pl-tips { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pl-tips li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--p-ink2); }
.pl-tips svg { flex: none; }
.pl-more { margin-top: 16px; }

/* 21 Material promocional */
.pm-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--p-panel-bd); }
.pm-tabs { flex: 1; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.pm-tabs a { padding: 10px 12px; font-size: 14px; font-weight: 600; color: var(--p-ink2); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.pm-tabs a.is-on { color: #5B2FE0; border-bottom-color: #7545F5; font-weight: 700; }
.pm-lang { display: flex; gap: 4px; padding: 3px; border-radius: 10px; border: 1px solid var(--p-chip-bd); background: var(--p-panel); margin-bottom: 6px; }
.pm-lang a { padding: 4px 9px; border-radius: 8px; font-size: 12px; font-weight: 800; color: var(--p-ink2); text-decoration: none; }
.pm-lang a.is-on { background: var(--p-tag); color: #5B2FE0; }
.pm-item { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 18px; background: var(--p-panel); border: 1px solid var(--p-panel-bd); }
.pm-item-h { display: flex; flex-direction: column; gap: 2px; }
.pm-item-h b { font-size: 15px; font-weight: 800; }
.pm-item-h span { font-size: 13px; color: var(--p-ink2); }
.pm-body { display: flex; flex-direction: column; gap: 12px; }
.pm-preview { display: flex; align-items: center; justify-content: center; padding: 14px; border-radius: 14px; background: var(--p-sub); border: 1px solid var(--p-panel-bd); min-height: 90px; overflow: hidden; }
.pm-preview img { height: auto; display: block; border-radius: 6px; }
.pm-preview-box { display: block; color: #1A1446; }
.pm-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pm-meta { margin: 0; font-size: 12.5px; color: var(--p-ink2); }
.pm-acts { display: flex; gap: 10px; flex-wrap: wrap; }
.pm-acts .p-btn { flex: 1 1 160px; }
.pm-code { display: flex; flex-direction: column; gap: 10px; }
.pm-code summary { list-style: none; }
.pm-code summary::-webkit-details-marker { display: none; }
.pm-code[open] summary { margin-bottom: 10px; }
.pm-code .p-textarea { margin-top: 8px; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.pm-code .p-btn-sm { margin-top: 8px; }
.pm-text { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; background: var(--p-panel); border: 1px solid var(--p-panel-bd); }
.pm-text p { margin: 0; font-size: 14px; line-height: 1.55; }
.pm-text .pm-acts .p-btn { flex: none; }

/* 22 Mis sitios web */
.pst-h { margin: 4px 0 0; font-size: 18px; font-weight: 800; }
.pst-site { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px 14px; align-items: center; padding: 16px; border-radius: 18px; background: var(--p-panel); border: 1px solid var(--p-panel-bd); }
.pst-ico { width: 52px; height: 52px; border-radius: 14px; background: var(--p-tag); color: #7545F5; display: flex; align-items: center; justify-content: center; grid-row: span 2; align-self: start; }
.pst-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pst-main b { font-size: 16px; font-weight: 800; overflow-wrap: anywhere; }
.pst-main a { font-size: 14px; text-decoration: none; overflow-wrap: anywhere; }
.pst-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; font-size: 13px; color: var(--p-ink2); }
.pst-meta .p-tag { border: 1px solid var(--p-chip-bd); background: var(--p-panel); color: var(--p-ink2); }
.pst-stat { display: flex; flex-direction: column; gap: 2px; grid-column: 2; }
.pst-stat span { font-size: 12.5px; color: var(--p-ink2); }
.pst-stat b { font-size: 15px; font-weight: 800; }
.pst-site .p-pill { grid-column: 3; grid-row: 1; justify-self: end; align-self: start; }
.pst-tips { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.pst-tips > div { flex: 1 1 260px; }
.pst-tips b { font-size: 15px; }
.pst-tips ul { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--p-ink2); }
.pst-tips .p-btn { align-self: center; }

/* 23 Configuración de cobros */
.pco-sec { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: 18px; background: var(--p-side-active-bg); }
.pco-sec-ico { width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--p-panel); color: #7545F5; display: flex; align-items: center; justify-content: center; }
.pco-sec b { font-size: 15px; }
.pco-sec p { margin: 4px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--p-ink2); }
.pco-cur { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; padding: 18px; border-radius: 18px; background: var(--p-panel); border: 1.5px solid #9B72FF; }
.pco-cur .p-kpi-icon { width: 44px; height: 44px; }
.pco-cur-main { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pco-cur-main b { font-size: 17px; }
.pco-cur-main span { font-size: 14px; color: var(--p-ink2); overflow-wrap: anywhere; }
.pco-cur-col { display: flex; flex-direction: column; gap: 2px; padding-left: 18px; border-left: 1px solid var(--p-panel-bd); }
.pco-cur-col span { font-size: 12.5px; color: var(--p-ink2); }
.pco-cur-col b { font-size: 14.5px; }
.pco-empty b { font-size: 15px; }
.pco-methods { display: grid; grid-template-columns: 1fr; gap: 12px; }
.pco-method { display: flex; flex-direction: column; gap: 14px; padding: 16px; border-radius: 18px; background: var(--p-panel); border: 1px solid var(--p-panel-bd); }
.pco-method-h { display: flex; gap: 12px; }
.pco-method-h div { display: flex; flex-direction: column; gap: 4px; }
.pco-method-h b { font-size: 15.5px; }
.pco-method-h span { font-size: 13.5px; line-height: 1.45; color: var(--p-ink2); }
/* Tarjetas de métodos de la misma altura, con el botón abajo. */
.pco-method > .p-btn { margin-top: auto; }
.pco-req { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }
.pco-req-main { flex: 1 1 220px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pco-req-main h2 { margin: 0 0 6px; font-size: 16px; font-weight: 800; }
.pco-req-main span { font-size: 13px; color: var(--p-ink2); }
.pco-req-main b { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.pco-req-side { flex: 1 1 280px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.pco-req-side form, .pco-req-side .p-btn { width: 100%; max-width: 320px; }
.pco-fields { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .pco-fields { grid-template-columns: 1fr 1fr; } .pco-fields .is-wide { grid-column: 1 / -1; } }
.pco-info { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.pco-info > div { flex: 1 1 280px; }
.pco-info .p-kpi-icon { width: 34px; height: 34px; border-radius: 10px; }
.pco-info b { font-size: 15px; }
.pco-info ul { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; color: var(--p-ink2); }
.pco-info .p-btn { align-self: center; }

/* 24 Mi perfil */
.ppr-grid { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.ppr-info { display: flex; flex-direction: column; gap: 16px; }
.ppr-fields { display: grid; grid-template-columns: 1fr; gap: 16px; }
.ppr-fields .p-field { font-size: 13.5px; font-weight: 700; color: var(--p-ink); gap: 6px; }
.ppr-fields .p-hint { font-weight: 400; font-size: 12.5px; }
.ppr-fields input[readonly] { background: var(--p-sub); color: var(--p-ink2); }
.ppr-row { display: flex; gap: 8px; align-items: center; }
.ppr-row .p-input { flex: 1; min-width: 0; }
.ppr-row .p-btn { height: 48px; }
.ppr-save { display: flex; justify-content: flex-end; }
.ppr-aside { display: flex; flex-direction: column; gap: 16px; }
.ppr-state { display: flex; flex-direction: column; gap: 10px; }
.ppr-pill { align-self: flex-start; border-radius: 99px; gap: 6px; }
.ppr-pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ppr-link { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--p-panel-bd); font-size: 13px; color: var(--p-ink2); }
.ppr-link .p-input { color: #5B2FE0; }
.ppr-copy { border: 1px solid var(--p-chip-bd); width: 42px; height: 42px; color: #7545F5; }
.ppr-opts nav { display: flex; flex-direction: column; margin-top: 8px; }
.ppr-opts a, .ppr-opts button { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 2px; border: 0; background: none; width: 100%; color: var(--p-ink); font: inherit; font-size: 14.5px; font-weight: 600; text-decoration: none; cursor: pointer; text-align: left; }
.ppr-opts a svg:first-child, .ppr-opts button svg:first-child { color: #7545F5; }
.ppr-opts span { flex: 1; }
.ppr-opts svg:last-child { color: var(--p-ink3); }
.ppr-opts .is-out, .ppr-opts .is-out svg:first-child { color: var(--p-err-fg); }

/* Administración */
.ad-h { margin: 0; font-size: 17px; font-weight: 800; flex: 1; }
.ad-card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.ad-row { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.ad-kpis .p-kpi > div { gap: 4px; }
.ad-kpis .p-kpi b { font-size: 24px; }
.ad-list { display: flex; flex-direction: column; overflow: hidden; }
.p-card.ad-list, .p-card.ad-recent, .p-card.ad-sites, .p-card.ad-access, .p-card.ad-flush { padding: 0; }
.ad-list .ad-h { padding: 16px 16px 10px; }
.ad-list a { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-top: 1px solid var(--p-panel-bd); color: var(--p-ink); text-decoration: none; font-size: 14.5px; font-weight: 600; }
.ad-list a:hover { background: var(--p-hover); color: var(--p-ink); }
.ad-list a span { flex: 1; }
.ad-list a b { color: #7545F5; }
.ad-list a svg { color: var(--p-ink3); }
.ad-recent { padding: 0; overflow: hidden; }
.ad-recent .ad-card-h { padding: 14px 16px 0; }
.ad-recent-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; padding: 11px 16px; border-top: 1px solid var(--p-panel-bd); }
.ad-recent-row > div { min-width: 0; display: flex; flex-direction: column; }
.ad-recent-row b { font-size: 14.5px; }
.ad-recent-row > div span { font-size: 13px; color: var(--p-ink2); overflow-wrap: anywhere; }
.ad-muted { font-size: 13px; color: var(--p-ink2); }
.ad-purple { color: #5B2FE0; }
.ad-sites { padding: 0; overflow: hidden; }
.ad-sites .ad-h { display: block; padding: 16px 16px 10px; }
.ad-mini { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ad-mini div { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 12px; border: 1px solid var(--p-panel-bd); background: var(--p-sub); }
.ad-mini span { font-size: 13px; color: var(--p-ink2); }
.ad-mini b { font-size: 21px; font-weight: 800; }
.ad-new { margin: 12px 0 0; font-size: 13.5px; font-weight: 700; color: #7545F5; }
.ad-money { display: flex; flex-direction: column; }
.ad-cur { margin-top: 10px; font-size: 12px; font-weight: 800; color: var(--p-ink3); letter-spacing: .04em; }
.ad-dl { margin: 4px 0 0; display: flex; flex-direction: column; }
.ad-dl > div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--p-panel-bd); font-size: 14px; }
.ad-dl dt { color: var(--p-ink2); }
.ad-dl dd { margin: 0; font-weight: 700; text-align: right; }
.ad-dl .is-strong dt { color: var(--p-ink); font-weight: 700; }
.ad-brand { color: #7545F5; }
.ad-mt { margin-top: 14px; }
.ad-big { font-size: 20px; font-weight: 800; color: #7545F5; margin: 2px 0 8px; }
.ad-perf .p-kpi { padding: 12px; }
.ad-perf .p-kpi b { font-size: 18px; }
.ad-perf-k { margin-bottom: 14px; }
.ad-access { padding: 0; overflow: hidden; }
.ad-access .ad-h { display: block; padding: 16px 16px 10px; }
.ad-access a { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--p-panel-bd); color: var(--p-ink); text-decoration: none; }
.ad-access a:hover { background: var(--p-hover); color: var(--p-ink); }
.ad-access a > div { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ad-access b { font-size: 14.5px; }
.ad-access span { font-size: 13px; color: var(--p-ink2); }
.ad-access em { font-style: normal; font-weight: 700; color: #7545F5; }
.ad-access a > svg { color: var(--p-ink3); flex: none; }

.p-kpi-big { align-items: center; }
.p-kpi-big b { font-size: 24px; line-height: 1.1; }
.p-kpi b.is-multi { font-size: 18px; display: flex; flex-direction: column; gap: 2px; }
.p-kpi-big .p-kpi-label { color: var(--p-ink); font-size: 14px; }
.ad-filters .ad-search { flex: 1 1 300px; }
.ad-filters .p-field:not(.ad-search) { flex: 0 1 180px; }
.ad-site-box { padding: 12px 14px; border-radius: 12px; background: var(--p-sub); border: 1px solid var(--p-panel-bd); }
.ad-site-box a { font-weight: 700; overflow-wrap: anywhere; }
.ad-site-box p { margin: 6px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--p-ink2); }
/* Correo rebotado (mail_events): etiqueta junto al correo y aviso en la ventana del afiliado. */
.ad-bounce-tag { margin-left: 6px; background: var(--p-err-bg); border: 1px solid var(--p-err-bd); color: var(--p-err-fg); font-weight: 700; white-space: nowrap; }
.ad-bounce { margin: 0; }
.p-row .p-ini { flex: none; }

.ad-rate { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.ad-rate .p-field { flex: 1 1 180px; }
.am-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.am-card { display: flex; flex-direction: column; border-radius: 18px; background: var(--p-panel); border: 1px solid var(--p-panel-bd); overflow: hidden; }
.am-prev { height: 150px; display: flex; align-items: center; justify-content: center; padding: 12px; background: repeating-conic-gradient(var(--p-sub) 0 25%, var(--p-panel) 0 50%) 0 0 / 16px 16px; border-bottom: 1px solid var(--p-panel-bd); overflow: hidden; }
.am-prev img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.am-prev p { margin: 0; align-self: flex-start; font-size: 12.5px; line-height: 1.45; color: var(--p-ink2); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.am-info { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px 16px; }
.am-info b { font-size: 15px; }
.am-info > span { font-size: 13.5px; color: var(--p-ink2); }
.am-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.am-foot small { font-size: 12.5px; color: var(--p-ink2); }
/* Celular: lista compacta (miniatura + datos), como en el prototipo. */
@media (max-width: 1023px) {
    .am-grid { grid-template-columns: 1fr; gap: 0; border-radius: 18px; background: var(--p-panel); border: 1px solid var(--p-panel-bd); overflow: hidden; }
    .am-card { flex-direction: row; align-items: center; border: 0; border-radius: 0; border-top: 1px solid var(--p-panel-bd); }
    .am-card:first-child { border-top: 0; }
    .am-prev { flex: none; width: 64px; height: 52px; margin: 10px 0 10px 12px; padding: 4px; border-radius: 8px; }
    .am-prev p { font-size: 8px; -webkit-line-clamp: 3; }
    .am-info { flex: 1; min-width: 0; padding: 10px 12px; gap: 1px; }
    .am-info b { font-size: 14px; }
    .am-info > span { font-size: 12.5px; }
    .am-foot { margin-top: 4px; }
    .am-foot small { display: none; }
}

.as-grid { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.as-h { display: block; margin-bottom: 6px; }
.as-links { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.as-links .p-field { font-size: 13.5px; font-weight: 700; color: var(--p-ink); }
.as-img { display: block; width: 100%; height: auto; border-radius: 12px; margin-top: 10px; }
.as-more { margin-top: 12px; }

.am-funnel .p-kpi b { font-size: 24px; }
.am-bar-row { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: 1px solid var(--p-panel-bd); }
.am-bar-row > div { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.am-bar-row small { font-size: 12.5px; color: var(--p-ink2); }
.am-bar-row .p-bar { flex: none; width: 100%; max-width: 220px; }
.am-state { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--p-panel-bd); }
.am-state div { display: flex; flex-direction: column; }
.am-state small { font-size: 12px; color: var(--p-ink3); }
.am-state strong { font-size: 14.5px; text-align: right; }
.am-defs { margin-top: 12px; }
.am-mt { margin-top: 12px; }
.am-h3 { margin: 16px 0 8px; font-size: 15px; }
.am-quote { margin: 0 0 10px; padding: 12px 14px; border-left: 3px solid #9B72FF; border-radius: 8px; background: var(--p-sub); font-size: 14px; line-height: 1.5; }
.am-quote span { display: block; margin-top: 6px; font-size: 12.5px; color: var(--p-ink2); }
.am-col { display: flex; flex-direction: column; gap: 16px; }
.am-rev { margin: 0 0 6px; font-size: 15px; }

/* ---------- barra de abajo y cajón (celular) ---------- */

.p-bnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--p-nav-bg); border-top: 1px solid var(--p-panel-bd); }
.p-bnav a, .p-bnav button { height: 58px; border: 0; border-radius: 14px; background: transparent; color: var(--p-ink2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11.5px; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none; }
.p-bnav .is-on { background: var(--p-side-active-bg); color: var(--p-side-active-fg); font-weight: 700; }
.p-overlay { position: fixed; inset: 0; z-index: 80; background: var(--p-overlay); opacity: 0; pointer-events: none; transition: opacity .25s; }
.p-drawer { position: fixed; left: 0; top: 0; bottom: 0; z-index: 81; width: min(310px, 84%); background: var(--p-sheet); display: flex; flex-direction: column; box-shadow: var(--p-shadow); transform: translateX(-104%); visibility: hidden; transition: transform .3s cubic-bezier(.2, .8, .2, 1), visibility .3s; }
.p-app.is-drawer .p-overlay { opacity: 1; pointer-events: auto; }
.p-app.is-drawer .p-drawer { transform: none; visibility: visible; }
.p-drawer-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 16px 14px 10px 20px; padding-top: calc(16px + env(safe-area-inset-top)); }
.p-drawer-head img { width: 32px; height: 32px; object-fit: contain; }
.p-drawer-head > span { flex: 1; display: flex; flex-direction: column; line-height: 1; }
.p-drawer-head b { font-size: 20px; letter-spacing: -.02em; }
.p-drawer-head span span { font-size: 11.5px; font-weight: 800; color: #7545F5; }
.p-drawer-head .p-icon-btn { width: 44px; height: 44px; }
.p-drawer-nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 0 10px 16px; }
.p-drawer-nav a, .p-drawer-nav button { min-height: 46px; width: 100%; border: 0; border-radius: 12px; padding: 0 12px; display: flex; align-items: center; gap: 14px; cursor: pointer; font-size: 15px; font-weight: 500; background: transparent; color: var(--p-side-fg); text-align: left; text-decoration: none; }
.p-drawer-nav .is-on { background: var(--p-side-active-bg); color: var(--p-side-active-fg); font-weight: 700; }
.p-drawer-nav .p-open { display: inline; }
.p-drawer-back { margin-top: 10px; font-size: 14px !important; font-weight: 600 !important; color: var(--p-ink3) !important; }

/* ---------- computador ---------- */

@media (min-width: 1024px) {
    .p-wide { display: flex !important; }
    .p-narrow { display: none !important; }
    .p-app { flex-direction: row; }
    .p-top { padding: 12px 28px; border-bottom: 1px solid var(--p-panel-bd); }
    .p-top.has-title { padding: 18px 28px 8px; border-bottom: 0; }
    .p-main, .p-affiliates .p-main { padding: 22px 28px 28px; }
    .p-top.has-title + .p-main { padding-top: 8px; }
    .p-wrap { gap: 18px; }
    .p-head { flex-direction: row; align-items: flex-start; }
    .p-head h1 { font-size: 28px; }
    .p-hello { display: none; }
    .p-toast { top: 22px; }
    .p-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .p-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .p-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .p-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .p-card { padding: 18px 20px; }
    .p-kpi { padding: 16px; }
    .p-wide-b { display: block !important; }
    .p-narrow-b, div.p-narrow-b.ph-quick { display: none !important; }
    .p-top.has-period .p-theme { display: flex; }
    .p-top.has-period .p-who { display: flex; }
    .p-top-period .p-period select { max-width: 200px; }
    .ph-inc { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
    .ph-break { display: grid; }
    .ph-total { padding: 24px 26px; }
    .ph-total b { font-size: 40px; }
    .ph-mid { grid-template-columns: minmax(0, 1fr) 260px; }
    .ph-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .ph-tools { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .p-gate { padding: 40px 20px; }
    .pc-sum { grid-template-columns: minmax(0, 1.35fr) repeat(3, minmax(0, 1fr)); }
    .pc-total { padding: 20px 22px; }
    .pp-sum { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ps-row { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
    .ps-row-b { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
    .pm-item-side .pm-body { flex-direction: row; align-items: flex-start; }
    .pm-item-side .pm-preview { flex: none; width: 46%; }
    .pm-item-side .pm-side { flex: 1; }
    .pst-site { grid-template-columns: auto minmax(0, 1fr) 140px auto; padding: 18px 22px; }
    .pst-ico { grid-row: auto; align-self: center; }
    .pst-stat { grid-column: auto; }
    .pst-site .p-pill { grid-column: auto; grid-row: auto; align-self: center; }
    .pco-methods { grid-template-columns: repeat(auto-fill, minmax(260px, 268px)); }
    .ppr-grid { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
    .ppr-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ppr-info { padding: 22px; }
    .ad-row-1 { grid-template-columns: minmax(0, .85fr) minmax(0, 1.25fr); }
    .ad-row-2 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
    .ad-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ad-recent-row { grid-template-columns: minmax(0, 1fr) auto auto auto; }
    .ad-perf-k { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .as-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
