<div class="rounded-2xl border border-border bg-card p-6 shadow-sm">
	<h3 class="text-lg font-semibold text-foreground"><?= lang('receipt_voucher') ?></h3>
	<p class="text-sm text-muted-foreground mb-4"><?= lang('receipt_voucher') . ' ' . lang('settings') ?></p>

	<?= form_open(base_url('admin/accounting/save_receipt_voucher_settings'), array('class' => 'space-y-4', 'enctype' => 'multipart/form-data')); ?>
	<?= form_input_group('receipt_voucher_prefix', lang('receipt_voucher') . ' ' . lang('prefix'), config_item('receipt_voucher_prefix'), 'text', true); ?>
	<?= form_input_group('receipt_voucher_prefix_start_no', lang('receipt_voucher_prefix_start_no'), config_item('receipt_voucher_prefix_start_no'), 'text', true); ?>
	<div>
		<?= form_input_group('receipt_voucher_format', lang('receipt_voucher') . ' ' . lang('number_format'), (empty(config_item('receipt_voucher_format')) ? '[' . config_item('receipt_voucher_format') . ']' . '[yyyy][mm][dd][number]' : config_item('receipt_voucher_format')), 'text', false); ?>
		<p class="text-xs text-muted-foreground mt-2">
			ex [<?= config_item('receipt_voucher_prefix') ?>] = <?= lang('receipt_voucher_prefix') ?>,
			[yyyy] = <?= date('Y') ?>,
			[yy] = <?= date('y') ?>,
			[mm] = <?= date('M') ?>,
			[m] = <?= date('m') ?>,
			[dd] = <?= date('d') ?>,
			[number] = <?= sprintf('%04d', config_item('estimate_start_no')) ?>
		</p>
	</div>
	<div class="flex items-center justify-between rounded-lg border border-border bg-muted/30 px-4 py-3">
		<div>
			<p class="text-sm font-medium text-foreground"><?= lang('increment_receipt_voucher') ?></p>
			<p class="text-xs text-muted-foreground"><?= lang('enable') . ' ' . lang('auto') . ' ' . lang('increment') ?></p>
		</div>
		<label class="inline-flex items-center gap-2 text-sm font-medium text-foreground">
			<input type="hidden" value="off" name="increment_receipt_voucher"/>
			<input type="checkbox" class="h-4 w-4 rounded border-border text-indigo-600" name="increment_receipt_voucher" <?= config_item('increment_receipt_voucher') == 'TRUE' ? 'checked' : '' ?>>
			<?= lang('enable') ?>
		</label>
	</div>
	<div class="flex justify-end">
		<button type="submit" class="inline-flex items-center gap-2 rounded-lg bg-indigo-600 px-4 py-2 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500">
			<i data-lucide="check" class="h-4 w-4"></i>
			<?= lang('save_changes') ?>
		</button>
	</div>
	<?= form_close(); ?>
</div>
