.dashboard-content {
    min-height: calc(100vh - 64px);
    padding: clamp(1rem, 2vw, 1.75rem);
}

.dashboard-container {
    max-width: 1680px;
}

.dashboard-messages {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.min-w-0 {
    min-width: 0;
}

.dashboard-workspace {
    align-items: stretch;
}

.dashboard-panel {
    min-width: 0;
    overflow: hidden;
    background: var(--dashboard-surface);
    border: 1px solid var(--dashboard-border);
    border-radius: 1.1rem;
    box-shadow: var(--dashboard-shadow);
}

.dashboard-panel-primary {
    display: flex;
    flex-direction: column;
}

.dashboard-intro {
    padding: 1.35rem 1.4rem 1rem;
}

.dashboard-eyebrow {
    display: block;
    margin-bottom: 0.3rem;
    color: var(--dashboard-primary);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.dashboard-title {
    margin-bottom: 0.45rem;
    color: var(--dashboard-text);
    font-size: clamp(1.35rem, 2vw, 1.8rem);
    font-weight: 750;
    letter-spacing: -0.035em;
}

.dashboard-subtitle {
    max-width: 34rem;
    color: var(--dashboard-muted);
    font-size: 0.86rem;
    line-height: 1.55;
}

.dashboard-mark {
    display: grid;
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    color: #ffffff;
    background: linear-gradient(145deg, #7c3aed, #5b21b6);
    border-radius: 0.9rem;
    box-shadow: 0 10px 24px rgba(109, 40, 217, 0.24);
    place-items: center;
}

.dashboard-mark i {
    font-size: 1.25rem;
}

.quick-action {
    display: flex;
    min-height: 62px;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem;
    color: #344054;
    background: #fafbfc;
    border: 1px solid #eaecf0;
    border-radius: 0.8rem;
    text-decoration: none;
    transition: border-color 150ms ease, box-shadow 150ms ease,
        transform 150ms ease;
}

.quick-action:hover,
.quick-action:focus-visible {
    color: var(--dashboard-primary);
    background: #ffffff;
    border-color: #d6c4f8;
    box-shadow: 0 8px 18px rgba(76, 29, 149, 0.08);
    transform: translateY(-1px);
}

.quick-action-primary {
    color: #4c1d95;
    background: #f7f2ff;
    border-color: #e5d7fb;
}

.quick-action-icon,
.section-icon,
.utility-icon {
    display: grid;
    flex: 0 0 auto;
    color: var(--dashboard-primary);
    background: var(--dashboard-primary-soft);
    place-items: center;
}

.quick-action-icon {
    width: 34px;
    height: 34px;
    border-radius: 0.65rem;
}

.quick-action-copy {
    display: block;
    min-width: 0;
    line-height: 1.2;
}

.quick-action-copy strong,
.quick-action-copy small {
    display: block;
    overflow-wrap: anywhere;
    white-space: normal;
}

.quick-action-copy strong {
    margin-bottom: 0.2rem;
    font-size: 0.82rem;
    font-weight: 700;
}

.quick-action-copy small {
    color: #667085;
    font-size: 0.75rem;
}

.quick-action > .bi-chevron-right {
    flex: 0 0 auto;
    color: #98a2b3;
    font-size: 0.7rem;
}

.customer-search {
    margin: 0.2rem 1.4rem 1rem;
    padding: 1rem;
    background: #f8f9fc;
    border: 1px solid #eaecf0;
    border-radius: 0.9rem;
}

.section-icon {
    width: 34px;
    height: 34px;
    border-radius: 0.65rem;
}

.section-title {
    color: #344054;
    font-size: 0.84rem;
    font-weight: 700;
}

.section-description {
    margin-top: 0.12rem;
    color: #667085;
    font-size: 0.78rem;
}

.customer-search .form-label {
    margin-bottom: 0.3rem;
    color: #475467;
    font-size: 0.75rem;
    font-weight: 700;
}

.dashboard-input-group .input-group-text {
    color: #7a8495;
    background: #ffffff;
    border-color: #dfe3ea;
}

.dashboard-input-group .form-control {
    min-height: 44px;
    color: #344054;
    background: #ffffff;
    border-color: #dfe3ea;
    font-size: 0.82rem;
    box-shadow: none;
}

.dashboard-input-group .form-control:focus {
    z-index: 3;
    border-color: #a78bfa;
    box-shadow: 0 0 0 0.2rem rgba(109, 40, 217, 0.1);
}

.dashboard-input-group .form-control.is-invalid {
    border-color: #f04438;
}

.dashboard-input-group .form-control.is-invalid:focus {
    box-shadow: 0 0 0 0.2rem rgba(240, 68, 56, 0.1);
}

.customer-search .invalid-feedback {
    margin-top: 0.2rem;
    color: #d92d20;
    font-size: 0.75rem;
}

.dashboard-form-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    margin-bottom: 0.7rem;
    padding: 0.55rem 0.65rem;
    font-size: 0.75rem;
    line-height: 1.35;
}

.dashboard-search-button {
    min-height: 44px;
    margin-top: 0.15rem;
    border-color: var(--dashboard-primary);
    background: var(--dashboard-primary);
    font-size: 0.8rem;
    font-weight: 700;
}

.dashboard-search-button:hover,
.dashboard-search-button:focus {
    border-color: var(--dashboard-primary-dark);
    background: var(--dashboard-primary-dark);
}

.client-result {
    display: flex;
    min-height: 64px;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem;
    background: #ffffff;
    border: 1px solid #d1fadf;
    border-radius: 0.75rem;
}

.client-result-icon {
    display: grid;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    color: #027a48;
    background: #dcfae6;
    border-radius: 50%;
    place-items: center;
}

.client-result span,
.client-result strong {
    font-size: 0.78rem;
}

.client-result span {
    display: block;
    margin-bottom: 0.12rem;
    color: #667085;
}

.client-result .btn {
    display: inline-flex;
    min-width: 96px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.5rem 0.65rem;
    border-radius: 0.6rem;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: color 120ms ease, background-color 120ms ease,
        border-color 120ms ease;
}

.client-result .btn-success {
    color: #ffffff;
    background: var(--dashboard-success);
    border: 1px solid var(--dashboard-success);
}

.client-result .btn-success:hover,
.client-result .btn-success:focus {
    color: #ffffff;
    background: var(--dashboard-success-dark);
    border-color: var(--dashboard-success-dark);
}

.client-result .btn-success:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(2, 122, 72, 0.25);
}

.client-result .btn-secondary {
    color: #667085;
    background: #f7f8fa;
    border: 1px solid #eaecf0;
}

.client-result .btn-secondary:hover,
.client-result .btn-secondary:focus {
    color: #ffffff;
    background: var(--dashboard-primary);
    border-color: var(--dashboard-primary);
}

.client-result .btn-secondary:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(109, 40, 217, 0.25);
}

