:root {
    color-scheme: dark;
    --bg: #020306;
    --panel: #090d13;
    --panel-2: #0e141e;
    --line: #1c2634;
    --text: #eff5fc;
    --muted: #98a7bb;
    --accent: #4f8cff;
    --accent-secondary: #7c5cff;
    --danger: #ff7f87;
    --success: #4ade80;
    --warning: #fbbf24;
    --info: #60a5fa;
    --neutral: #94a3b8;
}

/* Clientes: búsqueda guiada, estados legibles y estadísticas operativas. */
.client-identity-cell,
.client-identity-cell:visited,
.client-identity-cell:hover,
.client-identity-cell:active {
    color: #f8fafc;
    text-decoration: none;
}

.client-identity-cell .client-identity-name {
    color: #fff;
    font-size: .88rem;
    font-weight: 900;
    letter-spacing: .012em;
    line-height: 1.35;
    text-decoration: none;
}

.client-identity-cell small {
    color: #a8b5c7;
    font-size: .69rem;
    font-weight: 700;
    letter-spacing: .025em;
    line-height: 1.35;
    text-decoration: none;
    text-transform: none;
}

.client-identity-cell:hover .client-identity-name,
.client-identity-cell:focus-visible .client-identity-name {
    color: #bfdbfe;
}

.client-state--joined { --state-tone: #38bdf8; }
.client-state--left { --state-tone: #fb7185; }

.client-operations-toolbar > .client-payment-filters {
    grid-column: 1 / -1;
}

fieldset.client-payment-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 15px;
    padding: 0;
    border: 0;
}

.client-payment-filters legend {
    width: 100%;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: .76rem;
    font-weight: 850;
}

.client-payment-filters legend small {
    margin-left: 5px;
    color: #718096;
    font: inherit;
    font-weight: 650;
}

fieldset.client-payment-filters > label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 7px 10px;
    border: 1px solid #26364d;
    border-radius: 999px;
    background: rgba(10, 17, 27, .78);
    color: #dbeafe;
    cursor: pointer;
    font-size: .78rem;
    font-weight: 800;
}

fieldset.client-payment-filters input[type="checkbox"] {
    width: auto;
    min-height: auto;
    margin: 0;
    accent-color: var(--accent);
}

fieldset.client-payment-filters > label:has(input:checked) {
    border-color: var(--accent);
    background: rgba(37, 99, 235, .2);
    color: #fff;
}

.client-statistics {
    display: grid;
    gap: 16px;
}

.client-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 11px;
}

.client-stat-grid--payments {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 15px;
}

