body { font-family: 'Inter', sans-serif; -webkit-tap-highlight-color: transparent; }
/* General Transitions for smoother UX */
.nav-btn, .tab-btn, button {
    transition: background-color 0.2s ease-out, color 0.2s ease-out, opacity 0.2s ease-out;
}
.nav-btn.active { color: theme('colors.accent'); background-color: theme('colors.accent / 10%'); }
.dark .nav-btn.active { background-color: theme('colors.surface-dark'); color: #fff; }
.loader { border-top-color: theme('colors.accent'); }
.modal-content { animation: slide-up 0.3s ease-out; }
@keyframes slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-content.modal-lg {
    max-width: 90%;
}
@media (min-width: 768px) {
    .modal-content.modal-lg {
        max-width: 42rem; /* md:max-w-3xl */
    }
}
.tab-btn.active { border-color: theme('colors.accent'); color: theme('colors.accent'); background-color: theme('colors.accent / 10%'); }
.dark .tab-btn.active { background-color: theme('colors.surface-dark'); }
.stats-tab-btn.active { border-bottom: 2px solid theme('colors.accent'); color: theme('colors.accent'); background-color: theme('colors.accent / 10%'); }
.dark .stats-tab-btn.active { background-color: theme('colors.surface-dark'); }

/* Pie Chart Tooltip */
#pieTooltip {
    transform: translate(-50%, -100%);
    margin-top: -10px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

#pieTooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1f2937 transparent transparent transparent;
}

/* Budget vs Fact improvements */
.budget-item {
    transition: all 0.2s ease-in-out;
}

.budget-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.pie-legend-item {
    transition: all 0.2s ease-in-out;
}

.pie-legend-item:hover {
    transform: scale(1.02);
}
.form-section { animation: fade-in 0.3s; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.chat-bubble { max-width: 80%; word-break: break-word; }
.chat-bubble.user { background-color: theme('colors.accent'); color: white; align-self: flex-end; }
.chat-bubble.ai { background-color: #e5e7eb; color: #1f2937; align-self: flex-start; }
.dark .chat-bubble.ai { background-color: #374151; color: #f3f4f6; }
[draggable="true"] { cursor: grab; }
.dragging { opacity: 0.5; background: #c7d2fe; }
.color-input-wrapper { position: relative; width: 28px; height: 28px; }
.color-input-wrapper input[type="color"] { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.color-input-wrapper .color-display { width: 100%; height: 100%; border-radius: 9999px; border: 2px solid #e5e7eb; }
.dark .color-input-wrapper .color-display { border-color: #4b5563; }
.cat-item .sub-cat-list { margin-left: 20px; border-left: 2px solid #e5e7eb; dark:border-gray-700; }
.category-picker-item.selected { background-color: #186A77; color: white; }
.dark .category-picker-item.selected { background-color: #186A77; color: white; }
.category-picker-item:hover { background-color: theme('colors.accent / 10%'); }
.dark .category-picker-item:hover { background-color: theme('colors.accent / 15%'); }
.tag { background-color: #e0e7ff; color: #4338ca; }
.dark .tag { background-color: #3730a3; color: #e0e7ff; }
/* Filter panel with smoother animation and padding */
#filter-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out, margin 0.3s ease-out;
    padding: 0 1rem;
    margin-bottom: 0;
}
#filter-panel.open {
    max-height: 500px;
    padding: 1rem;
    margin-bottom: 1rem;
}
.budget-category:hover { 
    background-color: #186A77;
    color: white; 
}
.budget-category:hover span {
     color: white;
}
.date-header {
     position: sticky;
     top: -25px;
     z-index: 5;
     padding-top: 0.5rem;
     padding-bottom: 0.5rem;
     backdrop-filter: blur(8px);
     -webkit-backdrop-filter: blur(8px);
     background-color: #186A77;
     color: #FFFFFF;
     width: 100%;
     margin-top: 0.75rem;
     margin-bottom: 0.25rem;
	 border-radius: 8px;
}

.transaction-item {
    transition: background-color 0.2s ease-in-out;
}
.transaction-item:hover {
    background-color: rgba(0,0,0,0.02);
}
.dark .transaction-item:hover {
    background-color: rgba(255,255,255,0.03);
}

/* Icon Picker Modal Styles */
#icon-picker-modal .icon-picker-item svg {
    width: 24px;
    height: 24px;
}

/* FIX: Centering for SVG Icons */
.category-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-picker-item svg {
    color: #FFFFFF; /* Белый цвет для тёмной темы */
    /* Или можно использовать любой другой контрастный цвет, например, lightgray */
}

.tx-type-btn.active {
    background-color: #186A77; /* Это цвет фона для активной кнопки */
    color: #FFFFFF; /* Цвет текста для активной кнопки */
    border-color: #186A77; /* Цвет рамки для активной кнопки */
}
.dark .tx-type-btn.active {
    background-color: theme('colors.surface-dark'); /* Цвет фона для активной кнопки в темной теме */
    color: #FFFFFF; /* Цвет текста для активной кнопки в темной теме */
    border-color: #186A77; /* Цвет рамки для активной кнопки в темной теме */
}

/* Скрываем десктопные кнопки в мобильной версии */
@media (max-width: 767px) {
    #desktop-fab,
    #desktop-bulk-add {
        display: none !important;
    }
}

/* Скрываем мобильные флоатинг кнопки в ПК версии */
@media (min-width: 768px) {
    #fab-menu {
        display: none !important;
    }
}
    
    /* Улучшаем мобильное меню для размещения всех пунктов */
    #mobile-nav {
        height: 80px; /* Увеличиваем высоту для комфортного размещения */
        padding: 8px 4px; /* Добавляем отступы */
    }
    
    #mobile-nav .nav-btn {
        padding: 4px 2px; /* Уменьшаем отступы кнопок */
        min-width: 0; /* Убираем минимальную ширину */
        flex: 1; /* Равномерно распределяем пространство */
    }
    
    #mobile-nav .nav-btn div {
        margin: 0 auto 2px auto; /* Центрируем иконки с небольшим отступом */
        width: 20px; /* Фиксируем ширину иконок */
        height: 20px; /* Фиксируем высоту иконок */
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    #mobile-nav .nav-btn span {
        font-size: 10px; /* Уменьшаем размер шрифта */
        line-height: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}