/* PANARIA - FILTRO DE ALBARANES POR PROVEEDOR */

.lista-albaranes-proveedores {
    display: block;
}

.panel-filtro-proveedor-albaranes {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding: 14px;
    border-radius: 14px;
    background: #f7f2eb;
    border: 1px solid rgba(74, 58, 49, .08);
}

.campo-filtro-proveedor-albaranes {
    display: grid;
    gap: 6px;
    min-width: 280px;
}

.campo-filtro-proveedor-albaranes label {
    font-size: 12px;
    font-weight: 800;
    color: #5f493c;
}

.campo-filtro-proveedor-albaranes select {
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid rgba(74, 58, 49, .14);
    border-radius: 10px;
    background: #fff;
    color: #4a3429;
    font: inherit;
    font-weight: 700;
}

.resumen-proveedor-albaranes {
    color: #6f5a4d;
    font-size: 13px;
    font-weight: 700;
    text-align: right;
}

.historial-proveedor-albaranes {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.historial-proveedor-albaranes .tarjeta-albaran {
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 700px) {

    .panel-filtro-proveedor-albaranes {
        align-items: stretch;
        flex-direction: column;
    }

    .campo-filtro-proveedor-albaranes {
        min-width: 0;
        width: 100%;
    }

    .resumen-proveedor-albaranes {
        text-align: left;
    }

}


/* FILTRO ADICIONAL POR MES */

.filtros-historial-albaranes {
    display: flex;
    align-items: end;
    gap: 12px;
    flex-wrap: wrap;
}

.campo-filtro-proveedor-albaranes input[type="month"] {
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid rgba(74, 58, 49, .14);
    border-radius: 10px;
    background: #fff;
    color: #4a3429;
    font: inherit;
    font-weight: 700;
    box-sizing: border-box;
}

@media (max-width: 700px) {

    .filtros-historial-albaranes {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .campo-filtro-proveedor-albaranes input[type="month"] {
        width: 100%;
    }

}


/* =========================================================
   ALBARANES - NUEVO FORMULARIO
========================================================= */

.formulario-albaran-nuevo {
    display: grid !important;
    gap: 14px !important;
}

.fila-principal-albaran {
    display: grid;
    grid-template-columns:
        minmax(170px, 1.05fr)
        minmax(160px, .95fr)
        minmax(170px, .95fr)
        minmax(130px, .75fr)
        minmax(250px, 1.45fr);
    gap: 12px;
    align-items: end;
}

.fila-secundaria-albaran {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.formulario-albaran-nuevo .campo-pedido {
    min-width: 0;
}

.formulario-albaran-nuevo .campo-pedido label {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: baseline;
}

.campo-obligatorio,
.campo-opcional {
    font-size: 9px;
    font-weight: 800;
}

.campo-obligatorio {
    color: #8d3d31;
}

.campo-opcional {
    color: #85766c;
}

.formulario-albaran-nuevo input,
.formulario-albaran-nuevo select,
.formulario-albaran-nuevo textarea {
    box-sizing: border-box;
    width: 100%;
}

.formulario-albaran-nuevo input[type="file"] {
    min-height: 48px;
    padding: 8px;
    background: #fff;
}

.campo-nota-albaran textarea {
    min-height: 76px;
    resize: vertical;
}

.boton-guardar-albaran {
    min-width: 165px;
    min-height: 48px;
    align-self: end;
}

.datos-principales-albaran {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
    padding: 10px;
    border-radius: 10px;
    background: #f7f2eb;
}

.datos-principales-albaran > div {
    min-width: 0;
}

.datos-principales-albaran span {
    display: block;
    margin-bottom: 2px;
    color: #7b695e;
    font-size: 10px;
    font-weight: 800;
}

.datos-principales-albaran strong {
    display: block;
    overflow-wrap: anywhere;
    color: #4a3429;
    font-size: 12px;
}

@media (max-width: 1180px) {

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

    .campo-archivo-albaran {
        grid-column: 1 / -1;
    }

}

@media (max-width: 700px) {

    .fila-principal-albaran,
    .fila-secundaria-albaran {
        grid-template-columns: 1fr;
    }

    .campo-archivo-albaran {
        grid-column: auto;
    }

    .boton-guardar-albaran {
        width: 100%;
    }

    .datos-principales-albaran {
        grid-template-columns: 1fr;
    }

}


/* =========================================================
   ALBARANES - FORMULARIO MÁS LIMPIO
========================================================= */

.fila-secundaria-albaran {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin-top: 2px;
}

.campo-nota-albaran {
    width: 100%;
}

.campo-nota-albaran textarea {
    width: 100%;
    min-height: 78px;
}

.boton-guardar-albaran {
    justify-self: start;
    min-width: 170px;
}

.campo-obligatorio,
.campo-opcional {
    display: none !important;
}

@media (max-width: 700px) {
    .boton-guardar-albaran {
        width: 100%;
        justify-self: stretch;
    }
}


/* =========================================================
   ALBARANES - NOTA Y GUARDAR EN BLOQUES INFERIORES
========================================================= */

.formulario-albaran-nuevo {
    display: block !important;
}

.fila-principal-albaran {
    display: grid !important;
    grid-template-columns:
        minmax(180px, 1.1fr)
        minmax(170px, .95fr)
        minmax(180px, .95fr)
        minmax(140px, .75fr)
        minmax(260px, 1.35fr) !important;
    gap: 14px !important;
    align-items: end !important;
}

.fila-secundaria-albaran {
    display: block !important;
    margin-top: 20px !important;
}

.campo-nota-albaran {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

.campo-nota-albaran label {
    display: block !important;
    margin-bottom: 7px !important;
    font-weight: 800 !important;
}

.campo-nota-albaran textarea {
    display: block !important;
    width: 100% !important;
    min-height: 110px !important;
    box-sizing: border-box !important;
    padding: 14px 16px !important;
    border: 1px solid rgba(74,58,49,.18) !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: #4a3a31 !important;
    font: inherit !important;
    line-height: 1.45 !important;
    resize: vertical !important;
}

.campo-nota-albaran textarea::placeholder {
    color: #91877f !important;
}

.boton-guardar-albaran {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 52px !important;
    margin-top: 12px !important;
    border-radius: 11px !important;
    font-size: 16px !important;
    font-weight: 850 !important;
}

.acciones-pagina-pedidos > .boton {
    width: 100% !important;
}

@media (max-width: 1180px) {

    .fila-principal-albaran {
        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;
    }

    .campo-archivo-albaran {
        grid-column: 1 / -1 !important;
    }

}

@media (max-width: 700px) {

    .fila-principal-albaran {
        grid-template-columns: 1fr !important;
    }

    .campo-archivo-albaran {
        grid-column: auto !important;
    }

    .fila-secundaria-albaran {
        margin-top: 16px !important;
    }

    .campo-nota-albaran textarea {
        min-height: 100px !important;
    }

}


/* =========================================================
   ALBARANES - DOCUMENTO SOLO BAJO DEMANDA
========================================================= */

.datos-principales-albaran {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

.dato-documento-albaran {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.boton-ver-albaran-inline {
    margin-top: 3px;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid rgba(74,58,49,.12);
    border-radius: 9px;
    background: #fff;
    color: #4a3429;
    font: inherit;
    font-size: 11px;
    font-weight: 850;
    cursor: pointer;
}

.boton-ver-albaran-inline:hover {
    background: #f3eee8;
}

.preview-albaran {
    display: none !important;
}

.acciones-albaran-limpias {
    margin-top: 12px;
}

@media (max-width: 850px) {
    .datos-principales-albaran {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 520px) {
    .datos-principales-albaran {
        grid-template-columns: 1fr !important;
    }

    .boton-ver-albaran-inline {
        width: 100%;
    }
}
