body{
    background:#f4f6f9;
}

.drop-area{
    border:3px dashed #0d6efd;
    background:#ffffff;
    border-radius:18px;
    min-height:280px;
    display:flex;
    align-items:center;
    justify-content:center;
    text-align:center;
    padding:35px;
    transition:.25s;
}

.drop-area.dragover{
    background:#eaf3ff;
    border-color:#084298;
    transform:scale(1.01);
}

.drop-content{
    max-width:520px;
}

.sticky-panel{
    position:sticky;
    top:20px;
    max-height:calc(100vh - 40px);
    overflow-y:auto;
}

.galeria-vacia{
    min-height:260px;
}

.galeria{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(180px,1fr));
    gap:18px;
}

.imagen-card{
    border:1px solid #ddd;
    border-radius:14px;
    overflow:hidden;
    background:#fff;
    box-shadow:0 3px 10px rgba(0,0,0,.08);
    transition:.2s;
}

.imagen-card:hover{
    transform:translateY(-3px);
    box-shadow:0 6px 18px rgba(0,0,0,.14);
}

.imagen-preview{
    height:170px;
    background:#f8f9fa;
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
}

.imagen-preview img{
    max-width:100%;
    max-height:100%;
    object-fit:contain;
}

.imagen-info{
    padding:10px;
}

.imagen-nombre{
    font-size:13px;
    font-weight:600;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.imagen-peso{
    font-size:12px;
    color:#6c757d;
}

.imagen-acciones{
    display:flex;
    gap:5px;
    margin-top:8px;
}

.imagen-acciones button{
    flex:1;
    padding:4px 6px;
    font-size:13px;
}

.sortable-ghost{
    opacity:.35;
}

.sortable-chosen{
    transform:scale(1.04);
}

.overlay-progreso{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.55);
    z-index:9999;
    display:flex;
    align-items:center;
    justify-content:center;
}

.caja-progreso{
    width:90%;
    max-width:460px;
    background:#fff;
    border-radius:18px;
    padding:30px;
    text-align:center;
    box-shadow:0 10px 35px rgba(0,0,0,.25);
}

.resumen p{
    margin-bottom:7px;
}

@media(max-width:991px){
    .sticky-panel{
        position:static;
    }
}

@media(max-width:576px){
    .drop-area{
        min-height:220px;
        padding:25px 15px;
    }

    .galeria{
        grid-template-columns:repeat(auto-fill,minmax(140px,1fr));
    }

    .imagen-preview{
        height:135px;
    }
}

body.dark-mode{
    background:#121212;
    color:#e9ecef;
}

body.dark-mode .card{
    background:#1e1e1e;
    color:#e9ecef;
    border-color:#333;
}

body.dark-mode .card-header{
    border-color:#333;
}

body.dark-mode .drop-area{
    background:#1e1e1e;
    border-color:#0d6efd;
}

body.dark-mode .drop-area.dragover{
    background:#132238;
}

body.dark-mode .text-muted{
    color:#adb5bd !important;
}

body.dark-mode .imagen-card{
    background:#1e1e1e;
    border-color:#333;
}

body.dark-mode .imagen-preview{
    background:#2a2a2a;
}

body.dark-mode .form-control,
body.dark-mode .form-select{
    background:#2a2a2a;
    color:#fff;
    border-color:#444;
}

body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus{
    background:#2a2a2a;
    color:#fff;
}

body.dark-mode .modal-content{
    background:#1e1e1e;
    color:#e9ecef;
}

body.dark-mode .caja-progreso{
    background:#1e1e1e;
    color:#e9ecef;
}

body.dark-mode footer{
    background:#1e1e1e;
    color:#adb5bd;
}

body.dark-mode .list-group-item{
    background:#2a2a2a;
    color:#e9ecef;
    border-color:#444;
}

.imagen-preview{
    cursor:pointer;
}

#zoomImagen{
    max-height:75vh;
    object-fit:contain;
}

body.dark-mode .list-group-item{
    background:#2a2a2a;
    color:#e9ecef;
    border-color:#444;
}

/* ===========================
   Acordeón de herramientas
=========================== */

.accordion-item{
    border-radius:12px !important;
    overflow:hidden;
    margin-bottom:10px;
    border:1px solid #dee2e6;
}

.accordion-button{
    font-weight:600;
    background:#f8f9fa;
    color:#212529;
    box-shadow:none !important;
}

.accordion-button:not(.collapsed){
    background:#0d6efd;
    color:#fff;
}

.accordion-button::after{
    filter:none;
}

.accordion-button:not(.collapsed)::after{
    filter:brightness(0) invert(1);
}

.accordion-body{
    background:#fff;
}

.accordion-body h6{
    font-weight:700;
    color:#0d6efd;
    margin-bottom:10px;
}

.accordion-body hr{
    margin:18px 0;
}

/* ===========================
   Acordeón modo oscuro
=========================== */

body.dark-mode .accordion-item{
    border-color:#333;
    background:#1e1e1e;
}

body.dark-mode .accordion-button{
    background:#252525;
    color:#e9ecef;
}

body.dark-mode .accordion-button:not(.collapsed){
    background:#0d6efd;
    color:#fff;
}

body.dark-mode .accordion-body{
    background:#1e1e1e;
    color:#e9ecef;
}

body.dark-mode .accordion-body h6{
    color:#6ea8fe;
}

body.dark-mode .accordion-button::after{
    filter:brightness(0) invert(1);
}

.dashboard-card{
    border:none;
    border-radius:14px;
}

.dashboard-card h6{
    color:#6c757d;
    font-weight:600;
}

.dashboard-card h2{
    margin-top:10px;
    font-weight:700;
    color:#0d6efd;
}

body.dark-mode .dashboard-card{
    background:#1f1f1f;
    color:#fff;
}

body.dark-mode .dashboard-card h6{
    color:#adb5bd;
}

.custom-file-box{
    display:flex;
    align-items:center;
    gap:12px;
    flex-wrap:wrap;
}

.archivo-texto{
    color:#6c757d;
    font-size:14px;
}

body.dark-mode .archivo-texto{
    color:#adb5bd;
}

.custom-file-box{
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap:wrap;
}

.archivo-texto{
    font-size:14px;
    color:#6c757d;
    word-break:break-word;
}

body.dark-mode .archivo-texto{
    color:#adb5bd;
}

 .inline-block >{
    display: inline-block;
}

.ayuda-galeria{
    font-size:12px;
    color:#6c757d;
    margin-top:3px;
}

body.dark-mode .ayuda-galeria{
    color:#adb5bd;
}

.imagen-card{
    position:relative;
}

.drag-handle{
    position:absolute;
    top:8px;
    right:8px;
    width:28px;
    height:28px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:rgba(0,0,0,.65);
    color:white;
    border-radius:6px;
    cursor:grab;
    z-index:10;
    font-size:18px;
}

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

.drag-handle:hover{
    background:rgba(0,0,0,.85);
}

.imagen-preview img{
    image-rendering:auto;
    will-change:auto;
}

.preview-marca-agua{
    height:160px;
    border:1px dashed #adb5bd;
    border-radius:12px;
    background:#f8f9fa;
    position:relative;
    overflow:hidden;
}

.preview-marca-agua::before{
    content:"PDF";
    position:absolute;
    top:12px;
    left:12px;
    font-weight:700;
    color:#adb5bd;
}

.preview-marca-agua-texto{
    position:absolute;
    width:100%;
    left:0;
    text-align:center;
    transform:rotate(-35deg);
    color:rgba(0,0,0,.1);
    font-weight:700;
    white-space:nowrap;
}

body.dark-mode .preview-marca-agua{
    background:#2a2a2a;
    border-color:#444;
}

body.dark-mode .preview-marca-agua::before{
    color:#666;
}

body.dark-mode .preview-marca-agua-texto{
    color:rgba(255,255,255,.18);
}

#editarImagenPreview{
    max-height:75vh;
    object-fit:contain;
}

#editarImagenPreview{
    max-height:70vh;
    display:block;
    margin:auto;
}

.cropper-container{
    max-width:100%;
}

.editor-toolbar{
    display:flex;
    justify-content:center;
    gap:8px;
    flex-wrap:wrap;
}

.editor-toolbar .btn{
    min-width:150px;
}

@media(max-width:576px){
    .editor-toolbar .btn{
        width:100%;
    }
}

/* ===========================
   Fix definitivo modo oscuro:
   select idioma + password disabled
=========================== */

body.dark-mode .form-select{
    background-color:#2a2a2a !important;
    color:#ffffff !important;
    border-color:#666 !important;
}

body.dark-mode #selectorIdioma{
    background-color:#2a2a2a !important;
    color:#ffffff !important;
    border-color:#666 !important;
    background-repeat:no-repeat !important;
    background-position:right .75rem center !important;
    background-size:16px 12px !important;
}

body.dark-mode #passwordPDF{
    background-color:#2a2a2a !important;
    color:#ffffff !important;
    border-color:#666 !important;
    opacity:1 !important;
    -webkit-text-fill-color:#ffffff !important;
}

body.dark-mode #passwordPDF::placeholder{
    color:#d8d8d8 !important;
    opacity:1 !important;
}

body.dark-mode #passwordPDF:disabled{
    background-color:#2a2a2a !important;
    color:#d8d8d8 !important;
    border-color:#666 !important;
    opacity:1 !important;
    -webkit-text-fill-color:#d8d8d8 !important;
}

.password-group .btn{
    min-width:52px;
}

body.dark-mode .password-group .btn{
    background-color:#2a2a2a !important;
    color:#ffffff !important;
    border-color:#666 !important;
}

body.dark-mode .password-group .btn:hover{
    background-color:#3a3a3a !important;
}

input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear{
    display:none;
}

.plan-card{
    transition:transform .2s ease, box-shadow .2s ease;
}

.plan-card:hover{
    transform:translateY(-4px);
    box-shadow:0 .5rem 1rem rgba(0,0,0,.15);
}

body.dark-mode .plan-card{
    background-color:#252525;
    color:#f8f9fa;
}

body.dark-mode .plan-card .text-muted{
    color:#adb5bd !important;
}

.imagen-card {
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}

.imagen-card.imagen-procesando {
    opacity: 0.72;
    pointer-events: none;
}

.imagen-card.imagen-procesando
.imagen-preview {
    position: relative;
}

.imagen-card.imagen-procesando
.imagen-preview::after {
    content: "Procesando...";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.48);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: inherit;
}

/* ==========================================================
   ENTREGA 45.2A.1
   Base visual moderna y distribución más espaciosa
========================================================== */

:root {
    --app-max-width: 1680px;
    --app-space: 1.5rem;
    --app-radius: 18px;
    --app-border: #e4e8ef;
    --app-shadow:
        0 8px 28px rgba(24, 39, 75, 0.07);
}

/* ----------------------------------------------------------
   Contenedor general
---------------------------------------------------------- */

.app-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-body > main {
    flex: 1 0 auto;
}

.app-shell {
    width: 100%;
    max-width: var(--app-max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* ----------------------------------------------------------
   Barra superior
---------------------------------------------------------- */

.app-navbar {
    min-height: 68px;
}

.app-navbar .navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.app-navbar .navbar-brand i {
    font-size: 1.45rem;
}

.app-navbar .container-fluid {
    gap: 1.25rem;
}

/* ==========================================================
   ENTREGA 51.2
   Header responsive del Inicio
========================================================== */

.app-navbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 0.75rem;
    min-width: 0;
}

.app-navbar-actions .btn {
    flex-shrink: 0;
}

.app-navbar-actions #selectorIdioma {
    flex: 0 0 auto;
    min-width: 64px;
}

.app-navbar-user {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-navbar-version {
    flex-shrink: 0;
    white-space: nowrap;
}

/* ----------------------------------------------------------
   Dashboard compacto
---------------------------------------------------------- */

#dashboardStats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
    margin-left: 0;
    margin-right: 0;
}

#dashboardStats > div {
    width: 100%;
    max-width: none;
    padding: 0;
}

#dashboardStats .dashboard-card {
    height: 100%;
    min-height: 118px;
    border: 1px solid var(--app-border);
    box-shadow: var(--app-shadow);
    overflow: hidden;
}

#dashboardStats .dashboard-card .card-body {
    display: flex;
    min-height: 118px;
    padding: 1rem 1.15rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#dashboardStats .dashboard-card h6 {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.045em;
}

#dashboardStats .dashboard-card h2 {
    margin: 0.45rem 0 0;
    font-size: clamp(1.35rem, 2vw, 1.9rem);
    line-height: 1.1;
}

#dashboardStats .dashboard-card small {
    margin-top: 0.3rem;
}

/* ----------------------------------------------------------
   Planes
---------------------------------------------------------- */

#planes > .card {
    border: 1px solid rgba(255, 193, 7, 0.45);
    border-radius: var(--app-radius);
    overflow: hidden;
    box-shadow: var(--app-shadow);
}

#planes > .card > .card-header {
    padding: 0.85rem 1.25rem;
    font-weight: 700;
}

#planes > .card > .card-body {
    padding: 1.25rem;
}

#planes .plan-card {
    border-radius: 15px;
    box-shadow: none;
}

#planes .plan-card .card-body {
    padding: 1.15rem;
}

#planes .plan-card h2 {
    margin-bottom: 0.65rem;
}

/* ----------------------------------------------------------
   Área de trabajo
---------------------------------------------------------- */

.app-workspace {
    align-items: flex-start;
}

.app-main,
.app-sidebar {
    min-width: 0;
}

.app-card {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow) !important;
    overflow: hidden;
}

/* ----------------------------------------------------------
   Área de carga
---------------------------------------------------------- */

.drop-area {
    min-height: 340px;
    padding: 3.5rem 2rem;
    border-width: 2px;
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow);
}

.drop-content {
    max-width: 600px;
}

.drop-content > i {
    font-size: 4.2rem;
}

.drop-content h3 {
    margin-bottom: 0.75rem;
    font-size: clamp(1.45rem, 2.3vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.025em;
}

.drop-content p {
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

#btnSeleccionar {
    min-height: 48px;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    border-radius: 12px;
    font-weight: 600;
}

/* ----------------------------------------------------------
   Galería
---------------------------------------------------------- */

.galeria-card {
    margin-top: 2rem !important;
}

.galeria-card > .card-header {
    padding: 1.05rem 1.25rem;
    background: #fff;
}

.galeria-card > .card-body {
    padding: 1.35rem;
}

.galeria-vacia {
    min-height: 310px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.galeria {
    gap: 1.25rem;
}

.ayuda-galeria {
    margin-top: 0.3rem;
    line-height: 1.4;
}

/* ----------------------------------------------------------
   Panel lateral
---------------------------------------------------------- */

.sticky-panel {
    top: 1.5rem;
    max-height: calc(100vh - 3rem);
}

.herramientas-card > .card-header {
    padding: 1rem 1.2rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.herramientas-card > .card-body {
    padding: 1rem;
}

#panelHerramientas {
    display: grid;
    gap: 0.85rem;
}

#panelHerramientas .accordion-item {
    margin-bottom: 0;
    border-radius: 14px !important;
}

#panelHerramientas .accordion-button {
    min-height: 54px;
    padding: 0.9rem 1rem;
}

#panelHerramientas .accordion-body {
    padding: 1.2rem;
}

#panelHerramientas .accordion-body h6 {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0;
    margin-bottom: 0.85rem;
}

#panelHerramientas .accordion-body h6:not(:first-child) {
    margin-top: 1.75rem;
}

#panelHerramientas .form-label {
    margin-bottom: 0.45rem;
    font-size: 0.88rem;
    font-weight: 600;
}

#panelHerramientas .form-control,
#panelHerramientas .form-select {
    min-height: 42px;
    border-radius: 10px;
}

#panelHerramientas .form-check {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

#panelHerramientas hr {
    margin: 1.5rem 0;
    opacity: 0.1;
}

#panelHerramientas .btn.w-100 {
    min-height: 42px;
    border-radius: 10px;
    font-weight: 600;
}

.custom-file-box {
    padding: 0.65rem;
    border: 1px solid #e2e6ec;
    border-radius: 10px;
    background: #f8f9fb;
}

.archivo-texto {
    flex: 1;
    min-width: 0;
}

/* ----------------------------------------------------------
   Resumen de conversión
---------------------------------------------------------- */

.resumen {
    padding: 1rem;
    border: 1px solid #e4e8ef;
    border-radius: 12px;
    background: #f8f9fb;
}

.resumen p {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.55rem;
}

.resumen p:last-child {
    margin-bottom: 0;
}