.client-stat-card {
    display: grid;
    align-content: start;
    gap: 6px;
    min-width: 0;
    min-height: 116px;
    padding: 14px;
    border: 1px solid color-mix(in srgb, var(--stat-tone, var(--neutral)) 36%, #1d293a);
    border-radius: 13px;
    background: linear-gradient(145deg,
        color-mix(in srgb, var(--stat-tone, var(--neutral)) 10%, rgba(7, 13, 24, .92)),
        rgba(5, 10, 18, .92));
    color: #f8fafc;
    text-decoration: none;
}

a.client-stat-card:hover,
a.client-stat-card:focus-visible {
    border-color: color-mix(in srgb, var(--stat-tone, var(--accent)) 72%, #fff);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

.client-stat-card > span {
    color: #cad5e4;
    font-size: .78rem;
    font-weight: 800;
}

.client-stat-card > strong {
    color: #fff;
    font-size: clamp(1.7rem, 3vw, 2.35rem);
    line-height: 1;
}

.client-stat-card > small {
    margin-top: auto;
    color: var(--muted);
    font-size: .72rem;
    line-height: 1.4;
}

.client-stat-card--success { --stat-tone: var(--success); }
.client-stat-card--warning { --stat-tone: var(--warning); }
.client-stat-card--danger { --stat-tone: var(--danger); }
.client-stat-card--neutral { --stat-tone: var(--neutral); }

.client-statistics-section { margin: 0; }

.client-chart {
    display: grid;
    gap: 11px;
    margin-top: 18px;
}

.client-chart-row { display: grid; gap: 6px; }

.client-chart-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    color: #cbd5e1;
    font-size: .78rem;
}

.client-chart-label strong { color: #fff; }

.client-chart-track {
    height: 11px;
    overflow: hidden;
    border: 1px solid #233044;
    border-radius: 999px;
    background: #090f18;
}

.client-chart-fill {
    display: block;
    width: var(--client-chart-width, 0%);
    height: 100%;
    border-radius: inherit;
    background: var(--chart-tone, var(--neutral));
}

.client-chart-fill--success { --chart-tone: var(--success); }
.client-chart-fill--warning { --chart-tone: var(--warning); }
.client-chart-fill--danger { --chart-tone: var(--danger); }
.client-chart-fill--neutral { --chart-tone: var(--neutral); }

@media (max-width: 1100px) {
    .client-stat-grid--payments { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
    .client-stat-grid,
    .client-stat-grid--payments { grid-template-columns: minmax(0, 1fr); }
    fieldset.client-payment-filters > label { flex: 1 1 calc(50% - 8px); }
}

/* Gestión de clientes: lectura exacta y propuestas locales fail-closed. */
.client-management-heading,
.client-list-heading,
.client-profile-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.client-management-heading h2,
.client-list-heading h2,
.client-profile-header h2,
.client-individual-management h3 { margin: 0; }

.client-safety-pill {
    display: grid;
    flex: 0 0 auto;
    gap: 2px;
    padding: 10px 13px;
    border: 1px solid rgba(74, 222, 128, .35);
    border-radius: 12px;
    background: rgba(22, 101, 52, .16);
    color: #dcfce7;
}

.client-safety-pill span,
.client-profile-states small { color: var(--muted); font-size: .78rem; }

.client-search-form { margin-top: 18px; }
.client-search-fields {
    display: grid;
    grid-template-columns: 1.25fr 1fr 1fr;
    gap: 12px;
    margin-top: 7px;
}
.client-search-fields label { display: grid; align-content: start; min-width: 0; gap: 6px; }
.client-search-form input { width: 100%; min-width: 0; }
.client-search-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.client-directory-status {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}
.client-directory-status > div {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: rgba(7, 13, 24, .5);
}
.client-directory-status span { color: var(--muted); }
.client-directory-import {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 14px;
    padding: 14px;
    border: 1px solid rgba(96, 165, 250, .32);
    border-radius: 12px;
    background: rgba(30, 64, 175, .09);
}
.client-directory-import h3,
.client-directory-import p { margin-bottom: 4px; }
.client-directory-import form { display: grid; flex: 0 0 auto; gap: 6px; }
.client-directory-import small { max-width: 34ch; color: var(--muted); }

.client-result-list,
.client-event-list,
.client-right-list { display: grid; gap: 10px; margin-top: 16px; }

.client-directory-panel > summary {
    cursor: pointer;
    list-style: none;
}
.client-directory-panel > summary::-webkit-details-marker { display: none; }
.client-directory-panel > summary::after {
    align-self: center;
    content: "⌄";
    color: var(--accent);
    font-size: 1.25rem;
    transition: transform .18s ease;
}
.client-directory-panel[open] > summary::after { transform: rotate(180deg); }
.client-directory-panel > summary:hover .client-list-title,
.client-directory-panel > summary:focus-visible .client-list-title { color: #bfdbfe; }
.client-directory-panel > summary:focus-visible {
    border-radius: 8px;
    outline: 2px solid var(--accent);
    outline-offset: 5px;
}
.client-list-title { display: block; font-size: 1.35rem; }
.client-list-description {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-size: .94rem;
    font-weight: 400;
}
.client-directory-live-filter {
    display: grid;
    gap: 6px;
    margin-top: 18px;
    padding: 14px;
    border: 1px solid rgba(79, 140, 255, .32);
    border-radius: 12px;
    background: rgba(37, 99, 235, .07);
}
.client-directory-live-filter label { display: grid; gap: 7px; }
.client-directory-live-filter label > span { font-weight: 800; }
.client-directory-live-filter small,
.client-live-filter-status,
.client-card-load-status { color: var(--muted); }
.client-live-filter-status,
.client-card-load-status { min-height: 1.2em; margin: 0; font-size: .82rem; }
.client-card-load-status:not(:empty) { color: #bfdbfe; }
.client-result-item { min-width: 0; }
.client-result-item[hidden] { display: none !important; }
.client-result-item--open {
    overflow: hidden;
    border: 1px solid rgba(79, 140, 255, .72);
    border-radius: 14px;
    background: rgba(37, 99, 235, .055);
    box-shadow: 0 0 0 1px rgba(79, 140, 255, .12);
}
.client-result-item--open > .client-result-card {
    border: 0;
    border-bottom: 1px solid rgba(79, 140, 255, .35);
    border-radius: 0;
    background: rgba(37, 99, 235, .12);
}
.client-result-item--open > .client-result-card::after {
    content: "Contraer ficha";
    color: var(--accent);
    font-size: .78rem;
    font-weight: 750;
}
.client-inline-detail {
    display: grid;
    gap: 16px;
    padding: 16px;
}
.client-inline-detail[hidden],
.client-result-item:not(.client-result-item--open) > .client-inline-detail {
    display: none !important;
}
.client-inline-detail:focus { outline: none; }
.client-inline-detail > .panel { margin: 0; }
.client-whop-payments > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    cursor: pointer;
}
.client-whop-payments > summary strong,
.client-whop-payments > summary span { display: block; }
.client-observed-payments { display: grid; gap: 12px; margin-top: 14px; }
.client-observed-payment {
    padding: 14px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--info);
    border-radius: 12px;
    background: rgba(7, 13, 24, .58);
}
.client-observed-payment--refunded { border-left-color: var(--danger); }
.client-observed-payment--dispute { border-right: 3px solid var(--warning); }
.client-observed-payment > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.client-observed-payment > header div { display: grid; gap: 4px; }
.client-observed-payment > header small { color: var(--muted); }
.whop-payment-local-filter {
    display: grid;
    gap: 6px;
    margin: 16px 0;
    padding: 14px;
    border: 1px solid rgba(79, 140, 255, .32);
    border-radius: 12px;
    background: rgba(37, 99, 235, .07);
}
.whop-payment-local-filter label { display: grid; gap: 7px; }
.whop-payment-local-filter label span { font-weight: 800; }
.whop-payment-local-filter small,
.whop-payment-local-filter p { color: var(--muted); }
.whop-payment-local-filter p { min-height: 1.2em; margin: 0; font-size: .82rem; }
.whop-payment-state-filter {
    appearance: none;
    width: 100%;
    min-width: 0;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.whop-payment-state-filter:hover,
.whop-payment-state-filter:focus-visible {
    border-color: var(--accent);
    background: rgba(37, 99, 235, .12);
    outline: none;
}
.whop-payment-state-filter[aria-pressed="true"] {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .22);
    background: rgba(37, 99, 235, .16);
}
.whop-payment-filter-state {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.whop-payment-filter-state p { flex: 1 1 240px; }
[data-whop-payment-row][hidden] { display: none !important; }
.whop-payment-row--refunded td { background: rgba(127, 29, 29, .16); }
.whop-payment-row--dispute td { box-shadow: inset 0 2px 0 rgba(251, 191, 36, .45); }

.client-result-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(7, 13, 24, .58);
    color: inherit;
    text-decoration: none;
}

.client-result-card:hover,
.client-result-card:focus-visible {
    border-color: var(--accent);
    background: rgba(37, 99, 235, .09);
    outline: none;
}
.client-result-card[aria-busy="true"] {
    cursor: progress;
    opacity: .72;
}
.client-result-card--unavailable {
    cursor: default;
    border-style: dashed;
    color: var(--muted);
}
.client-profile-header:focus { outline: none; }
.client-open-feedback {
    margin: 0 0 8px;
    color: var(--success);
    font-size: .86rem;
    font-weight: 750;
}

.client-result-card > span { display: grid; min-width: 0; gap: 3px; }
.client-result-card > span:last-child { flex: 0 0 auto; text-align: right; }
.client-result-card small { overflow-wrap: anywhere; color: var(--muted); }
.client-profile-states { display: grid; justify-items: end; gap: 7px; }

.client-membership-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.client-membership-card {
    min-width: 0;
    overflow: hidden;
    padding: 16px;
    border: 1px solid var(--product-accent, #64748b);
    border-left: 4px solid var(--product-accent, #64748b);
    border-radius: 14px;
    background: linear-gradient(145deg, var(--product-background, rgba(30, 41, 59, .14)), rgba(7, 13, 24, .76));
}

.client-membership-card > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.client-membership-card h3 { margin: 10px 0 0; overflow-wrap: anywhere; }
.client-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin: 15px 0;
}
.client-facts div { min-width: 0; padding: 9px; border-radius: 9px; background: rgba(2, 6, 23, .45); }
.client-facts dt { margin-bottom: 4px; color: var(--muted); font-size: .76rem; }
.client-facts dd { margin: 0; overflow-wrap: anywhere; }
.client-facts code { white-space: normal; overflow-wrap: anywhere; }
.client-right-summary { display: grid; gap: 7px; margin-top: 12px; }
.client-right-summary p { margin: 0; overflow-wrap: anywhere; }
.client-payment-state { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.client-payment-state > strong { width: 100%; }

.client-two-column,
.client-capability-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.client-two-column .panel { margin: 0; min-width: 0; }
.client-right-list > div,
.client-event-list > div {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(7, 13, 24, .5);
}
.client-right-list > div { display: grid; gap: 4px; }
.client-right-list span,
.client-event-list small { color: var(--muted); }
.client-event-list p { margin: 6px 0; overflow-wrap: anywhere; }

.client-capability-grid { margin: 18px 0; }
.client-capability-grid > div { padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.client-capability-grid ul { margin-bottom: 0; padding-left: 19px; }

.client-action-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.client-action-form label { min-width: 0; }
.client-action-form textarea { min-height: 112px; resize: vertical; }
.client-action-form label:nth-of-type(5),
.client-action-form .client-impact-preview,
.client-action-form .check,
.client-action-form button { grid-column: 1 / -1; }
.client-impact-preview { padding: 13px; border: 1px solid rgba(96, 165, 250, .35); border-radius: 11px; background: rgba(30, 64, 175, .12); }
.client-impact-preview p { margin-bottom: 0; }

.technical-reference { margin-top: 8px; }
.technical-reference summary { width: max-content; max-width: 100%; color: var(--muted); cursor: pointer; }
.technical-reference dl { display: grid; gap: 4px; margin: 8px 0; }
.technical-reference dt { color: var(--muted); font-size: .75rem; }
.technical-reference dd { margin: 0; }
.technical-reference code { white-space: normal; overflow-wrap: anywhere; user-select: all; }
.policy-simulation-explainer { margin-top: 14px; padding: 12px 14px; border-left: 3px solid #60a5fa; border-radius: 8px; background: rgba(37, 99, 235, .1); }

@media (max-width: 850px) {
    .client-membership-grid,
    .client-two-column,
    .client-capability-grid,
    .client-search-fields { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
    .client-management-heading,
    .client-list-heading,
    .client-profile-header,
    .client-membership-card > header,
    .client-result-card { align-items: stretch; flex-direction: column; }
    .client-directory-import { align-items: stretch; flex-direction: column; }
    .client-directory-import button { width: 100%; }
    .client-profile-states { justify-items: start; }
    .client-result-card > span:last-child { text-align: left; }
    .client-directory-panel > summary::after { align-self: flex-start; }
    .client-inline-detail { padding: 10px; }
    .client-whop-payments > summary,
    .client-observed-payment > header { align-items: stretch; flex-direction: column; }
    .client-search-actions > * { width: 100%; }
    .client-directory-status { grid-template-columns: 1fr; }
    .client-facts,
    .client-action-form { grid-template-columns: 1fr; }
    .client-action-form > * { grid-column: 1 !important; }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 78% -12%, rgba(79, 140, 255, .07), transparent 38rem),
        radial-gradient(circle at 18% 18%, rgba(124, 92, 255, .035), transparent 30rem),
        var(--bg);
    color: var(--text);
    font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
}

body.auth {
    display: grid;
    place-items: center;
    padding: 24px;
}

a { color: var(--accent); }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(28px, 5vw, 44px); }
h2 { font-size: 18px; }

.auth-card {
    width: min(100%, 460px);
    padding: clamp(24px, 5vw, 42px);
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(16, 23, 32, .96);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
}

.auth-links {
    margin-top: 20px;
    text-align: center;
}

.portal-access-card { width: min(100%, 580px); }

.portal-access-card > p:not(.eyebrow, .notice, .muted) { color: var(--muted); }

.portal-email-field { margin-top: 4px; }
.portal-email-field > span {
    color: var(--text);
    font-size: clamp(17px, 3vw, 20px);
    font-weight: 850;
    letter-spacing: -.01em;
}
.portal-email-field > small {
    color: #b8c7db;
    font-size: 13px;
    font-weight: 600;
}
.portal-email-field input {
    min-height: 52px;
    border-color: #334b6d;
    font-size: 17px;
}
.portal-email-field input.is-attention {
    border-color: #3bd9ff;
    animation: portal-email-input-attention .42s ease-in-out 4 alternate;
}
@keyframes portal-email-input-attention {
    from {
        background: #091321;
        box-shadow: 0 0 0 rgba(59, 217, 255, 0);
    }
    to {
        background: rgba(18, 68, 103, .72);
        box-shadow: 0 0 14px rgba(59, 217, 255, .9),
            0 0 34px rgba(59, 217, 255, .58),
            inset 0 0 18px rgba(59, 217, 255, .18);
    }
}

.portal-access-explainer {
    margin-top: 24px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(4, 8, 14, .48);
}

.portal-access-explainer h2 { margin-bottom: 10px; }
.portal-access-steps { display: grid; gap: 10px; }
.portal-access-steps article {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 12px;
    align-items: start;
    padding: 13px;
    border: 1px solid rgba(79, 140, 255, .2);
    border-radius: 10px;
    background: rgba(79, 140, 255, .055);
}
.portal-access-steps article > span {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    font-weight: 900;
}
.portal-access-steps strong { display: block; color: #dce9ff; font-size: 15px; }
.portal-access-steps p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }

.portal-access-modal {
    position: fixed;
    z-index: 100;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    overflow-y: auto;
    background: rgba(0, 3, 8, .82);
    backdrop-filter: blur(8px);
}
.portal-access-modal > div {
    width: min(100%, 500px);
    padding: clamp(24px, 5vw, 34px);
    border: 1px solid #355378;
    border-radius: 16px;
    background: #0d151f;
    box-shadow: 0 28px 90px rgba(0, 0, 0, .58);
}
.portal-access-modal h2 { margin-bottom: 14px; font-size: clamp(22px, 5vw, 30px); }
.portal-access-modal p { color: #b8c7db; }
.portal-access-modal strong { color: var(--text); }
.portal-access-modal form { margin-top: 20px; }

.portal-login-shell {
    display: grid;
    grid-template-columns: minmax(300px, .72fr) minmax(560px, 1.28fr);
    width: min(100%, 1280px);
    min-height: 720px;
    overflow: hidden;
    border: 1px solid #263852;
    border-radius: 24px;
    background: rgba(8, 14, 23, .96);
    box-shadow: 0 34px 110px rgba(0, 0, 0, .45);
}
.portal-login-intro {
    padding: clamp(34px, 4vw, 54px);
    background: linear-gradient(145deg, rgba(37, 88, 170, .3), rgba(8, 16, 28, .96));
}
.portal-login-intro h1 { margin: 12px 0; font-size: clamp(30px, 3vw, 44px); }
.portal-login-intro > p:not(.eyebrow) { max-width: 500px; color: #b9cae0; font-size: 17px; }
.portal-login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 36px; }
.portal-login-brand > img {
    display: block;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    object-fit: cover;
    box-shadow: 0 0 18px rgba(57, 201, 235, .22);
}
.portal-login-brand strong { font-size: 19px; }
.portal-login-progress { display: grid; gap: 12px; margin: 30px 0; padding: 0; list-style: none; }
.portal-login-progress li {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 13px;
    align-items: center;
    padding: 13px;
    border: 1px solid rgba(99, 130, 174, .2);
    border-radius: 13px;
    color: #8294ac;
    transition: transform .35s ease, border-color .35s ease, background .35s ease,
        box-shadow .35s ease, color .35s ease;
}
.portal-login-progress li > span {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 50%;
    background: #172437;
    font-weight: 900;
    transition: transform .35s ease, background .35s ease, box-shadow .35s ease;
}
.portal-login-progress li strong,
.portal-login-progress li small { display: block; }
.portal-login-progress li.current {
    border-color: rgba(75, 145, 255, .7);
    background: rgba(75, 145, 255, .12);
    color: #fff;
}
.portal-login-progress li.current > span { background: #4b91ff; color: #fff; }
.portal-login-progress li.completed { color: #bff9e7; }
.portal-login-progress li.completed > span { background: #17654d; color: #fff; }
.portal-login-progress li.is-active {
    z-index: 1;
    transform: scale(1.035);
    border-color: #3bd9ff;
    background: linear-gradient(100deg, rgba(24, 83, 136, .66), rgba(11, 31, 53, .94));
    color: #fff;
    box-shadow: 0 0 10px rgba(59, 217, 255, .5),
        0 0 30px rgba(59, 217, 255, .28),
        inset 0 0 18px rgba(59, 217, 255, .12);
}
.portal-login-progress li.is-active > span {
    transform: scale(1.18);
    background: #20c8ed;
    color: #fff;
    box-shadow: 0 0 12px #20c8ed, 0 0 30px rgba(32, 200, 237, .8);
}
.portal-login-intro aside {
    padding: 16px;
    border: 1px solid rgba(99, 230, 190, .2);
    border-radius: 13px;
    background: rgba(10, 42, 39, .35);
}
.portal-login-intro aside p { margin: 5px 0 0; color: #a8c6c0; }
.portal-login-shell .portal-access-card {
    align-self: center;
    width: 100%;
    padding: clamp(42px, 5vw, 76px);
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.portal-login-shell .portal-access-card h2 {
    max-width: 680px;
    margin-bottom: 20px;
    font-size: clamp(36px, 4.2vw, 56px);
    line-height: 1.08;
}
.portal-login-shell .portal-access-card > .notice {
    max-width: 680px;
    padding: 16px 18px;
    font-size: 16px;
}
.portal-access-form { display: grid; gap: 16px; }
.portal-access-form label > span { font-size: 19px; }
.portal-access-form label > small { font-size: 14px; }
.portal-access-form input { min-height: 58px; font-size: 18px; }
.portal-access-form button { min-height: 60px; font-size: 16px; }
.portal-access-form button:disabled { cursor: not-allowed; opacity: .58; }
.portal-access-form button.is-email-ready {
    border-color: #71e7ff;
    animation: portal-submit-email-ready .72s ease-in-out infinite alternate;
}
@keyframes portal-submit-email-ready {
    from {
        filter: brightness(1);
        box-shadow: 0 0 8px rgba(59, 217, 255, .28);
    }
    to {
        filter: brightness(1.23);
        box-shadow: 0 0 16px rgba(59, 217, 255, .92),
            0 0 38px rgba(59, 217, 255, .54),
            inset 0 0 16px rgba(255, 255, 255, .13);
    }
}
.portal-form-security { margin: -4px 0 0; color: #9eb2ce; font-size: 13px; text-align: center; }
.portal-access-help {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}
.portal-access-help p { margin: 5px 0; color: var(--muted); }
.portal-whatsapp-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    min-height: 34px;
    padding: 6px 11px;
    border: 1px solid #4ee18a;
    border-radius: 9px;
    background: linear-gradient(135deg, #13743c, #1da653);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
    box-shadow: 0 5px 14px rgba(29, 166, 83, .16);
    transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}
.portal-whatsapp-help:hover,
.portal-whatsapp-help:focus-visible {
    color: #fff;
    filter: brightness(1.12);
    transform: translateY(-1px);
    box-shadow: 0 7px 18px rgba(50, 215, 113, .32);
}
.portal-whatsapp-help:focus-visible { outline: 3px solid rgba(78, 225, 138, .38); }
.portal-email-sent {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 16px;
    padding: 20px;
    border: 1px solid rgba(99, 230, 190, .38);
    border-radius: 15px;
    background: rgba(16, 82, 63, .18);
}
.portal-email-sent > span {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 50%;
    background: #17654d;
    color: white;
    font-size: 24px;
    font-weight: 950;
}
.portal-email-sent h2 { margin-bottom: 7px; }
.portal-email-sent .button-link { margin-top: 9px; }

.portal-email-overlay {
    position: fixed;
    z-index: 100;
    inset: 0;
    display: grid;
    place-items: center;
    overflow-y: auto;
    padding: 24px;
    background: rgba(1, 5, 11, .88);
    backdrop-filter: blur(9px);
}
.portal-email-popup {
    width: min(100%, 680px);
    padding: clamp(28px, 5vw, 52px);
    border: 1px solid rgba(75, 145, 255, .6);
    border-radius: 24px;
    background: #0b1421;
    box-shadow: 0 35px 120px rgba(0, 0, 0, .72);
}
.portal-email-popup > h2 {
    margin: 8px 0 14px;
    font-size: clamp(34px, 5vw, 52px);
    line-height: 1.08;
}
.portal-email-popup > p:not(.eyebrow) { color: #c0d0e3; font-size: 17px; }
.portal-email-success {
    display: grid;
    width: 58px;
    height: 58px;
    margin-bottom: 22px;
    place-items: center;
    border-radius: 50%;
    background: #17654d;
    color: #fff;
    font-size: 30px;
    font-weight: 950;
    box-shadow: 0 0 28px rgba(42, 209, 157, .22);
}
.portal-email-countdown {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 24px 0;
    padding: 17px 20px;
    border: 1px solid rgba(75, 145, 255, .5);
    border-radius: 15px;
    background: rgba(38, 91, 173, .15);
}
.portal-email-countdown span { color: #b8c9df; font-weight: 750; }
.portal-email-countdown strong {
    color: #fff;
    font-size: 30px;
    font-variant-numeric: tabular-nums;
}
.portal-email-countdown.expired { border-color: #9f5d18; background: rgba(128, 70, 10, .18); }
.portal-email-checklist { display: grid; gap: 11px; margin: 0; padding: 0; list-style: none; }
.portal-email-checklist li {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 13px;
    align-items: center;
    padding: 13px 15px;
    border: 1px solid rgba(98, 126, 164, .28);
    border-radius: 13px;
    background: rgba(13, 26, 43, .75);
    transition: transform .35s ease, border-color .35s ease, background .35s ease,
        box-shadow .35s ease;
}
.portal-email-checklist li > span {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 50%;
    background: #285ba9;
    color: #fff;
    font-weight: 900;
    transition: transform .35s ease, background .35s ease, box-shadow .35s ease;
}
.portal-email-checklist li.is-active {
    z-index: 1;
    transform: scale(1.035);
    border-color: #3bd9ff;
    background: linear-gradient(100deg, rgba(24, 83, 136, .66), rgba(11, 31, 53, .94));
    box-shadow: 0 0 10px rgba(59, 217, 255, .5),
        0 0 30px rgba(59, 217, 255, .28),
        inset 0 0 18px rgba(59, 217, 255, .12);
}
.portal-email-checklist li.is-active > span {
    transform: scale(1.18);
    background: #20c8ed;
    box-shadow: 0 0 12px #20c8ed, 0 0 30px rgba(32, 200, 237, .8);
}
.portal-email-checklist li.is-active strong { color: #fff; }
.portal-email-checklist strong,
.portal-email-checklist small { display: block; }
.portal-email-checklist small { margin-top: 3px; color: #9eb1ca; }
.portal-email-correction {
    margin: 20px 0;
    padding: 19px 20px;
    border: 1px solid rgba(255, 194, 76, .72);
    border-radius: 13px;
    background: linear-gradient(105deg, rgba(233, 168, 59, .2), rgba(95, 59, 8, .14));
    box-shadow: 0 0 22px rgba(233, 168, 59, .13), inset 0 0 18px rgba(233, 168, 59, .06);
}
.portal-email-correction strong {
    display: block;
    color: #fff3d1;
    font-size: 20px;
    line-height: 1.25;
}
.portal-email-correction p {
    margin: 8px 0 0;
    color: #f0d9aa;
    font-size: 16px;
    line-height: 1.5;
}
.portal-email-popup > .button-link { width: 100%; min-height: 54px; }
.portal-email-correct-action {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

@media (max-width: 820px) {
    body.auth { display: block; padding: 14px; }
    .portal-login-shell { grid-template-columns: 1fr; min-height: 0; margin: 0 auto; }
    .portal-login-intro { padding: 28px 24px; }
    .portal-login-brand { margin-bottom: 24px; }
    .portal-login-intro aside { display: none; }
    .portal-login-shell .portal-access-card { padding: 32px 24px; }
}

@media (max-width: 480px) {
    .portal-login-progress { gap: 8px; }
    .portal-login-progress li { grid-template-columns: 36px 1fr; padding: 10px; }
    .portal-login-progress li > span { width: 32px; height: 32px; }
    .portal-email-sent { grid-template-columns: 1fr; }
    .portal-email-overlay { align-items: start; padding: 12px; }
    .portal-email-popup { padding: 26px 20px; border-radius: 18px; }
    .portal-email-countdown { align-items: flex-start; flex-direction: column; gap: 7px; }
}

@media (prefers-reduced-motion: reduce) {
    .portal-access-form button.is-email-ready { animation: none; }
    .portal-email-field input.is-attention { animation: none; }
    .portal-login-progress li,
    .portal-login-progress li > span,
    .portal-email-checklist li,
    .portal-email-checklist li > span { transition: none; }
    .portal-login-progress li.is-active,
    .portal-email-checklist li.is-active { transform: none; }
}

.topbar {
    position: sticky;
    z-index: 5;
    top: 0;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 18px;
    padding: 15px clamp(18px, 4vw, 60px);
    border-bottom: 1px solid var(--line);
    background: rgba(7, 10, 15, .9);
    backdrop-filter: blur(12px);
}

.topbar form { justify-self: end; }

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 18px;
    font-weight: 850;
    letter-spacing: .03em;
    text-decoration: none;
}

.brand img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
}

.brand span { color: var(--accent); }

main {
    width: min(100%, 1480px);
    margin: 0 auto;
    padding: 34px clamp(18px, 4vw, 60px) 80px;
}

.hero { margin-bottom: 28px; }
.hero p { color: var(--muted); }

.eyebrow {
    margin-bottom: 7px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .14em;
}

.panel {
    margin-bottom: 18px;
    padding: 20px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
}

.notice {
    padding: 12px 14px;
    border: 1px solid #4a604e;
    border-radius: 10px;
    background: #14251f;
    color: #c6f3df;
}

.notice--error {
    border-color: #a83d55;
    background: #32131d;
    color: #ffd8df;
}

form { display: grid; gap: 15px; }

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

input, select, button {
    max-width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 9px;
    font: inherit;
}

input, select {
    width: 100%;
    padding: 9px 11px;
    background: #0b1119;
    color: var(--text);
}

input:focus, select:focus {
    outline: 2px solid rgba(79, 140, 255, .34);
    border-color: var(--accent);
}

button {
    padding: 9px 14px;
    border-color: #497fe0;
    background: #356fdc;
    color: #f7faff;
    font-weight: 850;
    cursor: pointer;
}

button:hover { filter: brightness(1.06); }

.button-link {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    padding: 7px 12px;
    border: 1px solid #497fe0;
    border-radius: 9px;
    background: #356fdc;
    color: #f7faff;
    font-weight: 850;
    text-decoration: none;
}

button.secondary {
    min-height: 36px;
    border-color: var(--line);
    background: var(--panel-2);
    color: var(--text);
}

.inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inline select, .inline button { min-height: 36px; }

.discord-id-editor summary {
    cursor: pointer;
    color: var(--accent);
    font-weight: 800;
}

.discord-id-editor[open] summary { margin-bottom: 10px; }

.discord-destination-form {
    width: min(520px, 72vw);
    min-width: 260px;
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--panel-2);
}

.discord-destination-form input[name="discord_role_id"] {
    min-width: 190px;
    flex: 1 1 220px;
    pointer-events: auto;
    opacity: 1;
}

.discord-destination-form label.check,
.discord-destination-form .field-note {
    flex: 1 0 100%;
    white-space: normal;
}

.form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    align-items: end;
}

.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel-2);
    color: #cbd6e5;
    font-size: 12px;
    white-space: nowrap;
}

.badge--success {
    border-color: rgba(74, 222, 128, .45);
    background: rgba(22, 101, 52, .25);
    color: #bbf7d0;
}

.badge--warning {
    border-color: rgba(251, 191, 36, .5);
    background: rgba(120, 53, 15, .28);
    color: #fde68a;
}

.badge--danger {
    border-color: rgba(255, 127, 135, .5);
    background: rgba(127, 29, 29, .3);
    color: #fecaca;
}

.badge--neutral {
    border-color: rgba(148, 163, 184, .42);
    background: rgba(51, 65, 85, .35);
    color: #d5dde8;
}

.badge--info {
    border-color: rgba(96, 165, 250, .45);
    background: rgba(30, 64, 175, .25);
    color: #bfdbfe;
}

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

.empty-cell {
    padding: 34px 12px;
    color: var(--muted);
    text-align: center;
}

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

.step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--panel-2);
}

.step-number {
    display: grid;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    place-items: center;
    border-radius: 50%;
    background: var(--accent);
    color: #f7faff;
    font-weight: 900;
}

.step strong { display: block; margin-bottom: 8px; }
.muted { color: var(--muted); }

label.check {
    display: inline-flex;
    align-items: center;
    grid-auto-flow: column;
    gap: 6px;
    color: var(--text);
    white-space: nowrap;
}

label.check input {
    width: auto;
    min-height: auto;
}

.admin-main {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: clamp(270px, 17vw, 318px) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    align-items: start;
    column-gap: clamp(32px, 3vw, 58px);
    padding: 30px clamp(24px, 3.2vw, 72px) 88px;
    overflow-x: clip;
}

body.app .topbar {
    border-bottom-color: #171f2b;
    background: rgba(2, 3, 6, .96);
}

.admin-main .admin-hero {
    grid-column: 2;
    grid-row: 1;
}

.admin-main .admin-section {
    grid-column: 2;
    grid-row: 2;
}

.admin-main .panel,
.admin-main .section-intro,
.admin-main .attention-banner,
.admin-main .catalog-layout-group,
.admin-main .catalog-history {
    border-color: #1a2431;
    background-color: #070b10;
}

.admin-main .panel {
    padding: clamp(22px, 1.7vw, 30px);
    background-image: linear-gradient(155deg, rgba(11, 16, 24, .99), rgba(5, 8, 13, .99));
    box-shadow: 0 18px 46px rgba(0, 0, 0, .22);
}

.admin-main > *,
.admin-section,
.admin-section > *,
#catalogo,
#catalogo .panel,
#catalogo form,
#catalogo label {
    min-width: 0;
    max-width: 100%;
}

#catalogo h1,
#catalogo h2,
#catalogo h3,
#catalogo h4,
#catalogo p,
#catalogo label,
#catalogo button,
#catalogo code {
    overflow-wrap: anywhere;
}

.admin-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.admin-hero h1 {
    font-size: clamp(38px, 3.2vw, 56px);
    letter-spacing: -.035em;
}

.fail-closed {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1px 9px;
    min-width: 260px;
    padding: 12px 14px;
    border: 1px solid rgba(74, 222, 128, .35);
    border-radius: 12px;
    background: rgba(20, 83, 45, .18);
    color: #d1fae5;
}

.fail-closed > span:first-child {
    grid-row: 1 / 3;
    align-self: center;
    font-size: 20px;
}

.fail-closed > span:last-child {
    color: #a7f3d0;
    font-size: 12px;
}

.admin-tabs {
    position: sticky;
    z-index: 4;
    top: 88px;
    grid-column: 1;
    grid-row: 1 / span 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    min-height: min(640px, calc(100vh - 118px));
    margin: 0;
    padding: 20px 15px;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(8, 12, 18, .99), rgba(4, 7, 11, .99));
    box-shadow: 0 22px 58px rgba(0, 0, 0, .3);
    backdrop-filter: blur(16px);
}

.admin-tabs::before {
    content: "NAVEGACIÓN";
    padding: 4px 11px 10px;
    color: #71819a;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .16em;
}

.admin-tabs::after {
    content: "CT AUTOMATIZACIONES · CONTROL INTERNO";
    margin-top: auto;
    padding: 18px 11px 4px;
    color: #435066;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .11em;
    line-height: 1.6;
}

.admin-tab {
    display: flex;
    width: 100%;
    min-height: 54px;
    flex: 0 0 auto;
    align-items: center;
    gap: 14px;
    padding: 13px 15px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: var(--muted);
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
    white-space: normal;
}

.admin-tab > span:first-child {
    width: 22px;
    flex: 0 0 22px;
    color: #718096;
    text-align: center;
    font-size: 16px;
}

.admin-tab:hover,
.admin-tab:focus-visible {
    border-color: var(--line);
    color: var(--text);
    outline: none;
}

.admin-tab.is-active {
    border-color: rgba(79, 140, 255, .45);
    background: linear-gradient(90deg, rgba(79, 140, 255, .19), rgba(124, 92, 255, .07));
    box-shadow: inset 3px 0 var(--accent);
    color: #e2edff;
}

.admin-tab.is-active > span:first-child { color: var(--accent); }

.admin-nav-group {
    display: grid;
    gap: 5px;
}

.admin-area-tab {
    display: flex;
    width: 100%;
    min-height: 54px;
    align-items: center;
    gap: 14px;
    padding: 13px 15px;
    border-color: transparent;
    background: transparent;
    color: var(--muted);
    font-size: 15px;
    font-weight: 850;
    text-align: left;
}

.admin-area-tab > span:first-child {
    width: 22px;
    flex: 0 0 22px;
    color: #718096;
    text-align: center;
}

.admin-area-tab:hover,
.admin-area-tab:focus-visible {
    border-color: #2b3b52;
    background: #0c131d;
    color: var(--text);
    outline: none;
}

.admin-area-tab.is-active {
    border-color: rgba(79, 140, 255, .45);
    background: linear-gradient(90deg, rgba(79, 140, 255, .19), rgba(124, 92, 255, .07));
    box-shadow: inset 3px 0 var(--accent);
    color: #e2edff;
}

.admin-area-tab.is-active > span:first-child { color: var(--accent); }

.admin-area-links {
    display: grid;
    gap: 3px;
    margin: 0 0 8px 18px;
    padding: 4px 0 4px 13px;
    border-left: 1px solid #202d3e;
}

.admin-area-links[hidden] { display: none !important; }

.admin-nav-group[data-admin-single-panel] .admin-area-links {
    display: none !important;
}

.admin-area-links .admin-tab {
    min-height: 38px;
    padding: 8px 11px;
    font-size: 12px;
    font-weight: 750;
}

.admin-area-links .admin-tab > span:first-child {
    width: auto;
    flex: 1 1 auto;
    text-align: left;
}

.admin-quick-guide ol {
    display: grid;
    gap: 8px;
    margin: 14px 0;
    padding-left: 22px;
}

.admin-main .admin-section { display: block; }
html.admin-ui-ready .admin-main .admin-section[hidden] { display: none !important; }
html.admin-ui-ready .admin-main .admin-section:not([hidden]) { display: block; }
html:not(.admin-ui-ready) .admin-tabs { visibility: hidden; }

html:not(.admin-ui-ready) .admin-main {
    display: block;
}

html:not(.admin-ui-ready) .admin-tabs {
    position: static;
    visibility: visible;
    margin: 18px 0;
}

html:not(.admin-ui-ready) .admin-main .admin-section {
    display: block;
    margin-top: 20px;
}

html:not(.admin-ui-ready) .admin-area-links[hidden] {
    display: flex !important;
}

.rules-inner-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 8px;
    margin: 0 0 18px;
    padding: 9px;
    border: 1px solid #1b2736;
    border-radius: 14px;
    background: rgba(5, 9, 14, .96);
}

.rules-inner-tab {
    width: 100%;
    height: 100%;
    min-height: 48px;
    padding: 10px 12px;
    border-color: transparent;
    background: #0b111a;
    color: var(--muted);
    line-height: 1.3;
    text-align: left;
}

.rules-inner-tab-item {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) 30px;
    align-items: stretch;
    overflow: hidden;
    border-radius: 10px;
}

.rules-tab-order-handle {
    display: grid;
    min-height: 48px;
    place-items: center;
    border-left: 1px solid #202c3c;
    background: #0b111a;
    color: #71819a;
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.rules-tab-order-handle:hover,
.rules-tab-order-handle:focus-visible {
    background: #131d2b;
    color: var(--accent);
    outline: 2px solid rgba(79, 140, 255, .34);
    outline-offset: -2px;
}

.rules-inner-tab:hover,
.rules-inner-tab:focus-visible {
    border-color: #31415a;
    background: #101826;
    color: var(--text);
    outline: none;
}

.rules-inner-tab.is-active {
    border-color: rgba(79, 140, 255, .5);
    background: linear-gradient(135deg, rgba(79, 140, 255, .2), rgba(124, 92, 255, .09));
    box-shadow: inset 0 -2px var(--accent);
    color: #f3f7ff;
}

[data-rules-panel][hidden] { display: none !important; }

.catalog-inner-tabs {
    position: sticky;
    z-index: 8;
    top: 76px;
    display: flex;
    gap: 8px;
    margin: 0 0 18px;
    padding: 9px;
    overflow-x: auto;
    border: 1px solid #1b2736;
    border-radius: 14px;
    background: rgba(5, 9, 14, .96);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .24);
    scrollbar-width: thin;
}

.catalog-inner-tab {
    min-height: 44px;
    min-width: max-content;
    padding: 10px 14px;
    flex: 1 0 auto;
    border-color: transparent;
    background: #0b111a;
    color: var(--muted);
    line-height: 1.3;
    white-space: nowrap;
}

.catalog-inner-tab:hover,
.catalog-inner-tab:focus-visible {
    border-color: #31415a;
    background: #101826;
    color: var(--text);
    outline: none;
}

.catalog-inner-tab.is-active {
    border-color: rgba(79, 140, 255, .5);
    background: linear-gradient(135deg, rgba(79, 140, 255, .2), rgba(124, 92, 255, .09));
    box-shadow: inset 0 -2px var(--accent);
    color: #f3f7ff;
}

.catalog-tab-panel { min-width: 0; }
[data-catalog-tab-panel][hidden] { display: none !important; }

.whop-connect {
    border-color: rgba(79, 140, 255, .34);
    background:
        linear-gradient(145deg, rgba(79, 140, 255, .07), transparent 42%),
        var(--panel);
}

.whop-status-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
    margin: 1rem 0;
}

.status-card {
    display: grid;
    gap: .35rem;
    min-width: 0;
    padding: .8rem;
    border: 1px solid var(--line);
    border-radius: .8rem;
    background: rgba(7, 13, 20, .55);
}

.status-card span,
.field-note {
    color: var(--muted);
    font-size: .84rem;
}

.status-text.status-success { color: #65d69b; }
.status-text.status-info { color: #77b9ff; }
.status-text.status-warning { color: #f2c36b; }
.status-text.status-neutral { color: #a8b4c4; }

.whop-actions-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr);
    gap: 1rem;
    align-items: start;
    margin: 1rem 0;
}

.whop-credentials,
.whop-explicit-actions {
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: .8rem;
    background: rgba(7, 13, 20, .45);
}

.whop-explicit-actions {
    display: grid;
    gap: .75rem;
}

.whop-explicit-actions form,
.whop-explicit-actions button { width: 100%; }

.profile-access-table-wrap {
    max-width: 100%;
    overflow-x: visible;
}

.profile-access-table {
    width: 100%;
    table-layout: fixed;
}

.profile-access-table th,
.profile-access-table td {
    min-width: 0;
    overflow-wrap: anywhere;
    vertical-align: top;
}

.profile-access-table th:nth-child(1) { width: 25%; }
.profile-access-table th:nth-child(2) { width: 20%; }
.profile-access-table th:nth-child(3) { width: 13%; }
.profile-access-table th:nth-child(4) { width: 42%; }

.profile-access-table code {
    white-space: normal;
    word-break: break-all;
}

.profile-access-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
    width: 100%;
    min-width: 0;
}

.profile-access-form select,
.profile-access-form button {
    width: 100%;
    min-width: 0;
    white-space: normal;
}

.profile-access-form label.check {
    display: flex;
    width: 100%;
    min-width: 0;
    align-items: flex-start;
    white-space: normal;
}

.profile-access-form label.check span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.catalog-preparation-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    margin: 18px 0;
    padding: 18px;
    border: 1px solid rgba(251, 191, 36, .55);
    border-left: 4px solid var(--warning);
    border-radius: 12px;
    background: rgba(120, 53, 15, .12);
}

.catalog-preparation-card h3 {
    margin: 8px 0 6px;
    font-size: 18px;
}

.catalog-preparation-card p { margin-bottom: 8px; }

.catalog-preparation-copy {
    min-width: 0;
}

.catalog-preparation-card form {
    width: 100%;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(7, 13, 20, .52);
}

.catalog-preparation-card form button {
    width: 100%;
    white-space: normal;
}

.catalog-preparation-confirm {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    gap: 9px;
    color: var(--text);
}

.catalog-preparation-confirm span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.catalog-preparation-confirm input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex: 0 0 auto;
    accent-color: var(--warning);
}

.draft-lock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 230px;
    padding: 6px 8px;
    border: 1px solid rgba(251, 191, 36, .45);
    border-radius: 8px;
    background: rgba(120, 53, 15, .13);
    color: #fde68a;
    font-size: 11px;
    font-weight: 750;
}

.policy-points {
    min-width: 230px;
    margin: 0;
    padding-left: 18px;
    color: #dce7f5;
    font-size: 12px;
}

.policy-points li + li { margin-top: 4px; }
.policy-points--pending { color: #fde68a; }

.secret-field {
    display: flex;
    gap: .5rem;
    align-items: center;
}

.secret-field input {
    min-width: 0;
    flex: 1;
}

.secret-field button { white-space: nowrap; }
button:disabled { cursor: not-allowed; opacity: .48; }

.section-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
    padding: 22px 24px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(130deg, rgba(14, 20, 30, .99), rgba(8, 12, 19, .92));
}

.section-intro h2 {
    margin: 0 0 5px;
    font-size: 27px;
}

.section-intro p:last-child {
    margin: 0;
    color: var(--muted);
}

.section-status {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
    padding: 8px 11px;
    border: 1px solid;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 850;
}

.section-status--warning {
    border-color: rgba(251, 191, 36, .5);
    background: rgba(120, 53, 15, .25);
    color: #fde68a;
}

.section-status--success {
    border-color: rgba(74, 222, 128, .4);
    background: rgba(22, 101, 52, .22);
    color: #bbf7d0;
}

.section-heading {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 14px;
}

.section-heading h2 { margin: 0; }

.panel-collapse-button {
    display: inline-flex;
    width: auto;
    min-height: 34px;
    align-items: center;
    gap: 7px;
    margin-left: auto;
    padding: 6px 10px;
    white-space: nowrap;
}

.panel-collapse-button [data-collapse-icon] {
    display: inline-grid;
    width: 16px;
    place-items: center;
    font-size: 16px;
    line-height: 1;
}

.panel-collapsed-status {
    margin-left: auto;
    padding: 4px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel-2);
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
}

.panel-collapsed-status:not([hidden]) + .panel-collapse-button {
    margin-left: 0;
}

.panel.is-collapsed > .section-heading {
    margin-bottom: 0;
}

.panel-collapsible-content[hidden] {
    display: none;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.summary-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 10px;
    min-height: 126px;
    padding: 16px;
    border: 1px solid var(--line);
    border-left-width: 4px;
    border-radius: 12px;
    background: var(--panel-2);
    color: var(--text);
    text-decoration: none;
}

.summary-card:hover,
.summary-card:focus-visible {
    transform: translateY(-1px);
    border-color: #5b6b80;
    outline: 2px solid rgba(79, 140, 255, .24);
}

.summary-card--success { border-left-color: var(--success); }
.summary-card--warning { border-left-color: var(--warning); }
.summary-card--danger { border-left-color: var(--danger); }
.summary-card--info { border-left-color: var(--info); }
.summary-card--neutral { border-left-color: var(--neutral); }

.summary-icon {
    grid-row: 1 / 3;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 9px;
    background: #0b1119;
    font-size: 18px;
}

.summary-value {
    font-size: 28px;
    font-weight: 900;
    line-height: 1;
}

.summary-label { color: var(--muted); }

.summary-action {
    grid-column: 1 / -1;
    align-self: end;
    margin-top: 10px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 850;
}

.attention-banner {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    padding: 15px 17px;
    border: 1px solid;
    border-radius: 12px;
}

.attention-banner--warning {
    border-color: rgba(251, 191, 36, .4);
    background: rgba(120, 53, 15, .2);
    color: #fef3c7;
}

.attention-icon {
    display: grid;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    place-items: center;
    border-radius: 50%;
    background: var(--warning);
    color: #3f2400;
    font-weight: 950;
}

.attention-banner p { margin: 4px 0 0; color: #fcdca0; }

.inline-status {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 11px 13px;
    border: 1px solid;
    border-radius: 10px;
}

.inline-status > span {
    display: grid;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    place-items: center;
    border-radius: 50%;
    font-weight: 900;
}

.inline-status--success {
    border-color: rgba(74, 222, 128, .4);
    background: rgba(22, 101, 52, .18);
    color: #bbf7d0;
}

.inline-status--warning {
    border-color: rgba(251, 191, 36, .4);
    background: rgba(120, 53, 15, .18);
    color: #fde68a;
}

.inline-status--danger {
    border-color: rgba(255, 127, 135, .4);
    background: rgba(127, 29, 29, .2);
    color: #fecaca;
}

.inline-status--info {
    border-color: rgba(96, 165, 250, .4);
    background: rgba(30, 64, 175, .18);
    color: #bfdbfe;
}

.product-filter {
    display: grid;
    grid-template-columns: auto minmax(220px, 360px);
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.product-filter label { color: var(--text); }

.product-group {
    margin-bottom: 10px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #0c121a;
}

.product-group[hidden] { display: none; }

.product-group > summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    cursor: pointer;
    list-style: none;
}

.product-group > summary::-webkit-details-marker { display: none; }
.product-group > summary::after {
    content: "⌄";
    margin-left: auto;
    color: var(--muted);
    font-size: 18px;
}

.product-group[open] > summary::after { transform: rotate(180deg); }
.product-group[open] > summary { border-bottom: 1px solid var(--line); }

.product-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 9px;
    border: 1px solid var(--product-accent);
    border-radius: 8px;
    background: var(--product-background);
    color: var(--product-text);
    font-size: 12px;
    font-weight: 850;
}

.product-symbol {
    display: inline-grid;
    width: 16px;
    place-items: center;
    color: var(--product-accent);
    font-size: 11px;
}

.product-group[class*="product-identity--"] {
    border-left: 4px solid var(--product-accent);
}

.product-chip--0, .product-identity--0 { --product-accent: #60a5fa; --product-background: rgba(37, 99, 235, .16); --product-text: #dbeafe; }
.product-chip--1, .product-identity--1 { --product-accent: #2dd4bf; --product-background: rgba(13, 148, 136, .16); --product-text: #ccfbf1; }
.product-chip--2, .product-identity--2 { --product-accent: #4ade80; --product-background: rgba(22, 163, 74, .14); --product-text: #dcfce7; }
.product-chip--3, .product-identity--3 { --product-accent: #a3e635; --product-background: rgba(101, 163, 13, .14); --product-text: #ecfccb; }
.product-chip--4, .product-identity--4 { --product-accent: #fbbf24; --product-background: rgba(180, 83, 9, .16); --product-text: #fef3c7; }
.product-chip--5, .product-identity--5 { --product-accent: #fb923c; --product-background: rgba(194, 65, 12, .16); --product-text: #ffedd5; }
.product-chip--6, .product-identity--6 { --product-accent: #fb7185; --product-background: rgba(190, 18, 60, .15); --product-text: #ffe4e6; }
.product-chip--7, .product-identity--7 { --product-accent: #e879f9; --product-background: rgba(162, 28, 175, .15); --product-text: #fae8ff; }
.product-chip--8, .product-identity--8 { --product-accent: #a78bfa; --product-background: rgba(109, 40, 217, .16); --product-text: #ede9fe; }
.product-chip--9, .product-identity--9 { --product-accent: #818cf8; --product-background: rgba(67, 56, 202, .16); --product-text: #e0e7ff; }
.product-chip--10, .product-identity--10 { --product-accent: #22d3ee; --product-background: rgba(8, 145, 178, .15); --product-text: #cffafe; }

.product-group-count {
    color: var(--muted);
    font-size: 12px;
}

.preview-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    margin-bottom: 14px;
    padding: 11px 13px;
    border: 1px solid rgba(96, 165, 250, .28);
    border-radius: 10px;
    background: rgba(30, 64, 175, .12);
}

.preview-summary span {
    color: var(--muted);
    font-size: 12px;
}

.product-external-id {
    color: #cbd5e1;
    font-size: 11px;
}

.preview-source-state {
    padding: 4px 8px;
    border: 1px solid rgba(96, 165, 250, .28);
    border-radius: 999px;
    color: #bfdbfe;
    font-size: 11px;
    font-weight: 750;
}

.whop-plan-table-wrap {
    max-width: 100%;
    overflow-x: visible;
}

.whop-plan-table {
    width: 100%;
    table-layout: fixed;
}

.whop-plan-table th,
.whop-plan-table td {
    min-width: 0;
    overflow-wrap: anywhere;
}

.whop-plan-table th:nth-child(1) { width: 7%; }
.whop-plan-table th:nth-child(2) { width: 20%; }
.whop-plan-table th:nth-child(3) { width: 16%; }
.whop-plan-table th:nth-child(4) { width: 11%; }
.whop-plan-table th:nth-child(5) { width: 14%; }
.whop-plan-table th:nth-child(6) { width: 9%; }
.whop-plan-table th:nth-child(7) { width: 9%; }
.whop-plan-table th:nth-child(8) { width: 14%; }

.whop-plan-table code {
    white-space: normal;
    word-break: break-all;
}

.preview-snapshot-note {
    margin: 0 0 14px;
    padding: 10px 12px;
    border: 1px solid rgba(96, 165, 250, .3);
    border-radius: 9px;
    background: rgba(30, 64, 175, .12);
    color: #dbeafe;
    font-size: 12px;
}

.price-line,
.member-count-warning {
    display: block;
}

.price-line + .price-line { margin-top: 4px; }
.currency-code {
    color: #cbd5e1;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .05em;
}

.currency-missing,
.member-count-zero {
    color: var(--muted);
    font-size: 11px;
}

.internal-name-source {
    display: block;
    width: max-content;
    margin-top: 4px;
    padding: 3px 6px;
    border: 1px solid rgba(96, 165, 250, .3);
    border-radius: 6px;
    background: rgba(30, 64, 175, .12);
    color: #bfdbfe;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .02em;
}

.member-count-warning {
    min-width: 210px;
    padding: 7px 9px;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    background: rgba(120, 53, 15, .3);
    color: #fde68a;
}

.member-count-warning strong,
.member-count-warning small {
    display: block;
}

.member-count-warning small {
    margin-top: 3px;
    color: #fef3c7;
    font-size: 10px;
    line-height: 1.35;
}

.membership-preview-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 16px;
}

.overlap-filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) minmax(190px, 1fr) minmax(180px, 1fr);
    align-items: end;
    gap: 12px;
    margin: 0 0 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--panel-2);
}

.overlap-only-toggle {
    display: flex;
    min-height: 42px;
    align-items: center;
    gap: 9px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    font-weight: 750;
}

.overlap-only-toggle input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--accent);
}

.overlap-filter-clear { min-height: 42px; }

.overlap-filter-count {
    align-self: center;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.overlap-group {
    --overlap-state-color: var(--info);
    --overlap-state-soft: rgba(96, 165, 250, .11);
    margin-bottom: 12px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-left: 4px solid var(--overlap-state-color);
    border-radius: 11px;
    background: var(--overlap-state-soft);
}

.overlap-group--attention {
    --overlap-state-color: var(--danger);
    --overlap-state-soft: rgba(127, 29, 29, .16);
    border-color: rgba(255, 127, 135, .62);
}

.overlap-group--overlap {
    --overlap-state-color: var(--warning);
    --overlap-state-soft: rgba(120, 53, 15, .12);
    border-color: rgba(251, 191, 36, .55);
}

.overlap-group--normal {
    --overlap-state-color: var(--info);
    --overlap-state-soft: rgba(30, 64, 175, .09);
}

.overlap-group > summary {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px 14px;
    cursor: pointer;
    list-style: none;
}

.overlap-group > summary::-webkit-details-marker { display: none; }
.overlap-group > summary::after {
    content: "⌄";
    margin-left: 4px;
    color: var(--overlap-state-color);
    font-size: 18px;
}

.overlap-group[open] > summary::after { transform: rotate(180deg); }
.overlap-group[open] > summary { border-bottom: 1px solid var(--line); }
.overlap-group summary span:nth-child(2) {
    display: grid;
    gap: 3px;
}

.overlap-group summary small {
    color: var(--muted);
    font-size: 11px;
}

.overlap-summary-recommendation {
    color: var(--text) !important;
    font-weight: 650;
}

.overlap-warning-icon {
    display: inline-grid;
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: var(--overlap-state-color);
    color: #071018;
    font-weight: 950;
}

.overlap-review {
    margin-left: auto;
    padding: 4px 8px;
    border: 1px solid var(--overlap-state-color);
    border-radius: 999px;
    color: var(--overlap-state-color);
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
}

.overlap-content { padding: 14px; }
.overlap-identity {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-bottom: 12px;
}

.overlap-identity span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.overlap-id {
    display: block;
    width: max-content;
    max-width: 230px;
    margin-top: 5px;
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    text-overflow: ellipsis;
}

.overlap-recommendation {
    margin: 12px 0 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-2);
    color: var(--muted);
    font-size: 12px;
}

.table-sort-button {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 8px;
    border: 1px solid transparent;
    background: transparent;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-align: left;
    text-transform: inherit;
    white-space: nowrap;
}

.table-sort-button:hover {
    border-color: var(--line);
    background: rgba(148, 163, 184, .08);
}

.table-sort-button:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

.sort-indicator {
    color: #93c5fd;
    font-size: 9px;
    font-weight: 750;
    letter-spacing: 0;
    text-transform: none;
}

.group-attention,
.group-ready {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 850;
}

.whop-update-all button {
    min-height: 48px;
    border-color: rgba(45, 212, 191, .62);
    background: linear-gradient(135deg, #0f766e, #0e7490);
}

.admin-instruction,
.sync-last-run {
    margin: 0;
    padding: 11px 13px;
    border: 1px solid rgba(251, 191, 36, .32);
    border-radius: 10px;
    background: rgba(120, 53, 15, .16);
    color: #fde68a;
}

.catalog-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.catalog-toolbar label {
    flex: 1 1 420px;
}

.catalog-toolbar label span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.catalog-operation-queue {
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid rgba(251, 191, 36, .32);
    border-radius: 12px;
    background: rgba(120, 53, 15, .12);
}

.catalog-operation-queue h3,
.catalog-operation-queue p {
    margin: 0 0 8px;
}

.catalog-queue-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 8px;
}

.catalog-queue-list a {
    display: grid;
    gap: 3px;
    padding: 9px 10px;
    border: 1px solid rgba(251, 191, 36, .24);
    border-radius: 9px;
    background: rgba(15, 23, 42, .64);
    color: var(--text);
    text-decoration: none;
}

.catalog-queue-list a:hover {
    border-color: #fbbf24;
}

.catalog-queue-list span {
    color: var(--muted);
    font-size: 12px;
}

.catalog-layout-group {
    margin-bottom: 12px;
    overflow: clip;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(7, 12, 18, .7);
}

.catalog-layout-group > summary {
    display: grid;
    grid-template-columns: auto minmax(180px, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    list-style: none;
    cursor: pointer;
}

.catalog-layout-group > summary::-webkit-details-marker {
    display: none;
}

.catalog-layout-group > summary input {
    min-height: 38px;
    font-weight: 850;
}

.drag-handle {
    color: var(--muted);
    font-size: 18px;
    letter-spacing: -3px;
}

.catalog-group-dropzone {
    display: grid;
    gap: 12px;
    min-height: 58px;
    padding: 12px;
    border-top: 1px solid var(--line);
    transition: background .16s ease, outline-color .16s ease;
}

.catalog-group-dropzone.is-drag-target {
    outline: 2px dashed #2dd4bf;
    outline-offset: -6px;
    background: rgba(13, 148, 136, .12);
}

.catalog-product-card {
    min-width: 0;
    padding: 15px;
    border: 1px solid color-mix(in srgb, var(--product-accent) 62%, transparent);
    border-left: 5px solid var(--product-accent);
    border-radius: 12px;
    background:
        linear-gradient(135deg, var(--product-background), rgba(7, 12, 18, .92) 58%),
        #0b1119;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .16);
}

.catalog-product-card.is-dragging {
    opacity: .5;
}

.catalog-product-card.is-missing,
.catalog-plan-card.is-missing {
    border-style: dashed;
    filter: saturate(.66);
}

.catalog-product-card > header,
.catalog-plan-head,
.catalog-product-meta,
.catalog-product-actions,
.catalog-plan-operations {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
}

.catalog-product-card > header > *,
.catalog-plan-head > *,
.catalog-product-detail,
.catalog-plan-card,
.catalog-product-actions,
.catalog-plan-operations,
.catalog-plan-operations > * {
    min-width: 0;
}

.catalog-product-card > header[data-catalog-product-collapse] {
    padding: 7px;
    border-radius: 9px;
    cursor: pointer;
    transition: background .16s ease, outline-color .16s ease;
}

.catalog-product-card > header[data-catalog-product-collapse]:hover {
    background: color-mix(in srgb, var(--product-accent) 8%, transparent);
}

.catalog-product-card > header[data-catalog-product-collapse]:focus-visible {
    outline: 2px solid var(--product-accent);
    outline-offset: 2px;
}

.catalog-product-header-actions {
    display: flex;
    min-width: 0;
    flex: 1 1 300px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.catalog-product-collapse-indicator {
    display: inline-grid;
    width: 30px;
    min-height: 30px;
    flex: 0 0 auto;
    border: 1px solid color-mix(in srgb, var(--product-accent) 42%, transparent);
    border-radius: 999px;
    background: rgba(2, 6, 23, .34);
    color: var(--product-text);
    place-items: center;
    font-size: 16px;
    font-weight: 900;
}

.catalog-product-card.is-product-collapsed {
    box-shadow: 0 7px 20px rgba(0, 0, 0, .13);
}

.catalog-card-badges {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
}

.catalog-card-badges .badge {
    max-width: 100%;
    white-space: normal;
    text-align: center;
    overflow-wrap: anywhere;
}

.reconciliation-state {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 999px;
    background: rgba(30, 41, 59, .76);
    color: #dbeafe;
    font-size: 10px;
    font-weight: 800;
}

.reconciliation-state--verified_current_name,
.reconciliation-state--reviewed_without_difference {
    border-color: rgba(45, 212, 191, .42);
    background: rgba(13, 148, 136, .16);
    color: #99f6e4;
}

.reconciliation-state--confirmed_obsolete_name,
.reconciliation-state--historical_absent {
    border-color: rgba(248, 113, 113, .38);
    background: rgba(127, 29, 29, .2);
    color: #fecaca;
}

.reconciliation-state--profile_pending,
.reconciliation-state--operational_review_pending,
.reconciliation-state--active_customers_protected,
.reconciliation-state--name_changed_same_product_id {
    border-color: rgba(251, 191, 36, .4);
    background: rgba(120, 53, 15, .24);
    color: #fde68a;
}

.catalog-safety-strip {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px 12px;
    margin: 8px 0;
    padding: 8px 10px;
    border: 1px solid rgba(96, 165, 250, .22);
    border-radius: 9px;
    background: rgba(30, 64, 175, .1);
    color: #bfdbfe;
    font-size: 11px;
}

.catalog-membership-warning {
    flex: 1 0 100%;
    margin: 8px 0 0;
    padding: 8px 10px;
    border: 1px solid rgba(251, 191, 36, .42);
    border-radius: 8px;
    background: rgba(120, 53, 15, .2);
    color: #fde68a;
    font-size: 11px;
    overflow-wrap: anywhere;
}

.catalog-lifecycle-actions {
    width: 100%;
    min-width: 0;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 9px;
}

.catalog-lifecycle-actions form {
    min-width: 0;
    flex: 1 1 170px;
    align-content: start;
}

.catalog-lifecycle-form {
    min-width: 0;
    max-width: 100%;
    flex-basis: 240px;
    padding: 8px;
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 9px;
    background: rgba(2, 6, 23, .28);
}

.catalog-lifecycle-form small {
    display: block;
    min-width: 0;
    max-width: 260px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.catalog-lifecycle-actions form.inline button,
.catalog-lifecycle-form button {
    width: 100%;
    white-space: normal;
}

.catalog-lifecycle-form label.check,
.catalog-recovery-form label.check {
    width: 100%;
    min-width: 0;
    align-items: flex-start;
    white-space: normal;
}

.catalog-lifecycle-form label.check span,
.catalog-recovery-form label.check span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.catalog-recovery-form {
    display: grid;
    width: min(100%, 520px);
    min-width: 0;
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(96, 165, 250, .34);
    border-radius: 9px;
    background: rgba(30, 64, 175, .1);
}

.catalog-recovery-form button {
    width: 100%;
    white-space: normal;
}

.catalog-recovery-form small {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

button.danger {
    border-color: rgba(248, 113, 113, .55);
    background: #7f1d1d;
    color: #fee2e2;
}

.catalog-history {
    margin-top: 18px;
    padding: 12px;
    border: 1px dashed rgba(148, 163, 184, .36);
    border-radius: 12px;
    background: rgba(15, 23, 42, .5);
}

.catalog-history > summary {
    cursor: pointer;
    color: #cbd5e1;
    font-weight: 850;
}

.catalog-history > p {
    color: var(--muted);
    font-size: 12px;
}

.catalog-history-grid {
    display: grid;
    gap: 10px;
}

.catalog-history-card {
    display: grid;
    min-width: 0;
    gap: 8px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 10px;
    background: rgba(2, 6, 23, .44);
    overflow-wrap: anywhere;
}

.catalog-history-card > div:first-child {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px 12px;
}

.catalog-history-card span {
    color: var(--muted);
    font-size: 11px;
}

.catalog-product-card h3,
.catalog-plan-card h4 {
    max-width: 100%;
    margin: 2px 0 0;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.catalog-kicker {
    color: var(--product-accent);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.catalog-product-meta {
    justify-content: flex-start;
    margin: 10px 0;
    color: var(--product-text);
    font-size: 12px;
}

.catalog-product-meta span {
    max-width: 100%;
    padding: 4px 8px;
    border: 1px solid color-mix(in srgb, var(--product-accent) 28%, transparent);
    border-radius: 999px;
    background: rgba(2, 6, 23, .38);
    overflow-wrap: anywhere;
}

.catalog-plan-grid {
    display: grid;
    min-width: 0;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 10px;
    margin-top: 12px;
}

.catalog-plan-card {
    position: relative;
    min-width: 0;
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--product-accent) 42%, transparent);
    border-radius: 10px;
    background: color-mix(in srgb, var(--product-background) 72%, #070c12);
}

.catalog-plan-card.is-dragging,
.catalog-product-card.is-dragging,
[data-order-item].is-dragging,
.is-pointer-dragging {
    opacity: .55;
    outline: 2px dashed var(--accent);
    outline-offset: 3px;
}

body.is-pointer-reordering {
    cursor: grabbing;
    user-select: none;
}

.catalog-plan-order-controls,
.catalog-product-order-controls,
.local-order-handle,
.local-order-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.catalog-plan-order-controls,
.catalog-product-order-controls,
.local-order-handle {
    color: var(--muted);
    font-size: 11px;
}

.catalog-product-order-controls {
    justify-content: flex-end;
    margin-bottom: 7px;
}

.catalog-plan-order-controls {
    justify-content: flex-end;
}

.local-order-handle {
    justify-content: flex-end;
    margin: -4px 0 10px;
    padding-bottom: 7px;
    border-bottom: 1px dashed rgba(148, 163, 184, .22);
}

.local-order-controls {
    margin-top: 14px;
    padding: 12px;
    border: 1px solid rgba(96, 165, 250, .25);
    border-radius: 11px;
    background: rgba(15, 23, 42, .58);
}

.local-order-controls .field-note {
    flex: 1 1 320px;
    margin: 0;
}

.drag-handle {
    display: inline-grid;
    min-width: 34px;
    min-height: 34px;
    place-items: center;
    border: 1px solid rgba(96, 165, 250, .38);
    border-radius: 7px;
    background: rgba(30, 64, 175, .16);
    color: #bfdbfe;
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.drag-handle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.drag-handle:active {
    cursor: grabbing;
}

.preview-plan-order-controls {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0 8px 4px 0;
    vertical-align: middle;
}

.preview-plan-order-controls .drag-handle {
    min-width: 34px;
}

.preview-plan-name {
    display: inline;
    font-weight: 750;
}

.preview-order-save {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 14px;
    padding: 12px;
    border: 1px solid rgba(96, 165, 250, .25);
    border-radius: 11px;
    background: rgba(15, 23, 42, .58);
}

.preview-order-save .field-note {
    flex: 1 1 320px;
    margin: 0;
}

.order-save-status {
    min-height: 1.2em;
    margin: 0;
    color: #86efac;
    font-size: 11px;
    font-weight: 750;
}

.order-save-status:empty {
    display: none;
}

.preview-product-drag-handle {
    flex: 0 0 34px;
}

.catalog-plan-card.is-pending {
    box-shadow: inset 0 0 0 1px rgba(251, 191, 36, .2);
}

.catalog-plan-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin: 10px 0;
}

.catalog-plan-facts > span {
    display: grid;
    min-width: 0;
    max-width: 100%;
    gap: 2px;
    padding: 7px 8px;
    border-radius: 8px;
    background: rgba(2, 6, 23, .35);
}

.catalog-plan-facts > span > small,
.catalog-plan-facts > span > strong {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.catalog-plan-facts small,
.catalog-references span {
    color: var(--muted);
    font-size: 10px;
}

.catalog-plan-facts strong {
    min-width: 0;
    color: var(--product-text);
    font-size: 12px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.catalog-plan-facts .badge {
    display: inline-flex;
    width: fit-content;
    min-width: 0;
    max-width: 100%;
    min-height: 0;
    align-items: flex-start;
    white-space: normal;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.catalog-references {
    margin-top: 9px;
    color: var(--muted);
    font-size: 11px;
}

.catalog-references summary {
    cursor: pointer;
}

.catalog-references code,
.catalog-references span {
    display: block;
    max-width: 100%;
    margin-top: 5px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.catalog-plan-operations {
    min-width: 0;
    align-items: flex-end;
    padding-top: 8px;
    border-top: 1px solid color-mix(in srgb, var(--product-accent) 22%, transparent);
}

.catalog-plan-operations > span {
    flex: 1 1 180px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.coverage-pause-panel {
    display: grid;
    gap: 16px;
}

.policy-center {
    display: grid;
    min-width: 0;
    gap: 14px;
    padding: 16px;
    border: 1px solid rgba(96, 165, 250, .3);
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(15, 23, 42, .92), rgba(8, 15, 25, .82));
}

.policy-center-head {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.policy-center-head h3,
.policy-center-head p {
    margin: 4px 0 0;
}

.policy-center-state {
    display: grid;
    min-width: 120px;
    padding: 10px 12px;
    border-radius: 9px;
    background: rgba(37, 99, 235, .18);
    text-align: center;
}

.policy-center-state strong {
    color: #bfdbfe;
    font-size: 20px;
}

.policy-center-state span {
    color: var(--muted);
    font-size: 11px;
}

.policy-stage-form,
.policy-manual-form {
    display: grid;
    min-width: 0;
    gap: 10px;
}

.policy-stage-form label.check,
.policy-manual-form label.check {
    width: 100%;
    min-width: 0;
    align-items: flex-start;
    white-space: normal;
}

.policy-stage-form label span,
.policy-manual-form label span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.policy-product-list {
    display: grid;
    min-width: 0;
    gap: 9px;
}

.policy-product {
    min-width: 0;
    border: 1px solid color-mix(in srgb, var(--product-accent) 38%, transparent);
    border-left: 5px solid var(--product-accent);
    border-radius: 9px;
    background:
        linear-gradient(120deg, var(--product-background), transparent 48%),
        rgba(2, 6, 23, .42);
    overflow: hidden;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.policy-product[open] {
    border-color: color-mix(in srgb, var(--product-accent) 74%, transparent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--product-accent) 18%, transparent),
        0 14px 34px rgba(0, 0, 0, .2);
}

.policy-product > summary,
.coverage-granular > summary {
    display: flex;
    min-width: 0;
    cursor: pointer;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 14px;
    padding: 11px 13px;
    color: #e5edf9;
}

.policy-product > summary {
    list-style: none;
    background: linear-gradient(
        90deg,
        color-mix(in srgb, var(--product-accent) 15%, transparent),
        transparent 62%
    );
    transition: background .16s ease, color .16s ease;
}

.policy-product > summary::-webkit-details-marker {
    display: none;
}

.policy-product > summary:hover {
    background: linear-gradient(
        90deg,
        color-mix(in srgb, var(--product-accent) 24%, transparent),
        transparent 72%
    );
}

.policy-product > summary:focus-visible {
    outline: 2px solid var(--product-accent);
    outline-offset: -3px;
}

.policy-product[open] > summary {
    background: linear-gradient(
        90deg,
        color-mix(in srgb, var(--product-accent) 28%, transparent),
        color-mix(in srgb, var(--product-accent) 8%, transparent) 68%,
        transparent
    );
}

.policy-product > summary::after {
    content: "Desplegar";
    flex: 0 0 auto;
    padding: 3px 8px;
    border: 1px solid color-mix(in srgb, var(--product-accent) 52%, transparent);
    border-radius: 999px;
    color: #dbe7f5;
    font-size: 10px;
    font-weight: 800;
}

.policy-product[open] > summary::after {
    content: "Abierto";
    background: color-mix(in srgb, var(--product-accent) 18%, transparent);
    color: #f8fbff;
}

.policy-product-title {
    display: inline-flex;
    min-width: 0;
    flex: 1 1 280px;
    align-items: center;
    gap: 9px;
    color: #f4f7fb !important;
    overflow-wrap: anywhere;
}

.policy-product-indicator {
    width: 11px;
    height: 11px;
    flex: 0 0 auto;
    border: 2px solid color-mix(in srgb, var(--product-accent) 72%, #fff 28%);
    border-radius: 50%;
    background: var(--product-accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--product-accent) 14%, transparent);
}

.policy-product-count {
    flex: 0 1 auto;
}

.policy-product > summary span,
.coverage-granular > summary span {
    color: var(--muted);
    font-size: 12px;
}

.policy-product .table-wrap {
    border-top: 1px solid rgba(148, 163, 184, .16);
}

.policy-product td,
.policy-product th {
    min-width: 0;
    vertical-align: top;
    overflow-wrap: anywhere;
}

.policy-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
}

.policy-flag {
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(245, 158, 11, .15);
    color: #fde68a;
    font-size: 10px;
    font-weight: 700;
}

.policy-simulation,
.policy-manual-dates,
.policy-cohorts {
    display: grid;
    min-width: 0;
    gap: 10px;
    padding: 13px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 10px;
    background: rgba(2, 6, 23, .28);
}

.policy-simulation h3,
.policy-manual-dates h3,
.policy-cohorts h3,
.policy-simulation p,
.policy-manual-dates p,
.policy-cohorts p {
    margin: 0;
}

.policy-simulation-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.policy-simulation-summary > div {
    display: grid;
    min-width: 0;
    padding: 9px;
    border-radius: 8px;
    background: rgba(30, 64, 175, .12);
}

.policy-simulation-summary strong {
    color: #bfdbfe;
    font-size: 18px;
}

.policy-simulation-summary span {
    color: var(--muted);
    font-size: 11px;
    overflow-wrap: anywhere;
}

.policy-simulation-detail summary {
    cursor: pointer;
    color: #bfdbfe;
    font-weight: 750;
}

.policy-manual-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
}

.policy-manual-form label {
    display: grid;
    min-width: 0;
    gap: 5px;
}

.policy-manual-form select,
.policy-manual-form input {
    width: 100%;
    min-width: 0;
}

.policy-manual-form .check,
.policy-manual-form button {
    grid-column: 1 / -1;
}

.policy-cohort-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.policy-cohort-card {
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(96, 165, 250, .18);
    border-radius: 8px;
    background: rgba(15, 23, 42, .72);
}

.policy-cohort-card header {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.policy-cohort-card p {
    margin: 7px 0 4px;
    overflow-wrap: anywhere;
}

.coverage-granular {
    min-width: 0;
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 10px;
}

.coverage-granular-body {
    display: grid;
    min-width: 0;
    gap: 14px;
    padding: 0 13px 13px;
}

@media (max-width: 760px) {
    .policy-center {
        padding: 12px;
    }

    .policy-center-head,
    .policy-product > summary,
    .coverage-granular > summary {
        align-items: stretch;
        flex-direction: column;
    }

    .policy-product > summary::after,
    .policy-product-count {
        align-self: flex-start;
    }

    .policy-product-title {
        flex-basis: auto;
        width: 100%;
    }

    .policy-center-state {
        width: 100%;
    }

    .policy-simulation-summary,
    .policy-manual-form,
    .policy-cohort-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.portal-resource--renewal {
    border-color: #8b6920;
    background: linear-gradient(135deg, #1b160b, #101827);
}
.portal-expiration-dialog {
    z-index: 1000;
    width: min(560px, calc(100vw - 32px));
    margin: auto;
    padding: 28px;
    border: 1px solid #84661f;
    border-radius: 18px;
    background: #0d1522;
    color: #f7f9fc;
    box-shadow: 0 28px 90px rgb(0 0 0 / 65%);
}
.portal-expiration-dialog::backdrop {
    background: rgb(0 0 0 / 72%);
    backdrop-filter: blur(4px);
}
.portal-expiration-dialog h2 { margin: 7px 36px 10px 0; }
.portal-expiration-dialog p:not(.eyebrow) {
    margin: 0 0 20px;
    color: #b9cbe2;
    line-height: 1.55;
}
.portal-expiration-dialog form { margin: 0; }
.portal-expiration-dialog__close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: grid;
    place-items: center;
    width: 38px;
    min-width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    background: #18253a;
    color: #fff;
    font-size: 1.4rem;
}

.coverage-safety-banner {
    display: grid;
    gap: 5px;
    padding: 13px 15px;
    border: 1px solid rgba(251, 191, 36, .46);
    border-radius: 11px;
    background: rgba(120, 53, 15, .2);
    color: #fde68a;
}

.coverage-safety-banner span {
    color: #fef3c7;
    line-height: 1.5;
}

.coverage-config-card,
.coverage-rules,
.coverage-generation,
.coverage-proposals {
    min-width: 0;
    padding: 14px;
    border: 1px solid rgba(96, 165, 250, .2);
    border-radius: 11px;
    background: rgba(2, 6, 23, .3);
}

.coverage-config-card h3,
.coverage-rules h3,
.coverage-generation h3,
.coverage-proposals h3 {
    margin-top: 0;
}

.coverage-rule-form {
    display: grid;
    min-width: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 11px;
    align-items: end;
}

.coverage-rule-form label {
    display: grid;
    min-width: 0;
    gap: 6px;
}

.coverage-rule-form select,
.coverage-rule-form input {
    width: 100%;
    min-width: 0;
}

.coverage-rule-form small {
    color: var(--muted);
    line-height: 1.4;
}

.coverage-rule-form .coverage-confirm {
    grid-column: 1 / -1;
    align-items: flex-start;
    white-space: normal;
}

.coverage-rule-form .coverage-confirm span,
.coverage-generate-form label span,
.coverage-review-form label span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.coverage-rule-form > button {
    width: 100%;
    grid-column: 1 / -1;
}

.coverage-generation code,
.coverage-rules code {
    overflow-wrap: anywhere;
}

.coverage-generate-form,
.coverage-review-form {
    display: grid;
    min-width: 0;
    gap: 9px;
}

.coverage-generate-form label.check,
.coverage-review-form label.check {
    width: 100%;
    min-width: 0;
    align-items: flex-start;
    white-space: normal;
}

.coverage-proposal-list {
    display: grid;
    min-width: 0;
    gap: 11px;
}

.coverage-proposal-card {
    display: grid;
    min-width: 0;
    gap: 11px;
    padding: 13px;
    border: 1px solid rgba(148, 163, 184, .22);
    border-left: 4px solid #60a5fa;
    border-radius: 10px;
    background: rgba(8, 15, 25, .78);
}

.coverage-proposal-card > header {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 9px 14px;
}

.coverage-proposal-card h3 {
    margin: 2px 0 0;
    overflow-wrap: anywhere;
}

.coverage-proposal-flow {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.coverage-proposal-flow > div {
    display: grid;
    min-width: 0;
    gap: 4px;
    padding: 10px;
    border-radius: 9px;
    background: rgba(30, 64, 175, .1);
}

.coverage-proposal-flow small,
.coverage-proposal-dates dt {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.coverage-proposal-flow strong,
.coverage-proposal-dates dd,
.coverage-proposal-card p {
    min-width: 0;
    overflow-wrap: anywhere;
}

.coverage-membership-id {
    min-width: 0;
    color: var(--muted);
    font: 600 11px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
    overflow-wrap: anywhere;
}

.coverage-membership-state {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.coverage-membership-state small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: none;
}

.coverage-payment-status {
    display: grid;
    min-width: 0;
    gap: 5px;
    margin-top: 5px;
    padding-top: 8px;
    border-top: 1px solid rgba(148, 163, 184, .16);
}

.coverage-payment-status .badge {
    width: fit-content;
    max-width: 100%;
    white-space: normal;
}

.coverage-payment-status small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0;
    line-height: 1.4;
    text-transform: none;
    overflow-wrap: anywhere;
}

.coverage-proposal-dates {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}

.coverage-proposal-dates > div {
    min-width: 0;
    padding: 9px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
}

.coverage-proposal-dates dd {
    margin: 4px 0 0;
    font-size: 12px;
}

.coverage-no-action {
    margin: 0;
    padding: 9px 10px;
    border-radius: 8px;
    background: rgba(127, 29, 29, .16);
    color: #fecaca;
}

.coverage-policy-note {
    margin: 0;
    padding: 9px 10px;
    border: 1px solid rgba(96, 165, 250, .2);
    border-radius: 8px;
    background: rgba(30, 64, 175, .12);
    color: #dbeafe;
}

.coverage-source-details {
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 8px;
}

.coverage-source-details summary {
    cursor: pointer;
    color: #bfdbfe;
    font-weight: 750;
}

.coverage-source-details ul {
    display: grid;
    min-width: 0;
    gap: 8px;
    margin: 9px 0 0;
    padding: 0;
    list-style: none;
}

.coverage-source-details li {
    display: grid;
    min-width: 0;
    gap: 4px;
    padding: 8px;
    border-radius: 7px;
    background: rgba(15, 23, 42, .62);
    overflow-wrap: anywhere;
}

.catalog-product-actions > *,
.catalog-plan-operations .action-with-help {
    min-width: 0;
    max-width: 100%;
}

.group-attention {
    background: rgba(120, 53, 15, .3);
    color: #fde68a;
}

.group-ready {
    background: rgba(22, 101, 52, .25);
    color: #bbf7d0;
}

.label-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.action-with-help {
    display: flex;
    align-items: center;
    gap: 7px;
}

.help-trigger {
    position: relative;
    display: inline-grid;
    width: 24px;
    min-height: 24px;
    flex: 0 0 24px;
    place-items: center;
    padding: 0;
    border: 1px solid #526277;
    border-radius: 50%;
    background: #172231;
    color: #cfe0f6;
    font: 800 12px/1 system-ui, sans-serif;
}

.help-trigger:hover,
.help-trigger:focus-visible {
    border-color: var(--info);
    background: #1d3555;
    outline: 2px solid rgba(96, 165, 250, .28);
}

.admin-help-tooltip {
    position: fixed;
    z-index: 30;
    width: min(360px, calc(100vw - 24px));
    padding: 11px 13px;
    border: 1px solid #526277;
    border-radius: 9px;
    background: #090e15;
    box-shadow: 0 12px 36px rgba(0, 0, 0, .5);
    color: #e7eef8;
    font: 500 12px/1.5 system-ui, sans-serif;
    pointer-events: none;
}

.admin-help-tooltip[hidden] { display: none; }

.help-dialog {
    width: min(92vw, 560px);
    padding: 0;
    border: 1px solid #526277;
    border-radius: 14px;
    background: var(--panel);
    color: var(--text);
    box-shadow: 0 24px 90px rgba(0, 0, 0, .65);
}

.help-dialog::backdrop { background: rgba(0, 0, 0, .72); }

.help-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
}

.help-dialog-head h2 { margin: 0; }

.help-dialog-close {
    width: 34px;
    min-height: 34px;
    padding: 0;
    border-color: var(--line);
    background: var(--panel-2);
    color: var(--text);
    font-size: 21px;
}

.help-dialog > p {
    margin: 0;
    padding: 20px;
    color: #d5dfec;
}

@media (max-width: 1180px) {
    .whop-plan-table-wrap { overflow: visible; }

    .whop-plan-table,
    .whop-plan-table tbody {
        display: block;
        width: 100%;
    }

    .whop-plan-table thead { display: none; }

    .whop-plan-table tbody {
        display: grid;
        gap: 10px;
    }

    .whop-plan-table tr[data-sort-row] {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: hidden;
        border: 1px solid var(--line);
        border-radius: 10px;
        background: rgba(7, 13, 20, .48);
    }

    .whop-plan-table td {
        display: grid;
        grid-template-columns: minmax(96px, .8fr) minmax(0, 1.2fr);
        align-content: start;
        gap: 8px;
        min-width: 0;
        padding: 9px 10px;
        vertical-align: top;
    }

    .whop-plan-table td::before {
        color: var(--muted);
        font-size: 10px;
        font-weight: 850;
        letter-spacing: .05em;
        text-transform: uppercase;
    }

    .whop-plan-table td:nth-child(1)::before { content: "Tipo"; }
    .whop-plan-table td:nth-child(2)::before { content: "Nombre"; }
    .whop-plan-table td:nth-child(3)::before { content: "ID externo"; }
    .whop-plan-table td:nth-child(4)::before { content: "Facturación"; }
    .whop-plan-table td:nth-child(5)::before { content: "Precio"; }
    .whop-plan-table td:nth-child(6)::before { content: "Periodo"; }
    .whop-plan-table td:nth-child(7)::before { content: "Caducidad"; }
    .whop-plan-table td:nth-child(8)::before { content: "Miembros activos"; }

    .whop-plan-table .empty-cell {
        display: block;
        grid-column: 1 / -1;
    }

    .whop-plan-table .empty-cell::before { display: none; }
}

.portal-main {
    width: min(1100px, calc(100% - 32px));
    margin: 0 auto;
    padding: 22px 0 52px;
}
.portal-main--onboarding { width: min(1040px, calc(100% - 36px)); }
.portal-main--onboarding { padding-top: 20px; }
.portal-main--onboarding .portal-hero {
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
    gap: 18px;
    align-items: center;
    margin-bottom: 14px;
}
.portal-main--onboarding .portal-hero h1 {
    margin: 2px 0 5px;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.02;
}
.portal-main--onboarding .portal-hero > div:first-child > p:last-child { margin-bottom: 0; }
.portal-main--onboarding .portal-security { padding: 13px 15px; }
.portal-main--onboarding .portal-security p { font-size: 14px; line-height: 1.45; }
.portal-main--onboarding > .portal-client-layout .notice { margin-bottom: 12px; }
.portal-hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: end;
}
.portal-hero h1 { margin: 4px 0 7px; font-size: clamp(2rem, 4vw, 3.35rem); line-height: 1.04; }
.portal-security {
    padding: 18px;
    border: 1px solid rgba(99, 230, 190, .22);
    border-radius: 14px;
    background: rgba(12, 31, 34, .68);
}
.portal-security p { margin-bottom: 0; color: var(--muted); }
.portal-overview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 14px 0;
}
.portal-overview article {
    display: grid;
    gap: 4px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(7, 13, 20, .72);
}
.portal-overview strong { font-size: 1.7rem; color: #dce9ff; }
.portal-overview span { color: var(--muted); }
.portal-progress {
    display: grid;
    gap: 10px;
    margin: 0 0 18px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(7, 13, 20, .72);
}
.portal-progress > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #dce9ff;
}
.portal-progress-track {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(111, 139, 181, .18);
}
.portal-progress-track > span {
    display: block;
    min-width: 8px;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #4b91ff, #63e6be);
}
.portal-client-layout {
    display: grid;
    grid-template-columns: 242px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}
.portal-client-layout--onboarding { grid-template-columns: minmax(0, 1fr); }
.portal-client-content { min-width: 0; }
.portal-onboarding-shell { width: 100%; }
.portal-client-sidebar {
    position: sticky;
    top: 18px;
    display: grid;
    gap: 8px;
    padding: 18px 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(8, 16, 27, .96);
}
.portal-client-sidebar > strong { margin-bottom: 7px; font-size: 1.05rem; }
.portal-client-sidebar nav { display: grid; gap: 7px; }
.portal-client-sidebar nav a {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    min-height: 50px;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #b9cbe2;
    text-decoration: none;
    transition: transform .22s ease, border-color .22s ease, background .22s ease,
        color .22s ease, box-shadow .22s ease;
}
.portal-client-sidebar nav a::after { display: none; content: none; }
.portal-nav-icon {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    border: 1px solid rgba(111, 174, 255, .2);
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(49, 112, 190, .18), rgba(14, 39, 70, .34));
    box-shadow: inset 0 0 14px rgba(74, 151, 255, .08);
    font-size: .95rem;
    line-height: 1;
    filter: grayscale(.15);
    transition: transform .22s ease, filter .22s ease, border-color .22s ease,
        box-shadow .22s ease;
}
.portal-nav-label { grid-column: 2; min-width: 0; line-height: 1.2; }
.portal-onboarding-wizard {
    display: grid;
    gap: 22px;
    margin: 22px 0;
    padding: 26px;
    border: 1px solid rgba(67, 118, 185, .45);
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(12, 27, 47, .96), rgba(6, 12, 21, .96));
}
.portal-main--onboarding .portal-onboarding-wizard {
    gap: 14px;
    margin: 16px 0 0;
    padding: 18px;
}
.portal-main--onboarding .portal-onboarding-wizard-heading p:last-child { display: none; }
.portal-main--onboarding .portal-onboarding-rail { gap: 9px; }
.portal-main--onboarding .portal-onboarding-stage {
    min-height: 66px;
    padding: 11px;
    grid-template-columns: 36px minmax(0, 1fr);
}
.portal-main--onboarding .portal-onboarding-stage > span { width: 36px; height: 36px; }
.portal-onboarding-wizard-heading {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
}
.portal-onboarding-wizard-heading h2 { margin: 5px 0 7px; }
.portal-onboarding-wizard-heading p:last-child { margin: 0; color: var(--muted); }
.portal-onboarding-wizard-heading > strong {
    flex: 0 0 auto;
    padding: 9px 13px;
    border-radius: 999px;
    background: rgba(75, 145, 255, .16);
    color: #a9cbff;
}
.portal-onboarding-rail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
}
.portal-onboarding-stage {
    position: relative;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-height: 84px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: rgba(6, 13, 23, .78);
    color: #9db0ca;
}
.portal-onboarding-stage > span {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 50%;
    background: rgba(75, 145, 255, .13);
    color: #8eb5ef;
    font-weight: 900;
}
.portal-onboarding-stage--completed {
    border-color: rgba(99, 230, 190, .34);
    color: #b9dbcF;
}
.portal-onboarding-stage--completed > span {
    background: rgba(23, 129, 96, .3);
    color: #63e6be;
}
.portal-onboarding-stage--current {
    border-color: rgba(61, 220, 255, .94);
    background: linear-gradient(135deg, rgba(25, 92, 151, .4), rgba(8, 18, 31, .92));
    color: #fff;
    box-shadow: 0 0 0 1px rgba(61, 220, 255, .2), 0 0 30px rgba(35, 196, 255, .3);
    animation: portalCurrentPulse 2.2s ease-in-out infinite;
}
.portal-onboarding-stage--current > span {
    background: #22b7e5;
    color: #fff;
    box-shadow: 0 0 22px rgba(34, 183, 229, .55);
}
.portal-onboarding-stage--waiting { opacity: .52; }
.portal-current-action {
    border-color: rgba(61, 220, 255, .74);
    box-shadow: 0 0 0 1px rgba(61, 220, 255, .12);
}
.portal-single-action-form { width: 100%; }
.portal-current-action .portal-single-action-form button,
.portal-current-action .portal-single-action-link {
    display: flex;
    width: 100%;
    min-height: 58px;
    align-items: center;
    justify-content: center;
    text-align: center;
    animation: portalActionPulse 1.55s ease-in-out infinite;
}
.portal-single-action-resource { grid-template-columns: minmax(0, 1fr); }
.portal-client-sidebar nav a .portal-nav-index {
    display: none;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 50%;
    background: rgba(75, 145, 255, .15);
    color: #78a9ff;
    font-size: .75rem;
    font-weight: 900;
}
.portal-client-sidebar nav a:hover,
.portal-client-sidebar nav a:focus-visible,
.portal-client-sidebar nav a.is-primary {
    border-color: rgba(61, 220, 255, .55);
    background: rgba(29, 91, 153, .22);
    color: #fff;
}
.portal-client-sidebar nav a:hover,
.portal-client-sidebar nav a:focus-visible { transform: translateX(5px); }
.portal-client-sidebar nav a:hover::after,
.portal-client-sidebar nav a:focus-visible::after,
.portal-client-sidebar nav a.is-primary::after {
    transform: scale(1.12) rotate(-3deg);
    border-color: rgba(87, 224, 255, .7);
    box-shadow: 0 0 20px rgba(35, 196, 255, .36), inset 0 0 16px rgba(74, 151, 255, .18);
    filter: grayscale(0) saturate(1.2);
}
.portal-client-sidebar nav a:hover .portal-nav-icon,
.portal-client-sidebar nav a:focus-visible .portal-nav-icon,
.portal-client-sidebar nav a.is-primary .portal-nav-icon {
    transform: scale(1.12) rotate(-3deg);
    border-color: rgba(87, 224, 255, .7);
    box-shadow: 0 0 20px rgba(35, 196, 255, .36), inset 0 0 16px rgba(74, 151, 255, .18);
    filter: grayscale(0) saturate(1.2);
}
.portal-ready-summary {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 15px;
    align-items: center;
    padding: 18px 20px;
}
.portal-ready-summary h2 { margin: 2px 0 3px; font-size: 1.25rem; }
.portal-ready-summary p { margin: 0; }
.portal-ready-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 1px solid rgba(99, 230, 190, .58);
    border-radius: 15px;
    background: rgba(23, 129, 96, .24);
    color: #63e6be;
    font-size: 1.45rem;
    box-shadow: 0 0 22px rgba(99, 230, 190, .16);
}
.portal-tabs-ready .portal-tab-section[hidden] { display: none !important; }
.portal-tabs-ready .portal-tab-section.is-active {
    animation: portalSectionReveal .28s ease-out both;
}
.portal-client-sidebar nav a[data-portal-section],
.portal-client-sidebar nav a.portal-support-link {
    animation: none;
}
.portal-client-sidebar nav a[data-portal-section].is-primary {
    animation: none;
    border-color: rgba(99, 230, 190, .92);
    background: linear-gradient(135deg, rgba(23, 129, 96, .52), rgba(7, 43, 36, .94));
    color: #effff9;
    box-shadow: 0 0 0 1px rgba(99, 230, 190, .25), 0 0 28px rgba(57, 211, 158, .38);
}
.portal-client-sidebar nav a.is-guided:not(.is-primary) {
    border-color: rgba(61, 220, 255, .96);
    background: linear-gradient(135deg, rgba(29, 91, 153, .58), rgba(8, 29, 49, .94));
    color: #fff;
    box-shadow: 0 0 0 1px rgba(61, 220, 255, .28), 0 0 30px rgba(35, 196, 255, .52);
}
.portal-client-sidebar nav a.is-guided:not(.is-primary) .portal-nav-icon {
    transform: scale(1.13);
    border-color: rgba(87, 224, 255, .82);
    box-shadow: 0 0 22px rgba(35, 196, 255, .48), inset 0 0 16px rgba(74, 151, 255, .2);
}
.portal-client-sidebar nav a.is-primary .portal-nav-icon {
    border-color: rgba(99, 230, 190, .88);
    background: linear-gradient(145deg, rgba(31, 159, 116, .42), rgba(8, 67, 53, .62));
    box-shadow: 0 0 23px rgba(57, 211, 158, .46), inset 0 0 16px rgba(99, 230, 190, .18);
}
@keyframes portalSectionReveal {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.portal-onboarding-alert {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin: 0 0 18px;
    padding: 18px;
    border: 2px solid rgba(255, 83, 105, .72);
    border-radius: 15px;
    background: rgba(93, 13, 29, .28);
    box-shadow: 0 0 24px rgba(255, 54, 88, .16);
}
.portal-main--onboarding .portal-onboarding-alert {
    margin-bottom: 14px;
    padding: 12px 15px;
}
.portal-main--onboarding .portal-onboarding-alert p { margin-top: 2px; }
.portal-onboarding-alert p { margin: 5px 0 0; color: #f2bdc5; }
.portal-onboarding-alert .button-link { flex: 0 0 auto; }
.portal-section-heading,
.portal-purchase,
.portal-resource,
.portal-discord {
    display: flex;
    justify-content: space-between;
    gap: 22px;
    align-items: center;
}
.portal-section-heading > p { max-width: 520px; color: var(--muted); }
.portal-purchases,
.portal-resources,
.portal-steps { display: grid; gap: 12px; }
.portal-purchase,
.portal-resource,
.portal-step {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(7, 13, 20, .55);
}
.portal-purchase > div:last-child,
.portal-resource-action { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.portal-current-action#indicadores {
    display: grid;
    justify-items: center;
    padding: clamp(22px, 4vw, 34px);
    border-color: rgba(61, 220, 255, .78);
    text-align: center;
    box-shadow: 0 0 28px rgba(35, 196, 255, .16);
}
.portal-main--onboarding .portal-current-action#indicadores { padding: 18px 24px; }
.portal-main--onboarding .portal-current-action#indicadores .portal-single-action-resource {
    margin-top: 10px;
}
.portal-main--onboarding .portal-current-action#indicadores .portal-resource-group {
    padding: 16px 20px;
}
.portal-main--onboarding .portal-resource--indicators {
    gap: 12px;
    padding: 18px 22px;
}
.portal-current-action#indicadores .portal-section-heading {
    display: grid;
    width: 100%;
    justify-content: center;
    justify-items: center;
    gap: 8px;
    text-align: center;
}
.portal-current-action#indicadores .portal-section-heading > p {
    max-width: 680px;
    margin: 0 auto;
}
.portal-current-action#indicadores .portal-single-action-resource {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 780px);
    justify-content: center;
    margin-top: 18px;
}
.portal-current-action#indicadores .portal-resource-group {
    width: 100%;
    padding: clamp(20px, 3vw, 30px);
    text-align: center;
}
.portal-current-action#indicadores .portal-resource-group > div:first-child {
    display: grid;
    justify-content: center;
    justify-items: center;
    gap: 3px;
}
.portal-current-action#indicadores .portal-resource-group > div:first-child span {
    color: #b8d9f2;
    font-weight: 750;
}
.portal-resource--indicators {
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    padding: clamp(24px, 5vw, 38px);
    border-color: rgba(61, 220, 255, .48);
    background: radial-gradient(circle at 50% 0, rgba(30, 145, 219, .2), rgba(7, 13, 20, .72) 62%);
    text-align: center;
}
.portal-resource--indicators > div:first-child { width: 100%; }
.portal-resource--indicators .muted {
    max-width: 560px;
    margin: 8px auto 0;
    color: #c6d8eb;
    font-size: 16px;
}
.portal-resource--indicators .portal-resource-action {
    width: 100%;
    justify-content: center;
    flex-direction: column;
    text-align: center;
}
.portal-resource--indicators .portal-resource-action > * { margin-inline: auto; }
.portal-resource--indicators .portal-resource-action .badge { align-self: center; }
.portal-resource--indicators .portal-resource-action .muted {
    width: 100%;
    margin-block: 0;
    text-align: center;
}
.portal-tab-section#indicadores .portal-section-heading {
    display: grid;
    justify-items: center;
    gap: 8px;
    text-align: center;
}
.portal-tab-section#indicadores .portal-section-heading > p {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}
.portal-tab-section#indicadores .portal-resources {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
}
.portal-tab-section#indicadores .portal-resource-group {
    width: 100%;
    max-width: 920px;
    margin-inline: auto;
    text-align: center;
}
.portal-tab-section#indicadores .portal-resource-group > div:first-child {
    display: grid;
    justify-items: center;
    justify-content: center;
    gap: 4px;
}
.portal-indicators-action { width: 100%; max-width: none; }
.portal-indicators-action button {
    width: 100%;
    min-height: 68px;
    padding-inline: 20px;
    border: 2px solid #65e5ff;
    background: linear-gradient(135deg, #2879ed, #16afd3);
    box-shadow: 0 0 16px rgba(61, 220, 255, .5), 0 12px 28px rgba(0, 105, 210, .3);
    font-size: clamp(13px, 1.35vw, 16px);
    letter-spacing: .01em;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.25;
    text-align: center;
}
.portal-indicators-action button:hover,
.portal-indicators-action button:focus-visible {
    transform: translateY(-2px) scale(1.015);
    filter: brightness(1.12);
    box-shadow: 0 0 24px rgba(61, 220, 255, .8), 0 16px 34px rgba(0, 105, 210, .4);
}
.portal-purchase--inactive { border-color: rgba(255, 179, 71, .34); }
.portal-purchase p,
.portal-resource p { margin: 5px 0 0; }
.portal-resource h3 { margin: 4px 0; }
.portal-resources { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.portal-resource-group {
    min-width: 0;
    padding: 16px;
    border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line));
    border-radius: 16px;
    background: rgba(9, 17, 28, .62);
}
.portal-resource-group > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    margin-bottom: 12px;
}
.portal-resource-group > div:first-child h3 { margin: 0; }
.portal-resource-group > div:first-child span { color: var(--muted); font-size: .85rem; }
.portal-resource-group > div:last-child { display: grid; gap: 10px; }
.portal-resource-group .portal-resource { min-width: 0; }
.portal-tab-section#accesos .portal-resource-action .button-link {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border: 1px solid rgba(112, 226, 255, .88);
    box-shadow: 0 0 0 1px rgba(61, 220, 255, .18), 0 0 18px rgba(35, 196, 255, .34);
    transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
    animation: portalAccessButtonGlow 2.4s ease-in-out infinite;
}
.portal-tab-section#accesos .portal-resource-action .button-link::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: -35% auto -35% -65%;
    width: 42%;
    transform: skewX(-18deg);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .52), transparent);
    animation: portalAccessButtonSweep 3.2s ease-in-out infinite;
    pointer-events: none;
}
.portal-tab-section#accesos .portal-resource-action .button-link:hover,
.portal-tab-section#accesos .portal-resource-action .button-link:focus-visible {
    transform: translateY(-2px) scale(1.025);
    filter: brightness(1.15);
    box-shadow: 0 0 0 2px rgba(112, 226, 255, .6), 0 0 30px rgba(35, 196, 255, .72), 0 12px 28px rgba(0, 84, 210, .32);
}
.portal-tab-section#accesos .portal-resource-action .button-link:active {
    transform: translateY(0) scale(.98);
}
.portal-resource--onboarding {
    border-color: rgba(61, 220, 255, .72);
    background: linear-gradient(135deg, rgba(25, 92, 151, .28), rgba(8, 18, 31, .9));
}
.portal-step { display: grid; grid-template-columns: auto 1fr; gap: 14px; }
.portal-step p { margin: 5px 0 10px; color: var(--muted); }
.portal-step--completed { border-color: rgba(99, 230, 190, .28); opacity: .82; }
.portal-step--current {
    border-color: rgba(61, 220, 255, .92);
    background: linear-gradient(135deg, rgba(25, 92, 151, .34), rgba(8, 18, 31, .86));
    box-shadow: inset 4px 0 0 #3ddcff, 0 0 24px rgba(35, 196, 255, .2);
    animation: portalCurrentPulse 2.2s ease-in-out infinite;
}
.portal-step--waiting { opacity: .72; }
.portal-step--state-blocked {
    border-color: rgba(255, 83, 105, .72);
    background: rgba(92, 14, 27, .24);
}
.portal-step--state-pending-configuration:not(.portal-step--current) {
    border-color: rgba(255, 179, 71, .45);
}
.portal-guide > summary {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    cursor: pointer;
    list-style: none;
}
.portal-guide > summary::-webkit-details-marker { display: none; }
.portal-guide > summary strong { display: block; margin-top: 5px; font-size: 1.25rem; }
.portal-guide[open] > summary { margin-bottom: 20px; }
.portal-secondary > summary {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    cursor: pointer;
    list-style: none;
}
.portal-secondary > summary::-webkit-details-marker { display: none; }
.portal-secondary > summary strong { display: block; margin-top: 5px; }
.portal-secondary[open] > summary { margin-bottom: 18px; }
.portal-secondary[open] > summary > span:last-child { transform: rotate(45deg); }
.portal-secondary > summary > span:last-child { transition: transform .2s ease; }
.portal-empty {
    padding: 24px;
    border: 1px dashed var(--line);
    border-radius: 14px;
    color: var(--muted);
}
.portal-discord { align-items: flex-start; }
.portal-discord--attention {
    border-color: rgba(61, 220, 255, .8);
    box-shadow: 0 0 0 1px rgba(61, 220, 255, .14);
}
.portal-discord > div:last-child { width: min(100%, 620px); }
.portal-discord textarea { min-height: 96px; resize: vertical; }
.portal-footer { padding: 12px 4px; color: var(--muted); text-align: center; }