.dashboard-utility {
    margin-top: auto;
    padding: 0.8rem 1.4rem;
    background: #fcfcfd;
    border-top: 1px solid var(--dashboard-border);
}

.utility-icon {
    width: 31px;
    height: 31px;
    color: #475467;
    background: #eef1f6;
    border-radius: 0.6rem;
}

.dashboard-utility-copy {
    min-width: 0;
    line-height: 1.3;
}

.dashboard-utility-copy strong {
    display: block;
    color: #475467;
    font-size: 0.75rem;
}

.dashboard-utility-copy small {
    display: block;
    color: #667085;
    font-size: 0.75rem;
}

.dashboard-utility .btn {
    min-height: 44px;
    color: #475467;
    border: 1px solid #dfe3ea;
    font-size: 0.75rem;
    font-weight: 700;
}

.recent-panel {
    display: flex;
    min-height: 430px;
    flex-direction: column;
}

.recent-panel-header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.25rem 1rem;
    border-bottom: 1px solid var(--dashboard-border);
}

.recent-panel-title {
    color: var(--dashboard-text);
    font-size: 1.12rem;
    font-weight: 750;
    letter-spacing: -0.02em;
}

.work-count {
    display: inline-grid;
    min-width: 28px;
    height: 28px;
    padding: 0 0.4rem;
    color: var(--dashboard-primary);
    background: var(--dashboard-primary-soft);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
    place-items: center;
}