/* ----------------------------------------------------------
   Modo oscuro
---------------------------------------------------------- */

body.dark-mode {
    --app-border: #343941;
    --app-shadow:
        0 8px 28px rgba(0, 0, 0, 0.24);
}

body.dark-mode .galeria-card > .card-header {
    background: #1e1e1e;
}

body.dark-mode .custom-file-box,
body.dark-mode .resumen {
    background: #252525;
    border-color: #3c4148;
}

/* ----------------------------------------------------------
   Responsive
---------------------------------------------------------- */

@media (max-width: 1199.98px) {

    #dashboardStats {
        grid-template-columns:
            repeat(4, minmax(0, 1fr));
    }

    /*
     * La quinta tarjeta corresponde al plan actual.
     * En tablet horizontal ocupa toda la segunda fila.
     */
    #dashboardStats > div:nth-child(5) {
        grid-column: 1 / -1;
    }

    .drop-area {
        min-height: 310px;
    }
}

@media (max-width: 991.98px) {

    .app-shell {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    #dashboardStats {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    #dashboardStats > div:nth-child(5) {
    grid-column: 1 / -1;
}

    .sticky-panel {
        position: static;
        max-height: none;
        overflow: visible;
    }

    .app-sidebar {
        margin-top: 0.5rem;
    }
}

@media (max-width: 767.98px) {


    #planes .card-body {
        padding: 1rem;
    }

    .drop-area {
        min-height: 260px;
        padding: 2.5rem 1.25rem;
    }
}

@media (max-width: 575.98px) {

    .app-shell {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    #dashboardStats {
        grid-template-columns: 1fr;
    }

    #dashboardStats > div:nth-child(5) {
        grid-column: auto;
    }

    #dashboardStats .dashboard-card,
    #dashboardStats .dashboard-card .card-body {
        min-height: 96px;
    }

    .drop-content > i {
        font-size: 3.25rem;
    }

    .galeria-card > .card-header {
        align-items: flex-start !important;
        gap: 0.75rem;
    }

    #panelHerramientas .accordion-body {
        padding: 1rem;
    }
}

/* ==========================================================
   ENTREGA 45.2A.2
   Planes compactos y desplegables
========================================================== */

.planes-resumen-card {
    border: 1px solid rgba(13, 110, 253, 0.16);
    border-radius: var(--app-radius, 18px);
    box-shadow: var(
        --app-shadow,
        0 8px 28px rgba(24, 39, 75, 0.07)
    );
    overflow: hidden;
}

.planes-resumen-card > .card-body {
    padding: 1rem 1.25rem;
}

.planes-resumen-contenido {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}

.planes-resumen-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.planes-resumen-icono {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    font-size: 1.35rem;
}

.planes-resumen-titulo {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.2rem;
    font-weight: 700;
}

.planes-resumen-texto {
    margin: 0;
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.4;
}

#btnMostrarPlanes {
    flex-shrink: 0;
    min-height: 42px;
    border-radius: 10px;
    font-weight: 600;
}

#btnMostrarPlanes i {
    transition: transform 0.2s ease;
}

#btnMostrarPlanes[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.planes-detalle {
    padding: 0 1.25rem 1.25rem;
    border-top: 1px solid #edf0f4;
}

.planes-detalle > .row {
    padding-top: 1.25rem;
}

.planes-detalle .plan-card {
    position: relative;
    min-height: 275px;
    border-radius: 15px;
    box-shadow: none;
}

.planes-detalle .plan-card .card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.35rem;
}

.planes-detalle .plan-card h5 {
    margin-top: 0.85rem;
    margin-bottom: 0.25rem;
    font-weight: 700;
}

.planes-detalle .plan-card h2 {
    margin-bottom: 0.7rem;
}

.planes-detalle .plan-card .btn {
    margin-top: auto;
}

.plan-icono {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    font-size: 1.45rem;
}

.plan-icono-gratis {
    background: rgba(108, 117, 125, 0.12);
    color: #6c757d;
}

.plan-icono-pro {
    background: rgba(13, 110, 253, 0.12);
    color: #0d6efd;
}

.plan-icono-premium {
    background: rgba(33, 37, 41, 0.12);
    color: #212529;
}

.plan-beneficio {
    min-height: 48px;
    margin-bottom: 1rem;
    font-size: 0.88rem;
    color: #6c757d;
}

.plan-card-destacado {
    border-width: 2px;
}

.plan-recomendado {
    position: absolute;
    top: 0;
    left: 50%;
    padding: 0.25rem 0.7rem;
    border-radius: 0 0 9px 9px;
    background: #0d6efd;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    transform: translateX(-50%);
}

/* Modo oscuro */

body.dark-mode .planes-resumen-card {
    background: #1e1e1e;
    border-color: #343941;
}

body.dark-mode .planes-resumen-icono {
    background: rgba(110, 168, 254, 0.13);
    color: #6ea8fe;
}

body.dark-mode .planes-resumen-texto,
body.dark-mode .plan-beneficio {
    color: #adb5bd;
}

body.dark-mode .planes-detalle {
    border-color: #343941;
}

body.dark-mode .plan-icono-gratis {
    background: rgba(173, 181, 189, 0.12);
    color: #adb5bd;
}

body.dark-mode .plan-icono-pro {
    background: rgba(110, 168, 254, 0.14);
    color: #6ea8fe;
}

body.dark-mode .plan-icono-premium {
    background: rgba(248, 249, 250, 0.12);
    color: #f8f9fa;
}

/* Responsive */

@media (max-width: 767.98px) {

    .planes-resumen-contenido {
        align-items: stretch;
        flex-direction: column;
    }

    #btnMostrarPlanes {
        width: 100%;
    }

    .planes-resumen-info {
        align-items: flex-start;
    }
}

@media (max-width: 575.98px) {

    .planes-resumen-card > .card-body {
        padding: 1rem;
    }

    .planes-resumen-icono {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
        border-radius: 12px;
    }

    .planes-detalle {
        padding: 0 1rem 1rem;
    }
}

/* ==========================================================
   ENTREGA 45.2A.3
   Panel profesional
========================================================== */

#panelHerramientas .accordion-item{

    border:1px solid rgba(0,0,0,.06);

    border-radius:16px!important;

    overflow:hidden;

    transition:.25s;
}

#panelHerramientas .accordion-item:hover{

    transform:translateY(-2px);

    box-shadow:0 10px 28px rgba(0,0,0,.08);
}

#panelHerramientas .accordion-button{

    padding:1rem 1.1rem;

    font-weight:700;

    letter-spacing:.2px;
}

#panelHerramientas .accordion-button::after{

    transform:scale(.9);
}

#panelHerramientas .accordion-button:not(.collapsed){

    box-shadow:none;
}

#panelHerramientas .accordion-body{

    padding:1.35rem;
}

#panelHerramientas h6{

    font-size:.95rem;

    font-weight:700;

    margin-bottom:1rem;
}

#panelHerramientas .btn{

    min-height:44px;

    font-weight:600;
}

#panelHerramientas .form-control,
#panelHerramientas .form-select{

    min-height:44px;
}

/* ==========================================================
   ENTREGA 45.2B.1
   Área de carga y galería modernas
========================================================== */

/* ----------------------------------------------------------
   Área de carga
---------------------------------------------------------- */

.drop-area {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background:
        linear-gradient(
            145deg,
            rgba(13, 110, 253, 0.035),
            rgba(255, 255, 255, 0.96)
        );
}

.drop-area::before {
    content: "";
    position: absolute;
    width: 280px;
    height: 280px;
    top: -150px;
    right: -100px;
    z-index: -1;
    border-radius: 50%;
    background: rgba(13, 110, 253, 0.06);
}

.drop-area::after {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    bottom: -130px;
    left: -90px;
    z-index: -1;
    border-radius: 50%;
    background: rgba(13, 110, 253, 0.045);
}

.drop-area:hover {
    border-color: #0b5ed7;
    box-shadow:
        0 12px 38px rgba(13, 110, 253, 0.12);
}

.drop-area.dragover {
    border-style: solid;
    transform: scale(1.006);
    box-shadow:
        0 16px 42px rgba(13, 110, 253, 0.18);
}

.drop-content {
    width: 100%;
}

.drop-icono {
    width: 86px;
    height: 86px;
    margin: 0 auto 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 26px;
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    font-size: 2.8rem;
    transition:
        transform 0.25s ease,
        background-color 0.25s ease;
}

.drop-area:hover .drop-icono {
    transform: translateY(-4px);
    background: rgba(13, 110, 253, 0.14);
}

.drop-area.dragover .drop-icono {
    transform: translateY(-5px) scale(1.08);
}

.drop-content h3 {
    margin: 0 0 0.6rem;
}

.drop-descripcion {
    margin-bottom: 1.5rem;
    color: #6c757d;
}

.drop-formatos {
    margin-top: 1.35rem;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.drop-formatos span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.6rem;
    border: 1px solid #e1e6ed;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    color: #6c757d;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.035em;
}

.drop-formatos i {
    color: #198754;
    font-size: 0.75rem;
}

/* ----------------------------------------------------------
   Encabezado de la galería
---------------------------------------------------------- */

.galeria-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.galeria-titulo-wrap {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.galeria-icono {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    font-size: 1.15rem;
}

.galeria-titulo {
    display: block;
    font-size: 1rem;
    line-height: 1.25;
}

.contador-imagenes {
    padding: 0.55rem 0.8rem;
    border: 1px solid rgba(13, 110, 253, 0.16);
    border-radius: 999px;
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    font-size: 0.8rem;
    font-weight: 700;
}

/* ----------------------------------------------------------
   Galería vacía
---------------------------------------------------------- */

.galeria-vacia-contenido {
    max-width: 420px;
    padding: 2rem;
    text-align: center;
}

.galeria-vacia-icono {
    width: 74px;
    height: 74px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 22px;
    background: #f0f3f7;
    color: #8b96a5;
    font-size: 2rem;
}

.galeria-vacia-contenido h5 {
    margin-bottom: 0.45rem;
    font-weight: 700;
}

/* ----------------------------------------------------------
   Tarjetas de imágenes
---------------------------------------------------------- */

.galeria .imagen-card {
    opacity: 0;
    animation: imagenCardEntrada 0.32s ease forwards;
    border-color: #e4e8ee;
    box-shadow:
        0 4px 14px rgba(24, 39, 75, 0.07);
}

.galeria .imagen-card:hover {
    border-color: rgba(13, 110, 253, 0.28);
    transform: translateY(-5px);
    box-shadow:
        0 12px 28px rgba(24, 39, 75, 0.13);
}

.imagen-preview {
    position: relative;
}

.imagen-preview::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(
            to bottom,
            transparent 65%,
            rgba(0, 0, 0, 0.05)
        );
}

.imagen-info {
    padding: 0.85rem;
}

.imagen-nombre {
    margin-bottom: 0.25rem;
}

.imagen-acciones {
    padding-top: 0.45rem;
    border-top: 1px solid #edf0f3;
}

.imagen-acciones button {
    min-height: 32px;
    border-radius: 8px;
}

@keyframes imagenCardEntrada {

    from {
        opacity: 0;
        transform: translateY(10px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ----------------------------------------------------------
   Modo oscuro
---------------------------------------------------------- */

body.dark-mode .drop-area {
    background:
        linear-gradient(
            145deg,
            rgba(13, 110, 253, 0.08),
            rgba(30, 30, 30, 0.97)
        );
}

body.dark-mode .drop-formatos span {
    background: rgba(42, 42, 42, 0.9);
    border-color: #3d424a;
    color: #adb5bd;
}

body.dark-mode .galeria-icono,
body.dark-mode .drop-icono {
    background: rgba(110, 168, 254, 0.13);
    color: #6ea8fe;
}

body.dark-mode .contador-imagenes {
    background: rgba(110, 168, 254, 0.12);
    border-color: rgba(110, 168, 254, 0.2);
    color: #8bb9fe;
}

body.dark-mode .galeria-vacia-icono {
    background: #292d32;
    color: #8c96a3;
}

body.dark-mode .galeria .imagen-card {
    border-color: #343941;
}

body.dark-mode .imagen-acciones {
    border-color: #343941;
}

/* ----------------------------------------------------------
   Responsive
---------------------------------------------------------- */

@media (max-width: 575.98px) {

    .drop-icono {
        width: 70px;
        height: 70px;
        border-radius: 21px;
        font-size: 2.25rem;
    }

    .drop-formatos {
        gap: 0.35rem;
    }

    .drop-formatos span {
        padding: 0.3rem 0.5rem;
        font-size: 0.66rem;
    }

    .galeria-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .contador-imagenes {
        margin-left: 3.55rem;
    }
}

/* ==========================================================
   CORRECCIÓN PANEL LATERAL
   Mantener ancho y posición al expandir acordeones
========================================================== */

.app-workspace {
    display: flex;
    align-items: flex-start;
}

.app-main,
.app-sidebar {
    min-width: 0;
}

.app-sidebar {
    align-self: flex-start;
}

.app-sidebar .herramientas-card {
    width: 100%;
}

/*
|--------------------------------------------------------------------------
| Panel fijo únicamente en escritorio
|--------------------------------------------------------------------------
*/

@media (min-width: 992px) {

    .app-main {
        flex: 0 0 75%;
        width: 75%;
        max-width: 75%;
    }

    .app-sidebar {
        flex: 0 0 25%;
        width: 25%;
        max-width: 25%;
    }

    .sticky-panel {
        position: sticky;
        top: 1.5rem;
        width: 100%;
        max-height: calc(100vh - 3rem);
        overflow-x: hidden;
        overflow-y: auto;
    }
}

/*
|--------------------------------------------------------------------------
| Tablet y móvil
|--------------------------------------------------------------------------
*/

@media (max-width: 991.98px) {

    .app-workspace {
        display: block;
    }

    .app-main,
    .app-sidebar {
        width: 100%;
        max-width: 100%;
    }

    .app-sidebar {
        margin-top: 1.5rem;
    }

    .sticky-panel {
        position: static;
        width: 100%;
        max-height: none;
        overflow: visible;
    }
}

#panelHerramientas,
#panelHerramientas .accordion-item,
#panelHerramientas .accordion-collapse,
#panelHerramientas .accordion-body {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

#panelHerramientas .form-control,
#panelHerramientas .form-select,
#panelHerramientas .custom-file-box,
#panelHerramientas .btn {
    max-width: 100%;
}

#panelHerramientas .archivo-texto {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 1400px) {

    .app-main {
        flex-basis: 78%;
        width: 78%;
        max-width: 78%;
    }

    .app-sidebar {
        flex-basis: 22%;
        width: 22%;
        max-width: 22%;
    }
}

/* ==========================================================
   ENTREGA 45.2B.2
   Tarjetas de imágenes más claras y funcionales
========================================================== */

.imagen-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    border-radius: 16px;
}

.imagen-preview {
    height: 185px;
    flex-shrink: 0;
}

.imagen-preview img {
    width: 100%;
    height: 100%;
    padding: 0.65rem;
    object-fit: contain;
}

.imagen-info {
    display: flex;
    min-height: 118px;
    flex: 1;
    flex-direction: column;
    padding: 0.9rem;
}

.imagen-nombre {
    margin-bottom: 0.3rem;
    color: #212529;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.35;
}

.imagen-peso {
    margin-bottom: 0.75rem;
    font-size: 0.76rem;
}

.imagen-acciones {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 0.4rem;
    margin-top: auto;
    padding-top: 0.7rem;
}

.imagen-acciones .btn {
    min-width: 0;
    min-height: 36px;
    padding: 0.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    font-size: 0.95rem;
}

.imagen-acciones .btn-primary {
    box-shadow:
        0 3px 8px rgba(13, 110, 253, 0.18);
}

.imagen-acciones .btn-danger {
    box-shadow:
        0 3px 8px rgba(220, 53, 69, 0.14);
}

/* ----------------------------------------------------------
   Control de arrastre
---------------------------------------------------------- */

.drag-handle {
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    background: rgba(24, 28, 33, 0.78);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(4px);
    transition:
        transform 0.18s ease,
        background-color 0.18s ease;
}

.drag-handle:hover {
    background: rgba(13, 110, 253, 0.92);
    transform: scale(1.05);
}

/* ----------------------------------------------------------
   Estados de Sortable
---------------------------------------------------------- */

.sortable-chosen {
    transform: scale(1.025);
    box-shadow:
        0 16px 34px rgba(24, 39, 75, 0.18);
}

.sortable-ghost {
    border: 2px dashed #0d6efd;
    background: rgba(13, 110, 253, 0.08);
    opacity: 0.42;
}