@keyframes portalCurrentPulse {
    0%, 100% { box-shadow: 0 0 0 1px rgba(66, 211, 255, .16), 0 0 18px rgba(35, 181, 255, .14); }
    50% { box-shadow: 0 0 0 2px rgba(66, 211, 255, .48), 0 0 34px rgba(35, 196, 255, .34); }
}

@keyframes portalActionPulse {
    0%, 100% {
        box-shadow: 0 0 0 1px rgba(61, 220, 255, .28), 0 0 18px rgba(35, 196, 255, .22);
        filter: brightness(1);
    }
    50% {
        box-shadow: 0 0 0 3px rgba(61, 220, 255, .58), 0 0 34px rgba(35, 196, 255, .48);
        filter: brightness(1.14);
    }
}

@keyframes portalAccessButtonGlow {
    0%, 100% { box-shadow: 0 0 0 1px rgba(61, 220, 255, .18), 0 0 15px rgba(35, 196, 255, .28); }
    50% { box-shadow: 0 0 0 2px rgba(112, 226, 255, .48), 0 0 27px rgba(35, 196, 255, .58); }
}

@keyframes portalAccessButtonSweep {
    0%, 35% { left: -65%; opacity: 0; }
    48% { opacity: 1; }
    65%, 100% { left: 135%; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .portal-step--current,
    .portal-onboarding-stage--current,
    .portal-current-action .portal-single-action-form button,
    .portal-current-action .portal-single-action-link,
    .portal-tab-section#accesos .portal-resource-action .button-link,
    .portal-tab-section#accesos .portal-resource-action .button-link::before,
    .portal-client-sidebar nav a { animation: none; }
}

@media (max-width: 980px) {
    .portal-main--onboarding .portal-hero {
        grid-template-columns: minmax(0, 1fr);
    }
    .portal-client-layout { grid-template-columns: 1fr; }
    .portal-client-sidebar {
        position: static;
        padding: 15px;
    }
    .portal-client-sidebar > strong { margin-bottom: 3px; }
    .portal-client-sidebar nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .portal-onboarding-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .portal-onboarding-alert {
        align-items: stretch;
        flex-direction: column;
    }
    .portal-onboarding-alert .button-link { width: 100%; text-align: center; }
}

@media (max-width: 560px) {
    .portal-client-sidebar nav { grid-template-columns: 1fr; }
    .portal-client-sidebar nav a { min-height: 52px; }
    .portal-onboarding-alert { padding: 15px; }
    .portal-onboarding-wizard { padding: 18px; }
    .portal-onboarding-wizard-heading { flex-direction: column; }
    .portal-onboarding-rail { grid-template-columns: 1fr; }
    .portal-main--onboarding .portal-current-action#indicadores,
    .portal-main--onboarding .portal-current-action#indicadores .portal-resource-group,
    .portal-main--onboarding .portal-resource--indicators { padding-inline: 14px; }
    .portal-indicators-action button {
        min-height: 62px;
        padding: 12px 10px;
        font-size: 13px;
    }
}

.portal-identity-center { display: grid; gap: 18px; }
.portal-audit-center { display: grid; gap: 18px; }
.portal-audit-search {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    gap: 14px;
    align-items: end;
}
.portal-audit-search label { display: grid; gap: 7px; min-width: 0; }
.portal-audit-search input { width: 100%; min-width: 0; }
.portal-audit-search > div { display: flex; gap: 10px; align-items: center; }
.portal-audit-explanation {
    margin: 0;
    padding: 14px 16px;
    border: 1px solid #294765;
    border-radius: 12px;
    background: #0d1a29;
}
.portal-audit-center td strong,
.portal-audit-center td small { display: block; }
.portal-audit-center td small { margin-top: 4px; color: var(--muted); }
.portal-audit-pagination {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 14px;
    align-items: center;
}
.portal-audit-pagination > :last-child { justify-self: end; }
@media (max-width: 760px) {
    .portal-audit-search { grid-template-columns: 1fr; }
    .portal-audit-search > div { flex-wrap: wrap; }
    .portal-audit-pagination { grid-template-columns: 1fr; text-align: center; }
    .portal-audit-pagination > * { justify-self: center !important; }
}
.portal-flow-connections {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.portal-flow-status {
    display: grid;
    gap: 8px;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-2);
}
.portal-flow-status .badge { justify-self: start; }
.portal-flow-status small { color: var(--muted); }
.portal-identity-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.portal-identity-form > * { min-width: 0; }
.portal-identity-form input:not([type="checkbox"]) { width: 100%; min-width: 0; }

@media (max-width: 900px) {
    .coverage-rule-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .coverage-proposal-flow { grid-template-columns: 1fr; }
    .coverage-proposal-flow > span { transform: rotate(90deg); justify-self: center; }
    .coverage-proposal-dates { grid-template-columns: 1fr 1fr; }
    .admin-main {
        display: block;
        padding: 24px 18px 72px;
    }
    .admin-main .admin-hero,
    .admin-main .admin-section {
        grid-column: auto;
        grid-row: auto;
    }
    .profile-access-table-wrap { overflow: visible; }
    .profile-access-table,
    .profile-access-table tbody {
        display: block;
        width: 100%;
    }
    .profile-access-table thead { display: none; }
    .profile-access-table tbody {
        display: grid;
        gap: 12px;
    }
    .profile-access-table tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        overflow: hidden;
        border: 1px solid var(--line);
        border-radius: 10px;
        background: rgba(7, 13, 20, .48);
    }
    .profile-access-table td {
        display: grid;
        grid-template-columns: minmax(110px, .7fr) minmax(0, 1.3fr);
        gap: 8px;
        padding: 9px 10px;
    }
    .profile-access-table td::before {
        color: var(--muted);
        font-size: 10px;
        font-weight: 850;
        letter-spacing: .05em;
        text-transform: uppercase;
    }
    .profile-access-table td:nth-child(1)::before { content: "Producto"; }
    .profile-access-table td:nth-child(2)::before { content: "Product ID"; }
    .profile-access-table td:nth-child(3)::before { content: "Estado"; }
    .profile-access-table td:nth-child(4) {
        grid-template-columns: minmax(0, 1fr);
    }
    .profile-access-table td:nth-child(4)::before { content: "Perfil de acceso"; }
    .profile-access-table .empty-cell { display: block; }
    .profile-access-table .empty-cell::before { display: none; }
    .topbar {
        grid-template-columns: 1fr auto;
    }
    .topbar > strong { display: none; }
    .form-grid { grid-template-columns: 1fr; }
    .catalog-toolbar { align-items: stretch; flex-direction: column; }
    .catalog-plan-grid { grid-template-columns: 1fr; }
    .inline { align-items: stretch; flex-direction: column; }
    .action-with-help { align-items: stretch; flex-direction: column; }
    .admin-hero,
    .section-intro {
        align-items: stretch;
        flex-direction: column;
    }
    .fail-closed { min-width: 0; }
    .admin-tabs {
        top: 68px;
        min-height: 0;
        width: auto;
        flex-direction: row;
        gap: 8px;
        margin-right: -18px;
        margin-bottom: 22px;
        margin-left: -18px;
        padding: 9px 18px;
        overflow-x: auto;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
        box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
        scrollbar-width: thin;
    }
    .admin-tabs::before,
    .admin-tabs::after { display: none; }
    .admin-nav-group {
        display: flex;
        flex: 0 0 auto;
        align-items: center;
        gap: 5px;
    }
    .admin-area-tab {
        width: auto;
        min-width: max-content;
        min-height: 42px;
        padding: 9px 13px;
    }
    .admin-area-links {
        display: flex;
        flex: 0 0 auto;
        gap: 4px;
        margin: 0;
        padding: 0 0 0 7px;
    }
    .admin-area-links .admin-tab { flex: 0 0 auto; }
    .admin-tab {
        width: auto;
        min-height: 42px;
        padding: 9px 13px;
        white-space: nowrap;
    }
    .rules-inner-tabs {
        display: flex;
        margin-right: -18px;
        margin-left: -18px;
        padding: 9px 18px;
        overflow-x: auto;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
        scroll-snap-type: x proximity;
        scrollbar-width: thin;
    }
    .rules-inner-tab-item {
        min-width: min(76vw, 280px);
        flex: 0 0 auto;
        scroll-snap-align: start;
    }
    .rules-inner-tab { min-width: 0; }
    .catalog-inner-tabs {
        top: 128px;
        margin-right: -18px;
        margin-left: -18px;
        padding: 9px 18px;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
        scroll-snap-type: x proximity;
    }
    .catalog-inner-tab {
        flex: 0 0 auto;
        scroll-snap-align: start;
    }
    .summary-grid { grid-template-columns: 1fr 1fr; }
    .product-filter { grid-template-columns: 1fr; }
    .product-group > summary { flex-wrap: wrap; }
    .product-group > summary::after { order: 5; }
    .whop-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .whop-actions-grid { grid-template-columns: 1fr; }
    .catalog-preparation-card { grid-template-columns: 1fr; }
    .membership-preview-actions { grid-template-columns: 1fr; }
    .overlap-filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .portal-hero,
    .portal-resources { grid-template-columns: 1fr; }
    .portal-flow-connections { grid-template-columns: 1fr; }
    .portal-section-heading,
    .portal-purchase,
    .portal-resource,
    .portal-discord { align-items: stretch; flex-direction: column; }
}