.recent-panel-description {
    margin-top: 0.28rem;
    color: var(--dashboard-muted);
    font-size: 0.8rem;
}

.recent-all-button {
    display: inline-flex;
    min-width: 96px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.5rem 0.65rem;
    color: #475467;
    background: #f7f8fa;
    border: 1px solid #eaecf0;
    border-radius: 0.6rem;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: color 120ms ease, background-color 120ms ease,
        border-color 120ms ease;
}

.recent-all-button:hover,
.recent-all-button:focus {
    color: var(--dashboard-primary);
    background: var(--dashboard-primary-soft);
    border-color: #d8c7fa;
}

.recent-all-button:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(109, 40, 217, 0.25);
}

.recent-table-wrap {
    flex: 1 1 auto;
    min-height: 0;
}

.dashboard-table {
    --bs-table-bg: transparent;
    color: #344054;
    width: 100%;
}

.dashboard-table > :not(caption) > * > * {
    padding: 0.78rem 0.7rem;
    background: transparent;
    border-bottom-color: #edf0f4;
    box-shadow: none;
}

.dashboard-table thead th {
    color: #667085;
    background: #fafbfc;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.dashboard-table thead th:first-child,
.dashboard-table tbody td:first-child {
    padding-left: 1.25rem;
}

.dashboard-table thead th:last-child,
.dashboard-table tbody td:last-child {
    padding-right: 1.25rem;
}

.dashboard-table tbody tr {
    transition: background-color 120ms ease;
}

.dashboard-table tbody tr:nth-child(even) {
    background: #f6f7fa;
}

.dashboard-table tbody tr:hover {
    background: #fcfaff;
}

.table-primary-text {
    max-width: 185px;
    color: #344054;
    font-size: 0.82rem;
    font-weight: 700;
}

.table-secondary-text {
    max-width: 185px;
    margin-top: 0.16rem;
    color: #667085;
    font-size: 0.75rem;
    overflow-wrap: anywhere;
    white-space: normal;
}

.work-date {
    display: block;
    max-width: 120px;
    color: #667085;
    font-size: 0.75rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.work-action {
    display: inline-flex;
    min-width: 96px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.5rem 0.65rem;
    color: #667085;
    background: #f7f8fa;
    border: 1px solid #eaecf0;
    border-radius: 0.6rem;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: color 120ms ease, background-color 120ms ease,
        border-color 120ms ease;
}

.work-action:hover,
.work-action:focus-visible {
    color: #ffffff;
    background: var(--dashboard-primary);
    border-color: var(--dashboard-primary);
}

/* Variante Editar — azul semántico */
.work-action-editar {
    color: #175cd3;
    background: #eff8ff;
    border-color: #d8e8ff;
}

.work-action-editar:hover,
.work-action-editar:focus-visible {
    color: #ffffff;
    background: #175cd3;
    border-color: #175cd3;
}

/* Variante PDF Talonario — azul */
.work-action-pdf-trabajo {
    color: #175cd3;
    background: #eff8ff;
    border-color: #d8e8ff;
}

.work-action-pdf-trabajo:hover,
.work-action-pdf-trabajo:focus-visible {
    color: #ffffff;
    background: #175cd3;
    border-color: #175cd3;
}

/* Variante PDF Muestra — ámbar/naranja */
.work-action-pdf-muestra {
    color: #b54708;
    background: #fffaeb;
    border-color: #fdeab3;
}

.work-action-pdf-muestra:hover,
.work-action-pdf-muestra:focus-visible {
    color: #ffffff;
    background: #b54708;
    border-color: #b54708;
}

/* Variante Ver trabajos — verde semántico */
.work-action-success {
    color: #ffffff;
    background: #027a48;
    border-color: #027a48;
}

.work-action-success:hover,
.work-action-success:focus-visible {
    color: #ffffff;
    background: #05603a;
    border-color: #05603a;
}

/* Variante Talonario — verde semántico, mismo destino que "Preparar Talonario" */
.work-action-talonario {
    color: var(--dashboard-success);
    background: var(--dashboard-success-soft);
    border-color: var(--dashboard-success-soft);
}

.work-action-talonario:hover,
.work-action-talonario:focus-visible {
    color: #ffffff;
    background: var(--dashboard-success);
    border-color: var(--dashboard-success);
}

/* Variante Descargar — azul sólido para que el botón resalte */
.work-action-descargar {
    color: #ffffff;
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.work-action-descargar:hover,
.work-action-descargar:focus-visible {
    color: #ffffff;
    background: #1e40af;
    border-color: #1e40af;
}

/* Bloque de descargas del Talonario — fondo azulado para ubicar la fila */
.talonario-descargas {
    padding: 1rem 1.25rem;
    background: #eff8ff;
    border: 1px solid #d8e8ff;
    border-radius: 0.75rem;
}

/* Variante Preparar — separa el botón del bloque de descargas cuando
   el talonario ya está listo y ambos se muestran en la misma columna */
.work-action-preparar {
    margin-bottom: 1em;
}

.work-details {
    margin-top: 0.25rem;
}

.work-details summary {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.1rem;
    color: var(--dashboard-primary);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    list-style: none;
}

.work-details summary::-webkit-details-marker {
    display: none;
}

.work-details summary::after {
    content: "+";
    display: inline-grid;
    width: 1.1rem;
    height: 1.1rem;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: 0.9rem;
    line-height: 1;
    place-items: center;
}

.work-details[open] summary::after {
    content: "−";
}

.work-details-content {
    display: grid;
    gap: 0.15rem;
    margin: 0.15rem 0 0.4rem;
    padding: 0.5rem;
    color: #344054;
    background: #f8f9fc;
    border: 1px solid var(--dashboard-border);
    border-radius: 0.55rem;
    font-size: 0.75rem;
    overflow-wrap: anywhere;
}

.work-details-label {
    color: #667085;
    font-weight: 700;
}

.empty-works {
    display: flex;
    flex: 1 1 auto;
    min-height: 250px;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    flex-direction: column;
}

.empty-works-icon {
    display: grid;
    width: 54px;
    height: 54px;
    margin-bottom: 0.8rem;
    color: #027a48;
    background: #ecfdf3;
    border-radius: 50%;
    font-size: 1.45rem;
    place-items: center;
}

.empty-works h3 {
    margin-bottom: 0.25rem;
    color: #344054;
    font-size: 0.95rem;
    font-weight: 750;
}

.empty-works .btn {
    min-height: 44px;
}

.empty-works p {
    margin-bottom: 0.85rem;
    color: #667085;
    font-size: 0.8rem;
}

.recent-panel-footer {
    display: flex;
    flex: 0 0 auto;
    min-height: 64px;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem;
    color: #667085;
    background: #fcfcfd;
    border-top: 1px solid var(--dashboard-border);
    font-size: 0.75rem;
}

.recent-panel-footer a {
    display: inline-flex;
    min-height: 44px;
    flex: 0 0 auto;
    align-items: center;
    color: var(--dashboard-primary);
    font-weight: 700;
    text-decoration: none;
}

.recent-panel-footer a:hover {
    text-decoration: underline;
}

@media (min-width: 992px) and (min-height: 680px) {
    .dashboard-content {
        height: calc(100vh - 64px);
        min-height: 590px;
        overflow-x: hidden;
        overflow-y: auto;
    }
}

@media (max-width: 1199.98px) {
    .table-primary-text,
    .table-secondary-text {
        max-width: 155px;
    }

    .recent-panel-footer > span {
        max-width: 55%;
    }
}

@media (max-width: 991.98px) {
    .dashboard-mark {
        width: 42px;
        height: 42px;
    }

    .recent-panel {
        min-height: 0;
    }
}

@media (max-width: 575.98px) {
    .dashboard-content {
        width: 100%;
        padding: 0.75rem;
        overflow-x: hidden;
    }

    .dashboard-container,
    .dashboard-workspace,
    .dashboard-workspace > [class*="col-"] {
        width: 100%;
        min-width: 0;
    }

    .recent-table-wrap {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
    }

    .dashboard-table {
        width: 100%;
        min-width: 0;
        table-layout: fixed;
    }

    .dashboard-table > :not(caption) > * > * {
        padding-right: 0.35rem;
        padding-left: 0.35rem;
    }

    .dashboard-table thead th:nth-child(1),
    .dashboard-table tbody td:nth-child(1) {
        width: 34%;
        padding-left: 0.7rem;
    }

    .dashboard-table thead th:nth-child(2),
    .dashboard-table tbody td:nth-child(2) {
        width: 28%;
    }

    .dashboard-table thead th:nth-child(3),
    .dashboard-table tbody td:nth-child(3) {
        width: 26%;
    }

    .dashboard-table thead th:nth-child(5),
    .dashboard-table tbody td:nth-child(5) {
        width: 104px;
        min-width: 104px;
        padding-right: 0.45rem;
    }

    .table-primary-text,
    .table-secondary-text {
        max-width: 100%;
    }

    .table-primary-text {
        display: -webkit-box;
        overflow: hidden;
        white-space: normal;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .table-secondary-text {
        font-size: 0.75rem;
    }

    .work-action {
        width: auto;
        min-width: 96px;
        height: 44px;
        min-height: 44px;
    }

    .dashboard-intro,
    .customer-search,
    .dashboard-utility {
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .customer-search {
        margin-right: 1rem;
        margin-left: 1rem;
    }

    .dashboard-subtitle {
        font-size: 0.82rem;
    }

    .dashboard-mark {
        display: none;
    }

    .quick-action {
        min-height: 70px;
        align-items: flex-start;
        flex-direction: column;
    }

    .quick-action > .bi-chevron-right {
        display: none;
    }

    .quick-action-copy strong,
    .quick-action-copy small {
        white-space: normal;
    }

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

    .recent-all-button {
        width: 100%;
    }

    .recent-panel-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Dropzone para subida de constancias */
.dropzone {
    position: relative;
    border: 2px dashed var(--dashboard-border);
    border-radius: 0.75rem;
    padding: 3rem 1.5rem;
    text-align: center;
    transition: border-color 0.2s, background-color 0.2s;
    background: var(--dashboard-surface);
    cursor: pointer;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--dashboard-primary);
    background: var(--dashboard-primary-soft);
}

.dropzone.dragover {
    transform: scale(1.01);
}

.dropzone input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

.dropzone-text {
    color: var(--dashboard-muted);
    pointer-events: none;
}

.dropzone-text i {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    display: block;
    color: var(--dashboard-primary);
}

.dropzone-text p {
    margin: 0.5rem 0 0.25rem;
    font-weight: 500;
}

.dropzone-text small {
    font-size: 0.8rem;
}

.dropzone.dragover .dropzone-text i {
    color: var(--dashboard-primary-dark);
}

@media (max-width: 575.98px) {
    .dropzone {
        padding: 2rem 1rem;
    }
    .dropzone-text i {
        font-size: 2rem;
    }
}

/* ==========================================================================
   ACCORDION SECTIONS (para forma_update)
   ========================================================================== */
.accordion-section {
    border: 1px solid var(--dashboard-border);
    border-radius: 0.75rem;
    background: var(--dashboard-surface);
    overflow: hidden;
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--dashboard-bg);
    border-bottom: 1px solid var(--dashboard-border);
    cursor: pointer;
    transition: background-color 0.15s ease;
    user-select: none;
}

.accordion-header:hover {
    background: var(--dashboard-primary-soft);
}

.accordion-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--dashboard-text);
}

.section-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.section-status.done {
    color: #22c55e;
    background: #dcfce7;
}

.section-status.pending {
    color: var(--dashboard-muted);
    background: var(--dashboard-bg);
}

.accordion-content {
    display: none;
    padding: 1.5rem;
    border-top: 1px solid var(--dashboard-border);
}

.accordion-content.show {
    display: block;
    animation: accordion-slide-down 0.2s ease-out;
}

@keyframes accordion-slide-down {
    from {
        opacity: 0;
        transform: translateY(-0.5rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   PROGRESS STEPPER (para forma_update)
   ========================================================================== */
.progress-stepper {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0.5rem 0;
    overflow-x: auto;
    margin-bottom: 0.5rem;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    max-width: 120px;
    padding: 0.5rem 0.25rem;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 0.75rem;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--dashboard-border);
    z-index: -1;
}

.step:last-child::after {
    display: none;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--dashboard-muted);
    background: var(--dashboard-bg);
    border: 2px solid var(--dashboard-border);
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
}

.step-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--dashboard-muted);
    text-align: center;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.step.pending .step-number {
    color: var(--dashboard-muted);
    border-color: var(--dashboard-border);
    background: var(--dashboard-bg);
}

.step.pending .step-label {
    color: var(--dashboard-muted);
}

.step.current .step-number {
    color: #fff;
    border-color: var(--dashboard-primary);
    background: var(--dashboard-primary);
    box-shadow: 0 0 0 3px var(--dashboard-primary-soft);
}

.step.current .step-label {
    color: var(--dashboard-primary);
    font-weight: 600;
}

.step.completed .step-number {
    color: #fff;
    border-color: #22c55e;
    background: #22c55e;
}

.step.completed .step-label {
    color: #166534;
    font-weight: 600;
}

.step.completed::after {
    background: #22c55e;
}

/* El paso que se puede abrir: es un enlace de verdad, no un div. Sin borde
   propio: el círculo del número es el que ya dice si el paso está hecho, en curso
   o pendiente. El hover sube apenas el círculo, para que el operador sepa que hay
   algo abajo sin que la barra cambie de tamaño. */
.step-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
    border-radius: 0.5rem;
    padding: 0.25rem 0.15rem;
    transition: background-color 0.2s ease;
}

.step-link:hover,
.step-link:focus-visible {
    background-color: var(--dashboard-primary-soft);
    outline: none;
}

.step-link:hover .step-label,
.step-link:focus-visible .step-label {
    color: var(--dashboard-primary);
}

.step-link:hover .step-number,
.step-link:focus-visible .step-number {
    border-color: var(--dashboard-primary);
}

/* El paso 4, Posición: es un ajuste que se confirma al avanzar al Talonario.
   Hasta ese momento se dibuja con círculo punteado para que no se lea como
   "te falta esto"; al confirmarse pasa al estado `completed` (verde). */
.step.adjust .step-number {
    border-style: dashed;
    color: var(--dashboard-muted);
}

.step.adjust .step-label {
    font-style: italic;
}

/* ==== La pantalla del membrete ==== */

/* Los subtítulos de los bloques de la pantalla del logo. */
.membrete-subtitle {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--dashboard-muted);
    margin: 1.25rem 0 0.5rem;
}

