/* === БАЗОВЫЕ ПЕРЕМЕННЫЕ === */
:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --danger: #dc2626;
    --success: #16a34a;
    --warning: #ca8a04;
    
    --bg: #ffffff;
    --surface: #f8fafc;
    --text: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
}

[data-theme="dark"] {
    --bg: #0f172a;
    --surface: #1e293b;
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #334155;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

/* === НАВИГАЦИЯ === */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
}

/* === КОНТЕЙНЕР === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* === КАРТОЧКИ === */
.balance-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.balance-amount {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
    margin: 1rem 0;
}

.balance-details {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.income { color: var(--success); }
.expense { color: var(--danger); }

/* === КНОПКИ === */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-block {
    width: 100%;
}

/* === ФОРМЫ === */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
}

/* === МОДАЛЬНЫЕ ОКНА === */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg);
    padding: 2rem;
    border-radius: var(--radius);
    max-width: 500px;
    width: 90%;
    position: relative;
}

.close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
}

/* === ОПЕРАЦИИ === */
.operations-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.operation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--surface);
    border-radius: var(--radius);
    border-left: 4px solid var(--border);
}

.operation-item.income {
    border-left-color: var(--success);
}

.operation-item.expense {
    border-left-color: var(--danger);
}

/* === АДАПТИВНОСТЬ === */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--surface);
        flex-direction: column;
        padding: 1rem;
        border-bottom: 1px solid var(--border);
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .balance-details {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .filters {
        flex-direction: column;
    }
}

/* === УТИЛИТЫ === */
.hidden { display: none !important; }
.error-message { color: var(--danger); margin-top: 1rem; }
.success-message { color: var(--success); margin-top: 1rem; }

/* === АДМИН-ПАНЕЛЬ === */
.admin-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
}

.admin-table th,
.admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.admin-table th {
    background: var(--bg);
    font-weight: 600;
}

.badge-free { background: #e2e8f0; color: #475569; }
.badge-basic { background: #dbeafe; color: #1e40af; }
.badge-advanced { background: #dcfce7; color: #166534; }

.status.active { color: var(--success); }
.status.inactive { color: var(--danger); }

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* === КАТЕГОРИИ === */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.category-card {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    position: relative;
}

.category-card.system {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.cat-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.cat-meta {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.badge {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.cat-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
}

/* === ОТЧЁТЫ === */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: center;
}

.card-value {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 0.5rem;
}

.chart-container {
    background: var(--surface);
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 2rem;
    height: 300px;
}

/* === ПАГИНАЦИЯ === */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.page-info {
    color: var(--text-secondary);
}

/* === ПУСТОЕ СОСТОЯНИЕ === */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

/* === АУТЕНТИФИКАЦИЯ === */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
}

.auth-container {
    background: var(--bg);
    padding: 2.5rem;
    border-radius: var(--radius);
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}

.logo-large {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 2rem;
}

.auth-tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
}

.tab-btn {
    flex: 1;
    padding: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.test-accounts {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--surface);
    border-radius: var(--radius);
    font-size: 0.875rem;
}

/* === УТИЛИТЫ === */
.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.btn-icon:hover {
    opacity: 1;
}

.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }

/* === МОБИЛЬНОЕ МЕНЮ === */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--surface);
        flex-direction: column;
        padding: 1rem;
        border-bottom: 1px solid var(--border);
        z-index: 1000;
    }
    
    .nav-links.active {
        display: flex !important;  /* ← важно */
    }
    
    .menu-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        color: var(--text);
        padding: 0.5rem;
    }
    
    /* Закрытие при клике на пункт */
    .nav-links a {
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--border);
    }
    
    .nav-links a:last-child {
        border-bottom: none;
    }
}

/*== voice-assistant =====*/

.btn-voice.recording {
    background: #dc2626;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}



