/* Estilos para el sistema de facturación */

/* Botón de Facturar selección */
.gd-listado-ordenes__acciones-seleccion {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    text-align: center;
}

.gd-listado-ordenes__facturar-seleccion {
    background: #91B508;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.gd-listado-ordenes__facturar-seleccion:hover {
    background: #7a9907;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(145, 181, 8, 0.3);
}

.gd-listado-ordenes__facturar-seleccion:active {
    transform: translateY(0);
}

.gd-listado-ordenes__facturar-icon {
    display: flex;
    align-items: center;
}

/* Checkbox para selección */
.orden-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #91B508;
    cursor: pointer;
}

/* Tabla responsive mejorada */
@media (max-width: 768px) {
    .gd-listado-ordenes__acciones-seleccion {
        padding: 15px;
    }
    
    .gd-listado-ordenes__facturar-seleccion {
        width: 100%;
        justify-content: center;
    }
}


/* Animaciones para feedback visual */
.gd-listado__tr:has(.orden-checkbox:checked) {
    background-color: rgba(145, 181, 8, 0.1);
    border-left: 3px solid #91B508;
}

/* Estados de carga */
.gd-listado-ordenes__facturar-seleccion:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.gd-listado-ordenes__facturar-seleccion.loading {
    position: relative;
}

.gd-listado-ordenes__facturar-seleccion.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mejoras visuales para la tabla de órdenes */
.gd-listado-ordenes .gd-listado__th:first-child {
    width: 50px;
    text-align: center;
}

.gd-listado-ordenes .gd-listado__td:first-child {
    text-align: center;
    vertical-align: middle;
}

/* Tooltips para mejor UX */
.gd-listado-ordenes__facturar-seleccion[title] {
    position: relative;
}

/* Indicadores visuales para órdenes ya facturadas */
.gd-listado__tr[data-facturado="true"] {
    opacity: 0.7;
    background-color: #f8f9fa;
}

.gd-listado__tr[data-facturado="true"] .orden-checkbox {
    opacity: 0.5;
    cursor: not-allowed;
}

.gd-listado__tr[data-facturado="true"]::after {
    content: 'Facturado';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #28a745;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
}

/* === ESTILOS PARA FORMULARIO DE CREAR DOCUMENTO === */

/* Sección de información del cliente */
.gd-crear-documento__cliente-campos {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
}

.gd-crear-documento__campo-grupo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.gd-crear-documento__campo-grupo:last-child {
    margin-bottom: 0;
}

.gd-crear-documento__campo {
    display: flex;
    flex-direction: column;
}

.gd-crear-documento__campo--completo {
    grid-column: 1 / -1;
}

.gd-crear-documento__campo label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.gd-crear-documento__campo input,
.gd-crear-documento__campo select {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: white;
}

.gd-crear-documento__campo input:focus,
.gd-crear-documento__campo select:focus {
    outline: none;
    border-color: #91B508;
    box-shadow: 0 0 0 3px rgba(145, 181, 8, 0.1);
}

.gd-crear-documento__campo input:required:invalid {
    border-color: #dc3545;
}

.gd-crear-documento__campo input:required:valid {
    border-color: #28a745;
}

.gd-crear-documento__separador {
    margin: 25px 0 20px 0;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
}

.gd-crear-documento__separador h3 {
    margin: 0;
    color: #666;
    font-size: 16px;
    font-weight: 600;
}

/* Responsive para campos del cliente */
@media (max-width: 768px) {
    .gd-crear-documento__campo-grupo {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .gd-crear-documento__cliente-campos {
        padding: 15px;
    }
}

/* Estados mejorados para los campos */
.gd-crear-documento__campo input[type="email"]:valid {
    background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2328a745' stroke-width='2'><path d='M9 12l2 2 4-4'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.gd-crear-documento__campo select:required:valid {
    background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2328a745' stroke-width='2'><path d='M9 12l2 2 4-4'/></svg>"), url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'><polyline points='6,9 12,15 18,9'/></svg>");
    background-repeat: no-repeat, no-repeat;
    background-position: right 40px center, right 12px center;
    background-size: 16px, 12px;
    padding-right: 65px;
}