@media (max-width: 560px) {
    .coverage-rule-form,
    .coverage-proposal-dates { grid-template-columns: 1fr; }
    .coverage-config-card,
    .coverage-rules,
    .coverage-generation,
    .coverage-proposals { padding: 11px; }
    .profile-access-table td { grid-template-columns: 1fr; }
    .summary-grid { grid-template-columns: 1fr; }
    .portal-overview,
    .portal-identity-form { grid-template-columns: 1fr; }
    .portal-identity-form .span-2,
    .portal-identity-form > button { grid-column: 1; }
    .admin-tab { padding-right: 11px; padding-left: 11px; }
    .section-status { align-self: flex-start; }
    .product-group-count { width: 100%; }
    .whop-status-grid { grid-template-columns: 1fr; }
    .secret-field { align-items: stretch; flex-direction: column; }
    .overlap-filter-bar { grid-template-columns: 1fr; }
    .overlap-filter-clear { width: 100%; }
    .overlap-group > summary { flex-wrap: wrap; }
    .overlap-review { margin-left: 0; }
    .catalog-layout-group > summary { grid-template-columns: auto 1fr; }
    .catalog-layout-group > summary [data-catalog-group-count] { grid-column: 2; }
    .catalog-plan-facts { grid-template-columns: 1fr; }
    .catalog-product-card { padding: 11px; }
    .catalog-product-card > header,
    .catalog-product-header-actions,
    .catalog-plan-head,
    .catalog-product-actions,
    .catalog-plan-operations {
        align-items: stretch;
        flex-direction: column;
    }
    .catalog-product-header-actions { flex-basis: auto; }
    .catalog-product-header-actions .catalog-card-badges {
        justify-content: flex-start;
    }
    .catalog-product-collapse-indicator { align-self: flex-end; }
    .catalog-lifecycle-actions form,
    .catalog-lifecycle-actions button,
    .catalog-recovery-form {
        width: 100%;
        max-width: 100%;
    }
    .catalog-product-order-controls,
    .catalog-plan-order-controls,
    .local-order-handle {
        justify-content: flex-start;
    }
    .local-order-controls {
        align-items: stretch;
        flex-direction: column;
    }
    .preview-order-save {
        align-items: stretch;
        flex-direction: column;
    }
    .whop-plan-table tr[data-sort-row] { grid-template-columns: 1fr; }
    .portal-main { width: min(100% - 24px, 1180px); padding-top: 20px; }
    .portal-purchase > div:last-child,
    .portal-resource-action { align-items: stretch; flex-direction: column; }
    .portal-resource-action > *,
    .portal-resource-action form,
    .portal-resource-action button,
    .portal-resource-action .button-link { width: 100%; }
}

