:root {
    --primary-color: #21b573;
    --bg-color: #ffffff;
    --text-dark: #111111;
    --text-gray: #666666;
}

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

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-color);
    /* Теперь фон всегда белый */
}

/* Главный контейнер теперь растягивается на 100% */
.app-container {
    width: 100%;
    background-color: var(--bg-color);
    min-height: 100vh;
    padding-bottom: 40px;
}

/* --- ШАПКА (Header) --- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background-color: var(--bg-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 10;
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #ddd;
}

.user-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
}

.header-actions {
    display: flex;
    gap: 20px;
    color: var(--primary-color);
}

.header-actions span {
    cursor: pointer;
    transition: opacity 0.2s;
    font-size: 28px;
}

.header-actions span:hover {
    opacity: 0.7;
}

/* --- ОБЩИЕ СТИЛИ СЕКЦИЙ --- */
.section {
    padding: 32px 20px 0;
    max-width: 1400px;
    /* Небольшое ограничение для ультра-широких мониторов, чтобы глаза не разбегались */
    margin: 0 auto;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 24px;
}

/* --- СЕКЦИЯ ПРИЛОЖЕНИЙ (Grid) --- */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* По умолчанию 3 колонки (для мобилок) */
    gap: 24px 12px;
}

.app-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s;
}

.app-item:hover {
    transform: translateY(-4px);
}

.app-icon {
    font-size: 36px;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.app-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.app-subtitle {
    font-size: 12px;
    color: var(--text-gray);
}

/* --- КАРТОЧКИ (Горизонтальный скролл) --- */
.cards-scroll-container {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 12px;
    scrollbar-width: thin;
    /* Тонкий скроллбар в Firefox */
    scrollbar-color: #cccccc transparent;
}

/* Стилизация скроллбара для Webkit (Chrome/Safari) */
.cards-scroll-container::-webkit-scrollbar {
    height: 6px;
}

.cards-scroll-container::-webkit-scrollbar-track {
    background: transparent;
}

.cards-scroll-container::-webkit-scrollbar-thumb {
    background-color: #cccccc;
    border-radius: 10px;
}

.card {
    min-width: 220px;
    height: 200px;
    border-radius: 16px;
    background-size: cover;
    background-position: center;
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    padding: 16px;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s;
}

.card:hover {
    transform: scale(1.02);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.85));
    z-index: 1;
}

.card-text {
    position: relative;
    z-index: 2;
    color: white;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
}

.card-large {
    min-width: 300px;
    height: 220px;
}

/* --- АДАПТИВНОСТЬ ДЛЯ ПЛАНШЕТОВ И ПК --- */
@media (min-width: 768px) {
    .header {
        padding: 16px 40px;
    }

    .section {
        padding: 40px 40px 0;
    }

    /* Иконки приложений перестраиваются автоматически: сколько влезет, столько и встанет в ряд */
    .apps-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 32px 20px;
    }

    .card {
        min-width: 280px;
        height: 220px;
    }

    .card-large {
        min-width: 400px;
        height: 260px;
    }
}