@extends('layouts.admin')

@section('title', 'Edit Unit Kerja')
@section('page_title', 'Edit Unit Kerja')

@section('style')
<style>
    

    

    

    .master-panel {
        border: 1px solid rgba(0,0,0,0.05);
        border-radius: 8px;
        box-shadow: none;
        overflow: hidden;
    }

    .master-panel .card-header {
        display: flex;
        align-items: center;
        padding: 1rem 1.15rem;
        color: #4a3728;
        background: #ffffff;
        border-bottom: 1px solid #e8edf2;
        border-radius: 0;
    }

    .master-panel .card-header h5 {
        margin: 0;
        font-size: 1rem;
        font-weight: 750;
    }

    .panel-subtitle {
        margin-top: 0.2rem;
        color: #64748b;
        font-size: 0.8rem;
    }
</style>
@endsection

@section('content')
<section class="page-hero">
    <div>
        <h3><i class="fas fa-edit"></i> Edit Unit Kerja</h3>
        <p>Perbarui nama unit kerja yang sudah terdaftar.</p>
    </div>
    <a href="{{ route('admin.unit-kerja.index') }}" class="btn btn-outline-secondary">
        <i class="fas fa-arrow-left"></i> Kembali
    </a>
</section>

<div class="row justify-content-center">
    <div class="col-lg-5">
        <div class="card master-panel">
            <div class="card-header">
                <div>
                    <h5>Form Edit Unit Kerja</h5>
                    <div class="panel-subtitle">Nama unit kerja harus unik dalam sistem.</div>
                </div>
            </div>
            <div class="card-body">
                <form action="{{ route('admin.unit-kerja.update', $unitKerja) }}" method="POST">
                    @csrf
                    @method('PUT')

                    <div class="mb-4">
                        <label for="nama_unit" class="form-label">Nama Unit Kerja <span class="text-danger">*</span></label>
                        <input type="text" id="nama_unit" name="nama_unit"
                            class="form-control @error('nama_unit') is-invalid @enderror"
                            value="{{ old('nama_unit', $unitKerja->nama_unit) }}" required>
                        @error('nama_unit')
                            <div class="invalid-feedback">{{ $message }}</div>
                        @enderror
                    </div>

                    <div class="d-flex gap-2">
                        <button type="submit" class="btn btn-primary">
                            <i class="fas fa-save"></i> Update
                        </button>
                        <a href="{{ route('admin.unit-kerja.index') }}" class="btn btn-outline-secondary">
                            <i class="fas fa-arrow-left"></i> Kembali
                        </a>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
@endsection