/* Estas clases son de esta pantalla y se llaman `dato-*` a propósito: `forma_update`
   ya usaba `info-card`, `info-label` e `info-value` en su markup sin que ninguna
   regla las definiera, y definirlas acá le cambiaría el aspecto a una pantalla que
   este change no tiene que tocar. Al no declararlas, `forma_update` sigue viéndose
   exactamente como se veía. Si alguna vez hay que darles estilo, que sea en su
   propio change. */

/* Sin `height: 100%`: la tarjeta se estira con la fila, que es lo que las iguala
   en alto. Con ese `height`, en una fila que se parte en dos líneas, la tarjeta
   tomaba la altura del contenedor entero y la segunda línea —la caja de fecha— le
   quedaba encima. Quien las iguala es `align-items-stretch` de la fila. */
.dato-card {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--dashboard-border);
    border-radius: 0.5rem;
    background: var(--dashboard-bg);
}

.dato-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--dashboard-muted);
}

.dato-value {
    font-size: 0.95rem;
    color: var(--dashboard-text);
    word-break: break-word;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2.5rem 1rem;
    text-align: center;
    border: 1px dashed var(--dashboard-border);
    border-radius: 0.5rem;
    color: var(--dashboard-muted);
}

.empty-state-title {
    font-weight: 600;
    color: var(--dashboard-text);
    margin: 0;
}

