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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f7fb;
    color: #1a1f36;
    line-height: 1.5;
}

/* ========================================
   Контейнеры
   ======================================== */

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

/* ========================================
   Шапка
   ======================================== */

.app-header {
    background: white;
    border-radius: 20px;
    padding: 20px 32px;
    margin-bottom: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e6e9f0;
}

.app-header h1 {
    font-size: 24px;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   Кнопки
   ======================================== */

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 1px solid #e6e9f0;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #f8f9fc;
    border-color: #667eea;
}

.btn-logout {
    background: #fee2e2;
    color: #dc2626;
    padding: 8px 16px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background: #fecaca;
}

.btn-edit {
    display: inline-block;
    background: white;
    color: #667eea;
    border: 1px solid #e6e9f0;
    padding: 10px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-edit:hover {
    background: #f8f9fc;
    border-color: #667eea;
}

/* ========================================
   Карточки
   ======================================== */

.create-card {
    background: white;
    border-radius: 20px;
    padding: 28px;
    margin-bottom: 32px;
    border: 1px solid #e6e9f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.create-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #1a1f36;
}

.create-card form {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.create-card input[type="text"] {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e6e9f0;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.create-card input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ========================================
   Сетка приложений
   ======================================== */

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 8px;
}

.app-card {
    background: white;
    border-radius: 20px;
    padding: 24px;
    transition: all 0.3s ease;
    border: 1px solid #e6e9f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.app-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.app-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.app-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1f36;
    margin-bottom: 8px;
}

.app-card p {
    font-size: 13px;
    color: #8a94a6;
    margin-bottom: 20px;
}

.app-card .btn-edit {
    width: 100%;
    text-align: center;
}

/* ========================================
   Формы входа/регистрации
   ======================================== */

.form-container {
    max-width: 460px;
    margin: 80px auto;
    background: white;
    border-radius: 28px;
    padding: 48px 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.form-container h1 {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    margin-bottom: 8px;
}

.form-container h2 {
    font-size: 18px;
    font-weight: 400;
    color: #8a94a6;
    text-align: center;
    margin-bottom: 32px;
}

.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #1a1f36;
    font-size: 14px;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e6e9f0;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-group input[type="color"] {
    width: 60px;
    height: 48px;
    padding: 4px;
    cursor: pointer;
}

/* ========================================
   Редактор (3 колонки)
   ======================================== */

.editor-layout {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    margin: 28px 0;
}

@media (max-width: 1024px) {
    .editor-layout {
        grid-template-columns: 1fr;
    }
}

.editor-panel {
    background: white;
    border-radius: 20px;
    padding: 28px;
    border: 1px solid #e6e9f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.editor-panel h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f2f6;
    color: #1a1f36;
}

/* ========================================
   Предпросмотр телефона
   ======================================== */

.phone-preview {
    max-width: 300px;
    margin: 0 auto;
    background: #f8f9fc;
    border-radius: 36px;
    overflow: hidden;
    box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.2);
    border: 1px solid #e6e9f0;
}

.phone-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 18px;
    text-align: center;
    font-weight: 600;
}

.phone-content {
    padding: 24px;
    text-align: center;
}

.phone-content p {
    margin-bottom: 12px;
    color: #1a1f36;
}

/* ========================================
   JSON предпросмотр
   ======================================== */

.json-preview {
    background: #1e1e2f;
    color: #e4e4e7;
    padding: 16px;
    border-radius: 12px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 12px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ========================================
   Сообщения
   ======================================== */

.message-error {
    background: #fee2e2;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 14px;
}

.message-success {
    background: #dcfce7;
    color: #16a34a;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 14px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 20px;
    border: 1px solid #e6e9f0;
}

.empty-state p {
    color: #8a94a6;
    margin-bottom: 8px;
}

/* ========================================
   Приветствие
   ======================================== */

.welcome-text {
    color: #8a94a6;
    margin-bottom: 28px;
    font-size: 14px;
}

/* ========================================
   Анимации
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.app-card, .create-card {
    animation: fadeIn 0.3s ease;
}

/* Стили для скролла */
.sidebar::-webkit-scrollbar,
.main-content::-webkit-scrollbar,
.right-panel::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track,
.main-content::-webkit-scrollbar-track,
.right-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb,
.main-content::-webkit-scrollbar-thumb,
.right-panel::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.main-content::-webkit-scrollbar-thumb:hover,
.right-panel::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}