body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: #f4f6f9; color: #333; margin: 0; padding: 0; -webkit-text-size-adjust: 100%;}
html { touch-action: manipulation; /* Отключает двойной тап для зума */}
.container { max-width: 900px; margin: 30px auto; padding: 0 20px; }
.card { background: #fff; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); padding: 20px; margin-bottom: 20px; }
.header { background: #fff; padding: 15px 20px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); display: flex; justify-content: space-between; align-items: center; }
.nav a { margin-right: 15px; text-decoration: none; color: #555; font-weight: 500; }
.nav a:hover { color: #007bff; }
.btn { display: inline-block; padding: 10px 20px; background: #007bff; color: #fff; border: none; border-radius: 5px; cursor: pointer; text-decoration: none; font-size: 14px; }
.btn-danger { background: #dc3545; }
.btn-success { background: #28a745; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
input, select { width: 100%; padding: 10px; margin: 5px 0 15px; border: 1px solid #ddd; border-radius: 4px; box-sizing: border-box; }
label { font-weight: bold; font-size: 13px; color: #666; }
.status-ok { color: green; font-weight: bold; }
.status-err { color: red; font-weight: bold; }
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th, td { padding: 10px; text-align: left; border-bottom: 1px solid #eee; font-size: 14px; }
.balance-box { font-size: 24px; font-weight: bold; color: #28a745; }
/* Fix for Telegram Scroll */
/*html, body { height: 100%; overflow: hidden; }
.main-container { height: 100%; overflow-y: auto; }
.main-container { margin-top: 100px;}*/
/* --- MODAL SYSTEM --- */
.modal {
    display: none; 
    position: fixed; z-index: 2000; 
    left: 0; top: 0; width: 100%; height: 100%; 
    background-color: rgba(0, 0, 0, 0.6); 
    justify-content: center; align-items: center;
}

.modal-content {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    width: 400px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

    /* === FIX: TELEGRAM SCROLL (Architecture) === */
    
    /* 1. Фиксируем страницу намертво */
    html, body {
        height: 100%;
        width: 100%;
        margin: 0;
        padding: 0;
        overflow: hidden; /* Глобальный запрет скролла */
        background: #f4f6f8;
    }

    /* 2. Настраиваем отступы под меню */
    body {
        /* Шапка 30px + Меню 50px = 80px */
        /*padding-top: 90px; */
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
    }
    
    /* Мобильная адаптация (Шапка auto(~50px) + Меню 60px) */
    @media (max-width: 768px) {
        body {
            padding-top: 60px; /* Подберите точное значение под вашу моб. версию */
        }
    }

    /* 3. Обертка контента (То, что мы добавили в menu.php) */
    .app-content-wrapper {
        flex: 1; /* Занимает все оставшееся место */
        width: 100%;
        height: 100%; /* Для надежности */
        overflow-y: auto; /* ВОТ ЗДЕСЬ РАБОТАЕТ СКРОЛЛ */
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch; /* Плавно на iOS */
        position: relative;
        z-index: 1;
        margin-bottom: 60px;
    }

    /* 4. Внутренний контейнер */
    .main-container {
        /* Убираем margin-top, так как body уже имеет padding-top */
        /* Если нужно, чтобы контейнер не схлопывался */
        min-height: 100%; 
        /* Убираем его собственный скролл, если был */
        overflow: visible; 
    }
