/* Benefits UNIQ Admin v3 — desktop workspace, reduced vertical stack, production member scope */

.benefits-admin-root {
    width: 100%;
    max-width: none;
    overflow: visible;
}

/* Keep the overview/list and the editor as full-width work areas instead of squeezing
   the editor into a narrow rail. */
.benefits-admin-workspace {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 18px !important;
    align-items: start;
}

.benefits-admin-list-panel,
.benefits-admin-editor {
    width: 100%;
    max-width: none;
}

.benefits-admin-list-panel {
    min-height: 220px;
}

.benefits-admin-editor {
    position: static !important;
    top: auto !important;
    overflow: visible !important;
    border-radius: 24px;
}

.benefits-admin-editor > header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 24px;
    padding: 30px 34px 26px;
}

.benefits-admin-editor > header::after {
    content: "FICHA DE CONVENIO";
    align-self: start;
    justify-self: end;
    padding: 8px 11px;
    border: 1px solid rgba(8,8,10,.12);
    border-radius: 999px;
    color: #756f6a;
    background: #f4f1ec;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .13em;
}

.benefits-admin-editor > header h2 {
    max-width: 850px;
    font-size: clamp(38px, 4vw, 58px);
    line-height: .84;
}

.benefits-admin-editor > header p {
    max-width: 880px;
    font-size: 12px;
    line-height: 1.55;
}

/* The actual editor becomes a 12-column workspace. This is the main change from v2:
   the sections are composed horizontally on desktop instead of becoming one tall column. */
.benefits-admin-form {
    display: grid !important;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px !important;
    padding: 18px !important;
    overflow: visible !important;
}

.benefits-admin-form > .validation-summary,
.benefits-admin-editor-actions {
    grid-column: 1 / -1;
}

.benefits-admin-form > .benefits-form-section {
    margin: 0;
    min-width: 0;
    height: 100%;
    padding: 22px;
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.96), rgba(249,247,243,.98));
    box-shadow: 0 12px 34px rgba(23,15,18,.035);
}

.benefits-admin-form > .benefits-form-section:nth-of-type(1) {
    grid-column: span 8;
}

.benefits-admin-form > .benefits-form-section:nth-of-type(2) {
    grid-column: span 4;
}

.benefits-admin-form > .benefits-form-section:nth-of-type(3),
.benefits-admin-form > .benefits-form-section:nth-of-type(4) {
    grid-column: span 6;
}

.benefits-form-section > header {
    min-height: 74px;
    align-content: start;
}

.benefits-form-section > header > strong {
    max-width: 720px;
    font-size: clamp(25px, 2.4vw, 34px);
    line-height: .88;
}

.benefits-form-section > header > small {
    max-width: 690px;
    font-size: 10px;
}

.benefits-form-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
}

.benefits-copy-grid textarea,
.benefits-admin-form textarea.input {
    min-height: 118px !important;
}

.benefits-admin-form .benefits-long-text {
    min-height: 148px !important;
}

/* Visibility block: image is full-width and the three choices sit as a compact control bank.
   This removes the narrow vertical logo strip visible in the previous version. */
.benefits-form-media-section .benefits-media-publish-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px;
}

.benefits-form-media-section .benefits-image-editor {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    min-width: 0;
    padding: 14px;
}

.benefits-form-media-section .benefits-image-preview {
    width: 100%;
    height: 190px;
    min-height: 190px;
}

.benefits-form-media-section .benefits-toggle-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
}

.benefits-form-media-section .benefits-toggle {
    min-height: 72px;
    padding: 12px 13px !important;
}

.benefits-form-media-section .benefits-toggle span {
    min-width: 0;
}

.benefits-admin-editor-actions {
    position: sticky;
    bottom: 12px;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 10px;
    margin-top: 2px;
    padding: 13px;
    border-radius: 16px;
    background: rgba(248,245,240,.96);
    box-shadow: 0 18px 44px rgba(18,11,14,.10);
}

.benefits-admin-editor-actions .button {
    min-height: 48px;
}

/* List rows get a little more breathing room and are easier to scan before editing. */
.benefits-admin-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.benefits-admin-row {
    grid-template-columns: 82px minmax(0, 1fr);
    align-items: center;
    min-height: 126px;
}

.benefits-admin-row-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.benefits-admin-row-actions .button {
    width: 100%;
    justify-content: center;
}

.benefits-admin-empty {
    grid-column: 1 / -1;
}

/* Production member navigation scope: keep only what is reliable before live E-Brain sync. */
.nav-role-group--member a[href="/my-workout"],
.nav-role-group--member a[href="/membership"],
.nav-role-group--member a[href="/attendance"],
.nav-role-group--member a[href="/evaluations"],
.nav-role-group--member a[href="/progress"] {
    display: none !important;
}

.member-home-command-grid--live {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

@media (max-width: 1360px) {
    .benefits-admin-list {
        grid-template-columns: minmax(0, 1fr);
    }

    .benefits-admin-form > .benefits-form-section:nth-of-type(1),
    .benefits-admin-form > .benefits-form-section:nth-of-type(2) {
        grid-column: span 6;
    }
}

@media (max-width: 1040px) {
    .benefits-admin-editor > header {
        grid-template-columns: minmax(0, 1fr);
    }

    .benefits-admin-editor > header::after {
        justify-self: start;
    }

    .benefits-admin-form > .benefits-form-section:nth-of-type(1),
    .benefits-admin-form > .benefits-form-section:nth-of-type(2),
    .benefits-admin-form > .benefits-form-section:nth-of-type(3),
    .benefits-admin-form > .benefits-form-section:nth-of-type(4) {
        grid-column: 1 / -1;
    }

    .member-home-command-grid--live {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 700px) {
    .benefits-admin-editor > header {
        padding: 24px 20px 20px;
    }

    .benefits-admin-form {
        grid-template-columns: minmax(0, 1fr);
        padding: 10px !important;
    }

    .benefits-admin-form > .benefits-form-section,
    .benefits-admin-form > .validation-summary,
    .benefits-admin-editor-actions {
        grid-column: 1 !important;
    }

    .benefits-form-grid.two,
    .benefits-copy-grid,
    .benefits-admin-list,
    .member-home-command-grid--live {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .benefits-admin-editor-actions {
        position: static;
        grid-template-columns: minmax(0, 1fr);
    }
}
