<!DOCTYPE html>
<html lang="ru">
<head>
    <meta charset="UTF-8">
    <title>Редактирование команды</title>
    <link rel="icon" href="/static/smith.ico" type="image/x-icon">
    <style>
        :root {
            --bg: #0f1115; --panel: #171a21; --panel-2: #1d222b; --border: #2b3240;
            --text: #e8ecf3; --muted: #9aa4b2; --accent: #4f8cff; --shadow: 0 10px 30px rgba(0,0,0,.35); --radius: 16px;
        }
        * { box-sizing: border-box; }
        body { margin: 0; background: var(--bg); color: var(--text); font-family: Arial, sans-serif; }
        .page { max-width: 1000px; margin: 0 auto; padding: 24px; }
        .panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
        .title { font-size: 24px; font-weight: 700; margin-bottom: 18px; }
        .small-meta { margin-bottom: 16px; color: var(--muted); font-size: 13px; }
        .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
        .form-group { display: flex; flex-direction: column; gap: 6px; }
        .form-group.full { grid-column: 1 / -1; }
        label { color: var(--muted); font-size: 13px; font-weight: 600; }
        input[type="text"] {
            min-height: 42px;
            padding: 0 12px;
            border-radius: 10px;
            border: 1px solid var(--border);
            background: var(--panel-2);
            color: var(--text);
        }
        .logo-box {
            margin-top: 8px;
            padding: 12px;
            border: 1px dashed var(--border);
            border-radius: 12px;
            background: var(--panel-2);
        }
        .logo-preview {
            max-width: 120px;
            max-height: 120px;
            object-fit: contain;
            display: block;
        }
        .actions { margin-top: 20px; display: flex; gap: 10px; }
        .btn { min-height: 42px; padding: 0 14px; border: none; border-radius: 10px; cursor: pointer; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; }
        .btn-primary { background: var(--accent); color: white; }
        .btn-secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
    </style>
</head>
<body>
    <div class="page">
        <div class="panel">
            <div class="title">Редактирование команды</div>
            <div class="small-meta">ID: {{ team.id }}</div>

            <form method="post" action="/admin/db/teams/{{ team.id }}/edit">
                <div class="form-grid">
                    <div class="form-group">
                        <label>Название</label>
                        <input type="text" name="name" value="{{ team.name }}">
                    </div>

                    <div class="form-group">
                        <label>External ID</label>
                        <input type="text" name="external_id" value="{{ team.external_id }}">
                    </div>

                    <div class="form-group full">
                        <label>Полное название</label>
                        <input type="text" name="full_name" value="{{ team.full_name }}">
                    </div>

                    <div class="form-group">
                        <label>Город</label>
                        <input type="text" name="city" value="{{ team.city }}">
                    </div>

                    <div class="form-group">
                        <label>Трёхбуквенное название</label>
                        <input type="text" name="short_name_3" value="{{ team.short_name_3 }}">
                    </div>

                    <div class="form-group full">
                        <label>Путь к логотипу</label>
                        <input type="text" name="logo_path" value="{{ team.logo_path }}">
                        <div class="logo-box">
                            {% if team.logo_path %}
                            <img src="{{ team.logo_path }}" alt="{{ team.name }}" class="logo-preview">
                            {% else %}
                            Логотип не задан.
                            {% endif %}
                        </div>
                    </div>
                </div>

                <div class="actions">
                    <button type="submit" class="btn btn-primary">Сохранить</button>
                    <a href="/admin/db/teams" class="btn btn-secondary">К списку</a>
                    <a href="/admin/db" class="btn btn-secondary">Разделы</a>
                </div>
            </form>
        </div>
    </div>
</body>
</html>