<?php $__env->startSection('title', 'Profil'); ?>
<?php $__env->startSection('page-title', 'Profil'); ?>

<?php $__env->startSection('content'); ?>

<?php if(session('success')): ?>
    <div class="mb-4 px-4 py-3 rounded-lg bg-green-100 text-green-700 flex items-center gap-2">
        <i class="bi bi-check-circle-fill"></i> <?php echo e(session('success')); ?>

    </div>
<?php endif; ?>

<?php if(session('error')): ?>
    <div class="mb-4 px-4 py-3 rounded-lg bg-red-100 text-red-700 flex items-center gap-2">
        <i class="bi bi-exclamation-triangle-fill"></i> <?php echo e(session('error')); ?>

    </div>
<?php endif; ?>

<div class="mb-6">
    <h2 class="text-xl font-bold text-gray-800">Profil Saya</h2>
    <p class="text-sm text-gray-500">Kelola informasi akun Anda</p>
</div>

<div class="grid md:grid-cols-2 gap-6">

    <!-- KIRI -->
    <div>

        <!-- INFO AKUN -->
        <div class="bg-white border rounded-xl shadow-sm mb-6">
            <div class="px-5 py-4 border-b font-semibold text-gray-700">
                Informasi Akun
            </div>

            <div class="p-5">

                <div class="flex items-center gap-4 mb-6 border-b pb-6">
                    <div class="w-16 h-16 rounded-full bg-gradient-to-br from-blue-500 to-indigo-500 text-white flex items-center justify-center text-xl font-bold">
                        <?php echo e(strtoupper(substr($user->name, 0, 1))); ?>

                    </div>

                    <div>
                        <h3 class="font-semibold text-gray-800"><?php echo e($user->name); ?></h3>
                        <p class="text-sm text-gray-500"><?php echo e($user->email); ?></p>
                        <span class="text-xs bg-blue-100 text-blue-600 px-2 py-1 rounded-full">
                            <?php echo e(ucfirst($user->role ?? 'Ekspedisi')); ?>

                        </span>
                    </div>
                </div>

                <div class="space-y-3 text-sm">
                    <div class="flex justify-between">
                        <span class="text-gray-500">Bergabung</span>
                        <span class="font-medium text-gray-800"><?php echo e($user->created_at->format('d M Y')); ?></span>
                    </div>
                    <div class="flex justify-between">
                        <span class="text-gray-500">Terakhir update</span>
                        <span class="font-medium text-gray-800"><?php echo e($user->updated_at->diffForHumans()); ?></span>
                    </div>
                    <div class="flex justify-between">
                        <span class="text-gray-500">Telepon</span>
                        <span class="font-medium text-gray-800"><?php echo e($user->phone ?? '-'); ?></span>
                    </div>
                </div>

            </div>
        </div>

        <!-- EDIT PROFIL -->
        <div class="bg-white border rounded-xl shadow-sm">
            <div class="px-5 py-4 border-b font-semibold text-gray-700">
                Edit Profil
            </div>

            <div class="p-5">
                <form method="POST" action="<?php echo e(route('ekspedisi.profil.update')); ?>">
                    <?php echo csrf_field(); ?>

                    <div class="mb-4">
                        <label class="block text-sm text-gray-600 mb-1">Nama Lengkap</label>
                        <input type="text" name="name"
                               value="<?php echo e(old('name', $user->name)); ?>"
                               class="w-full border rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-blue-400 outline-none">
                        <?php $__errorArgs = ['name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="text-red-500 text-xs mt-1"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    </div>

                    <div class="mb-4">
                        <label class="block text-sm text-gray-600 mb-1">Email</label>
                        <input type="email" name="email"
                               value="<?php echo e(old('email', $user->email)); ?>"
                               class="w-full border rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-blue-400 outline-none">
                        <?php $__errorArgs = ['email'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="text-red-500 text-xs mt-1"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    </div>

                    <div class="mb-4">
                        <label class="block text-sm text-gray-600 mb-1">Nomor Telepon</label>
                        <input type="text" name="phone"
                               value="<?php echo e(old('phone', $user->phone)); ?>"
                               class="w-full border rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-blue-400 outline-none">
                        <?php $__errorArgs = ['phone'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="text-red-500 text-xs mt-1"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    </div>

                    <button class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg text-sm">
                        <i class="bi bi-check-lg"></i> Simpan Perubahan
                    </button>

                </form>
            </div>
        </div>

    </div>

    <!-- KANAN -->
    <div>

        <!-- GANTI PASSWORD -->
        <div class="bg-white border rounded-xl shadow-sm mb-6">
            <div class="px-5 py-4 border-b font-semibold text-gray-700">
                Ganti Password
            </div>

            <div class="p-5">
                <form method="POST" action="<?php echo e(route('ekspedisi.profil.update-password')); ?>">
                    <?php echo csrf_field(); ?>

                    <div class="mb-4">
                        <label class="block text-sm text-gray-600 mb-1">Password Lama</label>
                        <input type="password" name="password_lama"
                               class="w-full border rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-blue-400 outline-none">
                        <?php $__errorArgs = ['password_lama'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="text-red-500 text-xs mt-1"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    </div>

                    <div class="mb-4">
                        <label class="block text-sm text-gray-600 mb-1">Password Baru</label>
                        <input type="password" name="password"
                               class="w-full border rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-blue-400 outline-none">
                        <?php $__errorArgs = ['password'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="text-red-500 text-xs mt-1"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    </div>

                    <div class="mb-4">
                        <label class="block text-sm text-gray-600 mb-1">Konfirmasi Password</label>
                        <input type="password" name="password_confirmation"
                               class="w-full border rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-blue-400 outline-none">
                    </div>

                    <button class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg text-sm">
                        <i class="bi bi-lock"></i> Ganti Password
                    </button>

                </form>
            </div>
        </div>

        <!-- LOGOUT -->
        <div class="bg-white border rounded-xl shadow-sm">
            <div class="px-5 py-4 border-b font-semibold text-red-500">
                Zona Berbahaya
            </div>

            <div class="p-5">
                <p class="text-sm text-gray-500 mb-4">
                    Keluar dari akun Anda di perangkat ini.
                </p>

                <form method="POST" action="<?php echo e(route('logout')); ?>">
                    <?php echo csrf_field(); ?>
                    <button onclick="return confirm('Yakin ingin logout?')"
                            class="bg-red-500 hover:bg-red-600 text-white px-4 py-2 rounded-lg text-sm">
                        <i class="bi bi-box-arrow-right"></i> Logout
                    </button>
                </form>
            </div>
        </div>

    </div>

</div>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.ekspedisi', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\laragon\www\Toko-miftah\resources\views/ekspedisi/profile.blade.php ENDPATH**/ ?>