#user-avatar-trigger {
    position: absolute; /* <-- ИЗМЕНЕНИЕ: Позиционирование относительно родителя */
    top: 15px;      /* Отступ сверху от края .content-block */
    right: 15px;     /* Отступ справа от края .content-block */
    /* Сбрасываем лишние стили */
    left: auto;
    transform: none;
    
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10; /* Можно уменьшить z-index, так как он теперь в другом контексте */
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
}
#user-avatar-trigger:hover { background: rgba(0, 0, 0, 0.6); border-color: #3498db; }
#user-avatar-trigger.logged-in { border-color: #2ecc71; }
#user-avatar-trigger img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.auth-modal-content {
    background: rgba(25, 25, 35, 0.95);
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    padding: 0;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    text-align: center;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.auth-modal-header {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    z-index: 10;
}
.auth-header-icon {
    font-size: 24px;
    cursor: pointer;
    opacity: 0.7;
    line-height: 1;
    margin-left: 15px;
    transition: transform 0.3s ease;
}
.auth-header-icon:hover { opacity: 1; }
#auth-back-btn { margin-right: auto; margin-left: 0; }
#auth-settings-btn.active { transform: rotate(90deg); }
.header-right-controls { margin-left: auto; display: flex; align-items: center; }

.auth-modal-body { display: flex; flex-direction: column; flex-grow: 1; min-height: 0; position: relative; }
.auth-view { display: none; flex-direction: column; flex-grow: 1; min-height: 0; padding: 20px 25px 25px; overflow-y: auto; }
#auth-profile-view { padding: 0; overflow-y: hidden; }
.profile-content-wrapper {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 0;
    overflow-y: auto;
    /* И измените padding, убрав левый отступ, который мы перенесли в .profile-header */
    padding: 0 25px 25px 10px; /* Уменьшили левый отступ, чтобы компенсировать */
}
.profile-content { display:none; flex-direction:column; }

