.client-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top, rgba(202, 166, 75, 0.16), transparent 32rem),
        #0a0a0a;
}

.revistas-page {
    position: relative;
    background: #050505;
}

.revistas-page::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        linear-gradient(rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.68)),
        url("/images/fondo.jpg?v=4") center / cover no-repeat;
    pointer-events: none;
    z-index: 0;
}

body.modal-open {
    overflow: hidden;
}

.client-shell {
    width: min(1180px, calc(100% - 32px));
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    min-height: 100vh;
    padding: 42px 0 70px;
}

.client-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
    padding: 46px 24px;
    border: 1px solid rgba(202, 166, 75, 0.45);
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(17, 17, 17, 0.92), rgba(0, 0, 0, 0.82));
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(3px);
}

.client-powered {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #caa64b;
    font-size: 13px;
    text-decoration: none;
}

.client-powered img {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: contain;
}

.client-kicker {
    color: #caa64b;
    font-size: clamp(13px, 2vw, 16px);
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.client-hero h1 {
    color: #f2d27a;
    font-size: clamp(32px, 6vw, 60px);
    line-height: 1.05;
}

.client-subtitle {
    max-width: 680px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 18px;
    line-height: 1.6;
}

.client-updated {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 14px;
}

.magazine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
    gap: 22px;
    margin-top: 34px;
}

.magazine-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 230px;
    padding: 24px;
    border: 1px solid rgba(202, 166, 75, 0.35);
    border-radius: 18px;
    background: rgba(17, 17, 17, 0.94);
    transition: transform 0.25s, border-color 0.25s, background 0.25s;
    backdrop-filter: blur(2px);
}

.magazine-card:hover {
    transform: translateY(-5px);
    border-color: #f2d27a;
    background: #151515;
}

.magazine-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: rgba(202, 166, 75, 0.16);
    color: #f2d27a;
    font-size: 24px;
}

.magazine-content {
    flex: 1;
}

.magazine-date {
    margin-bottom: 8px;
    color: #caa64b;
    font-size: 13px;
    font-weight: 700;
}

.magazine-card h2 {
    color: white;
    font-size: 22px;
    line-height: 1.25;
}

.magazine-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.magazine-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    background: #caa64b;
    color: #050505;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    transition: background 0.25s, transform 0.25s;
}

.magazine-button:hover {
    background: #f2d27a;
    transform: scale(1.02);
}

.magazine-button-secondary {
    background: transparent;
    border: 1px solid rgba(202, 166, 75, 0.7);
    color: #f2d27a;
}

.magazine-button-secondary:hover {
    background: rgba(202, 166, 75, 0.16);
}

.client-empty {
    max-width: 620px;
    margin: 36px auto 0;
    padding: 34px 24px;
    border: 1px dashed rgba(202, 166, 75, 0.55);
    border-radius: 18px;
    text-align: center;
    background: rgba(17, 17, 17, 0.78);
}

.client-empty i {
    color: #caa64b;
    font-size: 42px;
    margin-bottom: 16px;
}

.client-empty h2 {
    color: #f2d27a;
    margin-bottom: 10px;
}

.client-empty p {
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.5;
}

.client-footer {
    display: flex;
    justify-content: center;
    margin-top: auto;
    padding-top: 30px;
}

.client-footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 12px;
    text-decoration: none;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
    transition: color 0.25s;
}

.client-footer-brand img {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    opacity: 0.72;
    object-fit: contain;
}

.client-footer-brand:hover {
    color: rgba(242, 210, 122, 0.85);
}

.pdf-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 2000;
}

.pdf-modal[aria-hidden="false"] {
    display: flex;
}

.pdf-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(4px);
}

.pdf-modal-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(1100px, 100%);
    height: min(86vh, 900px);
    border: 1px solid rgba(202, 166, 75, 0.55);
    border-radius: 18px;
    overflow: hidden;
    background: #070707;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65);
}

.pdf-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 18px;
    background: #111;
    border-bottom: 1px solid rgba(202, 166, 75, 0.35);
}

.pdf-modal-header h2 {
    color: #f2d27a;
    font-size: 18px;
    flex: 1 1 160px;
    min-width: 0;
}

.pdf-zoom-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.pdf-zoom-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid rgba(202, 166, 75, 0.55);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: #f2d27a;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.pdf-zoom-btn-text {
    font-size: 13px;
    font-weight: 600;
    min-width: auto;
}

.pdf-zoom-label {
    min-width: 52px;
    text-align: center;
    color: #f2d27a;
    font-size: 14px;
    font-weight: 600;
}

.pdf-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(202, 166, 75, 0.55);
    border-radius: 10px;
    background: transparent;
    color: #f2d27a;
    cursor: pointer;
    font-size: 18px;
}

.pdf-modal-body {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background: #1c1c1c;
}

.pdf-modal-pages {
    height: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    padding: 12px;
}

.pdf-pages-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    min-width: min-content;
    margin: 0 auto;
}

