@extends('layouts.admin')

@section('title', 'Income ' . $income->income_number)

@section('page-title', 'Income Details')

@section('content')
<div class="max-w-3xl mx-auto space-y-6">
    <div class="bg-white rounded-xl shadow-sm border border-[#e5e7eb] p-6">
        <div class="flex justify-between items-start mb-6">
            <div>
                <h2 class="text-2xl font-bold text-[#111418] text-gray-900 mb-2">{{ $income->income_number }}</h2>
                <p class="text-sm text-[#617589]">Date: {{ $income->income_date->format('M d, Y') }}</p>
            </div>
            <span class="px-3 py-1 rounded-lg text-sm font-medium {{ $income->status === 'recorded' ? 'bg-green-100 text-green-800' : 'bg-gray-100 text-gray-800' }}">
                {{ ucfirst($income->status) }}
            </span>
        </div>

        <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
            <div>
                <p class="text-xs font-semibold text-[#617589] uppercase tracking-wider mb-2">Account</p>
                <p class="text-sm text-[#111418] text-gray-900">{{ $income->account->name }} ({{ $income->account->code }})</p>
            </div>
            @if($income->customer)
                <div>
                    <p class="text-xs font-semibold text-[#617589] uppercase tracking-wider mb-2">Customer</p>
                    <p class="text-sm text-[#111418] text-gray-900">{{ $income->customer->name }}</p>
                </div>
            @endif
            <div>
                <p class="text-xs font-semibold text-[#617589] uppercase tracking-wider mb-2">Payment Method</p>
                <p class="text-sm text-[#111418] text-gray-900">{{ ucfirst(str_replace('_', ' ', $income->payment_method)) }}</p>
            </div>
            <div>
                <p class="text-xs font-semibold text-[#617589] uppercase tracking-wider mb-2">Amount</p>
                <p class="text-2xl font-bold text-primary">{{ $income->currency }} {{ number_format($income->total, 2) }}</p>
            </div>
            @if($income->description)
                <div class="md:col-span-2">
                    <p class="text-xs font-semibold text-[#617589] uppercase tracking-wider mb-2">Description</p>
                    <p class="text-sm text-[#617589]">{{ $income->description }}</p>
                </div>
            @endif
            @if($income->notes)
                <div class="md:col-span-2">
                    <p class="text-xs font-semibold text-[#617589] uppercase tracking-wider mb-2">Notes</p>
                    <p class="text-sm text-[#617589] whitespace-pre-line">{{ $income->notes }}</p>
                </div>
            @endif
        </div>
    </div>
</div>
@endsection