/* ----------------------------------------------------------
   Modo oscuro
---------------------------------------------------------- */

body.dark-mode .imagen-nombre {
    color: #f1f3f5;
}

body.dark-mode .imagen-peso {
    color: #adb5bd;
}

body.dark-mode .imagen-info {
    background: #1f1f1f;
}

/* ----------------------------------------------------------
   Responsive
---------------------------------------------------------- */

@media (max-width: 1199.98px) {

    .galeria {
        grid-template-columns:
            repeat(
                auto-fill,
                minmax(165px, 1fr)
            );
    }

    .imagen-preview {
        height: 160px;
    }
}

@media (max-width: 575.98px) {

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

    .imagen-preview {
        height: 135px;
    }

    .imagen-preview img {
        padding: 0.4rem;
    }

    .imagen-info {
        min-height: 110px;
        padding: 0.65rem;
    }

    .imagen-nombre {
        font-size: 0.76rem;
    }

    .imagen-acciones {
        gap: 0.25rem;
    }

    .imagen-acciones .btn {
        min-height: 32px;
        font-size: 0.82rem;
    }

    .drag-handle {
        width: 30px;
        height: 30px;
        top: 7px;
        right: 7px;
    }
}

@media (max-width: 370px) {

    .galeria {
        grid-template-columns: 1fr;
    }

    .imagen-preview {
        height: 180px;
    }
}

/* ==========================================================
   FASE 46A
   Panel independiente de Imágenes a PDF
========================================================== */

/* ----------------------------------------------------------
   Distribución principal
---------------------------------------------------------- */

.app-workspace {
    display: flex;
    align-items: stretch;
}

.app-main,
.app-sidebar {
    min-width: 0;
}

.app-sidebar {
    align-self: stretch;
}

/* ----------------------------------------------------------
   Tarjeta de configuración
---------------------------------------------------------- */

.configuracion-pdf-card {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.configuracion-pdf-header {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1.15rem 1.25rem;
    background:
        linear-gradient(
            135deg,
            #0d6efd,
            #084298
        );
    color: #fff;
}

.configuracion-pdf-header h5 {
    font-size: 1.05rem;
    font-weight: 700;
}

.configuracion-pdf-header p {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.8rem;
    line-height: 1.35;
}

.configuracion-pdf-icono {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.13);
    font-size: 1.35rem;
}

.configuracion-pdf-body {
    padding: 0;
}

/* ----------------------------------------------------------
   Secciones internas
---------------------------------------------------------- */

.configuracion-seccion {
    padding: 1.25rem;
    border-bottom: 1px solid #e8ebf0;
}

.configuracion-seccion:last-of-type {
    border-bottom: 0;
}

.configuracion-seccion-titulo {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 1rem;
    color: #344054;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.configuracion-seccion-titulo i {
    color: #0d6efd;
    font-size: 1rem;
}

.configuracion-pdf-card .form-label {
    margin-bottom: 0.45rem;
    color: #475467;
    font-size: 0.84rem;
    font-weight: 650;
}

.configuracion-pdf-card .form-control,
.configuracion-pdf-card .form-select {
    min-height: 44px;
    border-radius: 10px;
}

.configuracion-pdf-card .form-check-label {
    font-size: 0.88rem;
    font-weight: 600;
}

.configuracion-pdf-card .form-switch .form-check-input {
    width: 2.4em;
    height: 1.25em;
}

/* ----------------------------------------------------------
   Resumen
---------------------------------------------------------- */

