<div class="rounded-2xl border border-slate-200 bg-white shadow-sm dark:border-slate-700 dark:bg-slate-900">
    <div class="modal-body wrap-modal wrap p-5">
        <form role="form" id="from_items"
              action="<?php echo base_url(); ?>admin/estimates/cloned_estimate/<?= $estimate_info->estimates_id ?>"
              method="post"
              class="space-y-4">

            <?php
            $selected_client_label = '';
            if (!empty($estimate_info->client_id)) {
                $selected_client = $this->db->select('name')->where('client_id', $estimate_info->client_id)->get('tbl_client')->row();
                if (!empty($selected_client->name)) {
                    $selected_client_label = $selected_client->name;
                }
            }
            echo form_lookup_group(
                'client_id',
                lang('select') . ' ' . lang('client'),
                !empty($estimate_info->client_id) ? $estimate_info->client_id : '',
                $selected_client_label,
                true,
                array('id' => 'estimate_client_id_lookup'),
                'mb-3',
                array(
                    'type' => 'client',
                    'min_length' => 0,
                    'placeholder' => lang('search') . ' ' . lang('client'),
                ),
                ''
            );
            ?>

            <?= form_datepicker(
                'estimate_date',
                lang('estimate_date'),
                !empty($estimate_info->estimate_date) ? $estimate_info->estimate_date : date('Y-m-d'),
                false,
                array('id' => 'estimate_date', 'data-format' => config_item('date_picker_format'), 'required' => true),
                '',
                '',
                'horizontal'
            ); ?>

            <?= form_datepicker(
                'due_date',
                lang('due_date'),
                !empty($estimate_info->due_date) ? $estimate_info->due_date : date('Y-m-d'),
                false,
                array('id' => 'due_date', 'data-format' => config_item('date_picker_format'), 'required' => true),
                '',
                '',
                'horizontal'
            ); ?>

            <div class="flex items-center justify-end gap-2 border-t border-slate-200 pt-4 dark:border-slate-700">
                <button type="button" class="inline-flex items-center rounded-lg border border-slate-200 bg-white px-4 py-2 text-sm font-semibold text-slate-700 hover:bg-slate-100 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-200 dark:hover:bg-slate-700" data-dismiss="modal">
                    <?= lang('close') ?>
                </button>
                <button type="submit" class="inline-flex items-center rounded-lg bg-slate-900 px-4 py-2 text-sm font-semibold text-white hover:bg-slate-800 dark:bg-slate-100 dark:text-slate-900 dark:hover:bg-white">
                    <?= lang('clone') ?>
                </button>
            </div>
        </form>
    </div>
</div>
