/* =====================================================================
   Edición de depósitos: botón "Editar" de las listas + ventana modal.
   Paleta tomada de listadepositosrdc.css para que combine con la app.
   ===================================================================== */

/* ---------- Botón "Editar" dentro de las tablas de las listas ---------- */
.editdep-btn-editar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 0.9rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #4b1ca4;
    background: #ffffff;
    border: 2px solid #4b1ca4;
    border-radius: 0.5rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.editdep-btn-editar:hover,
.editdep-btn-editar:focus-visible {
    color: #ffffff;
    background: #4b1ca4;
}

.editdep-sin-edicion {
    color: #9ca3af;
}

/* ---------- Ventana modal ---------- */
.editdep-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;            /* SweetAlert2 usa 1060, así que sus avisos quedan por encima */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
    background: rgba(17, 24, 39, 0.6);
}

.editdep-dialog {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 580px;
    max-height: calc(100vh - 2rem);
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.editdep-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    color: #ffffff;
    background: linear-gradient(135deg, #4b1ca4 0%, #6a28c4 100%);
}

.editdep-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.editdep-close {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1.5rem;
    line-height: 1;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.18);
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
}

.editdep-close:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
}

.editdep-close:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.editdep-body {
    flex: 1 1 auto;
    padding: 1.25rem;
    overflow-y: auto;
}

.editdep-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2.5rem 1rem;
    color: #6b7280;
}

.editdep-spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 3px solid #e5e7eb;
    border-top-color: #4b1ca4;
    border-radius: 50%;
    animation: editdep-giro 0.8s linear infinite;
}

@keyframes editdep-giro {
    to { transform: rotate(360deg); }
}

/* ---------- Resumen de solo lectura ---------- */
.editdep-resumen {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.4rem 1rem;
    margin: 0 0 1rem;
    padding: 0.9rem 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
}

.editdep-resumen dt {
    margin: 0;
    font-weight: 600;
    color: #6b7280;
}

.editdep-resumen dd {
    margin: 0;
    color: #1f2937;
    overflow-wrap: anywhere;
}

.editdep-importe {
    font-size: 1.15rem;
    font-weight: 700;
    color: #4b1ca4;
}

.editdep-bloqueado {
    margin-left: 0.5rem;
    padding: 0.1rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    background: #e5e7eb;
    border-radius: 999px;
    white-space: nowrap;
}

/* ---------- Avisos ---------- */
.editdep-aviso {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    border-radius: 0.75rem;
    border: 1px solid transparent;
}

.editdep-aviso-info {
    color: #1e40af;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.editdep-aviso-warning {
    color: #92400e;
    background: #fffbeb;
    border-color: #fde68a;
}

.editdep-aviso-error {
    color: #991b1b;
    background: #fef2f2;
    border-color: #fecaca;
}

/* ---------- Campos ---------- */
.editdep-field {
    margin-bottom: 1rem;
}

.editdep-label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    color: #1f2937;
}

.editdep-input {
    display: block;
    width: 100%;
    padding: 0.65rem 0.85rem;
    font-size: 1rem;
    color: #1f2937;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
}

.editdep-input:focus {
    outline: none;
    border-color: #6a28c4;
    box-shadow: 0 0 0 3px rgba(106, 40, 196, 0.18);
}

textarea.editdep-input {
    resize: vertical;
    min-height: 5rem;
}

