{# Confirmation dialog — native <dialog> element, no Alpine #}
{# Uses htmx.ajax() for the confirmed action (stays in htmx lifecycle). #}
{# #}
{# Usage: Include once in page. Trigger with: #}
{#   <button data-dz-dialog="confirm-dialog" #}
{#           data-dz-confirm-message="Delete this item?" #}
{#           data-dz-confirm-action="/api/tasks/1" #}
{#           data-dz-confirm-method="delete" #}
{#           data-dz-confirm-target="closest tr" #}
{#           data-dz-confirm-swap="outerHTML swap:300ms"> #}
{#     Delete #}
{#   </button> #}
{# #}
{# If target/swap are omitted, defaults to the trigger's nearest <tr> #}
{# (outerHTML swap:300ms) or body (innerHTML) as fallback. #}
<dialog id="confirm-dialog" class="modal">
  <div class="modal-box">
    <h3 class="font-bold text-lg">Confirm Action</h3>
    <p class="py-4" data-dz-dialog-message></p>
    <div class="modal-action">
      <form method="dialog">
        <button class="btn btn-ghost">Cancel</button>
      </form>
      <button class="btn btn-error" data-dz-dialog-confirm>
        Confirm
      </button>
    </div>
  </div>
  <form method="dialog" class="modal-backdrop"><button>close</button></form>
</dialog>