.empty-state-text {
    margin: 0;
    font-size: 0.9rem;
}

.logo-preview {
    padding: 1rem;
    border: 1px solid var(--dashboard-border);
    border-radius: 0.5rem;
    background: #fff;
    text-align: center;
}

.muestra-preview {
    padding: 1rem;
    border: 1px solid var(--dashboard-border);
    border-radius: 0.5rem;
    background: #fff;
    text-align: center;
}

.muestra-preview img {
    max-width: 100%;
    height: auto;
}

/* El selector de archivo del PDF del CAI no tiene que ocupar toda la fila: es
   un dato más de la pantalla, no su contenido. */
.archivo-cai {
    max-width: 14rem;
}

/* El nombre del logo en uso. Va en `code` porque es un nombre de archivo, y
   `word-break` porque el sistema le agrega el `----<id>` y hay nombres largos
   que revientan la columna de la cabecera. */
.logo-nombre {
    font-size: 0.9rem;
    word-break: break-all;
}

/* El `input[type=file]` del dropzone es transparente y va por encima de todo el
   dropzone con `z-index: 1`. Sin esto, la equis de "quitar el archivo" queda
   debajo y no se la puede apretar. La regla va scopeada a `dropzone-logo` y no
   al `.dropzone` general porque `forma_update` usa esa clase y este change no lo
   toca. */