.configuracion-resumen .resumen {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.configuracion-resumen .resumen p {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0;
    padding: 0.65rem 0;
    border-bottom: 1px dashed #e2e6ec;
}

.configuracion-resumen .resumen p:first-child {
    padding-top: 0;
}

.configuracion-resumen .resumen p:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.configuracion-resumen .resumen strong {
    color: #667085;
    font-size: 0.82rem;
}

.configuracion-resumen .resumen span {
    color: #101828;
    font-size: 0.88rem;
    font-weight: 700;
}

/* ----------------------------------------------------------
   Acciones
---------------------------------------------------------- */

.configuracion-acciones {
    display: grid;
    gap: 0.75rem;
    padding: 1.25rem;
    background: #f8fafc;
}

.configuracion-acciones .btn {
    min-height: 46px;
    border-radius: 11px;
    font-weight: 700;
}

/* ----------------------------------------------------------
   Comportamiento en escritorio
---------------------------------------------------------- */

@media (min-width: 992px) {

    .app-main {
        flex: 0 0 75%;
        width: 75%;
        max-width: 75%;
    }

    .app-sidebar {
        flex: 0 0 25%;
        width: 25%;
        max-width: 25%;
    }

    .configuracion-pdf-card {
        position: sticky;
        top: 1.5rem;
        height: auto;
        max-height: calc(100vh - 3rem);
        overflow-x: hidden;
        overflow-y: auto;
    }
}

@media (min-width: 1400px) {

    .app-main {
        flex-basis: 78%;
        width: 78%;
        max-width: 78%;
    }

    .app-sidebar {
        flex-basis: 22%;
        width: 22%;
        max-width: 22%;
    }
}

/* ----------------------------------------------------------
   Tablet y móvil
---------------------------------------------------------- */

@media (max-width: 991.98px) {

    .app-workspace {
        display: block;
    }

    .app-main,
    .app-sidebar {
        width: 100%;
        max-width: 100%;
    }

    .app-sidebar {
        margin-top: 1.5rem;
    }

    .configuracion-pdf-card {
        position: static;
        height: auto;
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 575.98px) {

    .configuracion-pdf-header,
    .configuracion-seccion,
    .configuracion-acciones {
        padding: 1rem;
    }

    .configuracion-pdf-icono {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
        border-radius: 12px;
    }
}

/* ----------------------------------------------------------
   Modo oscuro
---------------------------------------------------------- */

body.dark-mode .configuracion-seccion {
    border-color: #343941;
}

body.dark-mode .configuracion-seccion-titulo {
    color: #d7dce2;
}

body.dark-mode .configuracion-seccion-titulo i {
    color: #6ea8fe;
}

body.dark-mode .configuracion-pdf-card .form-label {
    color: #c4cad1;
}

body.dark-mode .configuracion-resumen .resumen p {
    border-color: #3c4148;
}

body.dark-mode .configuracion-resumen .resumen strong {
    color: #adb5bd;
}

body.dark-mode .configuracion-resumen .resumen span {
    color: #f1f3f5;
}

body.dark-mode .configuracion-acciones {
    background: #24272b;
}

/* ==========================================================
   FASE 46B.1
   Centro de herramientas horizontal y escalable
========================================================== */

.herramientas-centro {
    padding-top: 1rem;
    padding-bottom: 4rem;
}

.herramientas-centro-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.herramientas-centro-eyebrow {
    display: block;
    margin-bottom: 0.35rem;
    color: #0d6efd;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.herramientas-centro-header h2 {
    margin: 0;
    color: #101828;
    font-size: clamp(1.5rem, 2.4vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.035em;
}

.herramientas-centro-header p {
    margin: 0.4rem 0 0;
    color: #667085;
}

/* ----------------------------------------------------------
   Cuadrícula de cinco columnas
---------------------------------------------------------- */

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

/* ----------------------------------------------------------
   Tarjeta
---------------------------------------------------------- */

.herramienta-card {
    --herramienta-color: #0d6efd;
    --herramienta-fondo: rgba(13, 110, 253, 0.1);

    position: relative;
    min-width: 0;
    min-height: 270px;
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    overflow: hidden;
    border: 1px solid #e4e8ef;
    border-radius: 18px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    box-shadow:
        0 7px 24px rgba(24, 39, 75, 0.065);
    transition:
        transform 0.22s ease,
        border-color 0.22s ease,
        box-shadow 0.22s ease;
}

.herramienta-card::before {
    content: "";
    position: absolute;
    top: -60px;
    right: -55px;
    width: 145px;
    height: 145px;
    border-radius: 50%;
    background: var(--herramienta-fondo);
    pointer-events: none;
}

.herramienta-card:hover {
    color: inherit;
    border-color: var(--herramienta-color);
    transform: translateY(-5px);
    box-shadow:
        0 16px 34px rgba(24, 39, 75, 0.13);
}

.herramienta-card:focus-visible {
    outline: 3px solid rgba(13, 110, 253, 0.25);
    outline-offset: 3px;
}

/* ----------------------------------------------------------
   Icono
---------------------------------------------------------- */

.herramienta-icono {
    position: relative;
    z-index: 1;
    width: 54px;
    height: 54px;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: var(--herramienta-fondo);
    color: var(--herramienta-color);
    font-size: 1.55rem;
    transition: transform 0.22s ease;
}

.herramienta-card:hover .herramienta-icono {
    transform: scale(1.06) rotate(-2deg);
}

/* ----------------------------------------------------------
   Contenido
---------------------------------------------------------- */

.herramienta-contenido {
    position: relative;
    z-index: 1;
    min-height: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
}

.herramienta-categoria {
    margin-bottom: 0.55rem;
    color: var(--herramienta-color);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.herramienta-card h3 {
    margin: 0 0 0.65rem;
    color: #101828;
    font-size: 1.05rem;
    font-weight: 750;
    line-height: 1.3;
}

.herramienta-card p {
    margin: 0 0 1.2rem;
    color: #667085;
    font-size: 0.84rem;
    line-height: 1.55;
}

.herramienta-abrir {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--herramienta-color);
    font-size: 0.84rem;
    font-weight: 750;
}

.herramienta-abrir i {
    transition: transform 0.2s ease;
}

.herramienta-card:hover .herramienta-abrir i {
    transform: translateX(4px);
}

/* ----------------------------------------------------------
   Paleta reutilizable de herramientas
---------------------------------------------------------- */

/*
|--------------------------------------------------------------------------
| Colores disponibles
|--------------------------------------------------------------------------
|
| Las tarjetas no necesitan una regla CSS propia por herramienta.
| Basta con agregar una de estas clases al HTML.
|
| Ejemplo:
|
| <a class="herramienta-card herramienta-color-azul">
|
*/

.herramienta-color-azul {
    --herramienta-color: #0d6efd;
    --herramienta-fondo: rgba(13, 110, 253, 0.12);
}

.herramienta-color-amarillo {
    --herramienta-color: #f59f00;
    --herramienta-fondo: rgba(245, 159, 0, 0.12);
}

.herramienta-color-verde {
    --herramienta-color: #0ca678;
    --herramienta-fondo: rgba(12, 166, 120, 0.11);
}

.herramienta-color-violeta {
    --herramienta-color: #7048e8;
    --herramienta-fondo: rgba(112, 72, 232, 0.11);
}

.herramienta-color-rojo {
    --herramienta-color: #e03131;
    --herramienta-fondo: rgba(224, 49, 49, 0.1);
}

.herramienta-color-celeste {
    --herramienta-color: #1971c2;
    --herramienta-fondo: rgba(25, 113, 194, 0.11);
}

.herramienta-color-verde-claro {
    --herramienta-color: #2f9e44;
    --herramienta-fondo: rgba(47, 158, 68, 0.11);
}

.herramienta-color-gris {
    --herramienta-color: #495057;
    --herramienta-fondo: rgba(73, 80, 87, 0.1);
}

/* ----------------------------------------------------------
   Responsive
---------------------------------------------------------- */

@media (max-width: 1399.98px) {

    .herramientas-grid {
        grid-template-columns:
            repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1199.98px) {

    .herramientas-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {

    .herramientas-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .herramienta-card {
        min-height: 250px;
    }
}

@media (max-width: 479.98px) {

    .herramientas-grid {
        grid-template-columns: 1fr;
    }

    .herramienta-card {
        min-height: 220px;
    }
}

/* ----------------------------------------------------------
   Modo oscuro
---------------------------------------------------------- */

body.dark-mode .herramientas-centro-header h2,
body.dark-mode .herramienta-card h3 {
    color: #f1f3f5;
}

body.dark-mode .herramientas-centro-header p,
body.dark-mode .herramienta-card p {
    color: #adb5bd;
}

body.dark-mode .herramienta-card {
    border-color: #343941;
    background: #1e1e1e;
    box-shadow:
        0 7px 24px rgba(0, 0, 0, 0.2);
}

body.dark-mode .herramienta-card:hover {
    border-color: var(--herramienta-color);
    box-shadow:
        0 16px 34px rgba(0, 0, 0, 0.32);
}

/* ==========================================================
   FASE 46C
   Páginas individuales de herramientas
========================================================== */

.herramienta-pagina {
    padding-top: 2rem;
    padding-bottom: 4rem;
}

/* Navegación */

.herramienta-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 1.25rem;
    color: #667085;
    font-size: 0.85rem;
}

.herramienta-breadcrumb a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #667085;
    text-decoration: none;
}

.herramienta-breadcrumb a:hover {
    color: #0d6efd;
}

.herramienta-breadcrumb > i {
    font-size: 0.7rem;
}

/* Hero */

.herramienta-hero {
    --hero-color: #f59f00;
    --hero-bg: rgba(245, 159, 0, 0.11);

    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 2rem;
    padding: 1.6rem;
    border: 1px solid rgba(245, 159, 0, 0.22);
    border-radius: 20px;
    background:
        linear-gradient(
            135deg,
            var(--hero-bg),
            rgba(255, 255, 255, 0.92)
        );
}

.herramienta-hero-icono {
    width: 72px;
    height: 72px;
    flex: 0 0 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    background: var(--hero-bg);
    color: var(--hero-color);
    font-size: 2rem;
}

.herramienta-hero-categoria {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--hero-color);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.herramienta-hero h1 {
    margin: 0 0 0.4rem;
    color: #101828;
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.04em;
}

.herramienta-hero p {
    max-width: 760px;
    margin: 0;
    color: #667085;
    line-height: 1.6;
}

/* Tarjetas */

.herramienta-layout {
    align-items: flex-start;
}

.herramienta-trabajo-card,
.herramienta-ayuda-card {
    overflow: hidden;
}

.herramienta-card-header {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1.15rem 1.25rem;
    background: #fff;
}

.herramienta-card-header-icono {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    background: rgba(245, 159, 0, 0.12);
    color: #f59f00;
    font-size: 1.2rem;
}

.herramienta-card-header h2,
.herramienta-ayuda-card h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 750;
}

.herramienta-card-header p {
    margin: 0.15rem 0 0;
    color: #667085;
    font-size: 0.82rem;
}

.herramienta-formulario {
    padding: 1.5rem;
}

.herramienta-label {
    margin-bottom: 0.55rem;
    color: #344054;
    font-weight: 700;
}

.herramienta-file-box {
    min-height: 62px;
    padding: 0.75rem;
}

.herramienta-boton-principal {
    min-height: 52px;
    border-radius: 12px;
    font-weight: 750;
}

/* Ayuda */

.herramienta-ayuda-card {
    position: sticky;
    top: 1.5rem;
}

.herramienta-ayuda-card .card-body {
    padding: 1.4rem;
}

.herramienta-ayuda-icono {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    font-size: 1.3rem;
}

.herramienta-pasos {
    margin: 1rem 0 1.4rem;
    padding-left: 1.25rem;
    color: #667085;
}

.herramienta-pasos li {
    margin-bottom: 0.65rem;
    padding-left: 0.25rem;
    line-height: 1.5;
}

.herramienta-privacidad {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid rgba(25, 135, 84, 0.18);
    border-radius: 13px;
    background: rgba(25, 135, 84, 0.07);
}

.herramienta-privacidad > i {
    color: #198754;
    font-size: 1.25rem;
}

.herramienta-privacidad strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
}

.herramienta-privacidad p {
    margin: 0;
    color: #667085;
    font-size: 0.78rem;
    line-height: 1.45;
}

.herramienta-volver {
    margin-top: 2rem;
}

/* Modo oscuro */

body.dark-mode .herramienta-hero {
    background:
        linear-gradient(
            135deg,
            rgba(245, 159, 0, 0.1),
            rgba(30, 30, 30, 0.96)
        );
}

body.dark-mode .herramienta-hero h1,
body.dark-mode .herramienta-card-header h2,
body.dark-mode .herramienta-ayuda-card h2 {
    color: #f1f3f5;
}

body.dark-mode .herramienta-hero p,
body.dark-mode .herramienta-card-header p,
body.dark-mode .herramienta-pasos,
body.dark-mode .herramienta-privacidad p {
    color: #adb5bd;
}

body.dark-mode .herramienta-card-header {
    background: #1e1e1e;
}

body.dark-mode .herramienta-label {
    color: #d7dce2;
}

body.dark-mode .herramienta-privacidad {
    border-color: rgba(117, 183, 152, 0.22);
    background: rgba(25, 135, 84, 0.1);
}

/* Responsive */

@media (max-width: 991.98px) {

    .herramienta-ayuda-card {
        position: static;
    }
}

@media (max-width: 575.98px) {

    .herramienta-pagina {
        padding-top: 1.25rem;
    }

    .herramienta-hero {
        align-items: flex-start;
        flex-direction: column;
        padding: 1.25rem;
    }

    .herramienta-hero-icono {
        width: 60px;
        height: 60px;
        flex-basis: 60px;
        border-radius: 17px;
        font-size: 1.65rem;
    }

    .herramienta-formulario {
        padding: 1rem;
    }

    .herramienta-file-box {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* ==========================================================
   ENTREGA 46C.2
   Página Comprimir PDF
========================================================== */

.herramienta-hero-comprimir {
    --hero-color: #0ca678;
    --hero-bg: rgba(12, 166, 120, 0.11);

    border-color: rgba(12, 166, 120, 0.22);
}

.herramienta-header-comprimir {
    background: rgba(12, 166, 120, 0.11);
    color: #0ca678;
}

.compresion-opciones {
    display: grid;
    gap: 0.65rem;
}

.compresion-opciones > div {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.75rem;
    border: 1px solid #e4e8ef;
    border-radius: 11px;
    background: #f8fafc;
    color: #667085;
    font-size: 0.8rem;
    line-height: 1.45;
}

.compresion-opciones i {
    flex-shrink: 0;
    color: #0ca678;
    font-size: 1rem;
}

body.dark-mode .herramienta-hero-comprimir {
    background:
        linear-gradient(
            135deg,
            rgba(12, 166, 120, 0.1),
            rgba(30, 30, 30, 0.96)
        );
}

body.dark-mode .compresion-opciones > div {
    border-color: #343941;
    background: #24272b;
    color: #adb5bd;
}

/* ==========================================================
   ENTREGA 46C.3
   Página PDF a imágenes
========================================================== */

.herramienta-hero-imagenes {
    --hero-color: #7048e8;
    --hero-bg: rgba(112, 72, 232, 0.11);

    border-color: rgba(112, 72, 232, 0.22);
}

.herramienta-header-imagenes {
    background: rgba(112, 72, 232, 0.11);
    color: #7048e8;
}

.conversion-imagenes-opciones {
    display: grid;
    gap: 0.65rem;
}

.conversion-imagenes-opciones > div {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.8rem;
    border: 1px solid #e4e8ef;
    border-radius: 11px;
    background: #f8fafc;
    color: #667085;
    font-size: 0.8rem;
    line-height: 1.5;
}

.conversion-imagenes-opciones i {
    flex: 0 0 auto;
    margin-top: 0.05rem;
    color: #7048e8;
    font-size: 1rem;
}

body.dark-mode .herramienta-hero-imagenes {
    background:
        linear-gradient(
            135deg,
            rgba(112, 72, 232, 0.11),
            rgba(30, 30, 30, 0.96)
        );
}

body.dark-mode .conversion-imagenes-opciones > div {
    border-color: #343941;
    background: #24272b;
    color: #adb5bd;
}

/* ==========================================================
   ENTREGA 46C.4
   Página Separar PDF
========================================================== */

.herramienta-hero-separar {
    --hero-color: #e03131;
    --hero-bg: rgba(224, 49, 49, 0.1);

    border-color: rgba(224, 49, 49, 0.22);
}

.herramienta-header-separar {
    background: rgba(224, 49, 49, 0.1);
    color: #e03131;
}

.separar-informacion {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 1rem;
    border: 1px solid rgba(224, 49, 49, 0.18);
    border-radius: 13px;
    background: rgba(224, 49, 49, 0.055);
}

.separar-informacion-icono {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(224, 49, 49, 0.1);
    color: #e03131;
    font-size: 1.15rem;
}

.separar-informacion strong {
    display: block;
    margin-bottom: 0.25rem;
    color: #344054;
    font-size: 0.88rem;
}

.separar-informacion p {
    margin: 0;
    color: #667085;
    font-size: 0.8rem;
    line-height: 1.5;
}

.separar-ejemplo {
    padding: 1rem;
    border: 1px solid #e4e8ef;
    border-radius: 14px;
    background: #f8fafc;
}

.separar-ejemplo > span {
    display: block;
    margin-bottom: 0.85rem;
    color: #667085;
    font-size: 0.75rem;
    font-weight: 750;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.separar-ejemplo-flujo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.separar-pdf-original {
    min-width: 100px;
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.8rem;
    border-radius: 12px;
    background: #fff;
    color: #e03131;
    box-shadow: 0 4px 13px rgba(24, 39, 75, 0.07);
}

.separar-pdf-original i {
    font-size: 1.65rem;
}

.separar-pdf-original small {
    color: #667085;
}

.separar-ejemplo-flujo > i {
    color: #98a2b3;
    font-size: 1.25rem;
}

.separar-resultados {
    display: grid;
    gap: 0.4rem;
}

.separar-resultados span {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.65rem;
    border-radius: 9px;
    background: #fff;
    color: #667085;
    font-size: 0.76rem;
    box-shadow: 0 3px 10px rgba(24, 39, 75, 0.055);
}

.separar-resultados i {
    color: #e03131;
}

body.dark-mode .herramienta-hero-separar {
    background:
        linear-gradient(
            135deg,
            rgba(224, 49, 49, 0.1),
            rgba(30, 30, 30, 0.96)
        );
}

body.dark-mode .separar-informacion {
    border-color: rgba(255, 107, 107, 0.2);
    background: rgba(224, 49, 49, 0.08);
}

body.dark-mode .separar-informacion strong {
    color: #f1f3f5;
}

body.dark-mode .separar-informacion p,
body.dark-mode .separar-pdf-original small,
body.dark-mode .separar-resultados span {
    color: #adb5bd;
}

body.dark-mode .separar-ejemplo {
    border-color: #343941;
    background: #24272b;
}

body.dark-mode .separar-pdf-original,
body.dark-mode .separar-resultados span {
    background: #1e1e1e;
}

@media (max-width: 575.98px) {

    .separar-ejemplo-flujo {
        flex-direction: column;
    }

    .separar-ejemplo-flujo > i {
        transform: rotate(90deg);
    }

    .separar-resultados {
        width: 100%;
    }
}

/* ==========================================================
   ENTREGA 46C.5
   Página OCR
========================================================== */

.herramienta-hero-ocr {
    --hero-color: #1971c2;
    --hero-bg: rgba(25, 113, 194, 0.11);

    border-color: rgba(25, 113, 194, 0.22);
}

.herramienta-header-ocr {
    background: rgba(25, 113, 194, 0.11);
    color: #1971c2;
}

.ocr-caracteristicas {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.ocr-caracteristicas > div {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    padding: 1rem;
    border: 1px solid #e4e8ef;
    border-radius: 13px;
    background: #f8fafc;
}

.ocr-caracteristicas i {
    margin-bottom: 0.65rem;
    color: #1971c2;
    font-size: 1.35rem;
}

.ocr-caracteristicas strong {
    margin-bottom: 0.3rem;
    color: #344054;
    font-size: 0.84rem;
}

.ocr-caracteristicas span {
    color: #667085;
    font-size: 0.76rem;
    line-height: 1.45;
}

.ocr-recomendacion {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 1rem;
    border: 1px solid rgba(245, 159, 0, 0.22);
    border-radius: 13px;
    background: rgba(245, 159, 0, 0.075);
}

.ocr-recomendacion > i {
    flex-shrink: 0;
    color: #f59f00;
    font-size: 1.25rem;
}

.ocr-recomendacion strong {
    display: block;
    margin-bottom: 0.25rem;
    color: #344054;
    font-size: 0.86rem;
}

.ocr-recomendacion p {
    margin: 0;
    color: #667085;
    font-size: 0.79rem;
    line-height: 1.5;
}

.resultado-ocr-textarea {
    min-height: 310px;
    resize: vertical;
    font-family:
        Consolas,
        "Courier New",
        monospace;
    line-height: 1.55;
}

body.dark-mode .herramienta-hero-ocr {
    background:
        linear-gradient(
            135deg,
            rgba(25, 113, 194, 0.11),
            rgba(30, 30, 30, 0.96)
        );
}

body.dark-mode .ocr-caracteristicas > div {
    border-color: #343941;
    background: #24272b;
}

body.dark-mode .ocr-caracteristicas strong,
body.dark-mode .ocr-recomendacion strong {
    color: #f1f3f5;
}

body.dark-mode .ocr-caracteristicas span,
body.dark-mode .ocr-recomendacion p {
    color: #adb5bd;
}

body.dark-mode .ocr-recomendacion {
    border-color: rgba(255, 193, 7, 0.2);
    background: rgba(245, 159, 0, 0.08);
}

@media (max-width: 767.98px) {

    .ocr-caracteristicas {
        grid-template-columns: 1fr;
    }

    .resultado-ocr-textarea {
        min-height: 240px;
    }
}

/* ==========================================================
   ENTREGA 46C.6
   Página Firmar PDF
========================================================== */

.herramienta-hero-firmar {
    --hero-color: #2f9e44;
    --hero-bg: rgba(47, 158, 68, 0.11);

    border-color: rgba(47, 158, 68, 0.22);
}

.herramienta-header-firmar {
    background: rgba(47, 158, 68, 0.11);
    color: #2f9e44;
}

/* Vista de firma */

.firma-preview-box {
    padding: 1rem;
    border: 1px solid #e4e8ef;
    border-radius: 14px;
    background: #f8fafc;
}

.firma-preview-titulo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.firma-preview-titulo span {
    color: #344054;
    font-size: 0.85rem;
    font-weight: 750;
}

.firma-preview-titulo small {
    color: #98a2b3;
}

.firma-preview-imagen {
    min-height: 135px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border: 1px dashed #cfd6df;
    border-radius: 11px;
    background:
        linear-gradient(
            45deg,
            #f2f4f7 25%,
            transparent 25%
        ),
        linear-gradient(
            -45deg,
            #f2f4f7 25%,
            transparent 25%
        ),
        linear-gradient(
            45deg,
            transparent 75%,
            #f2f4f7 75%
        ),
        linear-gradient(
            -45deg,
            transparent 75%,
            #f2f4f7 75%
        ),
        #fff;
    background-size: 20px 20px;
    background-position:
        0 0,
        0 10px,
        10px -10px,
        -10px 0;
}

.firma-preview-imagen img {
    max-width: 100%;
    max-height: 115px;
    object-fit: contain;
}

.firma-preview-vacio {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 0.5rem;
    color: #98a2b3;
    font-size: 0.8rem;
}

.firma-preview-vacio i {
    font-size: 1.7rem;
}

/* Posiciones */

.firma-posiciones {
    display: grid;
    grid-template-columns:
        repeat(5, minmax(0, 1fr));
    gap: 0.55rem;
}

.firma-posicion-btn {
    min-width: 0;
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.6rem 0.35rem;
    border: 1px solid #dfe4ea;
    border-radius: 11px;
    background: #fff;
    color: #667085;
    cursor: pointer;
    transition:
        border-color 0.18s ease,
        background-color 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease;
}

.firma-posicion-btn i {
    font-size: 1.15rem;
}

.firma-posicion-btn span {
    font-size: 0.66rem;
    line-height: 1.25;
    text-align: center;
}

.firma-posicion-btn:hover {
    border-color: #2f9e44;
    color: #2f9e44;
    transform: translateY(-2px);
}

.firma-posicion-btn.activo {
    border-color: #2f9e44;
    background: rgba(47, 158, 68, 0.1);
    color: #2f9e44;
    box-shadow:
        0 0 0 2px rgba(47, 158, 68, 0.1);
}

/* Tamaño */

.firma-tamano-valor {
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    background: rgba(47, 158, 68, 0.1);
    color: #2f9e44;
    font-size: 0.76rem;
    font-weight: 750;
}

.firma-rango-etiquetas {
    display: flex;
    justify-content: space-between;
    color: #98a2b3;
    font-size: 0.7rem;
}

/* Documento gráfico */

.firma-documento-preview {
    padding: 1rem;
    border: 1px solid #e4e8ef;
    border-radius: 14px;
    background: #f8fafc;
}

.firma-documento-cabecera {
    margin-bottom: 0.85rem;
    color: #667085;
    font-size: 0.75rem;
    font-weight: 700;
}

.firma-documento-hoja {
    position: relative;
    width: min(100%, 340px);
    aspect-ratio: 1 / 1.414;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid #dfe4ea;
    border-radius: 4px;
    background: #fff;
    box-shadow:
        0 8px 24px rgba(24, 39, 75, 0.1);
}

.firma-documento-lineas {
    position: absolute;
    inset: 12% 11%;
    display: grid;
    align-content: start;
    gap: 8%;
}

.firma-documento-lineas span {
    height: 5px;
    border-radius: 999px;
    background: #eef1f5;
}

.firma-documento-lineas span:nth-child(2),
.firma-documento-lineas span:nth-child(4) {
    width: 78%;
}

.firma-documento-imagen,
.firma-documento-placeholder {
    position: absolute;
    z-index: 2;
    max-height: 18%;
    object-fit: contain;
    transform: translate(-50%, -50%);
    transition:
        top 0.2s ease,
        left 0.2s ease,
        width 0.2s ease;
}

.firma-documento-placeholder {
    width: 32%;
    padding: 0.35rem;
    border: 1px dashed rgba(47, 158, 68, 0.55);
    border-radius: 5px;
    background: rgba(47, 158, 68, 0.08);
    color: #2f9e44;
    font-size: 0.68rem;
    font-weight: 700;
    text-align: center;
}

#firmaDocumentoPlaceholder.d-none {
    display: none !important;
}

/* Coordenadas visuales */

.firma-documento-preview[data-posicion="arriba_izquierda"]
.firma-documento-imagen,
.firma-documento-preview[data-posicion="arriba_izquierda"]
.firma-documento-placeholder {
    top: 13%;
    left: 25%;
}

.firma-documento-preview[data-posicion="arriba_derecha"]
.firma-documento-imagen,
.firma-documento-preview[data-posicion="arriba_derecha"]
.firma-documento-placeholder {
    top: 13%;
    left: 75%;
}

.firma-documento-preview[data-posicion="centro"]
.firma-documento-imagen,
.firma-documento-preview[data-posicion="centro"]
.firma-documento-placeholder {
    top: 50%;
    left: 50%;
}

.firma-documento-preview[data-posicion="abajo_izquierda"]
.firma-documento-imagen,
.firma-documento-preview[data-posicion="abajo_izquierda"]
.firma-documento-placeholder {
    top: 87%;
    left: 25%;
}

.firma-documento-preview[data-posicion="abajo_derecha"]
.firma-documento-imagen,
.firma-documento-preview[data-posicion="abajo_derecha"]
.firma-documento-placeholder {
    top: 87%;
    left: 75%;
}

/* Oscuro */

body.dark-mode .herramienta-hero-firmar {
    background:
        linear-gradient(
            135deg,
            rgba(47, 158, 68, 0.11),
            rgba(30, 30, 30, 0.96)
        );
}

body.dark-mode .firma-preview-box,
body.dark-mode .firma-documento-preview {
    border-color: #343941;
    background: #24272b;
}

body.dark-mode .firma-preview-titulo span {
    color: #f1f3f5;
}

body.dark-mode .firma-preview-imagen {
    border-color: #444a52;
    background-color: #30343a;
}

body.dark-mode .firma-posicion-btn {
    border-color: #3c4148;
    background: #24272b;
    color: #adb5bd;
}

body.dark-mode .firma-posicion-btn.activo {
    border-color: #51cf66;
    background: rgba(47, 158, 68, 0.13);
    color: #69db7c;
}

body.dark-mode .firma-documento-hoja {
    border-color: #4b5159;
    background: #f8f9fa;
}

/* Responsive */

@media (max-width: 767.98px) {

    .firma-posiciones {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .firma-posicion-btn:nth-child(3) {
        grid-column: 1 / -1;
    }
}

@media (max-width: 479.98px) {

    .firma-posiciones {
        grid-template-columns: 1fr;
    }

    .firma-posicion-btn:nth-child(3) {
        grid-column: auto;
    }

    .firma-posicion-btn {
        min-height: 58px;
        flex-direction: row;
    }
}

/* ==========================================================
   ENTREGA 46C.6A
   Vista previa real del PDF para Firmar PDF
========================================================== */

.firma-pdf-editor {
    overflow: hidden;
    border: 1px solid #e4e8ef;
    border-radius: 16px;
    background: #f8fafc;
}

/* ----------------------------------------------------------
   Cabecera y navegación
---------------------------------------------------------- */

.firma-pdf-editor-header {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #e4e8ef;
    background: #fff;
}

.firma-pdf-editor-titulo {
    display: block;
    margin-bottom: 0.18rem;
    color: #344054;
    font-size: 0.88rem;
    font-weight: 750;
}

.firma-pdf-editor-header small {
    display: block;
    color: #667085;
    font-size: 0.75rem;
}

.firma-pdf-navegacion {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.firma-pdf-navegacion .btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
}

.firma-pdf-contador {
    min-width: 112px;
    padding: 0.4rem 0.65rem;
    border: 1px solid #e4e8ef;
    border-radius: 999px;
    background: #f8fafc;
    color: #475467;
    font-size: 0.76rem;
    font-weight: 700;
    text-align: center;
}

/* ----------------------------------------------------------
   Zona de documento
---------------------------------------------------------- */

.firma-pdf-zona {
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 1.5rem;
    overflow: auto;
    background:
        radial-gradient(
            circle at center,
            rgba(13, 110, 253, 0.035),
            transparent 62%
        ),
        #e9edf2;
}

.firma-pdf-zona-vacia {
    min-height: 330px;
    align-items: center;
}

.firma-pdf-vacio,
.firma-pdf-cargando {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.55rem;
    padding: 2rem;
    color: #667085;
    text-align: center;
}

.firma-pdf-vacio-icono {
    width: 62px;
    height: 62px;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: rgba(224, 49, 49, 0.1);
    color: #e03131;
    font-size: 1.7rem;
}

.firma-pdf-vacio strong {
    color: #344054;
    font-size: 0.9rem;
}

.firma-pdf-vacio span,
.firma-pdf-cargando span {
    max-width: 350px;
    font-size: 0.78rem;
    line-height: 1.5;
}

/*
|--------------------------------------------------------------------------
| Contenedor real del documento
|--------------------------------------------------------------------------
*/

.firma-documento-preview-real {
    width: max-content;
    min-width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
}

.firma-pdf-pagina {
    position: relative;
    flex: 0 0 auto;
    margin: 0;
    overflow: hidden;
    background: #fff;
    box-shadow:
        0 12px 36px rgba(24, 39, 75, 0.2);
}

#firmaPDFCanvas {
    display: block;
    max-width: none;
    background: #fff;
}

/* ----------------------------------------------------------
   Firma superpuesta
---------------------------------------------------------- */

.firma-pdf-pagina .firma-documento-imagen,
.firma-pdf-pagina .firma-documento-placeholder {
    position: absolute;
    z-index: 4;
    max-height: 22%;
    object-fit: contain;
    transform: translate(-50%, -50%);
    transition:
        top 0.2s ease,
        left 0.2s ease,
        width 0.2s ease;
}

.firma-pdf-pagina .firma-documento-imagen {
    pointer-events: none;
    user-select: none;
}

.firma-pdf-pagina .firma-documento-placeholder {
    width: 32%;
    padding: 0.35rem;
    border: 1px dashed rgba(47, 158, 68, 0.65);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.88);
    color: #2f9e44;
    font-size: 0.68rem;
    font-weight: 700;
    text-align: center;
}

/* ----------------------------------------------------------
   Posiciones rápidas sobre la página real
---------------------------------------------------------- */

.firma-documento-preview-real[data-posicion="arriba_izquierda"]
.firma-documento-imagen,
.firma-documento-preview-real[data-posicion="arriba_izquierda"]
.firma-documento-placeholder {
    top: 13%;
    left: 25%;
}

.firma-documento-preview-real[data-posicion="arriba_derecha"]
.firma-documento-imagen,
.firma-documento-preview-real[data-posicion="arriba_derecha"]
.firma-documento-placeholder {
    top: 13%;
    left: 75%;
}

.firma-documento-preview-real[data-posicion="centro"]
.firma-documento-imagen,
.firma-documento-preview-real[data-posicion="centro"]
.firma-documento-placeholder {
    top: 50%;
    left: 50%;
}

.firma-documento-preview-real[data-posicion="abajo_izquierda"]
.firma-documento-imagen,
.firma-documento-preview-real[data-posicion="abajo_izquierda"]
.firma-documento-placeholder {
    top: 87%;
    left: 25%;
}

.firma-documento-preview-real[data-posicion="abajo_derecha"]
.firma-documento-imagen,
.firma-documento-preview-real[data-posicion="abajo_derecha"]
.firma-documento-placeholder {
    top: 87%;
    left: 75%;
}

/* ----------------------------------------------------------
   Detalles
---------------------------------------------------------- */

.firma-pdf-detalles {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem 1.2rem;
    padding: 0.8rem 1rem;
    border-top: 1px solid #e4e8ef;
    background: #fff;
    color: #667085;
    font-size: 0.74rem;
}

.firma-pdf-detalles > span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.firma-pdf-detalles i {
    color: #2f9e44;
}

.firma-pdf-detalles strong {
    color: #475467;
}

/* ----------------------------------------------------------
   Modo oscuro
---------------------------------------------------------- */

body.dark-mode .firma-pdf-editor {
    border-color: #343941;
    background: #24272b;
}

body.dark-mode .firma-pdf-editor-header,
body.dark-mode .firma-pdf-detalles {
    border-color: #343941;
    background: #1e1e1e;
}

body.dark-mode .firma-pdf-editor-titulo,
body.dark-mode .firma-pdf-vacio strong,
body.dark-mode .firma-pdf-detalles strong {
    color: #f1f3f5;
}

body.dark-mode .firma-pdf-editor-header small,
body.dark-mode .firma-pdf-vacio,
body.dark-mode .firma-pdf-cargando,
body.dark-mode .firma-pdf-detalles {
    color: #adb5bd;
}

body.dark-mode .firma-pdf-contador {
    border-color: #3c4148;
    background: #24272b;
    color: #d7dce2;
}

body.dark-mode .firma-pdf-zona {
    background:
        radial-gradient(
            circle at center,
            rgba(47, 158, 68, 0.035),
            transparent 62%
        ),
        #151719;
}

/* ----------------------------------------------------------
   Responsive
---------------------------------------------------------- */

@media (max-width: 767.98px) {

    .firma-pdf-editor-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .firma-pdf-navegacion {
        width: 100%;
        justify-content: space-between;
    }

    .firma-pdf-contador {
        flex: 1;
    }

    .firma-pdf-zona {
        min-height: 320px;
        padding: 1rem;
    }
}

@media (max-width: 479.98px) {

    .firma-pdf-zona {
        padding: 0.65rem;
    }

    .firma-pdf-detalles {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* ==========================================================
   ENTREGA 46C.6B
   Posición manual de la firma
========================================================== */

/* ----------------------------------------------------------
   Botón y ayuda
---------------------------------------------------------- */

.firma-manual-control {
    display: grid;
    gap: 0.7rem;
}

#btnPosicionManualFirma {
    min-height: 46px;
    border-radius: 11px;
    font-weight: 700;
}

#btnPosicionManualFirma.activo {
    border-color: #2f9e44;
    background: rgba(47, 158, 68, 0.12);
    color: #2f9e44;
    box-shadow:
        0 0 0 3px rgba(47, 158, 68, 0.08);
}

.firma-manual-ayuda {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.75rem;
    border: 1px solid rgba(47, 158, 68, 0.2);
    border-radius: 11px;
    background: rgba(47, 158, 68, 0.07);
    color: #357a44;
    font-size: 0.8rem;
    font-weight: 650;
    text-align: center;
}

.firma-manual-ayuda i {
    font-size: 1.05rem;
}

/* ----------------------------------------------------------
   Firma arrastrable
---------------------------------------------------------- */

.firma-pdf-pagina.firma-modo-manual
.firma-arrastrable {
    pointer-events: auto;
    touch-action: none;
    cursor: grab;
    user-select: none;
    -webkit-user-drag: none;
}

.firma-pdf-pagina.firma-arrastrando
.firma-arrastrable {
    cursor: grabbing;
}

.firma-pdf-pagina.firma-modo-manual
.firma-documento-imagen,
.firma-pdf-pagina.firma-modo-manual
.firma-documento-placeholder {
    transition: none;
}

.firma-pdf-pagina.firma-modo-manual
.firma-documento-placeholder {
    border-style: solid;
    border-color: #2f9e44;
    box-shadow:
        0 0 0 3px rgba(47, 158, 68, 0.13);
}

.firma-pdf-pagina.firma-modo-manual
.firma-documento-imagen {
    outline: 2px dashed rgba(47, 158, 68, 0.75);
    outline-offset: 4px;
}

/* ----------------------------------------------------------
   Indicador de movimiento
---------------------------------------------------------- */

.firma-pdf-pagina.firma-modo-manual::after {
    content: attr(data-texto-arrastre);
    position: absolute;
    z-index: 5;
    top: 10px;
    left: 50%;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: rgba(16, 24, 40, 0.78);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    pointer-events: none;
    transform: translateX(-50%);
}

/* ----------------------------------------------------------
   Modo oscuro
---------------------------------------------------------- */

body.dark-mode #btnPosicionManualFirma.activo {
    border-color: #51cf66;
    background: rgba(47, 158, 68, 0.15);
    color: #69db7c;
}

body.dark-mode .firma-manual-ayuda {
    border-color: rgba(81, 207, 102, 0.22);
    background: rgba(47, 158, 68, 0.1);
    color: #8ce99a;
}

/* ==========================================================
   ENTREGA 46C.6D
   Zoom y desplazamiento del PDF
========================================================== */

/* ----------------------------------------------------------
   Herramientas superiores
---------------------------------------------------------- */

.firma-pdf-herramientas {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.firma-pdf-zoom {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.firma-pdf-zoom .btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
}

#firmaPDFZoom {
    width: 86px;
    min-height: 36px;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    border-radius: 9px;
    font-size: 0.76rem;
    font-weight: 700;
}

#btnFirmaMoverDocumento.activo {
    border-color: #0d6efd;
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
}

/* ----------------------------------------------------------
   Área desplazable
---------------------------------------------------------- */

.firma-pdf-zona {
    align-items: flex-start;
    justify-content: flex-start;
    max-height: 760px;
    scrollbar-gutter: stable;
}


/* ----------------------------------------------------------
   Pan
---------------------------------------------------------- */

.firma-pdf-zona.firma-pan-activo {
    cursor:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M11 15V7a2 2 0 0 1 4 0v6-3a2 2 0 0 1 4 0v3-2a2 2 0 0 1 4 0v3-1a2 2 0 0 1 4 0v6c0 6-4 10-10 10h-1c-4 0-6-2-8-5l-4-6a2.2 2.2 0 0 1 3.5-2.6L11 18z' fill='%23ffffff' stroke='%23000000' stroke-width='1.8' stroke-linejoin='round'/%3E%3C/svg%3E")
        11 8,
        grab;

    touch-action: none;
}

.firma-pdf-zona.firma-pan-moviendo {
    cursor:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M10 15V9a2 2 0 0 1 4 0v4-5a2 2 0 0 1 4 0v5-3a2 2 0 0 1 4 0v4-2a2 2 0 0 1 4 0v7c0 6-4 10-10 10h-1c-4 0-6-2-8-5l-3-5a2.2 2.2 0 0 1 3.5-2.6L10 19z' fill='%23d9d9d9' stroke='%23000000' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E")
        11 8,
        grabbing;

    user-select: none;
}

.firma-pdf-zona.firma-pan-activo
.firma-pdf-pagina {
    user-select: none;
}

/* ----------------------------------------------------------
   Barras de desplazamiento
---------------------------------------------------------- */

.firma-pdf-zona::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.firma-pdf-zona::-webkit-scrollbar-track {
    background: rgba(102, 112, 133, 0.12);
}

.firma-pdf-zona::-webkit-scrollbar-thumb {
    border: 3px solid transparent;
    border-radius: 999px;
    background:
        rgba(102, 112, 133, 0.55);
    background-clip: padding-box;
}

.firma-pdf-zona::-webkit-scrollbar-thumb:hover {
    background:
        rgba(71, 84, 103, 0.72);
    background-clip: padding-box;
}

.firma-pdf-zona::-webkit-scrollbar-corner {
    background: #e9edf2;
}

body.dark-mode
.firma-pdf-zona::-webkit-scrollbar-corner {
    background: #151719;
}

.firma-pdf-zona {
    scrollbar-color:
        rgba(102, 112, 133, 0.55)
        rgba(102, 112, 133, 0.12);
}

body.dark-mode .firma-pdf-zona {
    scrollbar-color:
        rgba(173, 181, 189, 0.42)
        rgba(255, 255, 255, 0.06);
}

/* ----------------------------------------------------------
   Modo oscuro
---------------------------------------------------------- */

body.dark-mode #btnFirmaMoverDocumento.activo {
    border-color: #6ea8fe;
    background: rgba(13, 110, 253, 0.15);
    color: #9ec5fe;
}

