@extends('layouts.app')

@section('title', 'Clients — TechCorp Manager')

@section('content')
<div data-tc-api-page="clients">
    <div class="tc-page-head-row">
        <div class="tc-page-head">
            <h2>Clients</h2>
            <p>Add, edit, or remove clients via the JSON API from this page.</p>
        </div>
        <button type="button" class="tc-btn-primary" id="tc-add-client">+ Add client</button>
    </div>

    <div class="tc-card">
        <div class="tc-table-wrap">
            <table class="tc-table">
                <thead>
                    <tr>
                        <th>Name</th>
                        <th>Company</th>
                        <th>Email</th>
                        <th>Phone</th>
                        <th>Status</th>
                        <th></th>
                    </tr>
                </thead>
                <tbody>
                    @forelse ($clients as $client)
                        <tr>
                            <td><strong>{{ $client->name }}</strong></td>
                            <td>{{ $client->company ?? '—' }}</td>
                            <td>{{ $client->email ?? '—' }}</td>
                            <td>{{ $client->phone ?? '—' }}</td>
                            <td><span class="tc-badge {{ $client->status }}">{{ $client->status }}</span></td>
                            <td class="tc-table-actions">
                                <button type="button" class="tc-btn-sm tc-edit-client" data-id="{{ $client->id }}">Edit</button>
                                <button type="button" class="tc-btn-sm danger tc-del-client" data-id="{{ $client->id }}">Delete</button>
                            </td>
                        </tr>
                    @empty
                        <tr><td colspan="6" class="tc-empty">No clients yet.</td></tr>
                    @endforelse
                </tbody>
            </table>
        </div>
    </div>
</div>
@endsection