.editdep-ayuda {
    margin-top: 0.3rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.editdep-contador {
    text-align: right;
}

.editdep-archivo-estado {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: #065f46;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 0.5rem;
    overflow-wrap: anywhere;
}

.editdep-link {
    padding: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4b1ca4;
    background: none;
    border: none;
    text-decoration: underline;
    cursor: pointer;
    white-space: nowrap;
}

.editdep-error-form {
    margin: 0 0 0.5rem;
    color: #b91c1c;
    font-weight: 600;
}

/* ---------- Pie con botones ---------- */
.editdep-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 0.9rem 1.25rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.editdep-btn {
    padding: 0.65rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
}

.editdep-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.editdep-btn-primary {
    color: #ffffff;
    background: #4b1ca4;
}

.editdep-btn-primary:hover:not(:disabled) {
    background: #3a1580;
}

.editdep-btn-secondary {
    color: #374151;
    background: #e5e7eb;
}

.editdep-btn-secondary:hover:not(:disabled) {
    background: #d1d5db;
}

@media (max-width: 576px) {
    .editdep-backdrop {
        align-items: flex-end;
        padding: 0;
    }

    .editdep-dialog {
        max-width: none;
        max-height: 94vh;
        border-radius: 1rem 1rem 0 0;
    }

    .editdep-resumen {
        grid-template-columns: 1fr;
        gap: 0.1rem;
    }

    .editdep-resumen dd {
        margin-bottom: 0.5rem;
    }

    .editdep-footer {
        flex-direction: column-reverse;
    }

    .editdep-btn {
        width: 100%;
    }
}

/* ---------- Periodo del diezmo dentro del modal ---------- */
.editdep-periodo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem 0.75rem;
    margin-bottom: 0.5rem;
}

.editdep-label-small {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4b5563;
}

/* ---------- Aviso de periodos ya depositados (formularios de depósito/ingreso y modal) ---------- */
.periodoaviso {
    margin: 0.75rem 0 0;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    line-height: 1.4;
    border-radius: 0.75rem;
    border: 1px solid transparent;
}

.periodoaviso strong {
    display: block;
    margin-bottom: 0.25rem;
}

.periodoaviso ul {
    margin: 0.25rem 0 0;
    padding-left: 1.2rem;
}

.periodoaviso-info {
    color: #1e40af;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.periodoaviso-error {
    color: #991b1b;
    background: #fef2f2;
    border-color: #fca5a5;
    font-weight: 600;
}

.periodoaviso-error strong {
    font-size: 1rem;
}

.periodoaviso-detalle {
    color: #6b7280;
    font-size: 0.85rem;
}

@media (max-width: 576px) {
    .editdep-periodo-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- Secciones, campos modificados y franja de estado del modal ---------- */
.editdep-seccion {
    margin: 0 0 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6b7280;
}

.editdep-seccion + .editdep-field,
.editdep-aviso + .editdep-seccion {
    margin-top: 0.25rem;
}

.editdep-marca {
    margin-left: 0.4rem;
    padding: 0.05rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: #4b1ca4;
    background: #ede9fe;
    border-radius: 999px;
    vertical-align: middle;
}

.editdep-input.editdep-cambiado {
    border-color: #6a28c4;
    background: #faf5ff;
}

.editdep-periodo-grid.editdep-cambiado .editdep-input {
    border-color: #6a28c4;
    background: #faf5ff;
}

/* Franja fija entre el formulario y los botones: siempre visible sin hacer scroll */
.editdep-estado {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
    border-top: 1px solid transparent;
}

.editdep-estado-error {
    color: #991b1b;
    background: #fef2f2;
    border-top-color: #fecaca;
    font-weight: 600;
}

.editdep-estado-ok {
    color: #065f46;
    background: #ecfdf5;
    border-top-color: #a7f3d0;
}

.editdep-estado-neutro {
    color: #6b7280;
    background: #f9fafb;
    border-top-color: #e5e7eb;
}

@media (max-width: 576px) {
    .editdep-estado-error {
        flex-direction: column;
        align-items: flex-start;
    }
}

.editdep-estado-ok,
.editdep-estado-neutro {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.3rem;
}

/* ---------- Capa "Subiendo tu comprobante" (cubre todo el modal mientras sube) ---------- */
.editdep-dialog {
    position: relative;
}

.editdep-subiendo {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.94);
}

.editdep-spinner-grande {
    width: 3.5rem;
    height: 3.5rem;
    border-width: 5px;
}

