<?php $pageTitle = t('new_group_title'); ?>
<div class="page-header">
    <div class="page-header-left">
        <a href="/dashboard" class="btn btn-ghost btn-sm">
            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="16" height="16"><path d="M19 12H5M12 19l-7-7 7-7"/></svg>
            <?= t('dashboard') ?>
        </a>
        <h1 class="page-title"><?= t('new_group_title') ?></h1>
    </div>
</div>

<?php if (!empty($errors)): ?>
<div class="alert alert-error"><?php foreach ($errors as $e): ?><div><?= Helper::e($e) ?></div><?php endforeach; ?></div>
<?php endif; ?>

<div class="card" style="max-width:540px">
    <div class="card-header"><h2 class="card-title"><?= t('new_group_title') ?></h2></div>
    <div class="card-body">
        <form method="POST">
            <?= Helper::csrf() ?>
            <div class="form-group">
                <label class="form-label"><?= t('group_name_label') ?> <span style="color:var(--color-danger)">*</span></label>
                <input type="text" name="name" class="form-input" required maxlength="80"
                       placeholder="<?= t('group_name_placeholder') ?>">
            </div>
            <div class="form-group">
                <label class="form-label"><?= t('description') ?> <span class="text-muted">(<?= t('optional') ?>)</span></label>
                <textarea name="description" class="form-input" rows="3"
                          placeholder="<?= t('group_desc_placeholder') ?>"></textarea>
            </div>
            <div style="margin-top:4px;padding:10px 12px;background:var(--bg-secondary);border-radius:6px;font-size:.85rem;color:var(--text-muted)">
                <?= t('group_admin_auto') ?>
            </div>
            <div style="margin-top:16px;display:flex;gap:8px">
                <button type="submit" class="btn btn-primary"><?= t('create_btn') ?></button>
                <a href="/dashboard" class="btn btn-ghost"><?= t('cancel') ?></a>
            </div>
        </form>
    </div>
</div>