.admin-completion-center {
  border-color: rgba(86, 143, 255, 0.52);
  background:
    radial-gradient(circle at 100% 0, rgba(56, 120, 255, 0.14), transparent 42%),
    var(--surface);
}

.admin-completion-center > p {
  max-width: 78ch;
}

.admin-completion-areas,
.admin-consolidated-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.admin-completion-areas > a,
.admin-consolidated-grid > article {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(120, 154, 216, 0.28);
  border-radius: 16px;
  background: rgba(7, 14, 27, 0.48);
  color: inherit;
  text-decoration: none;
}

.admin-completion-areas > a:hover,
.admin-completion-areas > a:focus-visible {
  border-color: var(--accent);
  background: rgba(38, 93, 190, 0.16);
  outline: none;
}

.admin-completion-areas strong,
.admin-consolidated-grid strong {
  color: var(--text);
  font-size: 1.02rem;
}

.admin-completion-areas span,
.admin-consolidated-grid span {
  color: var(--text);
  overflow-wrap: anywhere;
}

.admin-completion-areas small,
.admin-consolidated-grid small,
.admin-advanced-configuration summary small {
  color: var(--muted);
  line-height: 1.5;
}

.admin-final-decisions,
.admin-advanced-configuration,
.premium-historical-plans {
  margin-top: 18px;
}

