@extends('layouts.dashboard')
@section('title', 'Edit Quota')
@section('page-title', 'Adjust Reseller Quota')
@section('content')
<div class="content-card" style="max-width:560px;">
    <h4>{{ $user->name }} <small class="text-muted">@{{ $user->username }}</small></h4>
    <p class="mb-4">
        <span class="badge bg-secondary">Used: {{ $user->blogs_used }}</span>
        <span class="badge bg-success ms-1">Remaining: {{ $user->blogsRemaining() }}</span>
    </p>
    <form method="POST" action="{{ route('admin.resellers.quota.update', $user) }}">
        @csrf @method('PUT')
        <div class="mb-3">
            <label class="form-label">New Total Blog Quota</label>
            <input type="number" min="0" name="blogs_quota" class="form-control" value="{{ old('blogs_quota', $user->blogs_quota) }}" required>
            <small class="text-muted">Total lifetime allowance. Used count is unaffected.</small>
        </div>
        <div class="mb-3">
            <label class="form-label">Reason / Note (optional)</label>
            <input type="text" name="reason" class="form-control">
        </div>
        <button class="btn btn-primary">Update Quota</button>
        <a href="{{ route('admin.users.index', ['role'=>'reseller']) }}" class="btn btn-outline-secondary">Cancel</a>
    </form>
</div>
@endsection
