/* Estilos específicos para el módulo de facturación VERIFACTU */

/* Estadísticas de facturación */
.sgt-stats-row {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

/* Filtros de facturación */
.sgt-filters {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    align-items: end;
    flex-wrap: wrap;
}

.sgt-filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sgt-filter-group label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.sgt-filter-select,
.sgt-filter-input {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.9rem;
    min-width: 120px;
}

.sgt-filter-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sgt-filter-btn {
    background: #007bff;
    color: white;
}

.sgt-filter-btn:hover {
    background: #0056b3;
}

.sgt-filter-btn-clear {
    background: #6c757d;
    color: white;
}

.sgt-filter-btn-clear:hover {
    background: #545b62;
}

/* Tabla de facturas */
.sgt-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.sgt-table th {
    background: #343a40;
    color: white;
    padding: 15px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
}


.sgt-table tr:hover {
    background: #f8f9fa;
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.cliente-info strong {
    color: #495057;
}

.cliente-info small {
    color: #6c757d;
}

.fecha-info strong {
    color: #495057;
}

.fecha-info small {
    color: #6c757d;
}

/* Estados de facturas */
.sgt-status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-borrador {
    background: #ffc107;
    color: #212529;
}

.status-emitida {
    background: #17a2b8;
    color: white;
}

.status-enviada {
    background: #28a745;
    color: white;
}

.status-anulada {
    background: #dc3545;
    color: white;
}

.status-error_envio {
    background: #ff9800;
    color: white;
}

/* Botones de acción */
.sgt-action-buttons {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.sgt-btn {
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.sgt-btn-small {
    padding: 4px 8px;
    font-size: 0.7rem;
}

.sgt-btn-view {
    background: #6c757d;
    color: white;
}

.sgt-btn-view:hover {
    background: #545b62;
}

.sgt-btn-pdf {
    background: #dc3545;
    color: white;
}

.sgt-btn-pdf:hover {
    background: #c82333;
}

.sgt-btn-duplicate {
    background: #ffc107;
    color: #212529;
}

.sgt-btn-duplicate:hover {
    background: #e0a800;
}

.sgt-btn-edit {
    background: #007bff;
    color: white;
}

.sgt-btn-edit:hover {
    background: #0056b3;
}

.sgt-btn-anular {
    background: #dc3545;
    color: white;
}

.sgt-btn-anular:hover {
    background: #c82333;
}

.sgt-btn-qr {
    background: #17a2b8;
    color: white;
}

.sgt-btn-qr:hover {
    background: #138496;
}

.sgt-btn-enviar-verifactu {
    background: #28a745;
    color: white;
}

.sgt-btn-enviar-verifactu:hover {
    background: #218838;
}

/* Iconos de estado VERIFACTU */
.text-success {
    color: #28a745 !important;
}

.text-muted {
    color: #6c757d !important;
}

/* Modal específico para facturación */
.sgt-modal-large {
    max-width: 1200px;
    width: 95%;
}

.sgt-modal-small {
    max-width: 400px;
    width: 90%;
}

/* Formulario de nueva factura */
.sgt-form-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.sgt-form-section h4 {
    margin: 0 0 20px 0;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sgt-form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.sgt-form-group {
    flex: 1;
    min-width: 200px;
}

.sgt-form-group.flex-2 {
    flex: 2;
}

.sgt-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #495057;
}

.sgt-form-group input,
.sgt-form-group select,
.sgt-form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.sgt-form-group input:focus,
.sgt-form-group select:focus,
.sgt-form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

/* Líneas de factura */
.linea-factura {
    background: white;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 10px;
    border: 1px solid #dee2e6;
}

.sgt-btn-remove-linea {
    background: #dc3545;
    color: white;
    padding: 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.sgt-btn-remove-linea:hover {
    background: #c82333;
}

.total-linea {
    background: #e9ecef !important;
    font-weight: 600;
}

/* Totales de factura */
.totales-factura {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #007bff;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #dee2e6;
}

.total-row:last-child {
    border-bottom: none;
}

.total-final {
    font-size: 1.2rem;
    font-weight: bold;
    color: #007bff;
    border-top: 2px solid #007bff;
    margin-top: 10px;
    padding-top: 15px;
}

/* Botones del formulario */
.sgt-form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.sgt-submit-btn {
    background: #28a745;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s ease;
}

.sgt-submit-btn:hover {
    background: #218838;
}

.sgt-cancel-btn {
    background: #6c757d;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.sgt-cancel-btn:hover {
    background: #545b62;
}

.sgt-btn-secondary {
    background: #6c757d;
    color: white;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s ease;
    margin-top: 10px;
}

.sgt-btn-secondary:hover {
    background: #545b62;
}

/* Botones principales */
.sgt-new-factura-button,
.sgt-config-button {
    background: #007bff;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.sgt-new-factura-button:hover,
.sgt-config-button:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

.sgt-config-button {
    background: #6c757d;
}

.sgt-config-button:hover {
    background: #545b62;
}

/* Modal QR */
.qr-info {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 15px 0;
}

#qr-code-container {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive */
@media (max-width: 768px) {
    .sgt-stats-row {
        flex-direction: column;
    }

    .sgt-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .sgt-filter-group {
        width: 100%;
    }

    .sgt-form-row {
        flex-direction: column;
    }

    .sgt-form-group {
        min-width: auto;
    }

    .sgt-action-buttons {
        justify-content: center;
    }

    .sgt-table {
        font-size: 0.8rem;
    }

    .sgt-table th,
    .sgt-table td {
        padding: 8px 5px;
    }
} 