<?php if (isset($component)) { $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54 = $attributes; } ?>
<?php $component = App\View\Components\AppLayout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('app-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\AppLayout::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['title' => 'Ajukan Izin / Sakit']); ?>
<?php $__env->startPush('styles'); ?>
<style>
.form-wrap{max-width:560px;margin:0 auto;}
.form-card{background:var(--white);border:1px solid var(--border);border-radius:20px;box-shadow:var(--sh);overflow:hidden;}
.form-card-hd{padding:20px 24px;border-bottom:1px solid var(--border);display:flex;align-items:center;gap:12px;}
.form-card-ico{width:42px;height:42px;border-radius:12px;background:linear-gradient(135deg,#f59e0b,#f97316);display:flex;align-items:center;justify-content:center;flex-shrink:0;box-shadow:0 4px 12px rgba(245,158,11,.25);}
.form-card-ico svg{width:20px;height:20px;stroke:white;}
.form-card-title{font-size:1rem;font-weight:800;color:var(--text);}
.form-card-sub{font-size:12px;color:var(--muted);font-weight:500;margin-top:2px;}
.form-card-body{padding:24px;}
.form-card-ft{padding:16px 24px;border-top:1px solid var(--border);background:var(--bg2);display:flex;justify-content:flex-end;gap:10px;border-radius:0 0 20px 20px;}
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:14px;}
.jenis-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:4px;}
.jenis-card{border:2px solid var(--border);border-radius:12px;padding:14px 16px;cursor:pointer;transition:all .15s;display:flex;align-items:center;gap:10px;}
.jenis-card:hover{border-color:var(--primary);background:var(--primary-l);}
.jenis-card input[type=radio]{display:none;}
.jenis-card.selected{border-color:var(--primary);background:var(--primary-l);}
.jenis-card-ico{width:36px;height:36px;border-radius:9px;display:flex;align-items:center;justify-content:center;flex-shrink:0;}
.jenis-card-ico svg{width:16px;height:16px;}
.jenis-card-ico.izin{background:#fffbeb;border:1px solid #fde68a;}
.jenis-card-ico.izin svg{stroke:#d97706;}
.jenis-card-ico.sakit{background:#eff6ff;border:1px solid #bfdbfe;}
.jenis-card-ico.sakit svg{stroke:#3b82f6;}
.jenis-card-lbl{font-size:13px;font-weight:700;color:var(--text);}
.jenis-card-sub{font-size:11px;color:var(--muted);font-weight:500;margin-top:1px;}
.hint-text{font-size:11px;color:var(--muted2);font-weight:500;margin-top:5px;}
@media(max-width:480px){.form-row{grid-template-columns:1fr;}.jenis-grid{grid-template-columns:1fr;}}
</style>
<?php $__env->stopPush(); ?>

<div class="form-wrap">
    <a href="<?php echo e(route('karyawan.izin-sakit.index')); ?>" class="btn btn-ghost btn-sm" style="margin-bottom:18px;display:inline-flex;">
        <svg viewBox="0 0 24 24" fill="none" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"/></svg>
        Kembali
    </a>

    <div class="form-card">
        <div class="form-card-hd">
            <div class="form-card-ico">
                <svg viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 11l3 3L22 4"/><path d="M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"/></svg>
            </div>
            <div>
                <div class="form-card-title">Ajukan Izin / Sakit</div>
                <div class="form-card-sub">Isi form pengajuan dengan lengkap</div>
            </div>
        </div>

        <div class="form-card-body">
            <?php if($errors->any()): ?>
            <div class="alert alert-error" style="margin-bottom:16px;">
                <svg viewBox="0 0 24 24" fill="none" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/></svg>
                <?php echo e($errors->first()); ?>

            </div>
            <?php endif; ?>

            <form method="POST" action="<?php echo e(route('karyawan.izin-sakit.store')); ?>"
                  enctype="multipart/form-data" id="form-izin">
                <?php echo csrf_field(); ?>

                
                <div class="form-group">
                    <label>Jenis Pengajuan</label>
                    <div class="jenis-grid">
                        <label class="jenis-card <?php echo e(old('jenis','izin')==='izin' ? 'selected' : ''); ?>" id="card-izin">
                            <input type="radio" name="jenis" value="izin"
                                   <?php echo e(old('jenis','izin')==='izin' ? 'checked' : ''); ?>

                                   onchange="selectJenis('izin')">
                            <div class="jenis-card-ico izin">
                                <svg viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 11l3 3L22 4"/><path d="M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"/></svg>
                            </div>
                            <div>
                                <div class="jenis-card-lbl">Izin</div>
                                <div class="jenis-card-sub">Keperluan pribadi</div>
                            </div>
                        </label>
                        <label class="jenis-card <?php echo e(old('jenis')==='sakit' ? 'selected' : ''); ?>" id="card-sakit">
                            <input type="radio" name="jenis" value="sakit"
                                   <?php echo e(old('jenis')==='sakit' ? 'checked' : ''); ?>

                                   onchange="selectJenis('sakit')">
                            <div class="jenis-card-ico sakit">
                                <svg viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 12h-4l-3 9L9 3l-3 9H2"/></svg>
                            </div>
                            <div>
                                <div class="jenis-card-lbl">Sakit</div>
                                <div class="jenis-card-sub">Kondisi kesehatan</div>
                            </div>
                        </label>
                    </div>
                    <?php $__errorArgs = ['jenis'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><span class="error-message"><?php echo e($message); ?></span><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                </div>

                
                <div class="form-row">
                    <div class="form-group">
                        <label>Tanggal Mulai</label>
                        <input type="date" name="tanggal_mulai"
                               value="<?php echo e(old('tanggal_mulai', today()->toDateString())); ?>" required>
                        <?php $__errorArgs = ['tanggal_mulai'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><span class="error-message"><?php echo e($message); ?></span><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    </div>
                    <div class="form-group">
                        <label>Tanggal Selesai</label>
                        <input type="date" name="tanggal_selesai"
                               value="<?php echo e(old('tanggal_selesai', today()->toDateString())); ?>" required>
                        <?php $__errorArgs = ['tanggal_selesai'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><span class="error-message"><?php echo e($message); ?></span><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    </div>
                </div>

                
                <div class="form-group">
                    <label>Keterangan</label>
                    <textarea name="keterangan" rows="3"
                              placeholder="Jelaskan alasan izin atau kondisi sakit kamu..."><?php echo e(old('keterangan')); ?></textarea>
                    <?php $__errorArgs = ['keterangan'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><span class="error-message"><?php echo e($message); ?></span><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                </div>

                
                <div class="form-group">
                    <label>Bukti Lampiran <span style="font-weight:500;text-transform:none;font-size:10px;color:var(--muted2);">(opsional)</span></label>
                    <input type="file" name="bukti_file" accept=".jpg,.jpeg,.png,.pdf">
                    <p class="hint-text">Format: JPG, PNG, atau PDF. Maks 2MB.</p>
                    <?php $__errorArgs = ['bukti_file'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><span class="error-message"><?php echo e($message); ?></span><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                </div>
            </form>
        </div>

        <div class="form-card-ft">
            <a href="<?php echo e(route('karyawan.izin-sakit.index')); ?>" class="btn btn-ghost">Batal</a>
            <button type="submit" form="form-izin" class="btn btn-primary">
                <svg viewBox="0 0 24 24" fill="none" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>
                Kirim Pengajuan
            </button>
        </div>
    </div>
</div>

<?php $__env->startPush('scripts'); ?>
<script>
function selectJenis(jenis) {
    document.getElementById('card-izin').classList.toggle('selected', jenis === 'izin');
    document.getElementById('card-sakit').classList.toggle('selected', jenis === 'sakit');
}
</script>
<?php $__env->stopPush(); ?>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $attributes = $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $component = $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?><?php /**PATH C:\laragon\www\absen_gw\resources\views/karyawan/izin-sakit/create.blade.php ENDPATH**/ ?>