/*
 * mi-cuenta.css — Estilos del panel /mi-cuenta refactorizado v39.0.
 * Hereda variables de empresa-editorial.css (--paper, --ink, --garnet, --rule, --white).
 * Mobile-first con breakpoints 640/1024px.
 */

.mi-cuenta-page {
    background: var(--paper, #faf7f0);
    color: var(--ink, #1a1410);
    font-family: 'IBM Plex Sans', system-ui, sans-serif;
    min-height: 70vh;
}

/* ── Re-arquitectura Fase 1 (2026-07-04): neutralizar el azul legacy DENTRO del panel ──
 * styles.css (global, sitio público) define --accent:#0066FF y lo consumen componentes
 * genéricos (.btn-primary, input:focus, enlaces) que se cuelan en azul dentro del panel.
 * Aquí se redefine --accent a la marca burdeos SOLO en el subárbol del panel (por cascada
 * de custom properties). NO se toca styles.css ni el sitio público (que sigue azul). */
.mi-cuenta-page,
.panel-layout {
    --accent: var(--garnet, #8f0020);
    --accent-hover: #7d2a3a;
    --accent-soft: rgba(143, 0, 32, 0.08);
    /* a11y (revisión UX 2026-07-04): --ink-muted #8a8275 daba ~3.2:1 sobre paper
     * (falla WCAG AA). Se oscurece a #6b6358 (~4.6:1) SOLO en el panel. */
    --ink-muted: #6b6358;
}

/* ── Re-arquitectura Fase 2 (2026-07-04): shell del panel con sidebar persistente ──
 * .panel-layout envuelve (de forma aditiva) el <main class="mi-cuenta-page"> de cada
 * plantilla: columna [sidebar | contenido]. Colapsa a tira scrollable en móvil. */
.panel-layout {
    display: grid;
    grid-template-columns: 244px minmax(0, 1fr);
    align-items: start;
    background: var(--paper, #faf7f0);
}
.panel-main { min-width: 0; }
/* Miga estándar del shell (reemplaza los back-links ad-hoc "← Volver al panel") */
.panel-main .panel-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 24px 0;
    font-size: 12.5px;
    color: var(--ink-muted, #8a8275);
}
.panel-main .panel-breadcrumb a { color: var(--ink-soft, #4a423a); text-decoration: none; }
.panel-main .panel-breadcrumb a:hover { color: var(--garnet, #8f0020); text-decoration: underline; }
.panel-main .panel-breadcrumb__sep { opacity: .6; }
.panel-sidebar {
    position: sticky;
    top: 64px; /* bajo el .site-header sticky (64px, z-1000) — si no, tapa Inicio/Buscar al hacer scroll */
    align-self: start;
    /* v2026-07-10 pie estilo Claude: flex-column con ALTURA FIJA de viewport; el scroll
       vive en .panel-nav y el pie (.panel-user) queda anclado abajo SIN clipear su popover */
    display: flex;
    flex-direction: column;
    height: calc(100vh - 64px);
    max-height: calc(100vh - 64px);
    padding: 22px 12px 12px;
    border-right: 1px solid var(--rule, #e6dfce);
    background: var(--white, #fffdf9);
    font-family: 'IBM Plex Sans', system-ui, sans-serif;
}
.panel-nav { flex: 1 1 auto; overflow-y: auto; min-height: 0; }
.panel-nav__group {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--ink-muted, #8a8275);
    margin: 18px 10px 6px;
}
.panel-nav__list {
    list-style: none;
    margin: 0 0 4px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.panel-nav__link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--ink-soft, #4a423a);
    text-decoration: none;
    font-size: 14px;
    line-height: 1.2;
    transition: background .12s, color .12s;
}
.panel-nav__link:hover {
    background: var(--accent-soft, rgba(143, 0, 32, .08));
    color: var(--garnet, #8f0020);
}
.panel-nav__link.is-active {
    background: var(--garnet, #8f0020);
    color: #fff;
    font-weight: 600;
}
.panel-nav__link.is-active .panel-nav__icon { color: #fff; }
.panel-nav__icon { font-size: 20px; color: var(--ink-muted, #8a8275); flex-shrink: 0; }
.panel-nav__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ══ PIE DE USUARIO estilo Claude (v2026-07-10, decisión Pablo) ══════════════
   Fila fija abajo del sidebar (avatar+nombre+plan+saldo); el popover con las
   entradas de Cuenta abre HACIA ARRIBA. details nativo (patrón validado). */
.panel-user {
    flex-shrink: 0;
    border-top: 1px solid var(--rule, #e6dfce);
    padding-top: 8px;
    margin-top: 8px;
}
.panel-user__menu { position: relative; }
.panel-user__menu > summary { list-style: none; }
.panel-user__menu > summary::-webkit-details-marker { display: none; }
.panel-user__row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
}
.panel-user__row:hover { background: var(--accent-soft, rgba(143, 0, 32, .08)); }
.panel-user__row.is-active { box-shadow: inset 3px 0 0 var(--garnet, #8f0020); }
.panel-user__menu[open] > .panel-user__row { background: var(--accent-soft, rgba(143, 0, 32, .08)); }
.panel-user__avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: var(--garnet, #8f0020);
    color: #fff;
    font-size: 12.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: .02em;
}
.panel-user__meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.panel-user__name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink, #1a1410);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.panel-user__plan { font-size: 11.5px; color: var(--ink-muted, #8a8275); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-user__chev { font-size: 18px; color: var(--ink-muted, #8a8275); flex-shrink: 0; transition: transform .15s; }
.panel-user__menu[open] .panel-user__chev { transform: rotate(180deg); }
.panel-user__pop {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--rule, #e6dfce);
    border-radius: 12px;
    box-shadow: 0 10px 32px rgba(26, 20, 16, .16);
    padding: 6px;
    z-index: 60;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.panel-user__pop .panel-nav__link { padding: 8px 10px; }
.panel-user__sep { height: 1px; background: var(--rule, #e6dfce); margin: 5px 8px; }
.panel-user__logout { color: var(--garnet, #8f0020); }
.panel-user__logout .panel-nav__icon { color: var(--garnet, #8f0020); }
.panel-user__logout:hover { background: rgba(143, 0, 32, .08); }

/* fila de usuario en la bottom sheet móvil (paridad con el pie) */
.panel-msheet__userrow {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 4px 8px;
    padding-top: 12px;
    border-top: 1px solid var(--rule, #e6dfce);
}

/* ══ BUSCADOR LICITACIONES — doble slider de importe (rediseño 2026-07-10) ══ */
.licit-range { display: flex; flex-direction: column; gap: 6px; }
.licit-range__track {
    position: relative;
    height: 28px;
}
.licit-range__track input[type="range"] {
    position: absolute;
    left: 0; right: 0; top: 50%;
    transform: translateY(-50%);
    width: 100%;
    margin: 0;
    background: none;
    pointer-events: none;          /* solo los pulgares reciben eventos */
    -webkit-appearance: none;
    appearance: none;
    height: 28px;
}
/* pista (solo la pinta el primer slider) */
.licit-range__track input[type="range"]:first-child::-webkit-slider-runnable-track {
    height: 6px; border-radius: 999px;
    background: var(--rule, #e6dfce);
}
.licit-range__track input[type="range"]:last-child::-webkit-slider-runnable-track {
    height: 6px; border-radius: 999px;
    background: transparent;
}
.licit-range__track input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    pointer-events: auto;          /* el pulgar sí es interactivo */
    width: 22px; height: 22px;
    margin-top: -8px;
    border-radius: 999px;
    background: var(--garnet, #8f0020);
    border: 3px solid #fff;
    box-shadow: 0 1px 4px rgba(26, 20, 16, .25);
    cursor: grab;
}
.licit-range__track input[type="range"]::-moz-range-track {
    height: 6px; border-radius: 999px;
    background: var(--rule, #e6dfce);
}
.licit-range__track input[type="range"]:last-child::-moz-range-track { background: transparent; }
.licit-range__track input[type="range"]::-moz-range-thumb {
    pointer-events: auto;
    width: 18px; height: 18px;
    border-radius: 999px;
    background: var(--garnet, #8f0020);
    border: 3px solid #fff;
    box-shadow: 0 1px 4px rgba(26, 20, 16, .25);
    cursor: grab;
}

/* ══ LICITACIONES v2 — barra compacta + chips + cards jerárquicas (2026-07-10) ══ */
.mc-card {
    background: #fff;
    border: 1px solid var(--rule, #e6dfce);
    border-radius: 12px;
    padding: 14px 16px;
}
.mc-filterbar {
    display: grid;
    grid-template-columns: minmax(220px, 2.4fr) minmax(150px, 1.1fr) minmax(140px, 1fr) auto;
    gap: 10px;
    align-items: end;
}
.mc-filterbar__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--ink-soft, #4a423a);
}
.mc-filterbar__field input,
.mc-filterbar__field select {
    padding: 9px 10px;
    border: 1px solid var(--rule, #e6dfce);
    border-radius: 8px;
    font-size: 14.5px;
    background: #fff;
    min-width: 0;
}
.mc-filterbar__go { padding: 9px 20px; font-size: 14.5px; white-space: nowrap; }
.mc-filters-more { grid-column: 1 / -1; font-size: 12.5px; }
.mc-filters-more > summary {
    cursor: pointer;
    color: var(--ink-muted, #8a8275);
    user-select: none;
    width: max-content;
}
.mc-filters-more > summary:hover { color: var(--garnet, #8f0020); }
.mc-filters-more__body {
    display: grid;
    grid-template-columns: minmax(240px, 2fr) auto minmax(160px, 1fr);
    gap: 14px 18px;
    align-items: end;
    padding-top: 10px;
}
.mc-fchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mc-fchip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    background: var(--paper, #faf7f0);
    border: 1px solid var(--rule, #e6dfce);
    color: var(--ink-soft, #4a423a);
    padding: 3px 6px 3px 10px;
    border-radius: 999px;
}
.mc-fchip a {
    color: var(--ink-muted, #8a8275);
    text-decoration: none;
    font-weight: 700;
    padding: 0 4px;
    border-radius: 999px;
    line-height: 1.2;
}
.mc-fchip a:hover { color: #fff; background: var(--garnet, #8f0020); }

/* cabecera de resultados + barra guardar-alerta (v2.1 2026-07-10) */
.mc-results-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px 20px;
    flex-wrap: wrap;
    margin: 20px 0 14px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--rule, #e6dfce);
}
.mc-results-head__count { min-width: 0; }
.mc-results-head__n {
    margin: 0;
    font-size: 14.5px;
    color: var(--ink-soft, #4a423a);
    line-height: 1.2;
}
.mc-results-head__n strong {
    font-family: 'Fraunces', serif;
    font-size: 26px;
    font-weight: 600;
    color: var(--garnet, #8f0020);
    font-variant-numeric: tabular-nums;
    margin-right: 3px;
    letter-spacing: -.01em;
}
.mc-results-head__mode { color: var(--ink-muted, #8a8275); font-size: 13px; }
.mc-results-head__sub {
    margin: 3px 0 0;
    font-size: 12px;
    color: var(--ink-muted, #8a8275);
}
.mc-savebar {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
.mc-savebar__field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 11px;
    color: var(--ink-muted, #8a8275);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.mc-savebar__field input {
    padding: 8px 10px;
    border: 1px solid var(--rule, #e6dfce);
    border-radius: 8px;
    font-size: 13px;
    width: 185px;
    text-transform: none;
    letter-spacing: normal;
}
.mc-savebar__go { padding: 8px 16px; font-size: 13.5px; white-space: nowrap; }
.mc-savebar__plain {
    background: none;
    border: 0;
    cursor: pointer;
    font-size: 12px;
    color: var(--ink-muted, #8a8275);
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: nowrap;
    padding: 0 0 9px;
}
.mc-savebar__plain:hover { color: var(--garnet, #8f0020); }
@media (max-width: 720px) {
    .mc-savebar { width: 100%; }
    .mc-savebar__field { flex: 1; }
    .mc-savebar__field input { width: 100%; }
}

/* cards de resultados (sustituyen a la tabla en el panel) */
.mc-licit-list { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.mc-licit-card {
    background: #fff;
    border: 1px solid var(--rule, #e6dfce);
    border-radius: 10px;
}
.mc-licit-card[open] { box-shadow: 0 2px 10px rgba(26, 20, 16, .07); }
.mc-licit-card > summary {
    list-style: none;
    cursor: pointer;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.mc-licit-card > summary::-webkit-details-marker { display: none; }
.mc-licit-card__obj {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink, #1a1410);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}
.mc-licit-card__badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mc-badge {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 5px;
    white-space: nowrap;
    background: var(--paper, #faf7f0);
    color: var(--ink-soft, #4a423a);
    border: 1px solid var(--rule, #e6dfce);
}
.mc-badge--dias { background: #eaf6ec; color: #14532d; border-color: #cde8d3; }
.mc-badge--dias.is-urgent { background: #fdeaea; color: #8f0020; border-color: #f4c9c9; }
.mc-badge--imp { background: #f5efe2; color: #6b5310; border-color: #e8dcbc; font-variant-numeric: tabular-nums; }
.mc-badge--docs { background: #eef2f9; color: #23406e; border-color: #d3ddef; }
.mc-licit-card__sec {
    font-size: 12.5px;
    color: var(--ink-muted, #8a8275);
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin: 0;
}
.mc-licit-card__sec strong { color: var(--ink-soft, #4a423a); font-weight: 600; }
.mc-licit-card__sec a { color: var(--garnet, #8f0020); font-weight: 600; text-decoration: none; }
.mc-licit-card__sec a:hover { text-decoration: underline; }
.mc-licit-card__body {
    border-top: 1px solid var(--rule, #e6dfce);
    padding: 12px 14px 14px;
    font-size: 13.5px;
    color: var(--ink-soft, #4a423a);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.mc-licit-card__full { margin: 0; line-height: 1.55; }
.mc-licit-docs { display: flex; flex-direction: column; gap: 6px; }
.mc-licit-docs__title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--ink-muted, #8a8275);
    margin: 0;
}
.mc-licit-doc {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 7px 10px;
    background: var(--paper, #faf7f0);
    border: 1px solid var(--rule, #e6dfce);
    border-radius: 7px;
    font-size: 13px;
}
.mc-licit-doc a { color: var(--garnet, #8f0020); font-weight: 600; text-decoration: none; }
.mc-licit-doc a:hover { text-decoration: underline; }
.mc-licit-doc__kind {
    font-size: 11px;
    font-weight: 700;
    color: #23406e;
    background: #eef2f9;
    border-radius: 4px;
    padding: 1px 6px;
}
.mc-licit-doc__size { font-size: 11.5px; color: var(--ink-muted, #8a8275); }
.mc-licit-doc__plain { color: var(--ink-soft, #4a423a); }

/* v2.2 — iconos por tipo de archivo (chips de formato) */
.mc-fico {
    display: inline-block;
    min-width: 34px;
    text-align: center;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .03em;
    padding: 2px 5px;
    border-radius: 4px;
    border: 1px solid transparent;
    flex-shrink: 0;
}
.mc-fico--pdf   { background: #fdeaea; color: #8f0020; border-color: #f4c9c9; }
.mc-fico--doc   { background: #e8effc; color: #1e4b9e; border-color: #c9d9f4; }
.mc-fico--xls   { background: #e7f5ea; color: #14652d; border-color: #c5e5cd; }
.mc-fico--zip   { background: #fdf3e0; color: #8a5a10; border-color: #f0dcb2; }
.mc-fico--img   { background: #f2ecfa; color: #5b3a9e; border-color: #ddd0f0; }
.mc-fico--other { background: var(--paper, #faf7f0); color: var(--ink-soft, #4a423a); border-color: var(--rule, #e6dfce); }

/* v2.2 — ZIP como CARPETA navegable (details anidado) */
.mc-licit-folder {
    background: var(--paper, #faf7f0);
    border: 1px solid var(--rule, #e6dfce);
    border-radius: 7px;
}
.mc-licit-folder > summary { list-style: none; cursor: pointer; }
.mc-licit-folder > summary::-webkit-details-marker { display: none; }
.mc-licit-folder .mc-licit-doc--folder { border: 0; background: transparent; }
.mc-licit-folder__name { font-weight: 600; color: var(--ink, #1a1410); overflow-wrap: anywhere; }
.mc-licit-folder__chev { margin-left: auto; color: var(--ink-muted, #8a8275); font-size: 11px; transition: transform .15s; }
.mc-licit-folder[open] .mc-licit-folder__chev { transform: rotate(180deg); }
.mc-licit-folder__files {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 2px 10px 10px 30px;
}
.mc-licit-doc--inner { background: #fff; padding: 5px 9px; font-size: 12.5px; }

/* v2.2 — badge-enlace a la ficha propia */
.mc-badge--link { background: #fff; color: var(--garnet, #8f0020); border-color: #e4bfc8; text-decoration: none; }
.mc-badge--link:hover { background: var(--garnet, #8f0020); color: #fff; }

/* v2.3 — multi-formato (mismo doc en PDF+DOCX = una fila + chips) + vista previa */
.mc-doc-fmt {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .03em;
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px dashed var(--rule, #e6dfce);
    color: var(--ink-muted, #8a8275) !important;
    text-decoration: none !important;
    background: #fff;
}
.mc-doc-fmt:hover { color: #fff !important; background: var(--garnet, #8f0020); border-style: solid; }
.mc-doc-prevbtn {
    margin-left: auto;
    background: none;
    border: 1px solid var(--rule, #e6dfce);
    border-radius: 6px;
    padding: 2px 9px;
    font-size: 11.5px;
    color: var(--ink-soft, #4a423a);
    cursor: pointer;
    white-space: nowrap;
}
.mc-doc-prevbtn:hover { border-color: var(--garnet, #8f0020); color: var(--garnet, #8f0020); }
.mc-doc-preview { margin: 4px 0 8px; }
.mc-doc-preview iframe {
    width: 100%;
    height: 480px;
    border: 1px solid var(--rule, #e6dfce);
    border-radius: 8px;
    background: #fff;
    display: block;
}

/* v2.4 — previsualización en VENTANA EMERGENTE (modal) */
html.mc-docmodal-lock { overflow: hidden; }
.mc-docmodal { position: fixed; inset: 0; z-index: 1400; }
.mc-docmodal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(26, 20, 16, .55);
    backdrop-filter: blur(2px);
}
.mc-docmodal__panel {
    position: absolute;
    inset: 3vh 4vw;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 18px 60px rgba(26, 20, 16, .35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.mc-docmodal__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--rule, #e6dfce);
    background: var(--paper, #faf7f0);
}
.mc-docmodal__title {
    font-weight: 600;
    font-size: 14px;
    color: var(--ink, #1a1410);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mc-docmodal__open {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--garnet, #8f0020);
    text-decoration: none;
    white-space: nowrap;
}
.mc-docmodal__open:hover { text-decoration: underline; }
.mc-docmodal__close {
    background: none;
    border: 1px solid var(--rule, #e6dfce);
    border-radius: 6px;
    width: 30px;
    height: 30px;
    font-size: 14px;
    cursor: pointer;
    color: var(--ink-soft, #4a423a);
    flex-shrink: 0;
}
.mc-docmodal__close:hover { border-color: var(--garnet, #8f0020); color: var(--garnet, #8f0020); }
.mc-docmodal__frame { flex: 1; border: 0; width: 100%; background: #525659; }
.mc-docmodal__body {
    flex: 1;
    overflow: auto;
    background: #525659;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.mc-docmodal__page {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
    border-radius: 2px;
    max-width: 100%;
    height: auto;
}
.mc-docmodal__docx { background: #fff; border-radius: 4px; max-width: 100%; overflow-x: auto; }
.mc-docmodal__docx .docx-wrapper { background: transparent !important; padding: 8px !important; }
.mc-docmodal__loading { color: #e6dfce; font-size: 13.5px; margin: 18px 0; }
.mc-docmodal__loading a { color: #f4c9c9; }
@media (max-width: 720px) {
    .mc-docmodal__panel { inset: 0; border-radius: 0; }
}
.mc-licit-card__actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: 12.5px; }
.mc-licit-card__actions a { color: var(--garnet, #8f0020); font-weight: 600; text-decoration: none; }
.mc-licit-card__actions a:hover { text-decoration: underline; }
.mc-licit-card__src { font-size: 11.5px; color: var(--ink-muted, #8a8275); margin: 0; }
@media (max-width: 720px) {
    .mc-filterbar { grid-template-columns: 1fr 1fr; }
    .mc-filterbar__field--q, .mc-filterbar__go, .mc-filters-more { grid-column: 1 / -1; }
    .mc-filters-more__body { grid-template-columns: 1fr; }
}

/* ══ NAV MÓVIL DEL PANEL — rediseño 2026-07-10 ═══════════════════════════════
   Patrón app nativa: bottom tab bar fija (4 primarias + Menú) en la zona del
   pulgar + bottom sheet con las 16 secciones agrupadas. El sidebar desaparece
   en ≤1024px (adiós tira horizontal). Desktop intacto. */

/* por defecto (desktop) la barra y la sheet no existen visualmente */
.panel-mtabs, .panel-msheet { display: none; }
html.msheet-lock { overflow: hidden; }

@media (max-width: 1024px) {
    .panel-layout { grid-template-columns: 1fr; padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
    .panel-sidebar { display: none; }
    /* neutralizar el bottomtabs público legacy (3 plantillas viejas lo incluyen) */
    body:has(.panel-mtabs) .ob-bottomtabs { display: none !important; }

    /* ── Bottom tab bar ── */
    .panel-mtabs {
        position: fixed;
        left: 0; right: 0; bottom: 0;
        z-index: 950; /* > contenido, < dropdowns del header (1000) */
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        height: calc(58px + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: rgba(255, 253, 249, .97);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        border-top: 1px solid var(--rule, #e6dfce);
        box-shadow: 0 -2px 12px rgba(26, 20, 16, .06);
    }
    .panel-mtabs__item {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        min-height: 58px;             /* tap target holgado (>44px) */
        border: 0;
        background: none;
        text-decoration: none;
        color: var(--ink-muted, #8a8275);
        font-family: inherit;
        font-size: 10.5px;
        font-weight: 500;
        line-height: 1;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .panel-mtabs__item .material-symbols-outlined { font-size: 23px; }
    .panel-mtabs__label { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .panel-mtabs__item.is-active { color: var(--garnet, #8f0020); font-weight: 700; }
    .panel-mtabs__item.is-active::before {   /* indicador superior fino, estilo app */
        content: "";
        position: absolute;
        top: 0; left: 50%;
        transform: translateX(-50%);
        width: 28px; height: 3px;
        border-radius: 0 0 3px 3px;
        background: var(--garnet, #8f0020);
    }

    /* ── Bottom sheet (Menú) ── */
    .panel-msheet { display: block; position: fixed; inset: 0; z-index: 1200; }
    .panel-msheet[hidden] { display: none; }
    .panel-msheet__backdrop {
        position: absolute; inset: 0;
        background: rgba(26, 20, 16, .45);
        opacity: 0;
        transition: opacity .2s ease;
    }
    .panel-msheet__panel {
        position: absolute;
        left: 0; right: 0; bottom: 0;
        max-height: 84vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        background: var(--paper, #fffdf9);
        border-radius: 18px 18px 0 0;
        box-shadow: 0 -8px 32px rgba(26, 20, 16, .22);
        padding: 8px 16px calc(18px + env(safe-area-inset-bottom, 0px));
        transform: translateY(100%);
        transition: transform .22s cubic-bezier(.32, .72, .32, 1);
    }
    .panel-msheet.is-open .panel-msheet__backdrop { opacity: 1; }
    .panel-msheet.is-open .panel-msheet__panel { transform: translateY(0); }
    @media (prefers-reduced-motion: reduce) {
        .panel-msheet__backdrop, .panel-msheet__panel { transition: none; }
    }
    .panel-msheet__grab {
        width: 40px; height: 4px;
        margin: 6px auto 2px;
        border-radius: 999px;
        background: var(--rule, #e6dfce);
    }
    .panel-msheet__head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin: 2px 0 4px;
    }
    .panel-msheet__title {
        margin: 0;
        font-size: 15px;
        font-weight: 700;
        color: var(--ink, #1a1410);
    }
    .panel-msheet__close {
        display: flex; align-items: center; justify-content: center;
        width: 44px; height: 44px;
        margin-right: -10px;
        border: 0; border-radius: 999px;
        background: none;
        color: var(--ink-muted, #8a8275);
        cursor: pointer;
    }
    .panel-msheet__close:active { background: var(--accent-soft, rgba(143, 0, 32, .08)); }
    .panel-msheet__group {
        margin: 14px 2px 8px;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: .08em;
        text-transform: uppercase;
        color: var(--ink-muted, #8a8275);
    }
    .panel-msheet__grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .panel-msheet__card {
        display: flex;
        align-items: center;
        gap: 10px;
        min-height: 52px;             /* tap target grande */
        padding: 10px 12px;
        border: 1px solid var(--rule, #e6dfce);
        border-radius: 12px;
        background: #fff;
        text-decoration: none;
        color: var(--ink, #1a1410);
        font-size: 13.5px;
        font-weight: 500;
        line-height: 1.2;
    }
    .panel-msheet__card:active { background: var(--accent-soft, rgba(143, 0, 32, .08)); }
    .panel-msheet__icon { font-size: 22px; color: var(--ink-muted, #8a8275); flex-shrink: 0; }
    .panel-msheet__label { overflow: hidden; text-overflow: ellipsis; }
    .panel-msheet__card.is-active {
        background: var(--garnet, #8f0020);
        border-color: var(--garnet, #8f0020);
        color: #fff;
        font-weight: 700;
    }
    .panel-msheet__card.is-active .panel-msheet__icon { color: #fff; }
}
@media (max-width: 768px) {
    /* (rediseño 2026-07-10: el sidebar ya no se muestra en móvil; regla legacy retirada) */
}

.mc-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px 80px;
}

.mc-header { margin-bottom: 28px; }
.mc-header h1 {
    font-family: 'Fraunces', serif;
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--ink, #1a1410);
    margin: 0 0 6px;
    /* R29-01: el h1 del panel puede llevar TEXTO LIBRE del usuario (p.ej. el asunto de un ticket,
       hasta 200 chars). Un token largo sin espacios a ~28px medía ~1000px y, sin overflow-x global,
       daba scroll horizontal a TODA la página en 375px. Mismo blindaje que .mc-item__desc/.audit-target. */
    overflow-wrap: anywhere;
    word-break: break-word;
}
.mc-sub {
    font-size: 15px;
    color: var(--ink-soft, #4a423a);
    margin: 0;
    line-height: 1.5;
}
.mc-breadcrumb {
    font-size: 13px;
    color: var(--ink-muted, #8a8275);
    margin: 0 0 6px;
}
.mc-breadcrumb a {
    color: var(--ink-soft, #4a423a);
    text-decoration: none;
}
.mc-meter {
    font-size: 12px;
    background: var(--rule, #e6dfce);
    color: var(--ink-soft, #4a423a);
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 8px;
}

/* ── Banner persistente "personaliza tu rol" ─────────────────────────────── */
.mc-persona-banner {
    background: linear-gradient(90deg, #fff5f5 0%, #fefcf7 100%);
    border: 1px solid var(--rule, #e6dfce);
    border-left: 4px solid var(--garnet, #8f0020);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.mc-persona-banner__text { font-size: 14px; color: var(--ink, #1a1410); line-height: 1.45; }
.mc-persona-banner__text strong { font-weight: 600; }
.mc-persona-banner__cta {
    background: var(--garnet, #8f0020);
    color: white;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}
.mc-persona-banner__cta:hover { background: #7a001a; }

/* ── Bloques generales ───────────────────────────────────────────────────── */
.mc-block {
    background: var(--white, #fefcf7);
    border: 1px solid var(--rule, #e6dfce);
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 20px;
}
.mc-block h2 {
    font-family: 'Fraunces', serif;
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 16px;
    color: var(--ink, #1a1410);
}
.mc-block h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px;
}

/* ── Alertas / feedback ──────────────────────────────────────────────────── */
.mc-alert {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 16px;
}
.mc-alert.is-error { background: #fff5f5; border: 1px solid #ffd5d5; color: #8f0020; }
.mc-alert.is-ok    { background: #f0fff5; border: 1px solid #c5e8d0; color: #1a5a2a; }
.mc-alert.is-warn  { background: #fff8e0; border: 1px solid #ffe5a0; color: #7a5c2a; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.mc-form label { display: block; margin-bottom: 14px; }
.mc-form label > span {
    display: block;
    font-weight: 500;
    font-size: 13px;
    color: var(--ink, #1a1410);
    margin-bottom: 6px;
}
.mc-form input[type="text"],
.mc-form input[type="number"],
.mc-form input[type="email"],
.mc-form input[type="password"],
.mc-form select,
.mc-form textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--rule, #e6dfce);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    background: var(--paper, #faf7f0);
    color: var(--ink, #1a1410);
    box-sizing: border-box;
}
.mc-form input:focus, .mc-form select:focus, .mc-form textarea:focus {
    /* a11y: anillo de foco visible (antes outline:0 = solo cambio de borde, se perdía).
       outline sólido funciona también en modo alto-contraste / forced-colors. */
    outline: 2px solid var(--garnet, #8f0020);
    outline-offset: 1px;
    border-color: var(--garnet, #8f0020);
    background: white;
}
.mc-form__row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 4px;
}
.mc-form__actions {
    margin-top: 18px;
    display: flex;
    gap: 12px;
    align-items: center;
}

/* ── Botones ─────────────────────────────────────────────────────────────── */
.btn-primary {
    background: var(--garnet, #8f0020);
    color: white;
    padding: 10px 22px;
    border: 0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    display: inline-block;
}
.btn-primary:hover { background: #7a001a; }
.btn-secondary {
    background: white;
    color: var(--ink, #1a1410);
    padding: 9px 18px;
    border: 1px solid var(--rule, #e6dfce);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-family: inherit;
}
.btn-secondary:hover { border-color: var(--ink, #1a1410); }
.btn-link {
    background: none;
    border: 0;
    color: var(--ink-soft, #4a423a);
    cursor: pointer;
    font-size: 13px;
    padding: 6px 10px;
    font-family: inherit;
    text-decoration: underline;
}
.btn-link:hover { color: var(--garnet, #8f0020); }
.btn-link.is-danger { color: #8f0020; }
.btn-link.is-danger:hover { color: #5f0010; }

/* ── Listas de items / cards ─────────────────────────────────────────────── */
.mc-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.mc-item {
    background: white;
    border: 1px solid var(--rule, #e6dfce);
    border-radius: 8px;
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}
.mc-item__main { flex: 1; min-width: 0; }
.mc-item__title {
    font-family: 'Fraunces', serif;
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 6px;
    color: var(--ink, #1a1410);
}
.mc-item__title a { color: inherit; text-decoration: none; }
.mc-item__title a:hover { color: var(--garnet, #8f0020); }
.mc-item__desc {
    font-size: 13.5px;
    color: var(--ink-soft, #4a423a);
    line-height: 1.5;
    margin: 0 0 8px;
    /* R25-04: el cuerpo de mensaje de ticket usa white-space:pre-wrap (parte sólo en espacios).
       Un token largo sin espacios (URL/ruta/API-key/base64 pegado en soporte) desbordaba la tarjeta
       y, sin overflow-x:hidden global, daba scroll horizontal a TODA la página en móvil. Mismo blindaje
       que .audit-target (mi_cuenta_audit.php). */
    overflow-wrap: anywhere;
    word-break: break-word;
}
.mc-item__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.mc-chip {
    font-size: 11.5px;
    background: var(--rule, #e6dfce);
    color: var(--ink-soft, #4a423a);
    padding: 3px 8px;
    border-radius: 999px;
    text-transform: lowercase;
}
.mc-chip--meta { background: transparent; color: var(--ink-muted, #8a8275); }
.mc-item__actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* ── Empty states ────────────────────────────────────────────────────────── */
.mc-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--ink-soft, #4a423a);
    background: var(--paper, #faf7f0);
    border: 1px dashed var(--rule, #e6dfce);
    border-radius: 8px;
}
.mc-empty p { margin: 0 0 6px; font-size: 14px; }
.mc-empty__hint { font-size: 12.5px; color: var(--ink-muted, #8a8275) !important; }

/* ── Item list (simple <ul> inside detail) ───────────────────────────────── */
.mc-itemlist {
    list-style: none;
    padding: 0;
    margin: 0;
}
.mc-itemlist li {
    padding: 10px 14px;
    border-bottom: 1px solid var(--rule, #e6dfce);
    font-size: 14px;
    overflow: hidden;
}
.mc-itemlist li:last-child { border-bottom: 0; }
.mc-itemlist a {
    color: var(--garnet, #8f0020);
    text-decoration: none;
    font-weight: 500;
}
.mc-itemlist a:hover { text-decoration: underline; }
.mc-itemlist__note {
    color: var(--ink-soft, #4a423a);
    font-size: 13px;
    margin-left: 12px;
    font-style: italic;
}

.mc-nav-back {
    margin-top: 24px;
    text-align: center;
    font-size: 14px;
}
.mc-nav-back a {
    color: var(--ink-soft, #4a423a);
    text-decoration: none;
    padding: 8px 14px;
    border: 1px solid var(--rule, #e6dfce);
    border-radius: 6px;
    display: inline-block;
}
.mc-nav-back a:hover { border-color: var(--ink, #1a1410); }

/* ── Hub layout (dashboard.php refactor) ─────────────────────────────────── */
.mc-hub {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}
@media (min-width: 1100px) {
    .mc-hub { grid-template-columns: 1fr 280px; }
}
.mc-hub__main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.mc-hub__sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
@media (min-width: 1100px) {
    .mc-hub__sidebar { position: sticky; top: 24px; align-self: flex-start; }
}

/* Top strip KPIs + CTA */
.mc-topstrip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}
.mc-kpi {
    background: white;
    border: 1px solid var(--rule, #e6dfce);
    border-radius: 8px;
    padding: 16px 18px;
}
.mc-kpi__label {
    font-size: 12px;
    color: var(--ink-muted, #8a8275);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 8px;
}
.mc-kpi__value {
    font-family: 'Fraunces', serif;
    font-size: 28px;
    font-weight: 600;
    color: var(--ink, #1a1410);
    line-height: 1.1;
}
.mc-kpi__sub {
    font-size: 12px;
    color: var(--ink-soft, #4a423a);
    margin-top: 6px;
}

/* Widget grid 2x2 */
.mc-widgets {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
@media (min-width: 768px) {
    .mc-widgets { grid-template-columns: 1fr 1fr; }
}
.mc-widget {
    background: white;
    border: 1px solid var(--rule, #e6dfce);
    border-radius: 8px;
    padding: 18px 20px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
}
.mc-widget__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--rule, #e6dfce);
}
.mc-widget__title {
    font-family: 'Fraunces', serif;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: var(--ink, #1a1410);
    line-height: 1.3;
}
.mc-widget__more {
    font-size: 12px;
    color: var(--garnet, #8f0020);
    text-decoration: none;
    white-space: nowrap;
}
.mc-widget__more:hover { text-decoration: underline; }
.mc-widget__body { flex: 1; font-size: 13.5px; color: var(--ink-soft, #4a423a); line-height: 1.5; }
.mc-widget__body ul { list-style: none; margin: 0; padding: 0; }
.mc-widget__body ul li { padding: 6px 0; border-bottom: 1px dotted var(--rule, #e6dfce); }
.mc-widget__body ul li:last-child { border-bottom: 0; }
.mc-widget__body ul li a {
    color: var(--ink, #1a1410);
    text-decoration: none;
    font-weight: 500;
}
.mc-widget__body ul li a:hover { color: var(--garnet, #8f0020); }
.mc-widget__empty {
    font-style: italic;
    color: var(--ink-muted, #8a8275);
    padding: 24px 0;
    text-align: center;
}

/* Coverage banner inside widget (🟡 partial coverage) */
.mc-coverage-banner {
    background: #fff8e0;
    border: 1px solid #ffe5a0;
    color: #7a5c2a;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    margin-bottom: 10px;
}
.mc-coverage-banner a { color: #7a5c2a; text-decoration: underline; }

/* Sidebar widgets (plan, api key, atajos) */
.mc-side-widget {
    background: white;
    border: 1px solid var(--rule, #e6dfce);
    border-radius: 8px;
    padding: 16px 18px;
}
.mc-side-widget h3 {
    font-family: 'Fraunces', serif;
    font-size: 14px;
    margin: 0 0 10px;
    color: var(--ink, #1a1410);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}
.mc-side-widget p { font-size: 13px; margin: 0 0 6px; color: var(--ink-soft, #4a423a); line-height: 1.4; }
.mc-side-widget code {
    background: var(--paper, #faf7f0);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11.5px;
    font-family: 'IBM Plex Mono', monospace;
    color: var(--ink, #1a1410);
}
.mc-side-widget__list { list-style: none; padding: 0; margin: 0; }
.mc-side-widget__list li { padding: 6px 0; }
.mc-side-widget__list a {
    color: var(--ink-soft, #4a423a);
    text-decoration: none;
    font-size: 13px;
}
.mc-side-widget__list a:hover { color: var(--garnet, #8f0020); }

/* Persona switcher */
.mc-persona-switcher {
    background: white;
    border: 1px solid var(--rule, #e6dfce);
    border-radius: 6px;
    padding: 6px 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--ink, #1a1410);
    cursor: pointer;
    text-decoration: none;
}
.mc-persona-switcher:hover { border-color: var(--garnet, #8f0020); }
.mc-persona-switcher__icon {
    font-family: 'Material Symbols Outlined';
    font-size: 18px;
    color: var(--garnet, #8f0020);
}

/* Hub header */
.mc-hub-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.mc-hub-header h1 {
    font-family: 'Fraunces', serif;
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
}

/* Segments strip scroll */
.mc-segments-strip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
    margin: 0 -24px;
    padding-left: 24px;
    padding-right: 24px;
}
.mc-segments-strip > * { scroll-snap-align: start; flex-shrink: 0; }
.mc-segment-card {
    min-width: 220px;
    max-width: 280px;
    background: white;
    border: 1px solid var(--rule, #e6dfce);
    border-radius: 8px;
    padding: 14px 16px;
    text-decoration: none;
    color: var(--ink, #1a1410);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.mc-segment-card:hover { border-color: var(--garnet, #8f0020); }
.mc-segment-card__name { font-weight: 600; font-size: 14px; }
.mc-segment-card__count {
    font-size: 12px;
    color: var(--ink-soft, #4a423a);
}
.mc-segment-card--add {
    background: var(--paper, #faf7f0);
    border-style: dashed;
    justify-content: center;
    text-align: center;
    color: var(--garnet, #8f0020);
    font-weight: 500;
    min-width: 180px;
}

/* Mobile tweaks */
@media (max-width: 640px) {
    .mc-container { padding: 20px 14px 60px; }
    .mc-block { padding: 16px; }
    .mc-form__row { grid-template-columns: 1fr; }
    .mc-item { flex-direction: column; align-items: stretch; }
    .mc-item__actions { justify-content: flex-end; }
    .mc-hub-header { flex-direction: column; align-items: flex-start; }
    .mc-persona-banner { flex-direction: column; align-items: flex-start; }
}

/* ════════════════════════════════════════════════════════════════════════
 * Wallet de créditos — hero del panel + barra slim para subpáginas (v40).
 * Paleta editorial: granate sobre papel; tipografía Fraunces en cifras.
 * ════════════════════════════════════════════════════════════════════════ */

/* ── Hero wallet (landing /mi-cuenta) ─────────────────────────────────────── */
.mc-wallet {
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0) 45%),
        linear-gradient(135deg, #8f0020 0%, #6a0018 58%, #3d0010 100%);
    color: #fdf6ee;
    border: 1px solid #6a0018;
    border-radius: 12px;
    padding: 26px 28px;
    margin-bottom: 20px;
    box-shadow: 0 1px 2px rgba(61,0,16,0.12);
}
.mc-wallet__label {
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(253,246,238,0.72);
    margin: 0 0 2px;
}
.mc-wallet__balance {
    font-family: 'Fraunces', serif;
    font-size: clamp(40px, 7vw, 58px);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.02em;
    margin: 2px 0;
}
.mc-wallet__unit { font-size: 1rem; font-weight: 500; opacity: 0.82; font-family: 'IBM Plex Sans', system-ui, sans-serif; }
.mc-wallet__beta {
    display: inline-block;
    background: rgba(253,246,238,0.16);
    border: 1px solid rgba(253,246,238,0.22);
    border-radius: 999px;
    padding: 3px 12px;
    font-size: 12px;
    margin: 4px 0 2px;
}
.mc-wallet__split {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    margin: 16px 0 18px;
    font-size: 13px;
    color: rgba(253,246,238,0.86);
}
.mc-wallet__split > span { display: flex; flex-direction: column; gap: 2px; }
.mc-wallet__split b {
    font-family: 'Fraunces', serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: #fdf6ee;
    line-height: 1.1;
}
.mc-wallet__fineprint { font-size: 11.5px; color: rgba(253,246,238,0.68); margin: 10px 0 0; }

/* Packs de compra (botones crema sobre granate) */
.mc-packs { display: flex; gap: 10px; flex-wrap: wrap; }
.mc-pack-btn {
    background: #fdf6ee;
    color: #6a0018;
    border: 0;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.06s ease, box-shadow 0.12s ease;
}
.mc-pack-btn:hover { box-shadow: 0 2px 10px rgba(61,0,16,0.28); transform: translateY(-1px); }
.mc-pack-btn:disabled { opacity: 0.6; cursor: default; transform: none; box-shadow: none; }
.mc-pack-btn--ghost {
    background: rgba(253,246,238,0.14);
    color: #fdf6ee;
    border: 1px solid rgba(253,246,238,0.30);
}

/* ── Menú "¿En qué gastar créditos?" (dentro de .mc-block) ─────────────────── */
.mc-pricing { display: flex; flex-direction: column; }
.mc-pricing__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--rule, #e6dfce);
}
.mc-pricing__row:last-child { border-bottom: 0; }
.mc-pricing__name { font-weight: 600; font-size: 14.5px; color: var(--ink, #1a1410); }
.mc-pricing__desc { font-size: 12.5px; color: var(--ink-muted, #8a8275); margin-top: 3px; line-height: 1.45; }
.mc-pricing__cost {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 15px;
    color: var(--ink-soft, #4a423a);
    white-space: nowrap;
}
.mc-badge {
    display: inline-block;
    font-size: 11px;
    background: #f0fff5;
    color: #1a5a2a;
    border: 1px solid #c5e8d0;
    border-radius: 999px;
    padding: 1px 8px;
    margin-left: 8px;
    vertical-align: middle;
}

/* ── Ledger / actividad reciente (filas) ──────────────────────────────────── */
.mc-ledger { display: flex; flex-direction: column; }
.mc-ledger__row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--rule, #e6dfce);
    font-size: 14px;
}
.mc-ledger__row:last-child { border-bottom: 0; }
.mc-ledger__when { color: var(--ink-muted, #8a8275); font-size: 12px; }
.mc-ledger__amt { font-family: 'Fraunces', serif; font-weight: 600; white-space: nowrap; }
.mc-amt--pos { color: #1a5a2a; }
.mc-amt--neg { color: var(--garnet, #8f0020); }
.mc-amt--mut { color: var(--ink-muted, #8a8275); }

/* ── Accesos rápidos (chips de navegación) ────────────────────────────────── */
.mc-quick { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

/* ── Barra slim de saldo (subpáginas: presencia de wallet sin duplicar) ───── */
.mc-walletbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    background: var(--white, #fefcf7);
    border: 1px solid var(--rule, #e6dfce);
    border-left: 4px solid var(--garnet, #8f0020);
    border-radius: 8px;
    padding: 11px 16px;
    margin-bottom: 22px;
    font-size: 14px;
}
.mc-walletbar__bal { color: var(--ink, #1a1410); }
.mc-walletbar__bal b {
    font-family: 'Fraunces', serif;
    font-size: 1.1rem;
    color: var(--garnet, #8f0020);
    margin: 0 2px;
}
.mc-walletbar__cost { color: var(--ink-muted, #8a8275); font-size: 13px; }
.mc-walletbar__link {
    color: var(--garnet, #8f0020);
    font-weight: 600;
    text-decoration: none;
    font-size: 13.5px;
    white-space: nowrap;
}
.mc-walletbar__link:hover { text-decoration: underline; }

@media (max-width: 640px) {
    .mc-wallet { padding: 20px 18px; }
    .mc-wallet__split { gap: 18px; }
    .mc-walletbar { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* ── Intervención de conversión (upsell free→Profesional) ─────────────────────
   Tarjeta que aparece cuando un usuario FREE choca/se acerca a un límite.
   Piloto: página de Descargas. Componente: _partials/mi_cuenta/upgrade_prompt.php */
.mc-upsell {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    background: linear-gradient(180deg, #fffdf9 0%, #fbf3f5 100%);
    border: 1px solid var(--rule, #e6dfce);
    border-left: 4px solid var(--garnet, #8f0020);
    border-radius: 10px;
    padding: 20px 22px;
    margin-bottom: 24px;
}
.mc-upsell__icon {
    font-size: 30px;
    color: var(--garnet, #8f0020);
    flex-shrink: 0;
    line-height: 1;
    margin-top: 2px;
}
.mc-upsell__body { flex: 1 1 auto; min-width: 0; }
.mc-upsell__headline {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 17px;
    color: var(--ink, #1a1410);
    margin: 0 0 5px;
    line-height: 1.25;
}
.mc-upsell__text {
    font-size: 13.5px;
    color: var(--ink-muted, #6b6358);
    margin: 0 0 12px;
    line-height: 1.5;
    max-width: 62ch;
}
.mc-upsell__compare {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.mc-upsell__tier {
    display: inline-flex;
    flex-direction: column;
    gap: 1px;
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 8px;
    line-height: 1.15;
}
.mc-upsell__tier span {
    font-family: 'IBM Plex Sans', system-ui, sans-serif;
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.7;
}
.mc-upsell__tier--free { background: rgba(107,99,88,0.10); color: var(--ink-muted, #6b6358); }
.mc-upsell__tier--pro  { background: rgba(143,0,32,0.10); color: var(--garnet, #8f0020); }
.mc-upsell__arrow { font-size: 18px; color: var(--ink-muted, #8a8275); }
.mc-upsell__cta {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    flex-shrink: 0;
    align-self: center;
}
.mc-upsell__btn {
    display: inline-block;
    background: var(--garnet, #8f0020);
    color: #fdf6ee;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    text-align: center;
    padding: 11px 20px;
    border-radius: 8px;
    white-space: nowrap;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.mc-upsell__btn:hover {
    box-shadow: 0 2px 12px rgba(143,0,32,0.30);
    transform: translateY(-1px);
    color: #fdf6ee;
}
.mc-upsell__link {
    font-size: 12.5px;
    color: var(--ink-muted, #6b6358);
    text-decoration: none;
    text-align: center;
}
.mc-upsell__link:hover { color: var(--garnet, #8f0020); text-decoration: underline; }

/* Variante urgente (ha agotado / casi agota la cuota): garnet lleno, más presencia */
.mc-upsell--urgent {
    background: linear-gradient(135deg, #8f0020 0%, #6d0b1c 100%);
    border-color: #6d0b1c;
    border-left-color: #fdf6ee;
}
.mc-upsell--urgent .mc-upsell__icon { color: #fdf6ee; }
.mc-upsell--urgent .mc-upsell__headline { color: #fff; }
.mc-upsell--urgent .mc-upsell__text { color: rgba(253,246,238,0.86); }
.mc-upsell--urgent .mc-upsell__tier--free {
    background: rgba(253,246,238,0.12); color: rgba(253,246,238,0.80);
}
.mc-upsell--urgent .mc-upsell__tier--pro {
    background: rgba(253,246,238,0.22); color: #fff;
}
.mc-upsell--urgent .mc-upsell__arrow { color: rgba(253,246,238,0.65); }
.mc-upsell--urgent .mc-upsell__btn {
    background: #fdf6ee; color: var(--garnet, #8f0020);
}
.mc-upsell--urgent .mc-upsell__btn:hover {
    box-shadow: 0 2px 14px rgba(0,0,0,0.28); color: var(--garnet, #8f0020);
}
.mc-upsell--urgent .mc-upsell__link { color: rgba(253,246,238,0.78); }
.mc-upsell--urgent .mc-upsell__link:hover { color: #fff; }

@media (max-width: 720px) {
    .mc-upsell { flex-direction: column; gap: 14px; padding: 18px; }
    .mc-upsell__cta { align-self: stretch; }
    .mc-upsell__btn { padding: 12px 20px; }
}

/* ── B2c: modal de confirmación propio (acciones destructivas — sin confirm() nativo) ── */
.mc-confirm { position: fixed; inset: 0; z-index: 1500; display: flex; align-items: center; justify-content: center; }
.mc-confirm[hidden] { display: none; }
.mc-confirm__backdrop { position: absolute; inset: 0; background: rgba(20, 15, 10, .55); }
.mc-confirm__panel {
    position: relative; background: var(--white, #fefcf7);
    border: 1px solid var(--rule, #e6dfce); border-radius: 10px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
    width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
    overflow-y: auto; padding: 22px;
}
.mc-confirm__panel h3 { font-family: 'Fraunces', serif; font-size: 18px; font-weight: 600; margin: 0 0 10px; color: var(--ink, #1a1410); }
.mc-confirm__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.mc-confirm__danger {
    background: #b03a2e; color: #fff; border: 0; border-radius: 6px;
    padding: 10px 16px; font-family: 'IBM Plex Sans', sans-serif; font-size: 14px;
    font-weight: 600; cursor: pointer; min-height: 44px;
    transition: background .15s, opacity .15s;
}
.mc-confirm__danger:hover:not(:disabled) { background: #8f2d23; }
.mc-confirm__danger:focus-visible { outline: 2px solid var(--ink, #1a1410); outline-offset: 2px; }
.mc-confirm__danger:disabled { opacity: .45; cursor: not-allowed; }

/* ── B4: Salir = mini-form POST (el botón hereda el idioma del link/card) ── */
.panel-user__logoutform { margin: 0; }
.panel-user__logoutform button.panel-user__logout {
    width: 100%; background: none; border: 0; cursor: pointer;
    text-align: left; font: inherit;
}
.panel-msheet__logoutform { margin: 0; display: contents; }
button.panel-msheet__logout {
    background: none; border: 0; cursor: pointer; font: inherit; width: 100%;
}
