/* Escala responsive compartida del Panel.
   Solo interviene en tablet/móvil; escritorio conserva su densidad actual. */
@media (max-width: 1024px) {
    .panel-shell,
    .panel-auth {
        --panel-responsive-body: 15px;
        --panel-responsive-label: 14px;
        --panel-responsive-meta: 13px;
        --panel-responsive-control: 15px;
    }

    .panel-shell p,
    .panel-shell li,
    .panel-shell dt,
    .panel-shell dd,
    .panel-auth p {
        line-height: 1.5;
    }

    .panel-shell label,
    .panel-auth label {
        font-size: var(--panel-responsive-label) !important;
        line-height: 1.4;
    }

    .panel-shell small,
    .panel-shell [class*="-help"],
    .panel-shell [class*="-hint"],
    .panel-shell [class*="-meta"],
    .panel-auth small {
        font-size: var(--panel-responsive-meta) !important;
        line-height: 1.45;
    }

    .panel-shell input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]),
    .panel-shell select,
    .panel-shell textarea,
    .panel-auth input:not([type="checkbox"]):not([type="radio"]) {
        min-height: 45px;
        font-size: var(--panel-responsive-control) !important;
        line-height: 1.35;
    }

    .panel-shell textarea { min-height: 92px; }

    .panel-shell .vx-button,
    .panel-shell [class$="-primary-action"],
    .panel-shell [class$="-detail-button"],
    .panel-shell [class$="-filter-trigger"] {
        min-height: 43px;
        font-size: .875rem;
        line-height: 1.25;
    }

    .profile-tabs a,
    .profile-tabs button,
    .campaign-tabs a,
    .campaign-tabs button,
    .network-tabs a,
    .network-tabs button,
    .branch-network-tabs a,
    .branch-network-tabs button,
    .membership-panel-tabs a,
    .membership-panel-tabs button {
        min-height: 43px;
        font-size: .875rem !important;
        line-height: 1.25;
    }

    .panel-shell article,
    .panel-shell section,
    .panel-shell form,
    .panel-shell div {
        min-width: 0;
    }

    .panel-shell p,
    .panel-shell span,
    .panel-shell small,
    .panel-shell strong,
    .panel-shell label {
        overflow-wrap: break-word;
    }

    /* Módulos con metadatos originalmente inferiores a 12 px. */
    .activity-overview small,
    .activity-customer small,
    .activity-kind,
    .activity-operation > small,
    .activity-context > span,
    .activity-context small,
    .activity-movements-summary b,
    .activity-movements-summary strong,
    .activity-detail-grid small,
    .activity-detail-grid span,
    .activity-detail-movements small,
    .activity-balance-detail small,
    .activity-detail-notes small,
    .activity-benefit-detail small,
    .activity-export-panel small,
    .campaign-card small,
    .network-card small,
    .branch-rule-card small,
    .operation-option-copy small,
    .operation-option-copy em,
    .operation-confirm-body dt small,
    .operation-benefit-intro span,
    .operation-benefit-review-card small {
        font-size: 13px !important;
        line-height: 1.4;
    }

    .activity-search input,
    .activity-search button,
    .activity-filter-trigger,
    .activity-detail-button,
    .activity-state a,
    .activity-filter-options span,
    .activity-filter-panel footer a,
    .activity-filter-panel footer button {
        font-size: .84375rem !important;
    }

    .customer-actions-v2 button,
    .drawer-quick-actions a,
    .drawer-quick-actions button,
    .branch-schedule-copy-actions button,
    .network-action-slot a,
    .network-action-slot button {
        min-height: 42px;
        font-size: .84375rem;
    }
}

