body { font-family: sans-serif; background: #f9f9f9; padding: 10px; }
.container { max-width: 500px; margin: 0 auto; }
.card { background: white; padding: 15px; border-radius: 12px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); margin-bottom: 15px; }
.hidden { display: none; }
.btn-main { background: #007bff; color: white; border: none; padding: 10px; width: 100%; border-radius: 8px; cursor: pointer; }
.balance { font-size: 1.2rem; font-weight: bold; }
.red { color: #d63031; } .green { color: #27ae60; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.promo-banner { background: #fff3bf; padding: 8px; border-radius: 5px; font-size: 0.8rem; margin-bottom: 10px; }
/* Синий дашборд */
.dash-blue {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
}

/* Компактная форма */
.compact-form summary {
    cursor: pointer;
    color: #007bff;
    outline: none;
}

.flex-row {
    display: flex;
    gap: 10px;
}

.flex-row input {
    flex: 1;
    width: 50%; /* Чтобы два инпута стояли в ряд */
}

input {
    display: block;
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box; /* Чтобы padding не раздувал ширину */
}

.btn-sm {
    flex: 1;
    padding: 8px;
    border-radius: 6px;
    border: none;
    background: #e1f0ff;
    color: #007bff;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: bold;
}

.btn-sm.outline {
    background: #f0f0f0;
    color: #333;
}

.btn-sm:active {
    transform: scale(0.98);
}

.dash-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 колонки в ряд */
    gap: 10px;
    align-items: center;
}

.dash-item small {
    display: block;
    opacity: 0.8;
    font-size: 0.7rem;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.dash-item h2, .dash-item h3 {
    margin: 0;
    font-size: 1.1rem;
}
.red-text h2 {
    color: #ff4d4d !important; /* Ярко-красный для долгов */
}
.green-text { color: #2ecc71; }

/* Контейнер для уведомлений */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: white;
    color: #333;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    margin-bottom: 10px;
    border-left: 5px solid #2ecc71; /* Зеленый по умолчанию */
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease forwards;
}

.toast.error { border-left-color: #e74c3c; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Красивые карточки выбора ролей */
.welcome-container {
    text-align: center;
    max-width: 800px;
    margin: 50px auto;
}

.role-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
}

.role-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    cursor: pointer;
    transition: 0.3s;
    border: 2px solid transparent;
}

.role-card:hover {
    transform: translateY(-5px);
    border-color: #3498db;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.role-icon { font-size: 3rem; margin-bottom: 15px; }

.role-grid {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
}

.role-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 16px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    width: 200px;
}

.role-card:hover {
    background: #fff;
    border-color: #3498db;
    box-shadow: 0 10px 25px rgba(52, 152, 219, 0.15);
    transform: translateY(-5px);
}

.role-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.role-card h3 { margin: 10px 0; font-size: 1.2rem; }
.role-card p { font-size: 0.85rem; color: #7f8c8d; margin-bottom: 15px; }

/* Анимация для уведомлений */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 10000; }
.toast {
    background: white; padding: 15px 25px; border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1); border-left: 6px solid #2ecc71;
    margin-bottom: 10px; animation: slideIn 0.4s ease-out;
}
@keyframes slideIn { from { opacity: 0; transform: translateX(50px); } to { opacity: 1; transform: translateX(0); } }

/* Мобильная оптимизация */
@media (max-width: 600px) {
    .container {
        width: 95%; /* Почти на весь экран */
        padding: 10px;
    }

    /* Карточки ролей ставим в столбик, а не в ряд */
    .menu-grid, .role-grid {
        flex-direction: column;
        gap: 15px;
    }

    .role-card {
        width: 100% !important; /* Карточка на всю ширину */
        box-sizing: border-box;
        padding: 20px;
    }

    h1 {
        font-size: 1.8rem; /* Уменьшаем заголовок, чтобы не переносился криво */
    }

    /* Кнопки делаем крупнее для пальцев */
    .btn, .btn-main, .btn-outline {
        width: 100%;
        padding: 15px;
        font-size: 1.1rem;
    }

    /* Уведомления (тосты) на весь экран снизу */
    #toast-container {
        top: auto;
        bottom: 20px;
        left: 10px;
        right: 10px;
    }
}
.instruction-box {
    background: #ffffff;
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    padding: 25px;
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.guide-item h4 {
    color: #3498db;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.guide-item ul {
    padding-left: 18px;
    font-size: 0.9rem;
    color: #444;
}

.guide-item li {
    margin-bottom: 8px;
}

.promo-note {
    background: #fff9c4;
    padding: 5px;
    border-radius: 4px;
    list-style: none;
    margin-left: -18px;
    margin-top: 10px;
}

/* Для мобильных */
@media (max-width: 600px) {
    .guide-grid {
        grid-template-columns: 1fr;
    }
}
.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 15px;
}
.guide-item h4 {
    margin-bottom: 5px;
    color: #3498db;
    font-size: 1rem;
}
.guide-item p {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.4;
    margin: 0;
}
.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}
.guide-item h4 {
    margin: 10px 0 5px 0;
    color: #3498db;
    font-size: 1rem;
}