body.dark-mode
.firma-pdf-zona::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
}

body.dark-mode
.firma-pdf-zona::-webkit-scrollbar-thumb {
    background:
        rgba(173, 181, 189, 0.42);
    background-clip: padding-box;
}

/* ----------------------------------------------------------
   Responsive
---------------------------------------------------------- */

@media (max-width: 991.98px) {

    .firma-pdf-herramientas {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 575.98px) {

    .firma-pdf-herramientas {
        align-items: stretch;
        flex-direction: column;
    }

    .firma-pdf-zoom,
    .firma-pdf-navegacion {
        width: 100%;
        justify-content: space-between;
    }

    #firmaPDFZoom {
        flex: 1;
        width: auto;
    }

    .firma-pdf-zona {
        max-height: 580px;
    }
}

/* ==========================================================
   ENTREGA 46C.6F.2
   Selección visual de páginas para firmar
========================================================== */

.firma-paginas-card {
    padding: 1rem;
    border: 1px solid #e4e8ef;
    border-radius: 15px;
    background: #f8fafc;
}

.firma-paginas-encabezado {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.firma-paginas-icono {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(47, 158, 68, 0.11);
    color: #2f9e44;
    font-size: 1.1rem;
}

.firma-paginas-encabezado h3 {
    margin: 0 0 0.2rem;
    color: #344054;
    font-size: 0.9rem;
    font-weight: 750;
}

.firma-paginas-encabezado p {
    margin: 0;
    color: #667085;
    font-size: 0.78rem;
    line-height: 1.45;
}

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

/*
|--------------------------------------------------------------------------
| La opción personalizada ocupa todo el ancho
|--------------------------------------------------------------------------
*/

.firma-pagina-opcion:has(
    input[value="personalizado"]
) {
    grid-column: 1 / -1;
}

.firma-pagina-opcion {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.85rem;
    border: 1px solid #dfe4ea;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition:
        border-color 0.18s ease,
        background-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

.firma-pagina-opcion:hover {
    border-color: #2f9e44;
    transform: translateY(-1px);
}

.firma-pagina-opcion.activa {
    border-color: #2f9e44;
    background: rgba(47, 158, 68, 0.075);
    box-shadow:
        0 0 0 2px rgba(47, 158, 68, 0.09);
}

.firma-pagina-opcion input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.firma-pagina-opcion-marca {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #f2f4f7;
    color: #667085;
    transition:
        background-color 0.18s ease,
        color 0.18s ease;
}

.firma-pagina-opcion.activa
.firma-pagina-opcion-marca {
    background: rgba(47, 158, 68, 0.14);
    color: #2f9e44;
}

.firma-pagina-opcion-contenido {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
}

.firma-pagina-opcion-contenido strong {
    color: #344054;
    font-size: 0.8rem;
    line-height: 1.35;
}

.firma-pagina-opcion-contenido small {
    color: #667085;
    font-size: 0.7rem;
    line-height: 1.4;
}

.firma-paginas-personalizadas {
    margin-top: 0.9rem;
    padding: 0.9rem;
    border: 1px solid rgba(47, 158, 68, 0.18);
    border-radius: 12px;
    background: rgba(47, 158, 68, 0.045);
}

.firma-paginas-error {
    margin-top: 0.45rem;
    color: #dc3545;
    font-size: 0.75rem;
    font-weight: 650;
}

.firma-paginas-resumen {
    margin-top: 0.65rem;
    padding: 0.65rem 0.75rem;
    border-radius: 9px;
    background: rgba(47, 158, 68, 0.1);
    color: #357a44;
    font-size: 0.75rem;
    font-weight: 650;
    line-height: 1.45;
}

.firma-paginas-resultado {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 0.9rem;
    padding: 0.7rem 0.8rem;
    border-radius: 10px;
    background: #eef2f6;
    color: #667085;
    font-size: 0.76rem;
    line-height: 1.45;
}

.firma-paginas-resultado i {
    flex: 0 0 auto;
    margin-top: 0.05rem;
    color: #2f9e44;
}

/* Accesibilidad mediante teclado */

.firma-pagina-opcion:has(input:focus-visible) {
    outline: 3px solid rgba(13, 110, 253, 0.22);
    outline-offset: 2px;
}

/* Modo oscuro */

body.dark-mode .firma-paginas-card {
    border-color: #343941;
    background: #24272b;
}

body.dark-mode .firma-paginas-encabezado h3,
body.dark-mode
.firma-pagina-opcion-contenido strong {
    color: #f1f3f5;
}

body.dark-mode .firma-paginas-encabezado p,
body.dark-mode
.firma-pagina-opcion-contenido small {
    color: #adb5bd;
}

body.dark-mode .firma-pagina-opcion {
    border-color: #3c4148;
    background: #1e1e1e;
}

body.dark-mode .firma-pagina-opcion.activa {
    border-color: #51cf66;
    background: rgba(47, 158, 68, 0.12);
}

body.dark-mode .firma-pagina-opcion-marca {
    background: #2b2f34;
    color: #adb5bd;
}

body.dark-mode
.firma-pagina-opcion.activa
.firma-pagina-opcion-marca {
    background: rgba(47, 158, 68, 0.18);
    color: #69db7c;
}

body.dark-mode .firma-paginas-personalizadas {
    border-color: rgba(81, 207, 102, 0.18);
    background: rgba(47, 158, 68, 0.08);
}

body.dark-mode .firma-paginas-resumen {
    background: rgba(47, 158, 68, 0.14);
    color: #8ce99a;
}

body.dark-mode .firma-paginas-resultado {
    background: #1e1e1e;
    color: #adb5bd;
}

/* Responsive */

@media (max-width: 767.98px) {

    .firma-paginas-opciones {
        grid-template-columns: 1fr;
    }

    .firma-pagina-opcion:has(
       input[value="personalizado"]
   ) {
       grid-column: auto;
   }
}

/* ==========================================================
   ENTREGA 48.2A
   Navegación por categorías de Fotos a PDF
========================================================== */

/*
|--------------------------------------------------------------------------
| Barra de categorías
|--------------------------------------------------------------------------
*/

.fotos-pdf-config-nav {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    padding: 1rem;
    background: #f8f9fb;
    border-bottom: 1px solid var(
        --app-border,
        #e4e8ef
    );
}

/*
|--------------------------------------------------------------------------
| Botón de categoría
|--------------------------------------------------------------------------
*/

.fotos-pdf-config-tab {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.8rem;
    border: 1px solid #dfe4eb;
    border-radius: 12px;
    background: #ffffff;
    color: #343a40;
    text-decoration: none;
    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.fotos-pdf-config-tab:hover {
    color: #0d6efd;
    border-color: rgba(
        13,
        110,
        253,
        0.45
    );
    background: rgba(
        13,
        110,
        253,
        0.045
    );
    transform: translateY(-1px);
    box-shadow:
        0 5px 14px
        rgba(13, 110, 253, 0.08);
}

.fotos-pdf-config-tab:focus-visible {
    outline: 3px solid
        rgba(13, 110, 253, 0.25);
    outline-offset: 2px;
}

/*
|--------------------------------------------------------------------------
| Categoría principal
|--------------------------------------------------------------------------
*/

.fotos-pdf-config-tab.activa {
    color: #0d6efd;
    border-color: rgba(
        13,
        110,
        253,
        0.5
    );
    background: rgba(
        13,
        110,
        253,
        0.08
    );
}

/*
|--------------------------------------------------------------------------
| Icono
|--------------------------------------------------------------------------
*/

.fotos-pdf-config-tab-icono {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(
        13,
        110,
        253,
        0.09
    );
    color: #0d6efd;
    font-size: 1.05rem;
}

.fotos-pdf-config-tab.activa
.fotos-pdf-config-tab-icono {
    background: #0d6efd;
    color: #ffffff;
}

/*
|--------------------------------------------------------------------------
| Textos
|--------------------------------------------------------------------------
*/

.fotos-pdf-config-tab-contenido {
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.fotos-pdf-config-tab-contenido strong {
    font-size: 0.85rem;
    font-weight: 700;
}

.fotos-pdf-config-tab-contenido small {
    margin-top: 0.15rem;
    color: #6c757d;
    font-size: 0.7rem;
    white-space: normal;
}

/*
|--------------------------------------------------------------------------
| Destinos de navegación
|--------------------------------------------------------------------------
*/

.fotos-pdf-config-panel {
    scroll-margin-top: 1.5rem;
}

/*
|--------------------------------------------------------------------------
| Destacar temporalmente la sección seleccionada
|--------------------------------------------------------------------------
*/

.fotos-pdf-config-panel:target {
    border-color: rgba(
        13,
        110,
        253,
        0.4
    );
    background: rgba(
        13,
        110,
        253,
        0.025
    );
}

/*
|--------------------------------------------------------------------------
| Modo oscuro
|--------------------------------------------------------------------------
*/

body.dark-mode
.fotos-pdf-config-nav {
    background: #191919;
    border-color: #343941;
}

body.dark-mode
.fotos-pdf-config-tab {
    color: #e9ecef;
    background: #252525;
    border-color: #3c4148;
}

body.dark-mode
.fotos-pdf-config-tab:hover {
    color: #8ab8ff;
    background: rgba(
        13,
        110,
        253,
        0.12
    );
    border-color: rgba(
        110,
        168,
        254,
        0.55
    );
}

body.dark-mode
.fotos-pdf-config-tab.activa {
    color: #8ab8ff;
    background: rgba(
        13,
        110,
        253,
        0.16
    );
    border-color: rgba(
        110,
        168,
        254,
        0.6
    );
}

body.dark-mode
.fotos-pdf-config-tab-contenido small {
    color: #adb5bd;
}

body.dark-mode
.fotos-pdf-config-panel:target {
    border-color: rgba(
        110,
        168,
        254,
        0.45
    );
    background: rgba(
        13,
        110,
        253,
        0.06
    );
}

/*
|--------------------------------------------------------------------------
| Responsive
|--------------------------------------------------------------------------
*/

@media (max-width: 1199.98px) {

    .fotos-pdf-config-nav {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991.98px) {

    .fotos-pdf-config-nav {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {

    .fotos-pdf-config-nav {
        grid-template-columns: 1fr;
        padding: 0.8rem;
    }

    .fotos-pdf-config-tab {
        padding: 0.7rem;
    }
}

/* ==========================================================
   ENTREGA 48.2B
   Pestañas funcionales de Fotos a PDF
========================================================== */

/*
|--------------------------------------------------------------------------
| Botones reales
|--------------------------------------------------------------------------
*/

button.fotos-pdf-config-tab {
    width: 100%;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

/*
|--------------------------------------------------------------------------
| Paneles
|--------------------------------------------------------------------------
*/

.fotos-pdf-config-panel {
    display: none;
    margin-bottom: 0;
    animation:
        fotosPdfPanelEntrada
        0.22s ease;
}

.fotos-pdf-config-panel.activo {
    display: block;
}

.fotos-pdf-config-panel[hidden] {
    display: none !important;
}

/*
|--------------------------------------------------------------------------
| Animación de entrada
|--------------------------------------------------------------------------
*/

@keyframes fotosPdfPanelEntrada {

    from {
        opacity: 0;
        transform:
            translateY(5px);
    }

    to {
        opacity: 1;
        transform:
            translateY(0);
    }
}

/*
|--------------------------------------------------------------------------
| Cuerpo del panel
|--------------------------------------------------------------------------
*/

.configuracion-pdf-body {
    min-height: 340px;
}

/*
|--------------------------------------------------------------------------
| Accesibilidad y movimiento reducido
|--------------------------------------------------------------------------
*/

@media (
    prefers-reduced-motion:
    reduce
) {

    .fotos-pdf-config-panel {
        animation: none;
    }

    .fotos-pdf-config-tab {
        transition: none;
    }
}

/* ==========================================================
   ENTREGA 48.2C
   Diseño interno de las categorías de Fotos a PDF
========================================================== */

/*
|--------------------------------------------------------------------------
| Encabezado de cada panel
|--------------------------------------------------------------------------
*/

.fotos-pdf-panel-header {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid
        rgba(108, 117, 125, 0.16);
}

.fotos-pdf-panel-header-icono {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    font-size: 1.15rem;
}

.fotos-pdf-panel-header-texto {
    min-width: 0;
}

.fotos-pdf-panel-header-texto h6 {
    margin: 0;
    color: #212529;
    font-size: 1rem;
    font-weight: 700;
}

.fotos-pdf-panel-header-texto p {
    margin: 0.25rem 0 0;
    color: #6c757d;
    font-size: 0.82rem;
    line-height: 1.45;
}

/*
|--------------------------------------------------------------------------
| Campos del documento
|--------------------------------------------------------------------------
*/

.fotos-pdf-campos-grid {
    display: grid;
    gap: 1rem;
}

.fotos-pdf-campo {
    min-width: 0;
}

.fotos-pdf-config-panel .form-label {
    margin-bottom: 0.4rem;
    color: #495057;
    font-size: 0.82rem;
    font-weight: 650;
}

.fotos-pdf-config-panel .form-control,
.fotos-pdf-config-panel .form-select {
    min-height: 44px;
    border-radius: 11px;
}

/*
|--------------------------------------------------------------------------
| Interruptores principales
|--------------------------------------------------------------------------
*/

.fotos-pdf-opcion-principal {
    position: relative;
    display: grid;
    grid-template-columns:
        minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.7rem;
    min-height: 64px;
    margin: 0;
    padding:
        0.85rem
        0.85rem
        0.85rem
        3.15rem;
    border: 1px solid #dfe4eb;
    border-radius: 13px;
    background: #f8f9fb;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.fotos-pdf-opcion-principal
.form-check-input {
    position: absolute;
    top: 50%;
    left: 0.9rem;
    margin: 0;
    transform: translateY(-50%);
}

.fotos-pdf-opcion-principal
.form-check-label {
    min-width: 0;
    margin: 0;
    font-weight: 650;
    line-height: 1.35;
    cursor: pointer;
}

/*
|--------------------------------------------------------------------------
| Badge Activado / Desactivado
|--------------------------------------------------------------------------
*/

.fotos-pdf-estado-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 25px;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: #e9ecef;
    color: #6c757d;
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
}

.fotos-pdf-opcion-principal.activa {
    border-color: rgba(25, 135, 84, 0.4);
    background: rgba(25, 135, 84, 0.06);
    box-shadow:
        0 5px 16px
        rgba(25, 135, 84, 0.07);
}

.fotos-pdf-opcion-principal.activa
.fotos-pdf-estado-badge {
    background: #198754;
    color: #ffffff;
}

/*
|--------------------------------------------------------------------------
| Contenedor de opciones secundarias
|--------------------------------------------------------------------------
*/

.fotos-pdf-opciones-secundarias {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid #e4e8ef;
    border-radius: 13px;
    background: #ffffff;
}

/*
|--------------------------------------------------------------------------
| Resumen visual
|--------------------------------------------------------------------------
*/

.fotos-pdf-resumen-grid {
    display: grid;
    gap: 0.8rem;
}

.fotos-pdf-resumen-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 0;
    padding: 0.9rem;
    border: 1px solid #e2e6ec;
    border-radius: 13px;
    background: #ffffff;
}

.fotos-pdf-resumen-item.destacado {
    border-color: rgba(13, 110, 253, 0.32);
    background: rgba(13, 110, 253, 0.045);
}

.fotos-pdf-resumen-icono {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: #eef3f8;
    color: #495057;
    font-size: 1rem;
}

.fotos-pdf-resumen-item.destacado
.fotos-pdf-resumen-icono {
    background: #0d6efd;
    color: #ffffff;
}

.fotos-pdf-resumen-contenido {
    min-width: 0;
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.fotos-pdf-resumen-contenido small {
    color: #6c757d;
    font-size: 0.75rem;
    font-weight: 600;
}

.fotos-pdf-resumen-contenido strong {
    color: #212529;
    font-size: 0.95rem;
    font-weight: 750;
    text-align: right;
}

/*
|--------------------------------------------------------------------------
| Modo oscuro
|--------------------------------------------------------------------------
*/

body.dark-mode
.fotos-pdf-panel-header {
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode
.fotos-pdf-panel-header-texto h6 {
    color: #f1f3f5;
}

body.dark-mode
.fotos-pdf-panel-header-texto p,
body.dark-mode
.fotos-pdf-config-panel .form-label {
    color: #adb5bd;
}

body.dark-mode
.fotos-pdf-panel-header-icono {
    background: rgba(13, 110, 253, 0.18);
    color: #8ab8ff;
}

body.dark-mode
.fotos-pdf-opcion-principal {
    background: #252525;
    border-color: #3c4148;
}

body.dark-mode
.fotos-pdf-opcion-principal.activa {
    background: rgba(25, 135, 84, 0.12);
    border-color: rgba(75, 192, 125, 0.45);
}

body.dark-mode
.fotos-pdf-estado-badge {
    background: #3a3a3a;
    color: #c5cbd1;
}

body.dark-mode
.fotos-pdf-opcion-principal.activa
.fotos-pdf-estado-badge {
    background: #198754;
    color: #ffffff;
}

body.dark-mode
.fotos-pdf-opciones-secundarias,
body.dark-mode
.fotos-pdf-resumen-item {
    background: #252525;
    border-color: #3c4148;
}

body.dark-mode
.fotos-pdf-resumen-item.destacado {
    background: rgba(13, 110, 253, 0.12);
    border-color: rgba(110, 168, 254, 0.4);
}

body.dark-mode
.fotos-pdf-resumen-icono {
    background: #33373c;
    color: #d9dee3;
}

body.dark-mode
.fotos-pdf-resumen-contenido small {
    color: #adb5bd;
}

body.dark-mode
.fotos-pdf-resumen-contenido strong {
    color: #f1f3f5;
}

/*
|--------------------------------------------------------------------------
| Responsive
|--------------------------------------------------------------------------
*/

@media (max-width: 575.98px) {

    .fotos-pdf-panel-header {
        gap: 0.7rem;
    }

    .fotos-pdf-panel-header-icono {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .fotos-pdf-opcion-principal {
        grid-template-columns:
            minmax(0, 1fr);
        padding-left: 3.15rem;
    }

    .fotos-pdf-estado-badge {
        justify-self: start;
    }

    .fotos-pdf-resumen-contenido {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.15rem;
    }

    .fotos-pdf-resumen-contenido strong {
        text-align: left;
    }
}

/* ==========================================================
   ENTREGA 48.2C — PARTE 4
   Navegación compacta de Fotos a PDF
========================================================== */

/*
|--------------------------------------------------------------------------
| Cuadrícula de navegación
|--------------------------------------------------------------------------
*/

.fotos-pdf-config-nav {
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
    padding: 1rem;
}

/*
|--------------------------------------------------------------------------
| Tarjetas compactas
|--------------------------------------------------------------------------
*/

button.fotos-pdf-config-tab {
    min-height: 112px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.8rem 0.55rem;
    text-align: center;
}

/*
|--------------------------------------------------------------------------
| Iconos
|--------------------------------------------------------------------------
*/

.fotos-pdf-config-tab-icono {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 12px;
    font-size: 1.1rem;
}

/*
|--------------------------------------------------------------------------
| Contenido textual
|--------------------------------------------------------------------------
*/

.fotos-pdf-config-tab-contenido {
    width: 100%;
    min-width: 0;
    align-items: center;
    text-align: center;
}

.fotos-pdf-config-tab-contenido strong {
    display: block;
    width: 100%;
    font-size: 0.83rem;
    line-height: 1.2;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
}

.fotos-pdf-config-tab-contenido small {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.67rem;
    line-height: 1.3;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
}

/*
|--------------------------------------------------------------------------
| Ocultar descripciones en el panel lateral angosto
|--------------------------------------------------------------------------
*/

@media (
    min-width: 992px
) and (
    max-width: 1399.98px
) {

    .fotos-pdf-config-tab-contenido small {
        display: none;
    }

    button.fotos-pdf-config-tab {
        min-height: 88px;
    }
}

/*
|--------------------------------------------------------------------------
| Pantallas amplias
|--------------------------------------------------------------------------
*/

@media (min-width: 1400px) {

    button.fotos-pdf-config-tab {
        min-height: 106px;
    }

    .fotos-pdf-config-tab-contenido strong {
        font-size: 0.86rem;
    }
}

/*
|--------------------------------------------------------------------------
| Tablet: cuatro botones en una fila
|--------------------------------------------------------------------------
*/

@media (
    min-width: 768px
) and (
    max-width: 991.98px
) {

    .fotos-pdf-config-nav {
        grid-template-columns:
            repeat(4, minmax(0, 1fr));
    }

    button.fotos-pdf-config-tab {
        min-height: 100px;
    }

    .fotos-pdf-config-tab-contenido small {
        display: none;
    }
}

/*
|--------------------------------------------------------------------------
| Móvil
|--------------------------------------------------------------------------
*/

@media (max-width: 575.98px) {

    .fotos-pdf-config-nav {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
        gap: 0.55rem;
        padding: 0.75rem;
    }

    button.fotos-pdf-config-tab {
        min-height: 86px;
        padding: 0.65rem 0.4rem;
    }

    .fotos-pdf-config-tab-icono {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .fotos-pdf-config-tab-contenido strong {
        font-size: 0.78rem;
    }

    .fotos-pdf-config-tab-contenido small {
        display: none;
    }
}

/* ==========================================================
   ENTREGA 48.2C — PARTE 5
   Ajuste de interruptores principales
========================================================== */

.fotos-pdf-opcion-principal {
    grid-template-columns:
        minmax(0, 1fr) auto;
    padding:
        1rem
        0.9rem
        1rem
        4rem;
}

.fotos-pdf-opcion-principal
.form-check-input {
    left: 1rem;
    width: 2.3rem;
    height: 1.25rem;
}

.fotos-pdf-opcion-principal
.form-check-label {
    display: block;
    padding-left: 0.15rem;
    line-height: 1.3;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
}

.fotos-pdf-estado-badge {
    margin-left: 0.5rem;
}

/*
|--------------------------------------------------------------------------
| Panel lateral angosto
|--------------------------------------------------------------------------
*/

@media (
    min-width: 992px
) and (
    max-width: 1399.98px
) {

    .fotos-pdf-opcion-principal {
        grid-template-columns: 1fr;
        align-items: start;
        padding:
            1rem
            0.85rem
            1rem
            4rem;
    }

    .fotos-pdf-estado-badge {
        justify-self: start;
        margin-top: 0.45rem;
        margin-left: 0;
    }
}

/*
|--------------------------------------------------------------------------
| Móvil
|--------------------------------------------------------------------------
*/

@media (max-width: 575.98px) {

    .fotos-pdf-opcion-principal {
        grid-template-columns: 1fr;
        padding-left: 4rem;
    }

    .fotos-pdf-estado-badge {
        justify-self: start;
        margin-left: 0;
    }
}

/* ==========================================================
   ENTREGA 48.2C — PARTE 6
   Panel de configuración más ancho
========================================================== */

/*
|--------------------------------------------------------------------------
| Evitar desbordamientos en ambas columnas
|--------------------------------------------------------------------------
*/

.app-workspace > .app-main,
.app-workspace > .app-sidebar {
    min-width: 0;
}

/*
|--------------------------------------------------------------------------
| Portátiles y escritorios medianos
|--------------------------------------------------------------------------
*/

@media (
    min-width: 992px
) and (
    max-width: 1199.98px
) {

    .app-workspace > .app-sidebar {
        flex:
            0 0 370px;
        width: 370px;
        max-width: 370px;
    }

    .app-workspace > .app-main {
        flex:
            1 1 0;
        width:
            calc(100% - 370px);
        max-width:
            calc(100% - 370px);
    }
}

/*
|--------------------------------------------------------------------------
| Escritorios normales
|--------------------------------------------------------------------------
*/

@media (
    min-width: 1200px
) and (
    max-width: 1599.98px
) {

    .app-workspace > .app-sidebar {
        flex:
            0 0 420px;
        width: 420px;
        max-width: 420px;
    }

    .app-workspace > .app-main {
        flex:
            1 1 0;
        width:
            calc(100% - 420px);
        max-width:
            calc(100% - 420px);
    }
}

/*
|--------------------------------------------------------------------------
| Escritorios grandes
|--------------------------------------------------------------------------
*/

@media (min-width: 1600px) {

    .app-workspace > .app-sidebar {
        flex:
            0 0 430px;
        width: 430px;
        max-width: 430px;
    }

    .app-workspace > .app-main {
        flex:
            1 1 0;
        width:
            calc(100% - 430px);
        max-width:
            calc(100% - 430px);
    }
}

/*
|--------------------------------------------------------------------------
| Aprovechar el nuevo ancho en los interruptores
|--------------------------------------------------------------------------
*/

@media (min-width: 1200px) {

    .fotos-pdf-opcion-principal {
        grid-template-columns:
            minmax(0, 1fr)
            auto;
        align-items: center;
    }

    .fotos-pdf-estado-badge {
        justify-self: end;
        margin-top: 0;
        margin-left: 0.6rem;
    }
}

/* ==========================================================
   ENTREGA 48.2C — PARTE 7
   Eliminar scroll interno del panel de configuración
========================================================== */

/*
|--------------------------------------------------------------------------
| El panel deja de tener altura limitada
|--------------------------------------------------------------------------
*/

.configuracion-pdf-card {
    height: auto;
    max-height: none;
    overflow: visible;
}

/*
|--------------------------------------------------------------------------
| El cuerpo tampoco genera scroll propio
|--------------------------------------------------------------------------
*/

.configuracion-pdf-body {
    height: auto;
    max-height: none;
    overflow: visible;
}

/*
|--------------------------------------------------------------------------
| La columna lateral permite que el contenido crezca
|--------------------------------------------------------------------------
*/

.app-sidebar {
    height: auto;
    max-height: none;
    overflow: visible;
    align-self: flex-start;
}

/*
|--------------------------------------------------------------------------
| Desactivar reglas antiguas de panel fijo con scroll
|--------------------------------------------------------------------------
*/

.sticky-panel,
.configuracion-pdf-card.sticky-panel {
    position: static;
    top: auto;
    max-height: none;
    overflow: visible;
}

/*
|--------------------------------------------------------------------------
| Evitar una barra de desplazamiento residual
|--------------------------------------------------------------------------
*/

.configuracion-pdf-card::-webkit-scrollbar,
.configuracion-pdf-body::-webkit-scrollbar,
.app-sidebar::-webkit-scrollbar {
    display: none;
}

.configuracion-pdf-card,
.configuracion-pdf-body,
.app-sidebar {
    scrollbar-width: none;
}

/*
|--------------------------------------------------------------------------
| Mantener las acciones dentro del flujo normal
|--------------------------------------------------------------------------
*/

.configuracion-acciones {
    position: static;
    bottom: auto;
    z-index: auto;
}

/* ==========================================================
   ENTREGA 48.2C — PARTE 8
   Distribución compacta de controles
========================================================== */

/*
|--------------------------------------------------------------------------
| Panel Documento
|--------------------------------------------------------------------------
*/

#configDocumento .fotos-pdf-campos-grid {
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

#configDocumento
.fotos-pdf-campos-grid
> .fotos-pdf-campo:first-child,
#configDocumento
.fotos-pdf-campos-grid
> .fotos-pdf-campo:last-child {
    grid-column: 1 / -1;
}

#configDocumento .row {
    grid-column: 1 / -1;
    margin: 0;
}

#configDocumento .row > [class*="col-"] {
    padding-left: 0;
    padding-right: 0;
}

/*
|--------------------------------------------------------------------------
| Marca de agua
|--------------------------------------------------------------------------
*/

#configMarcaAgua
.fotos-pdf-opciones-secundarias
.row {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin: 0;
}

#configMarcaAgua
.fotos-pdf-opciones-secundarias
.row > [class*="col-"] {
    width: auto;
    max-width: none;
    padding: 0;
    --bs-gutter-y: 0rem;
}

#configMarcaAgua
.fotos-pdf-opciones-secundarias
.row > [class*="col-"]:last-child {
    grid-column: 1 / -1;
}

/*
|--------------------------------------------------------------------------
| Protección
|--------------------------------------------------------------------------
*/

#configProteccion
.fotos-pdf-opciones-secundarias {
    padding: 1rem;
}

/*
|--------------------------------------------------------------------------
| Campos más compactos
|--------------------------------------------------------------------------
*/

.fotos-pdf-config-panel .form-control,
.fotos-pdf-config-panel .form-select {
    min-height: 42px;
}

.fotos-pdf-config-panel .mb-3,
.fotos-pdf-config-panel .mt-3 {
    margin-bottom: 0.85rem !important;
    margin-top: 0.85rem !important;
}

/*
|--------------------------------------------------------------------------
| Pantallas angostas
|--------------------------------------------------------------------------
*/

@media (max-width: 1199.98px) {

    #configDocumento .fotos-pdf-campos-grid,
    #configMarcaAgua
    .fotos-pdf-opciones-secundarias
    .row {
        grid-template-columns: 1fr;
    }

    #configDocumento
    .fotos-pdf-campos-grid
    > .fotos-pdf-campo,
    #configMarcaAgua
    .fotos-pdf-opciones-secundarias
    .row
    > [class*="col-"] {
        grid-column: auto;
    }
}

/* ==========================================================
   ENTREGA 48.2C — PARTE 9
   Distribución equilibrada del panel Documento
========================================================== */

#configDocumento .fotos-pdf-campos-grid {
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
}

/*
|--------------------------------------------------------------------------
| Tamaño de papel y Calidad
|--------------------------------------------------------------------------
*/

#configDocumento
.fotos-pdf-campos-grid
> .fotos-pdf-campo:first-child {
    grid-column: 1;
}

#configDocumento
.fotos-pdf-campos-grid
> .fotos-pdf-campo:nth-of-type(3) {
    grid-column: 2;
    grid-row: 1;
}

/*
|--------------------------------------------------------------------------
| Orientación y Márgenes
|--------------------------------------------------------------------------
*/

#configDocumento
.fotos-pdf-campos-grid
> .row {
    grid-column: 1 / -1;
}

/*
|--------------------------------------------------------------------------
| Nombre del PDF
|--------------------------------------------------------------------------
*/

#configDocumento
.fotos-pdf-campos-grid
> .fotos-pdf-campo:last-child {
    grid-column: 1 / -1;
}

/*
|--------------------------------------------------------------------------
| Eliminar márgenes Bootstrap que alteran la cuadrícula
|--------------------------------------------------------------------------
*/

#configDocumento
.fotos-pdf-campos-grid
> .fotos-pdf-campo {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/*
|--------------------------------------------------------------------------
| Pantallas angostas
|--------------------------------------------------------------------------
*/

@media (max-width: 1199.98px) {

    #configDocumento
    .fotos-pdf-campos-grid {
        grid-template-columns: 1fr;
    }

    #configDocumento
    .fotos-pdf-campos-grid
    > .fotos-pdf-campo,
    #configDocumento
    .fotos-pdf-campos-grid
    > .row {
        grid-column: 1;
        grid-row: auto;
    }
}

/* ==========================================================
   ENTREGA 49.1
   Resúmenes inteligentes de configuración
========================================================== */

.fotos-pdf-resumen-config {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin-bottom: 1.1rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid
        rgba(13, 110, 253, 0.2);
    border-radius: 11px;
    background:
        rgba(13, 110, 253, 0.055);
    color: #495057;
    font-size: 0.76rem;
    line-height: 1.45;
}

.fotos-pdf-resumen-config i {
    flex: 0 0 auto;
    margin-top: 0.08rem;
    color: #0d6efd;
    font-size: 0.9rem;
}

.fotos-pdf-resumen-config span {
    min-width: 0;
    overflow-wrap: anywhere;
}

body.dark-mode
.fotos-pdf-resumen-config {
    border-color:
        rgba(110, 168, 254, 0.28);
    background:
        rgba(13, 110, 253, 0.1);
    color: #c8ced4;
}

body.dark-mode
.fotos-pdf-resumen-config i {
    color: #78adff;
}

/* ==========================================================
   ENTREGA 49.2
   Estados dinámicos de las pestañas
========================================================== */

.fotos-pdf-config-tab-estado {
    display: block;
    width: 100%;
    margin-top: 0.3rem;
    color: #6c757d;
    font-size: 0.68rem;
    font-weight: 500;
    line-height: 1.3;
    text-align: center;
}

.fotos-pdf-config-tab.activa
.fotos-pdf-config-tab-estado {
    color: #8ab8ff;
}

body:not(.dark-mode)
.fotos-pdf-config-tab.activa
.fotos-pdf-config-tab-estado {
    color: #416b9e;
}

body.dark-mode
.fotos-pdf-config-tab-estado {
    color: #adb5bd;
}

@media (max-width: 575.98px) {

    .fotos-pdf-config-tab-estado {
        font-size: 0.63rem;
    }
}

/* ==========================================================
   FOOTER GLOBAL
========================================================== */

.app-footer {
    width: 100%;
    margin-top: auto;
    flex-shrink: 0;
    border-top: 1px solid #e4e8ef;
    background: #ffffff;
}

.app-footer-contenido {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.app-footer-marca {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #344054;
    font-weight: 750;
}

.app-footer-marca i {
    color: #0d6efd;
    font-size: 1.25rem;
}

.app-footer-info {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.55rem;
    color: #667085;
    font-size: 0.8rem;
}

.app-footer-separador {
    color: #c1c7d0;
}

body.dark-mode .app-footer {
    border-color: #343941;
    background: #1a1a1a;
}

body.dark-mode .app-footer-marca {
    color: #f1f3f5;
}

body.dark-mode .app-footer-info {
    color: #adb5bd;
}

body.dark-mode .app-footer-separador {
    color: #555b64;
}

@media (max-width: 767.98px) {

    .app-footer-contenido {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
    }

    .app-footer-info {
        justify-content: flex-start;
    }
}

@media (max-width: 479.98px) {

    .app-footer-separador {
        display: none;
    }

    .app-footer-info {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* Estado normal del botón manual */

#btnPosicionManualFirma:not(.activo) {
    border-color: #2f9e44;
    background: transparent;
    color: #2f9e44;
    box-shadow: none;
}

/* Evitar que Bootstrap lo deje visualmente pulsado */

#btnPosicionManualFirma:not(.activo):active,
#btnPosicionManualFirma:not(.activo):focus,
#btnPosicionManualFirma:not(.activo):focus-visible {
    border-color: #2f9e44;
    background: transparent;
    color: #2f9e44;
    box-shadow:
        0 0 0 0.2rem rgba(47, 158, 68, 0.12);
}

/* Estado manual realmente activo */

#btnPosicionManualFirma.activo,
#btnPosicionManualFirma.activo:hover,
#btnPosicionManualFirma.activo:focus {
    border-color: #2f9e44;
    background: #198754;
    color: #fff;
}

body.dark-mode
#btnPosicionManualFirma:not(.activo) {
    border-color: #51cf66;
    background: transparent;
    color: #69db7c;
}

body.dark-mode
#btnPosicionManualFirma.activo {
    border-color: #51cf66;
    background: rgba(47, 158, 68, 0.28);
    color: #8ce99a;
}

/* ==========================================================
   ENTREGA 49.3
   Unificación de paneles y nueva zona de acciones
========================================================== */

/*
|--------------------------------------------------------------------------
| Documento: mismo contenedor que Marca de agua
|--------------------------------------------------------------------------
*/

#configDocumento
.fotos-pdf-documento-opciones {
    margin-top: 0;
    padding: 1rem;
}

#configDocumento
.fotos-pdf-documento-opciones
.fotos-pdf-campo {
    min-width: 0;
}

#configDocumento
.fotos-pdf-documento-opciones
.row {
    margin: 0;
    padding: 0;
    gap: 1rem;
}

#configDocumento
.fotos-pdf-documento-opciones
.row > [class*="col-"] {
    min-width: 0;
    padding: 0;
}

/*
|--------------------------------------------------------------------------
| Orden y separación interna de Documento
|--------------------------------------------------------------------------
*/

#configDocumento
.fotos-pdf-campos-grid {
    align-items: end;
    gap: 1rem;
}

#configDocumento
.fotos-pdf-campo {
    margin: 0 !important;
}

#configDocumento
.form-label {
    min-height: 1.25rem;
}

/*
|--------------------------------------------------------------------------
| Marca de agua: ordenar el contenido
|--------------------------------------------------------------------------
*/

#configMarcaAgua
.fotos-pdf-opciones-secundarias {
    padding: 1rem;
}

#configMarcaAgua
.fotos-pdf-opciones-secundarias
> .mb-3 {
    margin-top: 0 !important;
}

#configMarcaAgua
.fotos-pdf-opciones-secundarias
.row {
    align-items: end;
}

#configMarcaAgua
.fotos-pdf-opciones-secundarias
.form-label {
    min-height: 1.25rem;
}

#configMarcaAgua
.preview-marca-agua {
    margin-top: 1rem !important;
}

/*
|--------------------------------------------------------------------------
| Zona exterior de acciones
|--------------------------------------------------------------------------
*/

.configuracion-acciones {
    display: block;
    padding: 1rem;
    border-top: 1px solid #e1e6ed;
    background: #f5f7fa;
}

/*
|--------------------------------------------------------------------------
| Cabecera de acciones
|--------------------------------------------------------------------------
*/

.configuracion-acciones-cabecera {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid
        rgba(108, 117, 125, 0.16);
}

.configuracion-acciones-icono {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    font-size: 1rem;
}

.configuracion-acciones-texto {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.configuracion-acciones-texto strong {
    color: #212529;
    font-size: 0.82rem;
    font-weight: 750;
}

.configuracion-acciones-texto small {
    margin-top: 0.12rem;
    color: #6c757d;
    font-size: 0.68rem;
    line-height: 1.35;
}

/*
|--------------------------------------------------------------------------
| Contenedor de botones
|--------------------------------------------------------------------------
*/

.configuracion-acciones-botones {
    display: grid;
    gap: 0.65rem;
}

/*
|--------------------------------------------------------------------------
| Base común
|--------------------------------------------------------------------------
*/

.configuracion-acciones-botones .btn {
    position: relative;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 750;
    transition:
        transform 0.18s ease,
        background-color 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        color 0.18s ease;
}

.configuracion-acciones-botones
.btn:not(:disabled):hover {
    transform: translateY(-1px);
}

/*
|--------------------------------------------------------------------------
| Iconos internos
|--------------------------------------------------------------------------
*/

.fotos-pdf-btn-icono {
    width: 27px;
    height: 27px;
    flex: 0 0 27px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.9rem;
}

/*
|--------------------------------------------------------------------------
| Convertir
|--------------------------------------------------------------------------
*/

.fotos-pdf-btn-convertir {
    border: 1px solid #168454;
    background:
        linear-gradient(
            135deg,
            #15945f,
            #11764c
        );
    color: #ffffff;
    box-shadow:
        0 8px 18px
        rgba(21, 148, 95, 0.18);
}

.fotos-pdf-btn-convertir
.fotos-pdf-btn-icono {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.fotos-pdf-btn-convertir:not(:disabled):hover,
.fotos-pdf-btn-convertir:not(:disabled):focus {
    border-color: #107044;
    background:
        linear-gradient(
            135deg,
            #18a76c,
            #128254
        );
    color: #ffffff;
    box-shadow:
        0 10px 22px
        rgba(21, 148, 95, 0.24);
}

.fotos-pdf-btn-flecha {
    position: absolute;
    right: 0.95rem;
    font-size: 0.9rem;
}

/*
|--------------------------------------------------------------------------
| Vaciar lista
|--------------------------------------------------------------------------
*/

.fotos-pdf-btn-vaciar {
    border: 1px solid
        rgba(220, 53, 69, 0.45);
    background: transparent;
    color: #c92a3a;
}

.fotos-pdf-btn-vaciar
.fotos-pdf-btn-icono {
    background:
        rgba(220, 53, 69, 0.08);
    color: #dc3545;
}

.fotos-pdf-btn-vaciar:not(:disabled):hover,
.fotos-pdf-btn-vaciar:not(:disabled):focus {
    border-color: #dc3545;
    background:
        rgba(220, 53, 69, 0.07);
    color: #b42332;
    box-shadow:
        0 7px 16px
        rgba(220, 53, 69, 0.1);
}

/*
|--------------------------------------------------------------------------
| Estados deshabilitados
|--------------------------------------------------------------------------
*/

.configuracion-acciones-botones
.btn:disabled {
    transform: none;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.55;
}

.fotos-pdf-btn-convertir:disabled {
    border-color: #8bbca5;
    background: #4c9272;
    color: rgba(255, 255, 255, 0.78);
}

.fotos-pdf-btn-vaciar:disabled {
    border-color:
        rgba(220, 53, 69, 0.25);
    background: transparent;
    color:
        rgba(201, 42, 58, 0.55);
}

/*
|--------------------------------------------------------------------------
| Modo oscuro
|--------------------------------------------------------------------------
*/

body.dark-mode
.configuracion-acciones {
    border-color: #343941;
    background: #202327;
}

body.dark-mode
.configuracion-acciones-cabecera {
    border-color:
        rgba(255, 255, 255, 0.09);
}

body.dark-mode
.configuracion-acciones-icono {
    background:
        rgba(13, 110, 253, 0.18);
    color: #82b4ff;
}

body.dark-mode
.configuracion-acciones-texto strong {
    color: #f1f3f5;
}

body.dark-mode
.configuracion-acciones-texto small {
    color: #adb5bd;
}

body.dark-mode
.fotos-pdf-btn-vaciar {
    border-color:
        rgba(255, 99, 113, 0.52);
    color: #ff6b79;
}

body.dark-mode
.fotos-pdf-btn-vaciar
.fotos-pdf-btn-icono {
    background:
        rgba(255, 99, 113, 0.12);
    color: #ff7582;
}

body.dark-mode
.fotos-pdf-btn-vaciar:not(:disabled):hover,
body.dark-mode
.fotos-pdf-btn-vaciar:not(:disabled):focus {
    border-color: #ff6b79;
    background:
        rgba(255, 99, 113, 0.1);
    color: #ff8a95;
}

/*
|--------------------------------------------------------------------------
| Responsive
|--------------------------------------------------------------------------
*/

@media (max-width: 575.98px) {

    .configuracion-acciones {
        padding: 0.85rem;
    }

    .configuracion-acciones-cabecera {
        align-items: flex-start;
    }

    .configuracion-acciones-botones .btn {
        min-height: 46px;
    }
}

/* ==========================================================
   ENTREGA 51.2
   Header responsive profesional
========================================================== */

/* ----------------------------------------------------------
   Tablet
---------------------------------------------------------- */

@media (max-width: 1199.98px) {

    .app-navbar .container-fluid {
        flex-wrap: wrap;
        padding-top: 0.65rem;
        padding-bottom: 0.65rem;
    }

    .app-navbar-actions {
        flex-wrap: wrap;
        gap: 0.55rem;
    }

    .app-navbar-user {
        max-width: 150px;
    }
}


/* ----------------------------------------------------------
   Tablet pequeña / móvil horizontal
---------------------------------------------------------- */

@media (max-width: 767.98px) {

    .app-navbar {
        min-height: auto;
        padding-top: 0;
        padding-bottom: 0;
    }

    .app-navbar .container-fluid {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
        padding-top: 0.9rem;
        padding-bottom: 0.9rem;
    }

    .app-navbar .navbar-brand {
        width: 100%;
        margin-right: 0;
        font-size: 1.2rem;
    }

    .app-navbar-actions {
        width: 100%;
        display: grid;
        grid-template-columns:
            minmax(0, 1fr)
            auto
            auto;
        gap: 0.55rem;
        justify-content: stretch;
    }

    /*
     * Precios
     */
    .app-navbar-precios {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /*
     * Botón tema
     */
    .app-navbar-actions #btnModoOscuro {
        min-width: 42px;
    }

    /*
     * Idioma
     */
    .app-navbar-actions #selectorIdioma {
        width: 72px !important;
    }

    /*
     * Usuario
     */
    .app-navbar-user {
        grid-column: 1 / -1;
        max-width: none;
        padding: 0.15rem 0;
        text-align: left;
    }

    /*
     * Mi cuenta
     */
    .app-navbar-actions a[href="cuenta.php"] {
        grid-column: span 1;
    }

    /*
     * Salir
     */
    .app-navbar-actions a[href="auth/logout.php"] {
        grid-column: span 1;
    }

    /*
     * Versión
     */
    .app-navbar-version {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        min-height: 31px;
    }
}


/* ----------------------------------------------------------
   Móvil
---------------------------------------------------------- */

@media (max-width: 479.98px) {

    .app-navbar .container-fluid {
        gap: 0.75rem;
    }

    .app-navbar-actions {
        grid-template-columns: 1fr 44px 70px;
        gap: 0.45rem;
    }

    .app-navbar-precios {
        min-width: 0;
    }

    .app-navbar-precios,
    .app-navbar-actions a[href="cuenta.php"],
    .app-navbar-actions a[href="auth/logout.php"] {
        padding-left: 0.6rem;
        padding-right: 0.6rem;
    }

    .app-navbar-user {
        font-size: 0.8rem;
    }

    .app-navbar-version {
        font-size: 0.75rem;
    }
}


/* ----------------------------------------------------------
   Móvil muy angosto
---------------------------------------------------------- */

@media (max-width: 359.98px) {

    .app-navbar-actions {
        grid-template-columns: 1fr auto;
    }

    .app-navbar-precios {
        grid-column: 1;
    }

    .app-navbar-actions #btnModoOscuro {
        grid-column: 2;
    }

    .app-navbar-actions #selectorIdioma {
        grid-column: 1;
        width: 100% !important;
    }

    .app-navbar-user {
        grid-column: 1 / -1;
    }

    .app-navbar-actions a[href="cuenta.php"],
    .app-navbar-actions a[href="auth/logout.php"] {
        width: 100%;
    }

    .app-navbar-version {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

/* =========================================================
   HISTORIAL
========================================================= */

.historial-pagina {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
}


/* =========================================================
   ENCABEZADO
========================================================= */

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

.historial-eyebrow {
    display: block;
    margin-bottom: 6px;

    color: #0d6efd;

    font-size: 0.72rem;
    font-weight: 800;

    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.historial-titulo {
    display: flex;
    align-items: center;
    gap: 10px;

    margin: 0;

    font-size: clamp(1.65rem, 3vw, 2.3rem);
    font-weight: 800;
}

.historial-titulo i {
    color: #0d6efd;
}

.historial-descripcion {
    margin: 8px 0 0;

    color: var(--bs-secondary-color);
}


/* =========================================================
   CARD
========================================================= */

.historial-card {
    overflow: hidden;

    border-radius: 18px;
}

.historial-card-header {
    display: flex;
    align-items: center;
    gap: 14px;

    padding: 20px 22px;

    background: transparent;
}

.historial-card-icono {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 48px;
    height: 48px;

    flex: 0 0 48px;

    border-radius: 14px;

    color: #0d6efd;
    background: rgba(13, 110, 253, 0.12);

    font-size: 1.25rem;
}

.historial-card-titulo {
    margin: 0;

    font-size: 1.05rem;
    font-weight: 750;
}

.historial-card-subtitulo {
    margin: 3px 0 0;

    color: var(--bs-secondary-color);

    font-size: 0.88rem;
}


/* =========================================================
   LISTA
========================================================= */

.historial-lista {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.historial-lista .list-group-item {
    padding: 16px 18px;

    border: 1px solid rgba(128, 128, 128, 0.22);

    border-radius: 13px !important;

    background: rgba(255, 255, 255, 0.02);

    transition:
        border-color 0.2s ease,
        transform 0.2s ease,
        background-color 0.2s ease;
}

.historial-lista .list-group-item:hover {
    transform: translateY(-1px);

    border-color: rgba(13, 110, 253, 0.45);
}

.historial-lista strong {
    font-size: 0.96rem;
}

.historial-lista .text-muted {
    margin-top: 4px;

    font-size: 0.82rem;
}


/* =========================================================
   ESTADO VACÍO
========================================================= */

.historial-vacio {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-height: 300px;

    padding: 40px 20px;

    text-align: center;

    color: var(--bs-secondary-color);
}

.historial-vacio-icono {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 70px;
    height: 70px;

    margin-bottom: 18px;

    border-radius: 20px;

    color: #0d6efd;
    background: rgba(13, 110, 253, 0.1);

    font-size: 1.8rem;
}

.historial-vacio strong {
    margin-bottom: 6px;

    color: var(--bs-body-color);

    font-size: 1rem;
}

.historial-vacio span {
    font-size: 0.87rem;
}


/* =========================================================
   DARK MODE
========================================================= */

body.dark-mode .historial-card {
    background: #1c1c1c;

    border-color: #343434;
}

body.dark-mode .historial-card-header {
    border-color: #343434;
}

body.dark-mode .historial-lista .list-group-item {
    color: #f4f4f4;

    background: #222;

    border-color: #393939;
}

body.dark-mode .historial-lista .list-group-item:hover {
    background: #252525;

    border-color: rgba(13, 110, 253, 0.65);
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 767.98px) {

    .historial-encabezado {
        align-items: stretch;
        flex-direction: column;
    }

    .historial-encabezado .btn {
        width: 100%;
    }

    .historial-card-header {
        padding: 17px;
    }

    .historial-lista .list-group-item {
        padding: 14px;
    }

}

/* =========================================================
   HISTORIAL - CONTROLES
========================================================= */

.historial-controles {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.historial-buscador,
.historial-filtro {
    min-width: 0;
}

.historial-control-label {
    display: block;
    margin-bottom: 7px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #9ca3af;
}

.historial-input-wrap {
    position: relative;
}

.historial-input-wrap .bi-search {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: #6b7280;
    pointer-events: none;
}

.historial-input,
.historial-select {
    width: 100%;
    min-height: 42px;
    border: 1px solid #343a40;
    border-radius: 9px;
    background: #181a1d;
    color: #f1f3f5;
    outline: none;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background-color 0.18s ease;
}

.historial-input {
    padding: 9px 14px 9px 40px;
}

.historial-select {
    padding: 9px 36px 9px 14px;
}

.historial-input:focus,
.historial-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.13);
    background: #1b1e22;
}


/* =========================================================
   HISTORIAL - RESUMEN
========================================================= */

.historial-resumen {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 11px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: #8f969e;
    font-size: 0.8rem;
}


/* =========================================================
   HISTORIAL - PAGINACIÓN
========================================================= */

.historial-paginacion {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 18px 20px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.historial-paginacion[hidden] {
    display: none;
}

.historial-paginacion-btn,
.historial-pagina-btn {
    min-height: 38px;
    border: 1px solid #343a40;
    border-radius: 8px;
    background: #181a1d;
    color: #c7cbd1;
    cursor: pointer;
    transition:
        border-color 0.18s ease,
        background-color 0.18s ease,
        color 0.18s ease;
}

.historial-paginacion-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 13px;
}

.historial-pagina-btn {
    min-width: 38px;
    padding: 7px 10px;
}

.historial-paginacion-btn:hover:not(:disabled),
.historial-pagina-btn:hover:not(:disabled) {
    border-color: #0d6efd;
    color: #fff;
}

.historial-pagina-btn.activa {
    border-color: #0d6efd;
    background: #0d6efd;
    color: #fff;
}

.historial-paginacion-btn:disabled {
    opacity: 0.42;
    cursor: default;
}

.historial-paginas {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}


/* =========================================================
   HISTORIAL - RESPONSIVE
========================================================= */

@media (max-width: 700px) {

    .historial-controles {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 480px) {

    .historial-controles,
    .historial-resumen,
    .historial-paginacion {
        padding-left: 14px;
        padding-right: 14px;
    }

    .historial-paginacion-btn span {
        display: none;
    }

    .historial-paginacion-btn {
        width: 38px;
        padding: 7px;
    }

}

/* =========================================================
   HISTORIAL - PRIVACIDAD
========================================================= */

.historial-privacidad {
    display: flex;
    align-items: flex-start;
    gap: 14px;

    margin: 0 20px 18px;
    padding: 14px 16px;

    border: 1px solid rgba(13, 110, 253, 0.22);
    border-radius: 12px;

    background: rgba(13, 110, 253, 0.07);
}

.historial-privacidad-icono {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;
    flex: 0 0 40px;

    border-radius: 10px;

    color: #0d6efd;
    background: rgba(13, 110, 253, 0.12);

    font-size: 1.05rem;
}

.historial-privacidad strong {
    display: block;
    margin-bottom: 3px;
}

.historial-privacidad p {
    margin: 0;

    color: var(--bs-secondary-color);

    font-size: 0.85rem;
    line-height: 1.5;
}

body.dark-mode .historial-privacidad {
    border-color: rgba(77, 148, 255, 0.3);
    background: rgba(13, 110, 253, 0.1);
}

@media (max-width: 575.98px) {

    .historial-privacidad {
        margin-left: 14px;
        margin-right: 14px;
    }

}