/* Общие стили */

body {
    font-family: Arial, sans-serif;
    font-size: 13px;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
}

.app-container {
    max-width: 1100px;
    margin: 0 auto 40px;
    padding: 0 20px 20px;
    background-color: #f5f5f5;
}

header {
    background-color: #333;
    color: #fff;
    padding: 10px 20px;
    margin: 0 -20px 20px;
    text-align: center;
}

header h1 {
    margin: 0;
    font-size: 18px;
}

nav a {
    color: #fff;
    text-decoration: none;
    margin-right: 15px;
}

nav a:hover {
    text-decoration: underline;
}

main {
    margin-top: 10px;
}

/* Таблицы */

table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 15px;
    background-color: #fff;
}

table th,
table td {
    border: 1px solid #e0e0e0;
    padding: 4px 6px;
    text-align: left;
}

/* Формы */

form {
    margin: 0;
}

form input,
form select {
    font-size: 13px;
}

/* Кнопки вкладок */

.tx-type-tab {
    padding: 3px 10px;
    margin-right: 5px;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid #ccc;
    background-color: #eee;
}

.tx-type-tab.active {
    background-color: #ffd95e;
    border-color: #e0b800;
}

/* Таблица операций */

.tx-table {
    border-collapse: separate;
    border-spacing: 0 2px;
    background-color: transparent;
}

.tx-table th,
.tx-table td {
    border: none;
    padding: 2px 12px;
    font-size: 13px;
}

/* Таблица счетов */

.accounts-table {
    border-collapse: collapse;
    width: 100%;
    background-color: transparent;
    font-size: 13px;
}

.accounts-table th,
.accounts-table td {
    border: none;
    padding: 2px 4px;
}

.accounts-table a {
    color: #000;
    text-decoration: none;
}

.accounts-table a:hover {
    text-decoration: underline;
}

/* Таблица внутри форм */

.form-table {
    border-collapse: collapse;
    width: 100%;
    background-color: transparent;
}

.form-table th,
.form-table td {
    border: none;
    padding: 3px 4px;
}

/* Календарь */

.calendar-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    background-color: transparent;
}

.calendar-table th,
.calendar-table td {
    border: none;
    padding: 2px;
    text-align: center;
}

.calendar-table th {
    font-weight: normal;
    color: #666;
}

.calendar-table td a {
    display: block;
    padding: 3px 0;
    text-decoration: none;
    color: #000;
    border-radius: 3px;
}

.calendar-table td.other-month a {
    color: #bbb;
}

.calendar-table td.selected-day a {
    background-color: #ffd95e;
    border-radius: 3px;
}

/* Кнопки */

button {
    padding: 4px 10px;
    font-size: 13px;
    cursor: pointer;
}

/* ===== Actions ===== */

.actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.inline-form {
    display: inline;
    margin: 0;
}

.icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    text-decoration: none;
    color: #111;
    border-radius: 4px;
}

.icon-link:hover {
    background: #f0f0f0;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    padding: 0 6px;
    border: none;
    background: transparent;
    border-radius: 4px;
    line-height: 1;
}

.icon-btn:hover {
    background: #f0f0f0;
}

.icon-btn.danger {
    color: #b00020;
}

.icon-btn.danger:hover {
    background: #ffe9ec;
}

.subcat-input {
    width: 220px;
}

.mini-btn {
    padding: 2px 8px;
}

/* ===================================================== */
/* =============== iOS STYLE COLOR PALETTE ============= */
/* ===================================================== */

/* кружок цвета рядом с категорией */
.cat-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

/* палитра выбора цвета */
.color-palette {
    display: flex;
    gap: 10px;
    margin: 6px 0 10px;
}

.color-choice {
    cursor: pointer;
}

.color-choice input {
    display: none;
}

/* сам цветной кружок */
.color-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-block;
    border: 2px solid transparent;
}

/* выбранный цвет — как в iOS */
.color-choice input:checked + .color-dot {
    border-color: #000;
}

/* ===================================================== */
/* ===== ФИЛЬТР ПО ЦВЕТУ КАТЕГОРИЙ (ГЛАВНАЯ СТРАНИЦА) ==== */
/* ===================================================== */

/* контейнер цветовых фильтров рядом с поиском */
.color-filters {
    display: inline-flex;
    gap: 6px;
    margin-left: 10px;
    vertical-align: middle;
}

/* сам маркер-фильтр */
.color-filter-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.25);
    cursor: pointer;
    text-decoration: none;
}

/* активный фильтр */
.color-filter-dot.active {
    outline: 2px solid rgba(0,0,0,0.55);
    outline-offset: 2px;
}

/* ===================================================== */
/* ========== ПРЕДСКАЗАНИЕ КАТЕГОРИЙ =================== */
/* ===================================================== */

/* Стили для предсказанных категорий в выпадающем списке */
#tx-category option.predicted-category {
    font-weight: bold;
    padding-left: 4px;
}

/* Визуальное выделение звёздочкой уже в HTML, 
   но можем добавить дополнительный отступ */
#tx-category option[disabled] {
    color: #999;
    font-size: 11px;
    text-align: center;
}

/* ===== КАЛЕНДАРЬ: сегодняшняя дата ===== */
.calendar-table td.today-day a,
.calendar-table td.today-day span {
    font-weight: bold;
    border: 2px solid #007AFF;
    border-radius: 3px;
    padding: 1px;
    box-sizing: border-box;
    background-color: #E3F2FD;
}

.calendar-table td.today-day.selected-day a {
    background-color: #ffd95e;
    border: 2px solid #007AFF;
    font-weight: bold;
}

.calendar-table td.future-day span {
    color: #ddd;
}

/* ===== СТАТИСТИКА ПО ФИЛЬТРАМ ===== */
.filter-stats-box {
    background: #fff;
    border: 1px solid #ddd;
    padding: 10px;
    margin-bottom: 15px;
    font-size: 13px;
}

.filter-stats-title {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 13px;
}

.filter-stats-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
}

.filter-stat-label {
    color: #666;
}

.filter-stat-value {
    font-weight: bold;
}

.filter-stat-value.positive {
    color: #28a745;
}

.filter-stat-value.negative {
    color: #dc3545;
}

.filter-stat-value.neutral {
    color: #333;
}

/* ===== ПРОСТАЯ АДАПТИВНОСТЬ (только CSS) ===== */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    .app-container {
        padding: 0 10px 10px;
    }
    
    header {
        padding: 8px 10px;
    }
    
    table {
        font-size: 12px;
    }
    
    button, input, select {
        font-size: 14px;
    }
}