.pdf-page-canvas {
    display: block;
    width: auto;
    max-width: none;
    height: auto;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.pdf-modal-error {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    margin: 0;
    text-align: center;
    color: #f2d27a;
    background: rgba(7, 7, 7, 0.92);
}

.pdf-modal-error[hidden] {
    display: none;
}

.pdf-modal-body.is-loading .pdf-modal-pages {
    visibility: hidden;
}

.pdf-modal-body.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 42px;
    height: 42px;
    border: 3px solid rgba(202, 166, 75, 0.25);
    border-top-color: #f2d27a;
    border-radius: 50%;
    animation: pdf-modal-spin 0.8s linear infinite;
}

@keyframes pdf-modal-spin {
    to {
        transform: rotate(360deg);
    }
}

.pdf-viewer-page {
    margin: 0;
    min-height: 100vh;
    background: #070707;
    color: #f2d27a;
}

.pdf-viewer-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 18px;
    background: #111;
    border-bottom: 1px solid rgba(202, 166, 75, 0.35);
}

.pdf-viewer-header h1 {
    margin: 0;
    font-size: clamp(16px, 4vw, 20px);
    line-height: 1.3;
    flex: 1 1 180px;
    min-width: 0;
}

.pdf-header-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    flex: 0 0 auto;
}

.pdf-mobile-controls[hidden] {
    display: none;
}

.pdf-viewer-main {
    position: relative;
    min-height: calc(100vh - 56px);
}

.pdf-viewer-pages {
    min-height: calc(100vh - 56px);
    padding: 16px 12px 32px;
}

.pdf-viewer-main.is-loading .pdf-viewer-pages {
    visibility: hidden;
}

.pdf-viewer-main.is-loading::after {
    content: "";
    position: fixed;
    top: 50%;
    left: 50%;
    width: 42px;
    height: 42px;
    margin: -21px 0 0 -21px;
    border: 3px solid rgba(202, 166, 75, 0.25);
    border-top-color: #f2d27a;
    border-radius: 50%;
    animation: pdf-modal-spin 0.8s linear infinite;
}

.pdf-native-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow: hidden;
}

.pdf-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid rgba(202, 166, 75, 0.55);
    border-radius: 10px;
    background: rgba(242, 210, 122, 0.12);
    color: #f2d27a;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.pdf-download-btn:hover {
    background: rgba(242, 210, 122, 0.2);
    color: #ffe29a;
}

.pdf-native-main {
    flex: 1;
    min-height: 0;
    background: #1c1c1c;
}

.pdf-native-frame {
    display: block;
    width: 100%;
    height: calc(100vh - 64px);
    border: 0;
    background: #1c1c1c;
}

#pdf-mobile-view {
    flex: 1;
    min-height: 0;
}

#pdf-mobile-view .pdf-viewer-pages {
    height: calc(100vh - 64px);
    min-height: 0;
}

#pdf-mobile-view.is-loading .pdf-viewer-pages {
    visibility: hidden;
}

#pdf-mobile-view.is-loading::after {
    content: "";
    position: fixed;
    top: 50%;
    left: 50%;
    width: 42px;
    height: 42px;
    margin: -21px 0 0 -21px;
    border: 3px solid rgba(202, 166, 75, 0.25);
    border-top-color: #f2d27a;
    border-radius: 50%;
    animation: pdf-modal-spin 0.8s linear infinite;
}

.admin-shell {
    max-width: 900px;
}

.admin-panel {
    align-items: stretch;
}

.admin-panel .client-powered,
.admin-panel .client-kicker,
.admin-panel h1,
.admin-panel .client-subtitle {
    align-self: center;
}

.admin-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
    max-width: 620px;
    margin: 12px auto 0;
}

.admin-button {
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.admin-button-secondary {
    background: #2a2a2a;
    color: #f2d27a;
    border: 1px solid rgba(202, 166, 75, 0.5);
}

.admin-button-secondary:hover {
    background: #3a3320;
}

.admin-alert,
.admin-results {
    width: 100%;
    margin-top: 28px;
    padding: 20px;
    border-radius: 14px;
    background: #111;
}

.admin-alert-error {
    border: 1px solid #a93f3f;
    color: #ffd2d2;
}

.admin-results {
    border: 1px solid rgba(202, 166, 75, 0.35);
}

.admin-results h2 {
    color: #f2d27a;
    margin-bottom: 14px;
}

.admin-result {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    line-height: 1.4;
}

.admin-result-ok i {
    color: #55d17a;
}

.admin-result-error i {
    color: #ff7676;
}

@media(max-width:640px) {
    .client-shell {
        width: min(100% - 24px, 1180px);
        padding: 24px 0 46px;
    }

    .client-hero {
        padding: 30px 18px;
        border-radius: 18px;
    }

    .client-powered {
        flex-direction: column;
    }

    .client-subtitle {
        font-size: 16px;
    }

    .magazine-grid {
        grid-template-columns: 1fr;
    }

    .magazine-actions {
        grid-template-columns: 1fr;
    }

    .pdf-modal {
        padding: 10px;
    }

    .pdf-modal-panel {
        height: 88vh;
        border-radius: 14px;
    }

    .admin-actions {
        grid-template-columns: 1fr;
    }
}