.admin-final-decisions {
  padding-top: 18px;
  border-top: 1px solid rgba(120, 154, 216, 0.24);
}

.admin-product-decisions {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(120, 154, 216, 0.24);
}

.admin-product-decisions .admin-decision-card {
  margin-top: 14px;
  max-width: 760px;
}

.admin-decision-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.admin-decision-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(237, 175, 73, 0.34);
  border-radius: 14px;
  background: rgba(44, 31, 10, 0.2);
}

.admin-decision-card header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.admin-decision-card header span {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(237, 175, 73, 0.16);
  color: #f5c96f;
  font-weight: 900;
}

.admin-decision-card dl {
  display: grid;
  grid-template-columns: minmax(90px, auto) minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
}

.admin-decision-card dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-decision-card dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.section-status--coverage {
  border-color: rgba(71, 194, 139, 0.35);
  background: rgba(29, 123, 83, 0.12);
  color: #9ce8c4;
}

.admin-final-decisions > summary,
.admin-advanced-configuration > summary,
.premium-historical-plans > summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  font-weight: 800;
}

.admin-advanced-configuration > summary span {
  display: grid;
  gap: 5px;
}

.admin-final-decisions ul,
.premium-historical-plans ul {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding-left: 22px;
}

.admin-milestones {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.admin-milestones li {
  min-width: 0;
  padding: 14px;
  border-left: 3px solid var(--accent);
  background: rgba(53, 107, 203, 0.1);
}

.admin-consolidated-panel {
  overflow: hidden;
}

#politicas .table-wrap {
  overflow: visible;
}

#politicas table {
  table-layout: fixed;
  width: 100%;
}

#politicas th,
#politicas td {
  min-width: 0;
  overflow-wrap: anywhere;
  vertical-align: top;
}

#politicas th:nth-child(1) { width: 16%; }
#politicas th:nth-child(2) { width: 21%; }
#politicas th:nth-child(3) { width: 25%; }
#politicas th:nth-child(4) { width: 17%; }
#politicas th:nth-child(5) { width: 21%; }

@media (max-width: 900px) {
  #politicas table,
  #politicas thead,
  #politicas tbody,
  #politicas tr,
  #politicas th,
  #politicas td {
    display: block;
    width: 100%;
  }

  #politicas thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  #politicas tr {
    display: grid;
    gap: 12px;
    padding: 16px;
  }

  #politicas td {
    padding: 0;
    border: 0;
  }

  #politicas td::before {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  #politicas td:nth-child(1)::before { content: "Producto"; }
  #politicas td:nth-child(2)::before { content: "Política"; }
  #politicas td:nth-child(3)::before { content: "Qué cubre"; }
  #politicas td:nth-child(4)::before { content: "Al terminar"; }
  #politicas td:nth-child(5)::before { content: "Qué falta"; }
}

@media (max-width: 980px) {
  .admin-completion-areas,
  .admin-consolidated-grid,
  .admin-milestones {
    grid-template-columns: 1fr;
  }

  .admin-decision-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .admin-completion-areas > a,
  .admin-consolidated-grid > article {
    padding: 14px;
  }

  .admin-final-decisions > summary,
  .admin-advanced-configuration > summary,
  .premium-historical-plans > summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-decision-card dl {
    grid-template-columns: 1fr;
  }
}
.master-matrix-list {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}

.master-matrix-row {
  min-width: 0;
  padding: 0;
  overflow: hidden;
}

.master-matrix-row > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  cursor: pointer;
}

.master-matrix-row > summary span:first-child {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.master-matrix-row > summary strong,
.master-matrix-row > summary small,
.master-matrix-grid dd,
.connector-card code {
  overflow-wrap: anywhere;
}

.master-matrix-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.8fr);
  gap: 1rem;
  padding: 0 1rem 1rem;
}

.master-matrix-grid .form-grid {
  width: 100%;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.master-matrix-grid .form-grid > *,
.master-matrix-grid .form-grid label {
  min-width: 0;
  max-width: 100%;
}

.master-matrix-grid .form-grid input:not([type="checkbox"]),
.master-matrix-grid .form-grid textarea,
.master-matrix-grid .form-grid select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.master-matrix-grid .form-grid .span-2,
.master-matrix-grid .form-grid > button {
  grid-column: 1 / -1;
}

.master-matrix-grid .form-grid label.check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.master-matrix-grid .form-grid label.check input {
  flex: 0 0 auto;
  width: auto;
  margin-top: 0.2rem;
}

.master-matrix-grid .form-grid > button {
  width: min(100%, 22rem);
  justify-self: start;
  white-space: normal;
}

.connector-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.connector-card {
  min-width: 0;
  overflow-wrap: anywhere;
}

.connector-card .section-heading {
  align-items: flex-start;
  flex-wrap: wrap;
}

.connector-card .form-grid {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

.connector-card .form-grid > *,
.connector-card .form-grid label,
.connector-card .secret-field {
  min-width: 0;
}

.connector-card .form-grid > button {
  width: 100%;
}

.connector-card label.check {
  align-items: flex-start;
  grid-auto-flow: unset;
  white-space: normal;
}

.connector-card label.check input {
  flex: 0 0 auto;
  margin-top: 0.15rem;
}

.connector-card .secret-field {
  align-items: stretch;
  flex-wrap: wrap;
}

.connector-card .secret-field input {
  width: auto;
  flex: 1 1 16rem;
}

.connector-card .secret-field button {
  flex: 0 1 auto;
}

.connector-test {
  margin-top: 0.75rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.connector-test label.check {
  flex: 1 1 18rem;
}

.connector-test p {
  flex: 1 1 18rem;
  margin: 0;
}

.connector-test button {
  flex: 0 1 auto;
}

.connector-observation {
  min-width: 0;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: rgba(7, 13, 20, .45);
}

.connector-observation > summary {
  color: var(--text);
  font-weight: 850;
  cursor: pointer;
}

.connector-observation[open] > summary {
  margin-bottom: 0.75rem;
}

.connector-observation code,
.connector-observation li,
.connector-observation p {
  overflow-wrap: anywhere;
}

.connector-observation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.connector-observation-grid > section {
  min-width: 0;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: var(--panel-2);
}

.connector-observation-grid h4 {
  margin: 0 0 0.5rem;
}

.connector-observation-grid ul {
  max-height: 20rem;
  margin: 0;
  padding-left: 1.25rem;
  overflow: auto;
}

.connector-observation-grid li + li {
  margin-top: 0.55rem;
}

.master-history-list {
  display: grid;
  gap: 0.65rem;
}

.master-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: color-mix(in srgb, var(--panel) 86%, transparent);
}

.master-history-row > div {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.master-history-row code,
.master-deeptrade-grid code {
  overflow-wrap: anywhere;
}

.master-deeptrade-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.master-deeptrade-grid > div {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
}

@media (max-width: 1120px) {
  .connector-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  .master-matrix-grid .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .master-matrix-grid .form-grid > button {
    width: 100%;
  }

  .master-matrix-grid,
  .master-deeptrade-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .master-history-row {
    grid-template-columns: minmax(0, 1fr);
    align-items: flex-start;
  }

  .master-matrix-row > summary {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 700px) {
  .connector-observation-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .connector-card .secret-field input {
    width: 100%;
    flex: 0 0 auto;
  }

  .connector-card .secret-field button,
  .connector-test button {
    width: 100%;
  }
}

.rule-draft-editor {
  min-width: min(34rem, 78vw);
}

.rule-draft-editor > summary {
  cursor: pointer;
  font-weight: 750;
}

.rule-draft-editor[open] > summary {
  margin-bottom: 0.75rem;
}

.draft-scope,
.draft-review-step {
  margin: 0.75rem 0;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: color-mix(in srgb, var(--panel-2) 88%, transparent);
  overflow-wrap: anywhere;
}

.rule-draft-form,
.destination-draft-form,
.draft-review-form {
  min-width: 0;
}

.rule-draft-form label,
.destination-draft-form label,
.draft-review-form label {
  min-width: 0;
}

.rule-draft-form input,
.rule-draft-form select,
.destination-draft-form input {
  width: 100%;
  min-width: 0;
}

.draft-review-form {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.65rem;
}

.draft-review-form .check {
  align-items: flex-start;
  white-space: normal;
}

.draft-review-step h4 {
  margin: 0 0 0.45rem;
}

@media (max-width: 700px) {
  .rule-draft-editor {
    min-width: min(28rem, 82vw);
  }
}

.destination-mapping-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem;
}

.destination-review-center {
  display: grid;
  gap: 1rem;
  margin: 1rem 0;
}

.destination-review-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(16rem, 0.75fr);
  gap: 1rem;
}

.destination-review-summary > section,
.destination-review-toolbar,
.destination-batch-review {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: color-mix(in srgb, var(--panel-2) 92%, transparent);
}

.destination-review-summary h3,
.destination-review-summary p {
  overflow-wrap: anywhere;
}

.destination-review-summary h3 {
  margin-top: 0;
}

.saved-reference-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 0.75rem;
}

.saved-reference-group {
  min-width: 0;
  padding: 0.8rem;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--line));
  border-radius: 0.7rem;
  background: rgba(2, 6, 23, 0.3);
}

.saved-reference-group > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.saved-reference-group p {
  margin-bottom: 0;
}

.saved-reference-pairs {
  display: grid;
  gap: 0.35rem;
  margin: 0.6rem 0 0;
  padding-left: 1.15rem;
}

.saved-reference-pairs li {
  min-width: 0;
  overflow-wrap: anywhere;
}

.missing-reference-summary {
  border-color: rgba(245, 158, 11, 0.42) !important;
}

.missing-reference-summary ul {
  margin-bottom: 0;
  padding-left: 1.2rem;
}

.destination-review-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(12rem, 1fr)) minmax(14rem, auto);
  align-items: end;
  gap: 0.8rem;
}

.destination-review-toolbar label {
  display: grid;
  min-width: 0;
  gap: 0.35rem;
  font-weight: 700;
}

.destination-review-toolbar select {
  width: 100%;
  min-width: 0;
}

.destination-filter-status {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.destination-batch-review {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) minmax(16rem, 1.2fr) auto;
  align-items: center;
  gap: 1rem;
  border-color: rgba(76, 145, 255, 0.55);
}

.destination-batch-review > div,
.destination-batch-review p,
.destination-batch-review .check {
  min-width: 0;
  overflow-wrap: anywhere;
}

.destination-batch-review p {
  margin: 0.35rem 0 0;
}

.destination-batch-review .check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  white-space: normal;
}

.destination-batch-review .check input {
  flex: 0 0 auto;
  width: auto;
  margin-top: 0.2rem;
}

.destination-mapping-card[hidden],
.destination-product-group[hidden],
.discord-role-card[hidden] {
  display: none !important;
}

.discord-role-catalog {
  display: grid;
  gap: 1rem;
}

.discord-role-filters {
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) minmax(13rem, 0.7fr) auto;
  align-items: end;
  gap: 0.8rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: color-mix(in srgb, var(--panel-2) 92%, transparent);
}

.discord-role-filters label {
  display: grid;
  min-width: 0;
  gap: 0.35rem;
  font-weight: 700;
}

.discord-role-filters input,
.discord-role-filters select {
  width: 100%;
  min-width: 0;
}

.discord-role-filters p {
  margin: 0;
  color: var(--muted);
}

.discord-role-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 36rem), 1fr));
  gap: 1rem;
}

.discord-role-card {
  min-width: 0;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, #5865f2 48%, var(--line));
  border-radius: 0.9rem;
  background: linear-gradient(145deg, rgba(88, 101, 242, 0.1), var(--panel-2));
}

.discord-role-card > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 0.8rem;
}

.discord-role-card p,
.discord-role-card li {
  min-width: 0;
  overflow-wrap: anywhere;
}

.discord-role-card h3 {
  min-width: 0;
  overflow-wrap: break-word;
  word-break: normal;
}

.discord-role-card header code {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  overflow-wrap: normal;
  white-space: nowrap;
}

.discord-role-card__states,
.discord-role-card .destination-mapping-card__states {
  justify-content: flex-start;
}

.discord-role-card details,
.discord-role-create {
  margin-top: 0.8rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
}

.discord-role-card details > summary,
.discord-role-create > summary {
  cursor: pointer;
  font-weight: 750;
}

.discord-role-card details[open] > summary,
.discord-role-create[open] > summary {
  margin-bottom: 0.8rem;
}

