html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    overflow: hidden;
    background: #fff;
}

body.generar-pdfs-body {
    overflow: auto;
    background: #FCFCF7;
    color: #111827;
    font-family: "Satoshi", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.generar-pdfs-page {
    min-height: 100%;
    display: grid;
    place-items: center;
    padding: 48px 20px;
}

.generar-pdfs-card {
    width: min(100%, 980px);
    padding: 40px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 18px;
    box-shadow: 0 18px 48px rgba(17, 24, 39, 0.08);
}

.generar-pdfs-header {
    max-width: 760px;
    margin-bottom: 30px;
}

.generar-pdfs-header h1 {
    margin: 0 0 12px;
    color: #303947;
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.035em;
}

.generar-pdfs-header p {
    margin: 0;
    color: #6B7280;
    font-size: 1rem;
    line-height: 1.65;
}

.generar-pdfs-eyebrow {
    margin-bottom: 8px !important;
    color: #4B5563 !important;
    font-size: 0.78rem !important;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.generar-pdfs-search-method {
    margin: 0 0 22px;
    padding: 0;
    border: 0;
}

.generar-pdfs-search-method legend {
    margin-bottom: 8px;
    color: #111827;
    font-size: 0.95rem;
    font-weight: 650;
}

.generar-pdfs-segmented {
    display: inline-flex;
    padding: 4px;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    background: #F3F4F6;
}

.generar-pdfs-segmented label {
    margin: 0;
    cursor: pointer;
}

.generar-pdfs-segmented input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.generar-pdfs-segmented span {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 9px;
    color: #4B5563;
    font-size: 0.9rem;
    font-weight: 650;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.generar-pdfs-segmented input:checked + span {
    background: #FFFFFF;
    color: #111827;
    box-shadow: 0 1px 4px rgba(17, 24, 39, 0.12);
}

.generar-pdfs-segmented input:focus-visible + span {
    outline: 3px solid rgba(48, 57, 71, 0.18);
    outline-offset: 2px;
}

.generar-pdfs-search-panel {
    margin-bottom: 24px;
}

.generar-pdfs-field {
    margin-bottom: 22px;
}

.generar-pdfs-field label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #111827;
    font-size: 0.95rem;
    font-weight: 650;
}

.generar-pdfs-field .form-control,
.generar-pdfs-field .form-select {
    min-height: 48px;
    border-color: #D1D5DB;
    border-radius: 10px;
    background-color: #FFFFFF;
    color: #111827;
}

.generar-pdfs-field .form-control:focus,
.generar-pdfs-field .form-select:focus {
    border-color: #303947;
    box-shadow: 0 0 0 0.2rem rgba(48, 57, 71, 0.12);
}

.generar-pdfs-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.generar-pdfs-search-button {
    min-width: 112px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid #303947;
    border-radius: 10px;
    background: #FFFFFF;
    color: #303947;
    font-weight: 700;
}

.generar-pdfs-search-button:hover,
.generar-pdfs-search-button:focus {
    border-color: #111827;
    background: #F3F4F6;
    color: #111827;
}

.generar-pdfs-results {
    margin-top: 22px;
}

.generar-pdfs-results-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.generar-pdfs-results-header h2 {
    margin: 0;
    color: #303947;
    font-size: 1rem;
    font-weight: 700;
}

.generar-pdfs-results-header span {
    color: #6B7280;
    font-size: 0.84rem;
}

.generar-pdfs-table-wrap {
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    background: #FFFFFF;
}

.generar-pdfs-table {
    min-width: 760px;
    --bs-table-bg: transparent;
}

.generar-pdfs-table thead th {
    padding: 12px 14px;
    border-bottom-color: #E5E7EB;
    background: #F3F4F6;
    color: #4B5563;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.generar-pdfs-table tbody td {
    padding: 13px 14px;
    border-bottom-color: #E5E7EB;
    color: #111827;
    font-size: 0.9rem;
}

.generar-pdfs-table tbody tr {
    cursor: pointer;
    transition: background-color 0.12s ease;
}

.generar-pdfs-table tbody tr:hover,
.generar-pdfs-table tbody tr:focus {
    background: #F9FAFB;
    outline: none;
}

.generar-pdfs-table tbody tr.is-selected {
    background: #F3F4F6;
    box-shadow: inset 3px 0 0 #303947;
}

.generar-pdfs-table tbody tr:last-child td {
    border-bottom: 0;
}

.generar-pdfs-select-column {
    width: 96px;
    text-align: center;
}

.generar-pdfs-table .form-check-input {
    width: 1.05rem;
    height: 1.05rem;
    margin: 0;
    border-color: #9CA3AF;
    cursor: pointer;
}

.generar-pdfs-table .form-check-input:checked {
    border-color: #303947;
    background-color: #303947;
}

.generar-pdfs-divider {
    height: 1px;
    margin: 28px 0;
    background: #E5E7EB;
}

.generar-pdfs-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
}

.generar-pdfs-optional {
    padding: 2px 8px;
    border-radius: 999px;
    background: #F3F4F6;
    color: #6B7280;
    font-size: 0.72rem;
    font-weight: 600;
}

.generar-pdfs-help {
    margin: 7px 0 0;
    color: #6B7280;
    font-size: 0.84rem;
    line-height: 1.5;
}

.generar-pdfs-button {
    width: 100%;
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 6px;
    border: 1px solid #111827;
    border-radius: 10px;
    background: #111827;
    color: #FFFFFF;
    font-weight: 700;
}

.generar-pdfs-button:hover,
.generar-pdfs-button:focus {
    border-color: #303947;
    background: #303947;
    color: #FFFFFF;
}

.generar-pdfs-button:disabled,
.generar-pdfs-search-button:disabled {
    opacity: 0.72;
}

.generar-pdfs-mensaje {
    margin-bottom: 22px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 0.92rem;
    line-height: 1.45;
}

.generar-pdfs-mensaje--success {
    border-color: #BBF7D0;
    background: #F0FDF4;
    color: #166534;
}

.generar-pdfs-mensaje--info {
    border-color: #D1D5DB;
    background: #F3F4F6;
    color: #303947;
}

.generar-pdfs-mensaje--error {
    border-color: #FECACA;
    background: #FEE2E2;
    color: #B91C1C;
}

@media (max-width: 767.98px) {
    .generar-pdfs-form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

@media (max-width: 575.98px) {
    .generar-pdfs-page {
        padding: 24px 14px;
    }

    .generar-pdfs-card {
        padding: 28px 22px;
        border-radius: 14px;
    }

    .generar-pdfs-segmented {
        width: 100%;
    }

    .generar-pdfs-segmented label {
        flex: 1;
    }

    .generar-pdfs-segmented span {
        width: 100%;
        padding-inline: 10px;
    }

    .generar-pdfs-search-row {
        grid-template-columns: 1fr;
    }

    .generar-pdfs-search-button {
        width: 100%;
    }
}

/* ==========================================================
   Acceso interno y menú principal
   ========================================================== */
:root {
    --reportes-brand-dark: #303947;
    --reportes-surface-main: #FCFCF7;
    --reportes-surface-card: #FFFFFF;
    --reportes-surface-hover: #F3F4F6;
    --reportes-border: #E5E7EB;
    --reportes-text-primary: #111827;
    --reportes-text-secondary: #6B7280;
    --reportes-text-muted: #4B5563;
    --reportes-error: #B91C1C;
    --reportes-error-bg: #FEE2E2;
}

body:has(.reportes-login-page),
body:has(.reportes-shell) {
    overflow: auto;
    background: var(--reportes-surface-main);
    color: var(--reportes-text-primary);
    font-family: "Satoshi", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.btn-color-principal {
    min-height: 3.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 1rem 1.8rem;
    border: 1px solid var(--reportes-text-primary);
    border-radius: 999px;
    background: var(--reportes-text-primary);
    color: #FFFFFF;
    font-weight: 600;
}

.btn-color-principal:hover,
.btn-color-principal:focus {
    border-color: var(--reportes-brand-dark);
    background: var(--reportes-brand-dark);
    color: #FFFFFF;
}

.reportes-login-page {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    padding: 32px 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--reportes-surface-main);
}

.reportes-login-brand {
    position: absolute;
    top: 32px;
    left: 50%;
    width: 100%;
    padding: 0 1rem;
    display: flex;
    justify-content: center;
    transform: translateX(-50%);
}

.reportes-login-logo {
    display: block;
    width: 240px;
    max-width: 70vw;
    height: auto;
}

.reportes-login-container {
    width: 100%;
    max-width: 550px;
    transform: translateY(-70px);
}

.reportes-login-panel {
    width: 100%;
}

.reportes-eyebrow {
    margin: 0 0 0.75rem;
    color: var(--reportes-text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.reportes-login-title {
    margin: 0 0 0.85rem;
    color: var(--reportes-text-primary);
    font-size: clamp(2rem, 6vw, 2.4rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.reportes-login-lead {
    margin: 0 0 1.75rem;
    color: var(--reportes-text-secondary);
    font-size: 1.06rem;
    line-height: 1.6;
}

.reportes-login-page .form-control {
    min-height: 3.5rem;
    border: 1px solid #D1D5DB;
    border-radius: 0.5rem;
    background: #FFFFFF;
    color: var(--reportes-text-primary);
    box-shadow: none;
}

.reportes-login-page .form-control:focus {
    border-color: var(--reportes-text-primary);
    box-shadow: 0 0 0 0.2rem rgba(17, 24, 39, 0.08);
}

.reportes-login-page .form-control[readonly] {
    background: var(--reportes-surface-hover);
    color: var(--reportes-text-secondary);
}

.reportes-input-clean {
    padding-left: 1rem;
    padding-right: 1rem;
}

.reportes-code-input {
    font-weight: 600;
    letter-spacing: 0.08em;
}

.reportes-inline-message {
    margin: 0 0 0.65rem;
    color: var(--reportes-text-secondary);
    font-size: 0.98rem;
}

.reportes-main-btn {
    width: 100%;
}

.reportes-alert {
    padding: 0.85rem 1rem;
    border: 1px solid rgba(185, 28, 28, 0.2);
    border-radius: 0.5rem;
    background: var(--reportes-error-bg);
    color: var(--reportes-error);
    font-size: 0.94rem;
    line-height: 1.45;
}

.reportes-login-page .form-control.is-invalid {
    border-color: var(--reportes-error) !important;
    background-color: var(--reportes-error-bg) !important;
    background-image: none !important;
    box-shadow: none !important;
}

#alertPlaceholder:empty {
    display: none;
}

.reportes-shell {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--reportes-surface-main);
}

.reportes-topbar {
    min-height: 76px;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    border-bottom: 1px solid var(--reportes-border);
    background: var(--reportes-surface-card);
}

.reportes-brand-link {
    display: inline-flex;
    align-items: center;
}

.reportes-logo {
    display: block;
    width: 180px;
    height: auto;
}

.reportes-account {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.reportes-user {
    color: var(--reportes-text-secondary);
    font-size: 0.92rem;
}

.reportes-account form {
    margin: 0;
}

.reportes-logout-btn {
    min-height: 2.5rem;
    padding: 0.55rem 1rem;
    border: 1px solid var(--reportes-border);
    border-radius: 999px;
    background: transparent;
    color: var(--reportes-text-primary);
    font-size: 0.88rem;
    font-weight: 600;
}

.reportes-logout-btn:hover,
.reportes-logout-btn:focus {
    background: var(--reportes-surface-hover);
}

.reportes-menu-page {
    width: min(100%, 1120px);
    margin: 0 auto;
    padding: 64px 24px 80px;
}

.reportes-menu-heading {
    max-width: 700px;
    margin-bottom: 32px;
}

.reportes-menu-heading h1 {
    margin: 0 0 0.75rem;
    color: var(--reportes-brand-dark);
    font-size: clamp(2.2rem, 6vw, 3.2rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.reportes-menu-heading > p:last-child {
    margin: 0;
    color: var(--reportes-text-secondary);
    font-size: 1.05rem;
}

.reportes-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.reportes-menu-card {
    min-height: 156px;
    padding: 24px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    border: 1px solid var(--reportes-border);
    border-radius: 18px;
    background: var(--reportes-surface-card);
    color: var(--reportes-text-primary);
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(17, 24, 39, 0.05);
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.reportes-menu-card:hover,
.reportes-menu-card:focus-visible {
    border-color: #C9CDD3;
    color: var(--reportes-text-primary);
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(17, 24, 39, 0.09);
    outline: none;
}

.reportes-menu-icon {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: var(--reportes-surface-hover);
    color: var(--reportes-brand-dark);
}

.reportes-menu-icon svg {
    width: 27px;
    height: 27px;
}

.reportes-menu-content {
    min-width: 0;
}

.reportes-menu-content strong,
.reportes-menu-content small {
    display: block;
}

.reportes-menu-content strong {
    margin-bottom: 0.35rem;
    font-size: 1.08rem;
    font-weight: 700;
}

.reportes-menu-content small {
    color: var(--reportes-text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.reportes-menu-arrow {
    color: var(--reportes-text-muted);
    font-size: 1.3rem;
    transition: transform 0.16s ease;
}

.reportes-menu-card:hover .reportes-menu-arrow,
.reportes-menu-card:focus-visible .reportes-menu-arrow {
    transform: translateX(3px);
}

@media (max-width: 767.98px) {
    .reportes-topbar {
        padding: 0.9rem 1rem;
    }

    .reportes-logo {
        width: 150px;
    }

    .reportes-user {
        display: none;
    }

    .reportes-menu-page {
        padding: 40px 16px 60px;
    }

    .reportes-menu-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .reportes-login-page {
        align-items: flex-start;
        padding-top: 118px;
    }

    .reportes-login-brand {
        top: 24px;
    }

    .reportes-login-logo {
        width: 190px;
    }

    .reportes-login-container {
        transform: none;
    }

    .reportes-menu-card {
        min-height: 0;
        padding: 20px;
        grid-template-columns: auto minmax(0, 1fr);
    }

    .reportes-menu-arrow {
        display: none;
    }
}

@media (max-height: 720px) {
    .reportes-login-page {
        align-items: flex-start;
        padding-top: 132px;
    }

    .reportes-login-container {
        transform: none;
    }
}
