<div class="card-custom">
    <div class="d-flex justify-content-between mb-4"><h4>Proveedores</h4><button class="btn btn-primary rounded-pill" data-bs-toggle="modal" data-bs-target="#modalProv">+ Nuevo</button></div>
    <table class="table table-hover align-middle"><thead><tr><th>RUC</th><th>Razón Social</th><th>Teléfono</th><th>Dirección</th></tr></thead>
    <tbody><?php $q=$conn->query("SELECT * FROM proveedores WHERE estado=1"); while($p=$q->fetch_assoc()): ?>
        <tr><td class="fw-bold"><?php echo h($p['ruc']); ?></td><td><?php echo h($p['razon_social']); ?></td><td><?php echo h($p['telefono']); ?></td><td><?php echo h($p['direccion']); ?></td></tr>
    <?php endwhile; ?></tbody></table>
</div>
<div class="modal fade" id="modalProv"><div class="modal-dialog"><form method="POST" class="modal-content p-4">
    <input type="hidden" name="action" value="save_proveedor"><h5>Nuevo Proveedor</h5>
    <input name="ruc" class="form-control mb-2" placeholder="RUC">
    <input name="razon" class="form-control mb-2" placeholder="Razón Social" required>
    <input name="tel" class="form-control mb-2" placeholder="Teléfono">
    <input name="email" class="form-control mb-2" placeholder="Correo">
    <input name="dir" class="form-control mb-2" placeholder="Dirección">
    <button class="btn btn-primary w-100">Guardar</button>
</form></div></div>