.editdep-subiendo-titulo {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #4b1ca4;
}

.editdep-subiendo-texto {
    margin: 0;
    font-size: 1rem;
    color: #4b5563;
}

/* ---------- Aviso de subida en las pantallas de captura ---------- */
.comprobante-subiendo {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(17, 24, 39, 0.65);
}

.comprobante-subiendo-caja {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    max-width: 22rem;
    padding: 2rem 1.5rem;
    text-align: center;
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.3);
}

.comprobante-subiendo-spinner {
    width: 3.5rem;
    height: 3.5rem;
    border: 5px solid #e5e7eb;
    border-top-color: #4b1ca4;
    border-radius: 50%;
    animation: editdep-giro 0.8s linear infinite;
}

.comprobante-subiendo-titulo {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #4b1ca4;
}

.comprobante-subiendo-texto {
    margin: 0;
    font-size: 1rem;
    color: #4b5563;
}

.comprobante-cargado {
    margin-top: 0.5rem;
    padding: 0.6rem 0.85rem;
    font-size: 0.9rem;
    color: #065f46;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 0.5rem;
    overflow-wrap: anywhere;
}

/* ---------- Visor de comprobantes (vista previa) ---------- */
.visor-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(17, 24, 39, 0.7);
}

.visor-dialog {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 640px;
    max-height: calc(100vh - 2rem);
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.visor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.1rem;
    color: #ffffff;
    background: linear-gradient(135deg, #4b1ca4 0%, #6a28c4 100%);
}

.visor-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
}

.visor-close {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1.5rem;
    line-height: 1;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.18);
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
}

.visor-body {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 12rem;
    padding: 0.75rem;
    overflow: auto;
    background: #f3f4f6;
}

.visor-img {
    position: relative;
    z-index: 1;
    max-width: 100%;
    max-height: calc(100vh - 12rem);
    height: auto;
    border-radius: 0.5rem;
    background: #ffffff;
}

.visor-cargando {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    color: #6b7280;
}

.visor-spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 3px solid #e5e7eb;
    border-top-color: #4b1ca4;
    border-radius: 50%;
    animation: editdep-giro 0.8s linear infinite;
}

.visor-pdf,
.visor-error {
    padding: 1.5rem;
    text-align: center;
    color: #374151;
}

.visor-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.6rem;
    padding: 0.85rem 1.1rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.visor-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.1rem;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
}

.visor-btn-primary {
    color: #ffffff;
    background: #4b1ca4;
}

.visor-btn-secondary {
    color: #374151;
    background: #e5e7eb;
}

@media (max-width: 576px) {
    .visor-footer {
        flex-direction: column-reverse;
    }

    .visor-btn {
        width: 100%;
    }
}

/* ---------- Depositos por verificar: circulo rojo del menu y aviso de inicio ---------- */
.navbar-toggler {
    position: relative;
}

.nav-pendientes {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.35rem;
    margin-left: 0.45rem;
    padding: 0 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    color: #ffffff;
    background: #dc2626;
    border-radius: 999px;
    vertical-align: middle;
}

.nav-pendientes-punto {
    position: absolute;
    top: 0.2rem;
    right: 0.2rem;
    width: 0.8rem;
    height: 0.8rem;
    background: #dc2626;
    border: 2px solid #ffffff;
    border-radius: 50%;
}

.pendientes-aviso {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 1rem;
    padding: 0.9rem 1.1rem;
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #dc2626;
    border-radius: 0.75rem;
}

.pendientes-aviso-texto {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.pendientes-aviso-boton {
    flex-shrink: 0;
    padding: 0.55rem 1rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    background: #dc2626;
    border-radius: 0.5rem;
}

@media (max-width: 576px) {
    .pendientes-aviso {
        flex-direction: column;
        align-items: stretch;
    }

    .pendientes-aviso-boton {
        text-align: center;
    }
}
