@extends('layouts.app')

@section('title', 'Tambah User - Admin TUNJUK-i')

@section('content')
<div class="mb-6">
    <div class="flex items-center justify-between">
        <div>
            <h1 class="text-2xl font-bold text-[#0b2b4a] flex items-center gap-2">
                <i class="fas fa-user-plus text-[#c9a84c]"></i>
                Tambah User
            </h1>
            <p class="text-gray-500 text-sm mt-1">Isi form berikut untuk menambahkan user baru</p>
        </div>
        <a href="{{ route('admin.users.index') }}" class="text-gray-600 hover:text-gray-800 transition">
            <i class="fas fa-arrow-left mr-1"></i> Kembali
        </a>
    </div>
</div>

<div class="bg-white rounded-2xl shadow-sm border border-gray-100 p-6">
    <form action="{{ route('admin.users.store') }}" method="POST">
        @csrf

        <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
            <div>
                <label class="block text-sm font-medium text-gray-700 mb-1">Nama Lengkap *</label>
                <input type="text" name="name" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-[#0b2b4a] focus:border-[#0b2b4a]" required>
            </div>
            <div>
                <label class="block text-sm font-medium text-gray-700 mb-1">Email *</label>
                <input type="email" name="email" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-[#0b2b4a] focus:border-[#0b2b4a]" required>
            </div>
            <div>
                <label class="block text-sm font-medium text-gray-700 mb-1">Password *</label>
                <input type="password" name="password" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-[#0b2b4a] focus:border-[#0b2b4a]" required minlength="8">
            </div>
            <div>
                <label class="block text-sm font-medium text-gray-700 mb-1">Role *</label>
                <select name="role" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-[#0b2b4a] focus:border-[#0b2b4a]" required>
                    <option value="admin">Admin</option>
                    <option value="ppk">PPK</option>
                    <option value="contractor">Kontraktor</option>
                    <option value="agent">Agent</option>
                    <option value="bank">Bank</option>
                    <option value="auditor">Auditor</option>
                    <option value="super_admin">Super Admin</option>
                </select>
            </div>
        </div>

        <div class="mt-6 flex items-center gap-3">
            <button type="submit" class="bg-[#0b2b4a] text-white px-6 py-2 rounded-lg hover:bg-[#1a4a6e] transition">
                <i class="fas fa-save mr-2"></i> Simpan
            </button>
            <a href="{{ route('admin.users.index') }}" class="text-gray-600 hover:text-gray-800 transition">
                Batal
            </a>
        </div>
    </form>
</div>
@endsection