.dropzone-logo .dropzone-preview {
    position: relative;
    z-index: 2;
}

/* La fila de cada campo: el rótulo a la izquierda y la variable a la derecha.
   El rótulo se estira para que la variable quede siempre en el mismo lugar,
   con el campo más arriba o más abajo según el alto de la caja. */
.campo-cabecera {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 1.5rem;
    margin-bottom: 0.25rem;
}

/* La variable que hay que escribir en el logo. Es código, y por eso va en
   `code`: el operador tiene que poder distinguirla de la etiqueta. */
.variable-campo {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    white-space: nowrap;
}

.variable-texto {
    font-size: 0.72rem;
    color: var(--dashboard-muted);
    background: var(--dashboard-surface);
    border: 1px solid var(--dashboard-border);
    border-radius: 0.25rem;
    padding: 0.05rem 0.3rem;
    word-break: break-all;
}

/* Una variable que el logo no tiene: el campo se va a imprimir vacío, y el
   operador tiene que verlo antes de escribir, no después de imprimir. */
.variable-no-impresa .variable-texto {
    color: #b45309;
    background: #fef3c7;
    border-color: #fcd34d;
}

.btn-copiar-variable {
    border: 0;
    background: transparent;
    padding: 0.1rem 0.2rem;
    line-height: 1;
    color: var(--dashboard-muted);
    cursor: pointer;
}