.auth-tabs { display: flex; margin-bottom: 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.2); }
.auth-tab-btn { background: none; border: none; color: #ccc; padding: 10px 15px; cursor: pointer; font-size: 16px; flex-grow: 1; border-bottom: 3px solid transparent; }
.auth-tab-btn.active { color: white; border-bottom-color: #3498db; }
.auth-tab-content { display: none; flex-direction: column; gap: 15px; }
.auth-tab-content.active { display: flex; }

.auth-view h2 { margin: 0 0 15px 0; flex-shrink: 0; }
.auth-view input[type=text],
.auth-view input[type=tel],
.auth-view input[type=password],
.auth-view input[type=date] {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: 1px solid #555;
    border-radius: 5px;
    box-sizing: border-box;
}
.auth-checkbox { display: flex; align-items: center; gap: 10px; text-align: left; font-size: 14px; color: #ddd; }
.auth-button { padding: 12px 20px; border-radius: 5px; border: none; cursor: pointer; font-size: 16px; font-weight: bold; background: #3498db; color: white; width: 100%; transition: background-color .2s; flex-shrink: 0; }

.auth-message { margin:0; padding: 10px; border-radius: 5px; font-size: 14px; position: absolute; bottom: 0; left: 0; right: 0; z-index: 20; }
.auth-message.error { background: #e74c3c; }
.auth-message.success { background: #2ecc71; }

.profile-avatar-large { width: 100px; height: 100px; background: #34495e; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 40px; margin: 5px auto 15px; flex-shrink: 0; }
.profile-avatar-large img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.credentials-box { background: rgba(0, 0, 0, 0.3); border-radius: 8px; padding: 15px; margin: 20px 0; text-align: left; border: 1px solid #555; }
.auth-warning { font-size: 13px; color: #f1c40f; }

.profile-switcher { display: flex; justify-content: space-between; align-items: center; padding: 10px 20px; background: rgba(0, 0, 0, 0.2); flex-shrink: 0; }
.switcher-arrow { background: none; border: none; color: white; font-size: 20px; cursor: pointer; opacity: 0.7; padding: 5px 10px; }
.switcher-arrow:hover { opacity: 1; }
.switcher-name { font-size: 16px; font-weight: bold; text-align: center; flex-grow: 1; }

#settings-form, #add-child-form { display: flex; flex-direction: column; gap: 15px; }
.settings-section { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid #444; }
.settings-section:last-of-type { border-bottom: none; margin-bottom: 0; }
.settings-section h4 { margin-top: 0; margin-bottom: 15px; text-align: left; }
.avatar-preview { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; margin: 0 auto 15px; display: block; border: 2px solid #555; }
.file-upload-btn { display: block; width: auto; padding: 8px 16px; margin: 0 auto 5px; text-align: center; }
.field-hint { display: block; font-size: 12px; color: #999; margin-top: 5px; text-align: left; }
.uid-box { background: rgba(0, 0, 0, 0.5); padding: 10px; border-radius: 5px; border: 1px solid #555; font-family: monospace; font-size: 16px; cursor: pointer; word-break: break-all; }

.group-info-wrapper { text-align: left; flex-grow: 1; min-height: 0; }
.no-group-msg { text-align: center; color: #888; margin-top: 20px; }
.next-lesson-timer { text-align: center; font-size: 16px; color: #eee; margin-bottom: 15px; padding: 8px; background: rgba(52, 152, 219, 0.2); border-radius: 8px; }
.group-info-card { display: flex; gap: 15px; margin-bottom: 20px; background: rgba(0, 0, 0, 0.2); padding: 15px; border-radius: 12px; }
.teacher-photo { width: 80px; height: 80px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.group-details h3 { margin: 0 0 10px 0; font-size: 18px; }
.group-details p { margin: 0 0 5px 0; font-size: 14px; color: #ccc; }
.group-details p strong { color: #fff; }
.payment-status { font-weight: bold; padding: 2px 6px; border-radius: 4px; color: white; font-size: 12px; }
.payment-ok { background-color: #27ae60; }
.payment-warning { background-color: #f39c12; }
.payment-expired { background-color: #c0392b; }

.schedule-carousel-wrapper { position: relative; }
.schedule-carousel { display: flex; overflow-x: auto; padding-bottom: 15px; scrollbar-width: thin; scrollbar-color: #3498db rgba(0, 0, 0, 0.3); scroll-snap-type: x mandatory; }
.schedule-carousel::-webkit-scrollbar { height: 8px; }
.schedule-carousel::-webkit-scrollbar-thumb { background: #3498db; border-radius: 4px; }
.lesson-card { border: 1px solid #555; border-radius: 8px; padding: 10px; text-align: center; position: relative; font-size: 13px; min-width: 110px; flex-shrink: 0; scroll-snap-align: center; margin-right: 10px; display: flex; flex-direction: column; transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease; }
.lesson-next { box-shadow: 0 0 12px #3498db; transform: scale(1.05); }
.lesson-date { font-weight: bold; font-size: 18px; margin-top: 15%; }
.lesson-date small { font-weight: normal; font-size: 12px; color: #ccc; }
.lesson-status { font-size: 11px; color: #aaa; margin: 4px 0; }
.lesson-attendance { font-size: 12px; font-weight: bold; padding: 2px 4px; border-radius: 3px; margin-top: 4px; color: white; background: rgba(0, 0, 0, 0.2); }
.group-comment-icons-container { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; background: rgba(25, 25, 35, 0.95); padding: 2px 6px; border-radius: 10px; border: 1px solid #555; }
.personal-comment-icons-container { margin-top: auto; display: flex; justify-content: center; gap: 5px; padding-top: 5px; }
.comment-icon { cursor: pointer; font-size: 16px; opacity: 0.9; }
.comment-icon.is-personal { color: #2ecc71; }
.comment-icon.is-group { color: #e67e22; }

.lesson-card.status-future { background-color: rgba(50, 50, 50, 0.3); }
.lesson-card.status-today { background-color: rgba(52, 152, 219, 0.3); border-color: #3498db; }
.lesson-card.status-past { background-color: rgba(80, 80, 80, 0.3); }
.lesson-card.mark-present { background-color: rgba(39, 174, 96, 0.3); }
.lesson-card.mark-absent { background-color: rgba(192, 57, 43, 0.3); }
.lesson-card.mark-failed { background-color: rgba(243, 156, 18, 0.3); }
.lesson-card.mark-sick { background-color: rgba(142, 68, 173, 0.3); }

.form-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-top: 15px;
}

.form-actions > div,
.form-actions .auth-button {
    flex: 1; /* Заставляет оба элемента занимать по 50% ширины */
    width: 100%; /* Позволяет кнопке растянуться внутри flex-элемента */
}

/* Убираем лишние отступы и рамку у контейнера кнопки "Добавить ребенка" */
#add-child-section.settings-section {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: none;
}

.profile-header {
    display: flex;
    align-items: center;
    /* Замените gap на padding */
    padding: 15px 0 0 15px; /* 15px сверху, 15px слева, 0 справа и снизу */
    margin-bottom: 20px;
    width: 100%;
}
.profile-info {
    text-align: left;
    padding-left: 20px; /* Добавим отступ между аватаром и текстом */
}
.profile-info h3, .profile-info p {
    margin: 0;
}
.profile-info h3 {
    margin-bottom: 5px;
}

/* Переносим отступ с аватара на новый контейнер */
.profile-avatar-large {
    margin: 0; 
}

.no-group-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    height: 100%;
}

.no-group-container .no-group-msg {
    margin-bottom: 20px;
}

.no-group-container .auth-button {
    max-width: 250px; /* Ограничим ширину кнопки */
}