.discord-role-card .form-grid,
.discord-role-create .form-grid {
  width: 100%;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.discord-role-card .form-grid > *,
.discord-role-create .form-grid > *,
.discord-role-card .form-grid label,
.discord-role-create .form-grid label {
  min-width: 0;
  max-width: 100%;
}

.discord-role-card .form-grid label:not(.check),
.discord-role-create .form-grid label:not(.check) {
  display: grid;
  align-content: start;
  gap: 0.4rem;
}

.discord-role-card .form-grid input:not([type="checkbox"]),
.discord-role-card .form-grid textarea,
.discord-role-card .form-grid select,
.discord-role-create .form-grid input:not([type="checkbox"]),
.discord-role-create .form-grid textarea,
.discord-role-create .form-grid select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.discord-role-card .form-grid .span-2,
.discord-role-create .form-grid .span-2,
.discord-role-card .form-grid > button,
.discord-role-create .form-grid > button {
  grid-column: 1 / -1;
}

.discord-role-card .form-grid label.check,
.discord-role-create .form-grid label.check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.discord-role-card .form-grid label.check input,
.discord-role-create .form-grid label.check input {
  flex: 0 0 auto;
  width: auto;
  margin-top: 0.2rem;
}

.discord-role-card .form-grid > button,
.discord-role-create .form-grid > button {
  justify-self: start;
  white-space: normal;
}

.danger-zone {
  border-color: rgba(239, 68, 68, 0.45) !important;
  background: rgba(127, 29, 29, 0.1);
}

button.danger {
  border-color: rgba(239, 68, 68, 0.7);
  background: rgba(185, 28, 28, 0.86);
}

.destination-mapping-card {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: color-mix(in srgb, var(--panel-2) 92%, transparent);
}

.destination-mapping-card__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.destination-mapping-card__head > div,
.destination-mapping-card__head h3,
.destination-mapping-card__head p {
  min-width: 0;
  margin-top: 0;
  overflow-wrap: anywhere;
}

.destination-mapping-card__states {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
}

.destination-mapping-card__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0.85rem 0;
}

.destination-mapping-card__facts > div {
  min-width: 0;
  padding: 0.7rem;
  border-radius: 0.65rem;
  background: rgba(2, 6, 23, 0.34);
}

.destination-mapping-card__facts dt {
  margin-bottom: 0.3rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.destination-mapping-card__facts dd,
.destination-mapping-card__facts code {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.destination-mapping-card__editor,
.destination-mapping-card__editor > details,
.destination-mapping-card__editor > form {
  min-width: 0;
  width: 100%;
}

.destination-mapping-card__editor > details {
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
}

.destination-mapping-card__editor > details > summary {
  cursor: pointer;
  font-weight: 750;
}

.destination-mapping-card__editor > details[open] > summary {
  margin-bottom: 0.8rem;
}

.destination-mapping-card .destination-draft-form,
.destination-mapping-card .discord-destination-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 0.7rem;
  min-width: 0;
  width: 100%;
}

.destination-mapping-card .destination-draft-form > *,
.destination-mapping-card .discord-destination-form > * {
  min-width: 0;
  max-width: none;
}

.destination-mapping-card .destination-draft-form input:not([type="checkbox"]),
.destination-mapping-card .discord-destination-form input:not([type="checkbox"]) {
  width: 100%;
}

.destination-mapping-card .check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  width: 100%;
  white-space: normal;
}

.destination-mapping-card .check input {
  width: auto;
  flex: 0 0 auto;
  margin-top: 0.2rem;
}

.destination-mapping-card .check span,
.destination-mapping-card .field-note {
  min-width: 0;
  overflow-wrap: anywhere;
}

.destination-mapping-card button {
  justify-self: start;
  white-space: normal;
}

@media (max-width: 760px) {
  .destination-review-summary,
  .destination-review-toolbar,
  .destination-batch-review,
  .discord-role-filters,
  .discord-role-card > header {
    grid-template-columns: minmax(0, 1fr);
  }

  .discord-role-card .form-grid,
  .discord-role-create .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .discord-role-card .form-grid > button,
  .discord-role-create .form-grid > button {
    width: 100%;
  }

  .destination-batch-review button {
    width: 100%;
  }

  .destination-mapping-list {
    padding: 0.75rem;
  }

  .destination-mapping-card__head,
  .destination-mapping-card__facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .destination-mapping-card__states {
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .destination-mapping-list,
  .destination-mapping-card {
    padding: 0.65rem;
  }

  .destination-mapping-card button {
    width: 100%;
  }
}
.dry-run-safety,
.dry-run-source > div,
.dry-run-membership > header,
.dry-run-case > summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.dry-run-safety {
    border-color: rgba(76, 145, 255, 0.55);
    background: linear-gradient(135deg, rgba(37, 88, 160, 0.16), rgba(10, 18, 29, 0.94));
}

.dry-run-sources,
.dry-run-metrics,
.dry-run-memberships {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 0.9rem;
}

.dry-run-source,
.dry-run-metric,
.dry-run-membership,
.dry-run-preserved,
.dry-run-alert,
.dry-run-pending,
.dry-run-rights {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1rem;
    background: rgba(8, 14, 23, 0.72);
}

.dry-run-source--observed { border-left: 4px solid #4dc58a; }
.dry-run-source--pending { border-left: 4px solid #d7a84b; }
.dry-run-source span,
.dry-run-source small,
.dry-run-case summary span span { display: block; color: var(--muted); }

.dry-run-metric strong { display: block; font-size: clamp(1.5rem, 3vw, 2.25rem); }
.dry-run-metric span { color: var(--muted); }
.dry-run-metric--danger { border-color: rgba(235, 99, 99, 0.55); }
.dry-run-metric--warning { border-color: rgba(215, 168, 75, 0.55); }
.dry-run-metric--success { border-color: rgba(77, 197, 138, 0.55); }

.dry-run-cases { display: grid; gap: 0.85rem; }
.dry-run-case {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    background: rgba(8, 14, 23, 0.68);
}
.dry-run-case--danger { border-left: 4px solid #eb6363; }
.dry-run-case--warning { border-left: 4px solid #d7a84b; }
.dry-run-case--info { border-left: 4px solid #4c91ff; }
.dry-run-case > summary { cursor: pointer; padding: 1rem; }
.dry-run-case-body { display: grid; gap: 1rem; padding: 0 1rem 1rem; }
.dry-run-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}
.dry-run-facts div { min-width: 0; }
.dry-run-facts dt { color: var(--muted); font-size: 0.82rem; }
.dry-run-facts dd { margin: 0.2rem 0 0; overflow-wrap: anywhere; }
.dry-run-alert { border-color: rgba(235, 99, 99, 0.55); }
.dry-run-pending { border-color: rgba(215, 168, 75, 0.55); }
.dry-run-rights ul,
.dry-run-alert ul,
.dry-run-pending ul,
.dry-run-preserved ul { margin-bottom: 0; padding-left: 1.2rem; }

.historical-product-filter { display: grid; gap: 0.4rem; max-width: 32rem; margin: 1rem 0; }
.historical-rule-review-form { display: grid; gap: 0.65rem; margin-top: 0.8rem; }
.rule-order-controls { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.7rem; }
.rule-order-controls button { width: auto; min-width: 5rem; }

@media (max-width: 620px) {
    .dry-run-safety,
    .dry-run-source > div,
    .dry-run-membership > header,
    .dry-run-case > summary { flex-direction: column; }
    .dry-run-facts { grid-template-columns: 1fr; }
    .rule-order-controls button { flex: 1 1 8rem; }
}
.overlap-preview-panel [hidden] { display: none !important; }
.dry-run-membership--historical { opacity: 0.92; border-style: dashed; }
.dry-run-history { margin-top: 1rem; }
.dry-run-history > summary { cursor: pointer; font-weight: 800; }

@media (max-width: 1100px) {
    .overlap-membership-table-wrap { overflow: visible; }
    .overlap-membership-table,
    .overlap-membership-table tbody,
    .overlap-membership-table tr,
    .overlap-membership-table td { display: block; width: 100%; }
    .overlap-membership-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
    .overlap-membership-table tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem 1rem;
        margin-bottom: 0.9rem;
        padding: 0.9rem;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: rgba(8, 14, 23, 0.62);
    }
    .overlap-membership-table td {
        min-width: 0;
        padding: 0;
        border: 0;
        overflow-wrap: anywhere;
    }
    .overlap-membership-table td::before {
        display: block;
        margin-bottom: 0.2rem;
        color: var(--muted);
        font-size: 0.72rem;
        font-weight: 800;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }
    .overlap-membership-table td:nth-child(1)::before { content: "Producto"; }
    .overlap-membership-table td:nth-child(2)::before { content: "Plan"; }
    .overlap-membership-table td:nth-child(3)::before { content: "Membresía"; }
    .overlap-membership-table td:nth-child(4)::before { content: "Estado"; }
    .overlap-membership-table td:nth-child(5)::before { content: "Alta"; }
    .overlap-membership-table td:nth-child(6)::before { content: "Periodo actual"; }
    .overlap-membership-table td:nth-child(7)::before { content: "Renovación / fin"; }
    .overlap-membership-table td:nth-child(8)::before { content: "Cancela al finalizar"; }
    .overlap-membership-table td:nth-child(9)::before { content: "Cobro pausado"; }
}

@media (max-width: 620px) {
    .overlap-membership-table tr { grid-template-columns: 1fr; }
}

.policy-central-reference-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.policy-central-reference-grid .destination-editor-card {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(8, 14, 23, 0.72);
}

.policy-central-reference-grid form,
.policy-central-reference-grid label {
    display: grid;
    min-width: 0;
    gap: 0.55rem;
}

.policy-central-reference-grid input,
.policy-central-reference-grid button {
    width: 100%;
    min-width: 0;
}

.policy-central-reference-grid p {
    overflow-wrap: anywhere;
}

/*
 * Administracion diaria v2.
 * Capa aditiva: mantiene las rutas y paneles historicos y ofrece el nuevo
 * cascaron de cinco areas con modo Simple/Avanzado sobre los mismos datos.
 */

.skip-link {
    position: fixed;
    z-index: 1000;
    top: 12px;
    left: 12px;
    max-width: calc(100vw - 24px);
    padding: 10px 14px;
    transform: translateY(calc(-100% - 24px));
    border: 2px solid #bfdbfe;
    border-radius: 10px;
    background: #0b1220;
    box-shadow: 0 10px 34px rgba(0, 0, 0, .45);
    color: #eff6ff;
    font-weight: 850;
    text-decoration: none;
}

.skip-link:focus,
.skip-link:focus-visible {
    transform: translateY(0);
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 3px;
}

.admin-workspace {
    width: 100%;
    min-width: 0;
}

.admin-workspace :where(section, article, nav, form, fieldset, table, dl) {
    min-width: 0;
}

.admin-workspace-header,
.admin-workspace-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.admin-workspace-toolbar {
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.admin-shell-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
}

.admin-shell-controls > * {
    min-width: 0;
}

.admin-primary-nav {
    display: grid;
    gap: 6px;
}

.admin-primary-nav__link {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 48px;
    padding: 10px 13px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: var(--muted);
    font-weight: 800;
    line-height: 1.25;
    text-decoration: none;
}

.admin-primary-nav__link:hover,
.admin-primary-nav__link:focus-visible {
    border-color: #2b3b52;
    background: #0c131d;
    color: var(--text);
}

.admin-primary-nav__link.is-active,
.admin-primary-nav__link[aria-current="page"] {
    border-color: rgba(79, 140, 255, .5);
    background: linear-gradient(90deg, rgba(79, 140, 255, .2), rgba(124, 92, 255, .07));
    box-shadow: inset 3px 0 var(--accent);
    color: #e2edff;
}

.admin-mode-switch {
    display: inline-grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(98px, 1fr);
    gap: 4px;
    padding: 4px;
    border: 1px solid #263448;
    border-radius: 12px;
    background: rgba(4, 8, 14, .88);
}

.admin-mode-switch [data-admin-mode-switch],
.admin-mode-switch__option {
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}

.admin-mode-switch [data-admin-mode-switch]:hover,
.admin-mode-switch__option:hover {
    background: rgba(79, 140, 255, .09);
    color: var(--text);
}

.admin-mode-switch [data-admin-mode-switch][aria-pressed="true"],
.admin-mode-switch__option[aria-pressed="true"],
.admin-mode-switch__option.is-active {
    border-color: rgba(79, 140, 255, .42);
    background: rgba(37, 99, 235, .2);
    box-shadow: 0 0 0 1px rgba(79, 140, 255, .08);
    color: #dbeafe;
}

.admin-mode-context {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--muted);
    font-size: .82rem;
}

.admin-mode-context::before {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: var(--accent);
    content: "";
}

/* Sin JS no se oculta ninguna funcion: el modo es una mejora progresiva. */
html.admin-ui-ready .admin-workspace[data-admin-mode="simple"] :is(
    [data-admin-advanced-only],
    [data-admin-visibility="advanced"]
) {
    display: none !important;
}

html.admin-ui-ready .admin-workspace[data-admin-mode="advanced"] :is(
    [data-admin-simple-only]
) {
    display: none !important;
}

.admin-dashboard {
    display: grid;
    gap: 18px;
}

.admin-dashboard-filters,
.admin-filter-chips,
.client-quick-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-dashboard-filters {
    justify-content: space-between;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: rgba(7, 13, 24, .5);
}

.admin-dashboard-filters fieldset,
.client-quick-filters fieldset {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin: 0;
    padding: 0;
    border: 0;
}

.admin-dashboard-filters legend,
.client-quick-filters legend {
    width: 100%;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: .76rem;
    font-weight: 850;
}

.admin-filter-chip,
.client-quick-filter {
    min-height: 38px;
    padding: 7px 11px;
    border: 1px solid #29384d;
    border-radius: 999px;
    background: rgba(7, 13, 24, .76);
    color: #cbd5e1;
    font-size: .82rem;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
}

.admin-filter-chip:hover,
.client-quick-filter:hover,
.admin-filter-chip[aria-pressed="true"],
.client-quick-filter[aria-pressed="true"],
.admin-filter-chip.is-active,
.client-quick-filter.is-active {
    border-color: rgba(79, 140, 255, .62);
    background: rgba(37, 99, 235, .18);
    color: #e0ecff;
}

.admin-date-range,
.admin-periodicity-filter {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    min-width: min(100%, 310px);
}

.admin-date-range label,
.admin-periodicity-filter label {
    display: grid;
    gap: 5px;
    min-width: 0;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 750;
}

.admin-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
}

.admin-kpi-card {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 150px;
    align-content: space-between;
    gap: 12px;
    overflow: hidden;
    padding: 17px;
    border: 1px solid #223047;
    border-left: 4px solid var(--kpi-tone, var(--accent));
    border-radius: 15px;
    background:
        radial-gradient(circle at 100% 0, color-mix(in srgb, var(--kpi-tone, var(--accent)) 18%, transparent), transparent 62%),
        rgba(8, 14, 23, .84);
    color: inherit;
    text-decoration: none;
}

.admin-kpi-card:hover,
.admin-kpi-card:focus-visible {
    border-color: color-mix(in srgb, var(--kpi-tone, var(--accent)) 72%, #ffffff 8%);
    background-color: rgba(12, 21, 34, .96);
    transform: translateY(-1px);
}

.admin-kpi-card[aria-disabled="true"] {
    cursor: default;
    opacity: .78;
}

.admin-kpi-card[aria-disabled="true"]:hover {
    border-color: color-mix(in srgb, var(--kpi-tone, var(--line)) 38%, var(--line));
    background-color: rgba(7, 13, 23, .88);
    transform: none;
}

.admin-kpi-card--success,
.admin-kpi-card[data-tone="success"] { --kpi-tone: var(--success); }
.admin-kpi-card--warning,
.admin-kpi-card[data-tone="warning"] { --kpi-tone: var(--warning); }
.admin-kpi-card--danger,
.admin-kpi-card[data-tone="danger"] { --kpi-tone: var(--danger); }
.admin-kpi-card--neutral,
.admin-kpi-card[data-tone="neutral"] { --kpi-tone: var(--neutral); }

.admin-kpi-card__label,
.admin-kpi-card > span:first-child {
    color: #cbd5e1;
    font-size: .88rem;
    font-weight: 800;
    line-height: 1.35;
}

.admin-kpi-card__value,
.admin-kpi-card > strong {
    display: block;
    color: #f8fbff;
    font-size: clamp(1.75rem, 3vw, 2.55rem);
    font-variant-numeric: tabular-nums;
    font-weight: 900;
    letter-spacing: -.035em;
    line-height: 1;
}

.admin-kpi-card__meta,
.admin-kpi-card > small {
    color: var(--muted);
    font-size: .77rem;
    line-height: 1.4;
}

.client-operations-toolbar > .client-search-fields,
.client-operations-toolbar > .client-quick-filters,
.client-operations-toolbar > .client-search-actions {
    grid-column: 1 / -1;
}

fieldset.client-quick-filters {
    margin: 0 0 15px;
    padding: 0;
    border: 0;
}

fieldset.client-quick-filters > label,
.client-quick-filters > a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 7px 10px;
    border: 1px solid #26364d;
    border-radius: 999px;
    background: rgba(10, 17, 27, .78);
    color: #dbeafe;
    text-decoration: none;
}

fieldset.client-quick-filters input[type="radio"] {
    width: auto;
    min-height: auto;
    margin: 0;
    accent-color: var(--accent);
}

fieldset.client-quick-filters > label:has(input:checked) {
    border-color: var(--accent);
    background: rgba(37, 99, 235, .2);
}

.client-payment-reconciliation {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.client-payment-reconciliation > div {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid #26364d;
    border-radius: 12px;
    background: rgba(8, 14, 23, .72);
}

.client-payment-reconciliation span {
    overflow-wrap: anywhere;
    color: var(--muted);
}

.client-inline-detail:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 3px;
}

.client-directory-table--responsive .empty-cell::before {
    display: none;
}

.admin-automation-card__facts {
    display: grid;
    grid-template-columns: minmax(105px, .35fr) minmax(0, 1fr);
    gap: 7px 10px;
}

.admin-automation-card__facts dt,
.admin-automation-card__facts dd {
    margin: 0;
}

.admin-automation-card__facts dt {
    color: var(--muted);
    font-size: .75rem;
    font-weight: 800;
}

@media (max-width: 620px) {
    .client-payment-reconciliation,
    .admin-automation-card__facts {
        grid-template-columns: minmax(0, 1fr);
    }
}

.admin-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.admin-dashboard-card,
.admin-attention-list,
.admin-provider-health {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: rgba(7, 13, 24, .62);
}

.admin-dashboard-card > header,
.admin-attention-list > header,
.admin-provider-health > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.admin-dashboard-card > header :is(h2, h3),
.admin-attention-list > header :is(h2, h3),
.admin-provider-health > header :is(h2, h3) {
    margin: 0;
}

.admin-chart-placeholder {
    display: grid;
    min-height: 210px;
    place-items: center;
    padding: 18px;
    border: 1px dashed #33445c;
    border-radius: 12px;
    background: rgba(2, 6, 15, .42);
    color: var(--muted);
    text-align: center;
}

.admin-attention-list .table-wrap,
.client-directory-table-wrap,
.client-access-matrix-wrap {
    border: 1px solid #1d293a;
    border-radius: 12px;
    background: rgba(4, 8, 14, .52);
}

.admin-provider-health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
    gap: 11px;
}

.admin-provider-health-item {
    display: grid;
    gap: 7px;
    min-width: 0;
    padding: 13px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--provider-tone, var(--neutral));
    border-radius: 11px;
    background: rgba(8, 14, 23, .72);
}

.admin-provider-health-item[data-health="ok"] { --provider-tone: var(--success); }
.admin-provider-health-item[data-health="attention"] { --provider-tone: var(--warning); }
.admin-provider-health-item[data-health="error"] { --provider-tone: var(--danger); }
.admin-provider-health-item[data-health="unchecked"] { --provider-tone: var(--neutral); }
.admin-provider-health-item small { color: var(--muted); }

.admin-automation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 285px), 1fr));
    gap: 14px;
}

.admin-automation-card {
    --automation-tone: var(--neutral);
    display: grid;
    min-width: 0;
    align-content: start;
    gap: 13px;
    overflow: hidden;
    padding: 17px;
    border: 1px solid #253248;
    border-top: 3px solid var(--automation-tone);
    border-radius: 14px;
    background:
        linear-gradient(155deg, color-mix(in srgb, var(--automation-tone) 8%, transparent), transparent 54%),
        rgba(7, 13, 24, .72);
}

.admin-automation-card[data-automation-state="simulation"] { --automation-tone: var(--info); }
.admin-automation-card[data-automation-state="active"] { --automation-tone: var(--success); }
.admin-automation-card[data-automation-state="paused"] { --automation-tone: var(--warning); }
.admin-automation-card[data-automation-state="error"] { --automation-tone: var(--danger); }
.admin-automation-card[data-automation-state="off"],
.admin-automation-card[data-automation-state="unavailable"] { --automation-tone: var(--neutral); }

.admin-automation-card > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 11px;
}

.admin-automation-card > header > div {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.admin-automation-card h3 {
    margin: 0;
    overflow-wrap: anywhere;
}

.admin-automation-card p {
    margin: 0;
    color: var(--muted);
}

.admin-automation-card__state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    max-width: 100%;
    padding: 5px 8px;
    border: 1px solid color-mix(in srgb, var(--automation-tone) 48%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--automation-tone) 12%, transparent);
    color: #e5edf8;
    font-size: .72rem;
    font-weight: 850;
    line-height: 1.2;
    white-space: nowrap;
}

.admin-automation-card__state::before {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: var(--automation-tone);
    content: "";
}

.admin-automation-card__facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}

.admin-automation-card__facts > div {
    min-width: 0;
    padding: 9px;
    border-radius: 9px;
    background: rgba(2, 6, 15, .42);
}

.admin-automation-card__facts dt {
    margin-bottom: 3px;
    color: var(--muted);
    font-size: .71rem;
    font-weight: 800;
}

.admin-automation-card__facts dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.admin-automation-card__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 2px;
}

.admin-automation-card__actions > * {
    min-width: 0;
}

.client-operations-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    align-items: end;
    gap: 13px;
    margin-bottom: 15px;
    padding: 15px;
    border: 1px solid rgba(79, 140, 255, .3);
    border-radius: 14px;
    background: rgba(37, 99, 235, .065);
}

