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

	<?= form_open(base_url('admin/accounting/save_journal_entry_settings'), array('class' => 'space-y-4', 'enctype' => 'multipart/form-data')); ?>
	<?= form_input_group('journal_entry_prefix', lang('journal_entry') . ' ' . lang('prefix'), config_item('journal_entry_prefix'), 'text', true); ?>
	<?= form_input_group('journal_entry_prefix_start_no', lang('journal_entry_prefix_start_no'), config_item('journal_entry_prefix_start_no'), 'text', true); ?>
	<div>
		<?= form_input_group('journal_entry_format', lang('journal_entry') . ' ' . lang('number_format'), (empty(config_item('journal_entry_format')) ? '[' . config_item('journal_entry_format') . ']' . '[yyyy][mm][dd][number]' : config_item('journal_entry_format')), 'text', false); ?>
		<p class="text-xs text-muted-foreground mt-2">
			ex [<?= config_item('journal_entry_prefix') ?>] = <?= lang('journal_entry_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_journal_entry') ?></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_journal_entry"/>
			<input type="checkbox" class="h-4 w-4 rounded border-border text-indigo-600" name="increment_journal_entry" <?= config_item('increment_journal_entry') == '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>