.btn-copiar-variable:hover,
.variable-copiada .btn-copiar-variable {
    color: var(--dashboard-primary);
}

.copiado {
    font-size: 0.68rem;
    color: var(--dashboard-primary);
    min-width: 0;
}

/* Item del modal "Variables de la tapa": el marcador y su descripción en una
   columna, separados entre sí con un borde superior. Reusa las clases de
   variable del membrete (`.variable-campo`, `.btn-copiar-variable`, `.copiado`). */
.variable-tapa-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.6rem 0;
}

.variable-tapa-item + .variable-tapa-item {
    border-top: 1px solid var(--dashboard-border);
}

.variable-tapa-detalle {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    min-width: 0;
}

.variable-tapa-descripcion {
    font-size: 0.8rem;
    color: var(--dashboard-muted);
}

/* El botón de ayuda junto al label "Tapa del Talonario": mismo tamaño que el
   label, para que no descoloque el resto de los campos de la sección. */
.tapa-ver-variables {
    font-size: 0.8rem;
    color: var(--dashboard-primary);
}

.tapa-ver-variables:hover,
.tapa-ver-variables:focus {
    color: var(--dashboard-primary-dark);
}

/* La lista de variables que el logo sí usa. */
.variable-lista {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.variable-ok {
    font-family: var(--bs-font-monospace, monospace);
    font-size: 0.72rem;
    color: var(--dashboard-text);
    background: var(--dashboard-surface);
    border: 1px solid var(--dashboard-border);
    border-radius: 0.25rem;
    padding: 0.05rem 0.3rem;
}

@media (max-width: 767.98px) {
    .progress-stepper {
        padding-bottom: 1rem;
    }
    .step {
        min-width: 70px;
        max-width: 100px;
    }
    .step:not(:last-child)::after {
        width: calc(100% - 1rem);
        left: calc(50% + 0.5rem);
    }
}

/* ==========================================================================
   COLOR SELECTORS (para forma_update - colores original, duplicado, etc.)
   ========================================================================== */
.color-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 2.5rem;
    background-image: var(--color-preview, linear-gradient(transparent, transparent));
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.color-select:hover {
    border-color: var(--dashboard-primary);
}

.color-select:focus {
    border-color: var(--dashboard-primary);
    box-shadow: 0 0 0 0.2rem rgba(109, 40, 217, 0.15);
    outline: none;
}

/* ==========================================================================
   RESPONSIVE ADJUSTMENTS FOR FORMA_UPDATE
   ========================================================================== */
@media (max-width: 575.98px) {
    .accordion-header {
        padding: 0.5rem 0.75rem;
    }
    .accordion-title {
        font-size: 0.9rem;
    }
    .accordion-content {
        padding: 1rem;
    }
    .progress-stepper {
        gap: 0;
        padding: 0.25rem 0 1rem;
    }
    .step {
        min-width: 60px;
        max-width: 90px;
        padding: 0.375rem 0.125rem;
    }
    .step:not(:last-child)::after {
        width: calc(100% - 0.5rem);
        left: calc(50% + 0.25rem);
    }
    .step-number {
        width: 1.25rem;
        height: 1.25rem;
        font-size: 0.7rem;
    }
    .step-label {
        font-size: 0.65rem;
    }
}

/* ==========================================================================
   FIELD VALIDATION WRAPPERS (para forma_update)
   ========================================================================== */
.field-wrapper {
    border-radius: 0.5rem;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    padding: 0.375rem;
    margin: -0.375rem;
    border: 1px solid transparent;
}

.field-wrapper.field-has-error {
    background-color: var(--error-bg);
    border-color: var(--error-border);
    box-shadow: 0 0 0 0.125rem rgba(240, 68, 56, 0.1);
}

.field-wrapper.field-has-success {
    background-color: var(--success-bg);
    border-color: var(--success-border);
    box-shadow: 0 0 0 0.125rem rgba(2, 122, 72, 0.1);
}

/* Inputs/selects dentro del wrapper no deben tapar el fondo */
.field-wrapper .form-control,
.field-wrapper .form-select {
    background-color: transparent !important;
    border-radius: 0.375rem; /* Ligeramente menor que el wrapper */
}

/* Dropzone dentro del wrapper: quitar fondo y padding para que se vea el wrapper */
.field-wrapper .dropzone {
    background-color: transparent !important;
    border-radius: 0.375rem;
    padding: 0; /* El padding visual lo da dropzone-text */
    min-height: auto;
}

.field-wrapper .dropzone .dropzone-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    padding: 1.5rem 1rem;
    text-align: center;
}

/* Aviso de archivo ya cargado dentro del dropzone: tilde de OK + texto. Sale del
   estado que trae el servidor (el campo con archivo), sin depender del JS. */
.field-wrapper .dropzone .dropzone-text .dropzone-cargado {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--dashboard-success);
}

/* La tilde del aviso es chica y alineada: anula el tamaño grande de los íconos
   del dropzone (los define `.dropzone-text i`). */
.field-wrapper .dropzone .dropzone-text .dropzone-cargado i {
    display: inline;
    margin: 0;
    font-size: 1rem;
    color: var(--dashboard-success);
}

/* Ajuste para dropzone preview y checkbox clear dentro del wrapper */
.field-wrapper .dropzone-preview,
.field-wrapper .form-check {
    background-color: transparent;
}

/* Cuando el dropzone está en estado error/éxito, mostrar borde en el input file */
.field-wrapper.field-has-error .dropzone input[type="file"],
.field-wrapper.field-has-success .dropzone input[type="file"] {
    border-color: inherit;
}