.client-operations-toolbar label,
.client-global-search {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.client-global-search input {
    width: 100%;
    min-height: 46px;
}

.client-quick-filters {
    margin: 0 0 15px;
}

.client-directory-table-wrap {
    width: 100%;
    overflow: auto;
}

.client-directory-table {
    width: 100%;
    min-width: 980px;
    border-collapse: separate;
    border-spacing: 0;
}

.client-directory-table caption,
.client-access-matrix caption {
    padding: 11px 13px;
    color: var(--muted);
    font-size: .8rem;
    text-align: left;
}

.client-directory-table thead th {
    position: sticky;
    z-index: 1;
    top: 0;
    background: #0b111a;
}

.client-directory-table tbody tr:hover td,
.client-directory-table tbody tr:focus-within td {
    background: rgba(37, 99, 235, .08);
}

.client-directory-table td,
.client-directory-table th,
.client-access-matrix td,
.client-access-matrix th {
    vertical-align: top;
}

.client-identity-cell {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.client-identity-cell :is(strong, small, code) {
    overflow-wrap: anywhere;
}

.client-identity-cell small { color: var(--muted); }

.client-state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    max-width: 100%;
    padding: 5px 9px;
    border: 1px solid color-mix(in srgb, var(--state-tone, var(--neutral)) 48%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--state-tone, var(--neutral)) 12%, transparent);
    color: #e5edf8;
    font-size: .76rem;
    font-weight: 850;
    line-height: 1.25;
}

.client-state::before {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: var(--state-tone, var(--neutral));
    content: "";
}

.client-state[data-state="ok"],
.client-state--success { --state-tone: var(--success); }
.client-state[data-state="attention"],
.client-state--warning { --state-tone: var(--warning); }
.client-state[data-state="error"],
.client-state--danger { --state-tone: var(--danger); }
.client-state[data-state="unchecked"],
.client-state[data-state="unknown"],
.client-state--neutral { --state-tone: var(--neutral); }

.client-360-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(270px, .34fr);
    align-items: start;
    gap: 15px;
}

.client-360-main,
.client-360-aside {
    display: grid;
    gap: 15px;
    min-width: 0;
}

.client-360-aside {
    position: sticky;
    top: 104px;
}

.client-360-summary,
.client-360-section,
.client-action-preflight {
    min-width: 0;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(7, 13, 24, .62);
}

.client-360-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 14px;
    border-color: rgba(79, 140, 255, .34);
}

.client-360-summary__identity,
.client-360-summary__states {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.client-360-summary__states { justify-items: end; }

.client-360-overview {
    display: grid;
    gap: 16px;
    overflow: hidden;
    border-color: rgba(79, 140, 255, .38);
    background:
        radial-gradient(circle at 12% 0%, rgba(79, 140, 255, .13), transparent 35%),
        linear-gradient(145deg, rgba(8, 15, 28, .98), rgba(4, 8, 16, .96));
}

.client-journey {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.client-journey-stage {
    position: relative;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 9px;
    min-width: 0;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: rgba(3, 8, 16, .8);
}

.client-journey-stage[data-state="ok"] {
    border-color: rgba(34, 197, 94, .36);
    background: rgba(20, 83, 45, .12);
}

.client-journey-stage[data-state="attention"] {
    border-color: rgba(245, 158, 11, .4);
    background: rgba(120, 53, 15, .12);
}

.client-journey-icon {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 9px;
    color: var(--accent);
    background: rgba(79, 140, 255, .1);
    font-size: .72rem;
    font-weight: 900;
}

.client-journey-stage[data-stage="whop"] .client-journey-icon::before { content: "W"; }
.client-journey-stage[data-stage="portal"] .client-journey-icon::before { content: "P"; }
.client-journey-stage[data-stage="activecampaign"] .client-journey-icon::before { content: "AC"; }
.client-journey-stage[data-stage="teachable"] .client-journey-icon::before { content: "T"; }
.client-journey-stage[data-stage="discord"] .client-journey-icon::before { content: "D"; }

.client-journey-stage > div:last-child {
    display: grid;
    align-content: start;
    gap: 5px;
    min-width: 0;
}

.client-journey-stage strong,
.client-journey-stage small {
    overflow-wrap: anywhere;
}

.client-journey-stage small {
    color: var(--muted);
    line-height: 1.42;
}

.client-360-kpis {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 9px;
}

.client-360-kpis article {
    display: grid;
    align-content: start;
    gap: 5px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(8, 14, 24, .74);
}

.client-360-kpis strong {
    color: var(--text);
    font-size: clamp(1.12rem, 1.6vw, 1.52rem);
    line-height: 1;
}

.client-360-kpis span {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 750;
    line-height: 1.35;
}

.client-timeline--compact > li {
    display: grid;
    grid-template-columns: minmax(150px, .42fr) minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 8px 12px;
}

.client-timeline--compact span {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.client-attention-ok {
    border-left-color: var(--success) !important;
}

.client-source-freshness {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    max-width: 100%;
    color: var(--muted);
    font-size: .78rem;
}

.client-source-freshness::before {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: var(--freshness-tone, var(--neutral));
    content: "";
}

.client-source-freshness[data-freshness="current"] { --freshness-tone: var(--success); }
.client-source-freshness[data-freshness="stale"] { --freshness-tone: var(--warning); }
.client-source-freshness[data-freshness="unchecked"] { --freshness-tone: var(--neutral); }

.client-attention-reasons,
.client-timeline {
    display: grid;
    gap: 9px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.client-attention-reasons > li,
.client-timeline > li {
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--warning);
    border-radius: 10px;
    background: rgba(8, 14, 23, .72);
}

.client-timeline > li {
    border-left-color: var(--accent);
}

.client-attention-reasons small,
.client-timeline small {
    color: var(--muted);
}

.client-access-matrix-wrap {
    width: 100%;
    overflow-x: auto;
}

.client-access-matrix {
    width: 100%;
    min-width: 760px;
    border-collapse: separate;
    border-spacing: 0;
}

.client-access-matrix tr[data-access-delta="missing"] td {
    background: rgba(127, 29, 29, .1);
}

.client-access-matrix tr[data-access-delta="unchecked"] td {
    background: rgba(71, 85, 105, .08);
}

.client-action-preflight {
    border-color: rgba(96, 165, 250, .42);
    background: rgba(30, 64, 175, .09);
}

.client-action-preflight dl {
    display: grid;
    grid-template-columns: minmax(120px, .35fr) minmax(0, 1fr);
    gap: 8px 12px;
    margin: 0;
}

.client-action-preflight dt {
    color: var(--muted);
    font-size: .76rem;
    font-weight: 800;
}

.client-action-preflight dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

@media (min-width: 901px) and (max-width: 1700px) {
    .admin-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-shell-controls {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 1100px) {
    .admin-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .client-360-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .client-360-aside {
        position: static;
    }

    .client-journey {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .client-360-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .admin-workspace-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-primary-nav {
        display: flex;
        width: 100%;
        padding-bottom: 5px;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scrollbar-width: thin;
    }

    .admin-primary-nav__link {
        flex: 0 0 auto;
        min-width: 148px;
    }

    .admin-dashboard-grid,
    .client-operations-toolbar {
        grid-template-columns: minmax(0, 1fr);
    }

    .admin-dashboard-filters {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 700px) {
    .admin-kpi-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .client-journey,
    .client-360-kpis {
        grid-template-columns: minmax(0, 1fr);
    }

    .client-timeline--compact > li {
        grid-template-columns: minmax(0, 1fr);
    }

    .admin-kpi-card {
        min-height: 126px;
    }

    .client-directory-table--responsive,
    .client-directory-table--responsive tbody,
    .client-directory-table--responsive tr,
    .client-directory-table--responsive th,
    .client-directory-table--responsive td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .client-directory-table--responsive thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .client-directory-table--responsive tbody {
        display: grid;
        gap: 11px;
        padding: 10px;
    }

    .client-directory-table--responsive tr {
        overflow: hidden;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: rgba(8, 14, 23, .72);
    }

    .client-directory-table--responsive :is(th, td) {
        display: grid;
        grid-template-columns: minmax(108px, .4fr) minmax(0, 1fr);
        gap: 10px;
        padding: 9px 11px;
        border: 0;
        border-bottom: 1px solid rgba(28, 38, 52, .72);
    }

    .client-directory-table--responsive :is(th, td):last-child {
        border-bottom: 0;
    }

    .client-directory-table--responsive :is(th, td)::before {
        color: var(--muted);
        content: attr(data-label);
        font-size: .7rem;
        font-weight: 850;
        letter-spacing: .04em;
        text-transform: uppercase;
    }

    .client-360-summary {
        grid-template-columns: minmax(0, 1fr);
    }

    .client-360-summary__states {
        justify-items: start;
    }
}

@media (max-width: 560px) {
    .admin-shell-controls {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .admin-mode-switch {
        width: 100%;
    }

    .admin-dashboard-card,
    .admin-attention-list,
    .admin-provider-health,
    .client-360-summary,
    .client-360-section,
    .client-action-preflight {
        padding: 14px;
    }

    .admin-date-range,
    .admin-periodicity-filter,
    .client-action-preflight dl {
        grid-template-columns: minmax(0, 1fr);
    }

    .admin-filter-chip,
    .client-quick-filter {
        flex: 1 1 auto;
        justify-content: center;
        text-align: center;
    }

    .client-directory-table--responsive td {
        grid-template-columns: minmax(0, 1fr);
        gap: 4px;
    }

    .admin-automation-card__facts {
        grid-template-columns: minmax(0, 1fr);
    }

    .admin-automation-card__actions > * {
        flex: 1 1 auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }

    .admin-kpi-card:hover,
    .admin-kpi-card:focus-visible,
    .skip-link:focus,
    .skip-link:focus-visible {
        transform: none;
    }
}

/* Flujo simple del Portal, combinaciones y centro de alertas. */
.portal-setup-state {
    padding: 12px 14px;
    border: 1px solid rgba(251, 191, 36, .34);
    border-radius: 12px;
    background: rgba(120, 53, 15, .13);
    color: #fde68a;
}

.portal-setup-flow {
    display: grid;
    gap: 9px;
    margin: 18px 0;
    padding: 0;
    list-style: none;
}

.portal-setup-step {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px 13px;
    border: 1px solid #253247;
    border-radius: 12px;
    background: rgba(7, 13, 24, .66);
}

.portal-setup-step > span:first-child {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 50%;
    background: #172033;
    color: #fff;
    font-weight: 900;
}

.portal-setup-step--ready { border-color: rgba(74, 222, 128, .34); }
.portal-setup-step--ready > span:first-child { background: #14532d; }
.portal-setup-step p { margin: 3px 0 0; color: var(--muted); }

.portal-flow-status {
    border-left: 3px solid var(--portal-flow-tone, var(--neutral));
}
.portal-flow-status--success { --portal-flow-tone: var(--success); }
.portal-flow-status--warning { --portal-flow-tone: var(--warning); }

.client-alert-center,
.client-alert-list {
    display: grid;
    gap: 14px;
}

.client-alert-counter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    margin-top: 16px;
}

.client-alert-counter {
    display: grid;
    gap: 5px;
    min-height: 105px;
    padding: 12px;
    border: 1px solid #253247;
    border-radius: 11px;
    background: rgba(7, 13, 24, .7);
    color: #eef6ff;
    text-decoration: none;
}

a.client-alert-counter:hover,
a.client-alert-counter:focus-visible {
    border-color: var(--accent);
    color: #fff;
    text-decoration: none;
}

.client-alert-counter > span { color: #cad5e4; font-size: .76rem; font-weight: 800; }
.client-alert-counter > strong { color: #fff; font-size: 1.8rem; }
.client-alert-counter > small { margin-top: auto; color: var(--muted); }
.client-alert-counter[aria-disabled="true"] { opacity: .72; }

.client-alert-filters {
    display: grid;
    grid-template-columns: repeat(5, minmax(130px, 1fr));
    gap: 10px;
    align-items: end;
}

.client-alert-filters label { display: grid; gap: 6px; min-width: 0; }
.client-alert-filters .client-search-actions { grid-column: 1 / -1; }

.client-alert-card {
    --client-alert-tone: var(--warning);
    padding: 15px;
    border: 1px solid color-mix(in srgb, var(--client-alert-tone) 48%, #253247);
    border-left-width: 4px;
    border-radius: 13px;
    background: rgba(7, 13, 24, .84);
}

.client-alert-card--critical { --client-alert-tone: var(--danger); }
.client-alert-card--information { --client-alert-tone: var(--info); }

.client-alert-card > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.client-alert-card h3 { margin: 3px 0; color: #fff; }
.client-alert-card header p { margin: 0; color: var(--muted); }
.client-alert-priority {
    color: var(--client-alert-tone);
    font-size: .7rem;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.client-alert-facts,
.client-combination-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 14px 0;
}

.client-alert-facts > div,
.client-combination-facts > div {
    min-width: 0;
    padding: 10px;
    border: 1px solid #202c3f;
    border-radius: 9px;
    background: rgba(3, 7, 13, .55);
}

.client-alert-facts dt,
.client-combination-facts dt {
    color: var(--muted);
    font-size: .69rem;
    font-weight: 850;
    text-transform: uppercase;
}

.client-alert-facts dd,
.client-combination-facts dd {
    margin: 5px 0 0;
    overflow-wrap: anywhere;
    color: #edf4fd;
}

.client-alert-actions,
.client-combination-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.table-sort-button {
    width: auto;
    min-height: 34px;
    padding: 4px 24px 4px 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    text-transform: inherit;
    letter-spacing: inherit;
    position: relative;
}

.table-sort-button::after {
    content: "⇅";
    position: absolute;
    right: 2px;
    opacity: .55;
}

.table-sort-button[aria-sort="ascending"]::after {
    content: "↑";
    opacity: 1;
}

.table-sort-button[aria-sort="descending"]::after {
    content: "↓";
    opacity: 1;
}

.table-sort-button:hover {
    color: #fff;
}

/* Evita que la arquitectura completa aparezca antes de inicializar la navegación. */
html:not(.admin-ui-ready) .admin-main.admin-workspace {
    opacity: 0;
    visibility: hidden;
}

html.admin-ui-ready .admin-main.admin-workspace {
    opacity: 1;
    visibility: visible;
}

.client-alert-state-editor { margin-top: 12px; }
.client-alert-state-editor form {
    display: grid;
    grid-template-columns: minmax(170px, .4fr) minmax(0, 1fr) auto;
    gap: 9px;
    align-items: end;
    margin-top: 10px;
}
.client-alert-state-editor label { display: grid; gap: 5px; }

.client-combination-banner {
    --combination-tone: var(--warning);
    border-color: color-mix(in srgb, var(--combination-tone) 58%, #253247);
    border-left: 4px solid var(--combination-tone);
}
.client-combination-banner--success { --combination-tone: var(--success); }
.client-combination-banner--danger { --combination-tone: var(--danger); }
.client-combination-banner > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}
.client-combination-evidence { margin: 12px 0; }
.client-combination-evidence ul { margin-bottom: 0; }

.portal-client-preview .section-heading {
    align-items: center;
}

.portal-preview-shell {
    overflow: hidden;
    margin: 18px 0;
    border: 1px solid #2d4263;
    border-radius: 16px;
    background: linear-gradient(145deg, #0d1727, #09111e);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 4%);
}

.portal-preview-shell > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid #263650;
    background: rgb(12 23 41 / 78%);
}

.portal-preview-shell > header > div {
    display: grid;
    gap: 4px;
}

.portal-preview-shell > header small,
.portal-preview-shell > header > span {
    color: #91a9ca;
}

.portal-preview-shell > header strong {
    color: #fff;
    font-size: 1.2rem;
}

.portal-preview-resource-grid,
.portal-preview-link-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.portal-preview-resource-grid {
    padding: 18px;
}

.portal-preview-resource-grid article,
.portal-preview-link {
    padding: 16px;
    border: 1px solid #263650;
    border-radius: 12px;
    background: #0b1422;
}

.portal-preview-resource-grid strong,
.portal-preview-link strong {
    color: #fff;
}

.portal-preview-resource-grid p,
.portal-preview-link p {
    margin: 8px 0 0;
    color: #a9bad2;
}

.portal-preview-summary {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 4px 0 12px;
}

.portal-preview-summary > * {
    padding: 7px 11px;
    border: 1px solid #2d4263;
    border-radius: 999px;
    background: #0b1422;
}

.portal-preview-summary strong { color: #65e6a5; }
.portal-preview-summary span { color: #f6ca62; }

.portal-preview-link {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    align-items: start;
}

.portal-preview-link > div {
    display: grid;
    gap: 4px;
}

.portal-preview-link > p {
    grid-column: 1 / -1;
}

.portal-preview-link--ready { border-left: 3px solid var(--success); }
.portal-preview-link--missing { border-left: 3px solid var(--warning); }

.portal-public-link-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.portal-public-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    border: 1px solid #2d4263;
    border-radius: 12px;
    background: #0b1422;
    color: #fff;
    text-decoration: none;
}

.portal-public-link:hover {
    border-color: var(--accent);
    background: #101d31;
}

.portal-public-link strong {
    color: #7fb1ff;
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .client-alert-counter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .client-alert-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .client-alert-state-editor form { grid-template-columns: minmax(0, 1fr); }
    .portal-preview-resource-grid,
    .portal-preview-link-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
    .portal-setup-step { grid-template-columns: 34px minmax(0, 1fr); }
    .portal-setup-step > .badge { grid-column: 2; justify-self: start; }
    .client-alert-counter-grid,
    .client-alert-filters,
    .client-alert-facts,
    .client-combination-facts { grid-template-columns: minmax(0, 1fr); }
    .client-alert-card > header,
    .client-combination-banner > header { flex-direction: column; }
    .client-alert-actions > *,
    .client-combination-actions > * { width: 100%; justify-content: center; }
    .portal-client-preview .section-heading,
    .portal-preview-shell > header { align-items: flex-start; flex-direction: column; }
    .portal-preview-resource-grid,
    .portal-preview-link-grid,
    .portal-public-link-grid { grid-template-columns: minmax(0, 1fr); }
}

/* 20260811 portal guided preview */
.portal-preview-selector {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
    margin: 18px 0;
    padding: 16px;
    border: 1px solid #27456f;
    border-radius: 14px;
    background: #091426;
}
.portal-preview-selector label { margin: 0; }
.portal-preview-selector select { margin-top: 7px; }
.portal-all-simulations {
    display: grid;
    gap: 22px;
    margin-top: 22px;
}
.portal-all-simulations > header {
    padding: 18px 20px;
    border: 1px solid rgba(79, 140, 255, .35);
    border-radius: 16px;
    background: rgba(79, 140, 255, .08);
}
.portal-all-simulations > header h4 { margin: 4px 0 6px; }
.portal-all-simulations > header p:last-child { margin: 0; color: var(--muted); }
.portal-customer-simulation {
    display: grid;
    gap: 18px;
    margin: 18px 0 22px;
    padding: clamp(16px, 2vw, 24px);
    border: 1px solid #2f5e9f;
    border-radius: 18px;
    background: linear-gradient(145deg, #0b1729, #07101e);
}
.portal-customer-simulation > header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
}
.portal-customer-simulation h4 {
    margin: 5px 0;
    color: #f7fbff;
    font-size: clamp(1.25rem, 2vw, 1.65rem);
}
.portal-customer-simulation header p:last-child { margin: 0; color: #a9bed9; }
.portal-simulation-flow {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.portal-simulation-flow li {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 13px;
    align-items: center;
    padding: 13px;
    border: 1px solid #20344e;
    border-radius: 12px;
    background: #0b1524;
}
.portal-simulation-flow li > span {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #2f72dc;
    color: #fff;
    font-weight: 800;
}
.portal-simulation-flow strong { display: block; color: #f5f9ff; }
.portal-simulation-flow p { margin: 3px 0 0; color: #9fb4d0; }
.portal-simulation-flow em {
    color: #b9cbea;
    font-size: .8rem;
    font-style: normal;
    text-align: right;
}
.portal-simulation-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.portal-simulation-resource {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border: 1px solid #23405f;
    border-left: 3px solid #4d8eff;
    border-radius: 12px;
    background: #0c1728;
}
.portal-simulation-resource small,
.portal-simulation-resource strong,
.portal-simulation-resource div > span { display: block; }
.portal-simulation-resource small { color: #8da6c7; }
.portal-simulation-resource strong { margin: 5px 0; color: #fff; }
.portal-simulation-resource div > span { color: #bdd1ec; }
.portal-registration-preview {
    padding: 15px;
    border: 1px solid #806321;
    border-radius: 12px;
    background: #1b160c;
}
.portal-registration-preview strong { color: #ffe08a; }
.portal-registration-preview p { margin: 6px 0; color: #e6d8ad; }
.portal-registration-preview span { color: #f5c85f; font-size: .86rem; }

@media (max-width: 760px) {
    .portal-preview-selector,
    .portal-simulation-grid { grid-template-columns: 1fr; }
    .portal-preview-selector button { width: 100%; }
    .portal-customer-simulation > header { flex-direction: column; }
    .portal-simulation-flow li {
        grid-template-columns: 38px minmax(0, 1fr);
    }
    .portal-simulation-flow em {
        grid-column: 2;
        text-align: left;
    }
}

/* Client search results: visible cards and a distinct open selection. */
.client-directory-panel a.client-result-card {
    background: linear-gradient(110deg, #174fc4, #075d78);
    border: 2px solid #38bdf8;
    border-left-width: 6px;
    color: #fff;
    box-shadow: 0 4px 18px rgba(14, 165, 233, .18);
}
.client-directory-panel a.client-result-card small { color: #e0f2fe; }
.client-directory-panel a.client-result-card strong { color: #fff; }
.client-directory-panel a.client-result-card:hover {
    background: linear-gradient(110deg, #1d5adb, #086881);
    border-color: #7dd3fc;
}
.client-directory-panel a.client-result-card:focus-visible {
    outline: 3px solid #fef08a;
    outline-offset: 3px;
}
.client-directory-panel .client-result-item--open {
    border-color: #34d399;
    box-shadow: 0 0 0 2px rgba(52, 211, 153, .25);
}
.client-directory-panel .client-result-item--open > a.client-result-card {
    background: linear-gradient(110deg, #065f46, #064e3b);
    border-color: #34d399;
}
.client-directory-panel .client-result-item--open > a.client-result-card::after {
    content: "Ficha abierta · Contraer";
    color: #d1fae5;
}
