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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f7fb;
    color: #1a1a2e;
    padding-bottom: 80px; /* место под нижнюю навигацию */
}

#app {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px 16px 0;
}

/* Шапка */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}

header h1 {
    font-weight: 600;
    font-size: 1.4rem;
    color: #0f172a;
}

#auth-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

#login-status {
    white-space: nowrap;
}

button {
    background: #4d6bfe;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 30px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.9rem;
}

button:hover {
    background: #3b5de7;
}

button.outline {
    background: transparent;
    border: 1.5px solid #4d6bfe;
    color: #4d6bfe;
}

button.outline:hover {
    background: #eef2ff;
}

/* Вкладки */
.tab-content {
    display: none;
    animation: fadeIn 0.25s ease;
}

.tab-content.active {
    display: block;
}

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

/* Статистика */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 18px 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    text-align: center;
    border: 1px solid #e9edf4;
}

.stat-card h3 {
    font-weight: 400;
    color: #64748b;
    font-size: 0.8rem;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card span {
    font-size: 1.6rem;
    font-weight: 600;
}

.neon-green {
    color: #10b981;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.25);
}

/* Списки */
h2 {
    font-weight: 500;
    font-size: 1.2rem;
    margin: 0 0 12px 0;
    color: #1e293b;
}

.list-item {
    background: white;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    border: 1px solid #edf2f7;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.list-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.list-item .title {
    font-weight: 500;
}

.list-item .amount {
    font-weight: 600;
    color: #0f172a;
}

.list-item .date {
    color: #94a3b8;
    font-size: 0.8rem;
}

/* Дети */
.child-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 6px;
    border: 1px solid #edf2f7;
}

.child-item .name {
    font-weight: 500;
}

.child-item .paid {
    font-weight: 600;
    color: #10b981;
}

/* Модалки */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.35);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 16px;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 28px 24px;
    max-width: 480px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    max-height: 90vh;
    overflow-y: auto;
}

.close {
    position: absolute;
    top: 12px; right: 18px;
    font-size: 1.8rem;
    cursor: pointer;
    color: #94a3b8;
    line-height: 1;
}

.close:hover {
    color: #1e293b;
}

.modal-content input, .modal-content textarea, .modal-content select {
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 12px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 1rem;
    background: white;
}

.modal-content button {
    width: 100%;
    padding: 12px;
    border-radius: 30px;
}

.error {
    color: #ef4444;
    font-size: 0.9rem;
    margin-top: 8px;
}

#modal-image {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

#modal-image img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 0;
    border: 1px solid #e2e8f0;
}

/* Карусель */
.carousel-content {
    text-align: center;
}

#carousel-image {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 10px;
    display: block;
    margin: 6px auto 0;
}

.carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 16px;
}

.carousel-nav {
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.carousel-nav:hover {
    background: #eef2ff;
}

#carousel-counter {
    color: #64748b;
    font-size: 0.9rem;
    min-width: 60px;
}

/* Результаты опроса */
.result-row {
    margin-bottom: 16px;
}
.result-label {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: #334155;
}

.result-label span:last-child {
    color: #64748b;
    white-space: nowrap;
}

.progress {
    background: #e2e8f0;
    border-radius: 10px;
    height: 12px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: #4d6bfe;
    border-radius: 10px;
    transition: width 0.3s ease;
    min-width: 2px;
}

/* Варианты голосования */
.vote-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 10px 0;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
}

.vote-option:hover {
    border-color: #cbd5e1;
}

.vote-option input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid #cbd5e1;
    border-radius: 5px;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
}

.vote-option input[type="radio"]:checked {
    border-color: #4d6bfe;
    background: #4d6bfe;
}

.vote-option input[type="radio"]:checked::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 15px;
    line-height: 1;
    font-weight: 700;
}

/* Нижняя навигация */
#bottom-nav,
#admin-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-around;
    padding: 8px 0 env(safe-area-inset-bottom);
    box-shadow: 0 -4px 12px rgba(0,0,0,0.04);
    z-index: 999;
}

#admin-bottom-nav {
    max-width: 600px;
    margin: 0 auto;
}

.nav-btn {
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 12px;
    color: #94a3b8;
    font-size: 0.7rem;
    cursor: pointer;
    transition: color 0.2s;
    flex: 1;
}

.nav-btn .nav-icon {
    font-size: 1.6rem;
    line-height: 1.4;
}

.nav-btn .nav-label {
    font-weight: 500;
    letter-spacing: 0.3px;
}

.nav-btn.active {
    color: #4d6bfe;
}

.nav-btn:hover {
    color: #4d6bfe;
}

/* Админка (дополнительно) – сохраняем старые стили для админки */
.admin-container .admin-section {
    background: white;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #edf2f7;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.admin-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.admin-controls input, .admin-controls textarea, .admin-controls select {
    flex: 1 1 180px;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 0.95rem;
    background: #fafcff;
}

.admin-controls textarea {
    flex-basis: 100%;
    min-height: 60px;
}

.admin-controls button {
    flex: 0 0 auto;
    padding: 10px 20px;
}

.admin-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
}

.admin-item .actions button {
    margin-left: 6px;
    padding: 4px 12px;
    font-size: 0.8rem;
    background: #e2e8f0;
    color: #1e293b;
}

.admin-item .actions button.danger {
    background: #fee2e2;
    color: #b91c1c;
}

.admin-item .actions button.danger:hover {
    background: #fecaca;
}

.poll-item {
    border: 1px solid #edf2f7;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
}

.poll-item .poll-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.poll-item .poll-options {
    margin-top: 8px;
    padding-left: 16px;
}

.poll-item .poll-options li {
    list-style: none;
    padding: 4px 0;
}

@media (max-width: 480px) {
    header h1 { font-size: 1.2rem; }
    .stat-card span { font-size: 1.3rem; }
    .nav-btn .nav-label { font-size: 0.6rem; }
}