@media (max-width: 768px) {
    .panel-shell,
    .panel-auth {
        --panel-responsive-body: 15px;
        --panel-responsive-label: 14px;
        --panel-responsive-meta: 13px;
        --panel-responsive-control: 16px;
    }

    /* A 768 px el Login todavía puede conservar el split sin forzar ancho. */
    .panel-auth {
        grid-template-columns: minmax(285px, .75fr) minmax(0, 1.25fr) !important;
    }

    .panel-shell p:not(.section-eyebrow):not([class*="kicker"]),
    .panel-shell li,
    .panel-shell dt,
    .panel-shell dd,
    .panel-auth p:not(.panel-eyebrow):not(.login-brand-kicker) {
        font-size: var(--panel-responsive-body);
        line-height: 1.55;
    }

    .panel-shell label,
    .panel-auth label {
        font-size: var(--panel-responsive-label) !important;
    }

    .panel-shell input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]),
    .panel-shell select,
    .panel-auth input:not([type="checkbox"]):not([type="radio"]) {
        min-height: 48px;
        font-size: 1rem !important;
    }

    .panel-shell textarea {
        min-height: 104px;
        font-size: 1rem !important;
        line-height: 1.5;
    }

    .panel-shell .vx-button,
    .panel-shell [class$="-primary-action"],
    .panel-shell [class$="-detail-button"],
    .panel-shell [class$="-filter-trigger"] {
        min-height: 45px;
        font-size: .9375rem;
    }

    .profile-tabs,
    .campaign-tabs,
    .network-tabs,
    .branch-network-tabs,
    .membership-panel-tabs {
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .profile-tabs a,
    .profile-tabs button,
    .campaign-tabs a,
    .campaign-tabs button,
    .network-tabs a,
    .network-tabs button,
    .branch-network-tabs a,
    .branch-network-tabs button,
    .membership-panel-tabs a,
    .membership-panel-tabs button {
        flex: 0 0 auto;
        min-height: 45px;
        font-size: .9rem !important;
        white-space: nowrap;
    }

    /* Header y menú: más legibles sin aumentar la altura exterior. */
    .panel-menu-toggle {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }

    .panel-nav-primary a,
    .panel-nav-secondary a,
    .panel-drawer-branches > summary {
        min-height: 44px;
        font-size: .9rem !important;
    }

    .panel-nav-secondary > span,
    .panel-drawer-commerce small {
        font-size: .75rem !important;
    }

    .panel-drawer-commerce em,
    .panel-drawer-user small {
        font-size: 13px !important;
    }

    /* PanelHome permanece como referencia, corrigiendo solo microtexto. */
    .performance-metrics-v3 small,
    .home-actions .panel-actions > a span,
    .home-secondary span,
    .activity-list-v3 article small,
    .activity-list-v3 article > aside span,
    .activity-empty-v3 > span {
        font-size: 13px !important;
        line-height: 1.4;
    }

    /* Operación */
    .operation-step-copy small,
    .operation-option-copy small,
    .operation-option-copy em,
    .operation-no-benefits p,
    .operation-opportunity p,
    .operation-opportunity small,
    .operation-summary dl > div,
    .operation-generated,
    .operation-confirm-box p,
    .operation-result-totals span,
    .operation-confirm-header p,
    .operation-confirm-body dt small,
    .operation-benefit-review-card p,
    .operation-benefit-review-card em {
        font-size: 13px !important;
        line-height: 1.45;
    }

    .operation-option-copy b,
    .operation-summary dt,
    .operation-summary dd,
    .operation-total span,
    .operation-confirm-body dt,
    .operation-confirm-body dd {
        font-size: .9rem;
    }

    .operation-option { min-height: 58px; }
    .operation-switch { flex: 0 0 40px; width: 40px; height: 24px; }
    .is-selected .operation-switch::after { left: 20px; }

    /* Clientes y Actividad */
    .client-info em,
    .client-info span,
    .client-balance small,
    .client-balance span,
    .client-record small,
    .activity-overview small,
    .activity-customer small,
    .activity-kind,
    .activity-operation > small,
    .activity-context > strong,
    .activity-context > span,
    .activity-context small,
    .activity-day span,
    .activity-state p {
        font-size: 13px !important;
        line-height: 1.4;
    }

    .activity-customer strong,
    .activity-operation > strong,
    .client-info strong {
        white-space: normal;
    }

    .activity-ticket,
    .customer-directory .customer-row {
        overflow: hidden;
    }

    .activity-detail-button,
    .customer-actions-v2 button,
    .activity-filter-trigger {
        min-height: 44px;
        font-size: .875rem !important;
    }

    /* Perfil, campañas, reglas, redes y membresía. */
    .profile-page small,
    .profile-page [class*="help"],
    .campaign-page small,
    .settings-page small,
    .network-page small,
    .branch-network-page small,
    .membership-page small {
        font-size: 13px !important;
        line-height: 1.45;
    }

    .profile-switch,
    .settings-switch,
    .operation-switch {
        touch-action: manipulation;
    }

    .branch-schedule-copy-actions,
    .operation-confirm-actions,
    .operation-benefit-actions,
    .activity-detail-actions {
        gap: 10px;
    }

    .branch-schedule-copy-actions button,
    .operation-confirm-actions button,
    .operation-benefit-actions button,
    .activity-detail-actions button,
    .activity-detail-actions a {
        min-height: 44px;
        font-size: .875rem !important;
    }

    /* Login */
    .panel-auth .panel-subtitle,
    .panel-auth .panel-remember {
        font-size: .9375rem !important;
    }

    .panel-auth .panel-remember-help,
    .panel-auth .login-security-note {
        font-size: 13px !important;
        line-height: 1.45;
    }

    .panel-auth .login-password-toggle {
        width: 44px;
        height: 44px;
        min-height: 44px !important;
        font-size: 1rem;
    }

    .panel-auth .login-submit {
        min-height: 50px;
        font-size: 1rem;
    }
}

@media (max-width: 390px) {
    .panel-shell,
    .panel-auth {
        --panel-responsive-body: 14.8px;
    }

    .panel-shell p:not(.section-eyebrow):not([class*="kicker"]),
    .panel-auth p:not(.panel-eyebrow):not(.login-brand-kicker) {
        font-size: var(--panel-responsive-body);
    }

    .branch-schedule-copy-actions,
    .operation-confirm-actions,
    .operation-benefit-actions {
        grid-template-columns: 1fr;
    }
}

/* Confirmación compacta para el logo superpuesto. Evita que las reglas
   táctiles generales conviertan esta acción secundaria en un bloque grande. */
.profile-media-tile.logo.is-pending .profile-media-meta {
    min-height: 0 !important;
    height: 44px;
    flex-wrap: nowrap;
    gap: 6px;
    padding: 5px 6px;
}

.profile-media-tile.logo.is-pending .profile-media-meta > span {
    min-width: 132px;
    line-height: 1.15;
}

.profile-media-tile.logo.is-pending .profile-media-meta b {
    font-size: 12px;
}

.profile-media-tile.logo.is-pending .profile-media-meta small {
    font-size: 10px !important;
    white-space: nowrap;
}

.profile-media-tile.logo.is-pending .profile-media-meta button {
    width: auto !important;
    min-width: 0 !important;
    min-height: 34px !important;
    height: 34px !important;
    padding: 6px 9px !important;
    border-radius: 8px;
    font-size: 12px !important;
    line-height: 1;
    white-space: nowrap;
}

@media (max-width: 560px) {
    .profile-media-tile.logo.is-pending .profile-media-meta {
        height: auto;
        min-height: 44px !important;
        max-width: calc(100vw - 154px);
    }

    .profile-media-tile.logo.is-pending .profile-media-meta > span {
        display: none;
    }
}
