* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background-color: #f5f7fa;
}

h1, h2, h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 18px 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.back-button {
    background: #2563eb;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

.back-button:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.header-title {
    font-size: 1.5em;
    font-weight: 600;
    color: #1a1a1a;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Панель управления */
.control-panel {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.panel-title {
    font-size: 1.3em;
    color: #1a1a1a;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.panel-section {
    margin-bottom: 24px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.panel-section:last-of-type {
    margin-bottom: 0;
}

.section-subtitle {
    font-size: 1em;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

.version-selector {
    display: flex;
    align-items: center;
    gap: 12px;
}

.version-selector select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9em;
    font-family: 'Inter', sans-serif;
    background: white;
    cursor: pointer;
}

.version-selector select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.version-info {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 12px;
    margin-bottom: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-weight: 600;
    color: #374151;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input,
.form-group textarea {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9em;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.action-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(107, 114, 128, 0.2);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.save-result {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 6px;
    font-weight: 500;
    display: none;
}

.save-result.success {
    display: block;
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.save-result.error {
    display: block;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Контейнер промптов */
.prompts-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-title {
    font-size: 1.2em;
    color: #1a1a1a;
    margin-bottom: 16px;
    font-weight: 600;
}

.prompt-editor {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.prompt-editor:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.prompt-header {
    background: #f9fafb;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.prompt-header h3 {
    font-size: 0.95em;
    color: #1a1a1a;
    font-weight: 600;
}

.prompt-key {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75em;
    color: #6b7280;
    background: #e5e7eb;
    padding: 3px 8px;
    border-radius: 3px;
}

.prompt-textarea {
    width: 100%;
    padding: 16px;
    border: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
    line-height: 1.6;
    color: #1f2937;
    background: #ffffff;
    resize: vertical;
    min-height: 100px;
    max-height: none;
    overflow-y: auto;
}

.prompt-textarea:focus {
    outline: none;
    background: #fefefe;
}

.prompt-textarea::placeholder {
    color: #9ca3af;
    font-style: italic;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }

    .header {
        padding: 12px 16px;
    }

    .header-title {
        font-size: 1.2em;
    }

    .version-info {
        grid-template-columns: 1fr;
    }

    .version-selector {
        flex-direction: column;
        align-items: stretch;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .prompt-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
