/* ========================================
   MODALS.CSS - МОДАЛЬНЫЕ ОКНА
   ========================================
   
   Содержит:
   - Общие стили модальных окон
   - Модальное окно операции
   - Модальное окно добавления счета
   - Модальное окно перевода
   - Модальное окно выбора категорий
   - Модальное окно выбора даты (календарь)
*/

/* ========================================
   ОБЩИЕ СТИЛИ МОДАЛЬНЫХ ОКОН
   ======================================== */

/* Фон модального окна */
.modal-bg {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(30, 33, 39, 0.72);
    justify-content: center;
    align-items: center;
    z-index: 100;
    animation: fadeInBg 0.3s;
}

@keyframes fadeInBg {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.modal-bg.active {
    display: flex;
}

/* Контейнер модального окна */
.modal {
    background: #2e323a;
    padding: 24px 16px;
    border-radius: 12px;
    min-width: 320px;
    color: #fff;
    text-align: center;
    box-sizing: border-box;
    animation: popInModal 0.35s cubic-bezier(.4,1.6,.6,1) both;
}

@keyframes popInModal {
  0% { transform: scale(0.96) translateY(30px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Заголовок модального окна */
.modal-header {
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 16px;
    text-align: center;
}

/* Общие стили для элементов формы */
.modal h3 {
    margin: 0 0 16px 0;
    font-size: 1.2em;
}

.modal label {
    display: block;
    text-align: left;
    margin: 8px 0 6px 0;
    font-weight: 600;
    font-size: 0.95em;
    color: #a6b1c2;
    user-select: none;
}

.modal select,
.modal input {
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    background: #444a56;
    color: #f5f6fa;
    outline: none;
    box-sizing: border-box;
}

.modal select:focus,
.modal input:focus {
    background: #555b67;
}

/* Общие стили для кнопок в модальных окнах */
.modal button {
    margin-top: 8px;
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    background: #4f504e;
    color: #fff;
    font-size: 1em;
    cursor: pointer;
    user-select: none;
}

.modal button.close-btn {
    background: #e84118;
}

/* ========================================
   МОДАЛЬНОЕ ОКНО ОПЕРАЦИИ
   ======================================== */

/* Строки в модальном окне операции */
.modal-row {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

/* Кнопка выбора даты */
.date-row .date-select-btn {
    width: 100%;
}

.date-select-btn {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #444a56;
    border-radius: 8px;
    background: #444a56;
    color: #f5f6fa;
    font-size: 1em;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
}

.date-select-btn:hover {
    background: #555b67;
    border-color: #555b67;
}

.date-select-btn:focus {
    border-color: #a6b1c2;
}

.date-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.date-icon svg {
    width: 16px;
    height: 16px;
    color: #a6b1c2;
    transition: color 0.2s ease;
}

.date-select-btn:hover .date-icon svg {
    color: #44bd32;
}

/* Адаптация для мобильных устройств */
@media (max-width: 500px) {
    .date-icon svg {
        width: 18px;
        height: 18px;
    }
}

/* Кнопка выбора счета */
.modal-account-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 10px 12px;
    background-color: #444a56 !important;
    color: #f5f6fa;
    border: none !important;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.2s ease;
    outline: none;
    margin-top: 0 !important;
    position: relative;
    overflow: hidden;
}

.modal-account-btn:hover {
    background-color: #555b67 !important;
    border: none !important;
}

.modal-account-btn:focus {
    background-color: #555b67 !important;
    border: none !important;
}

/* Подсветка фона цветом счета */
.modal-account-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--account-color, #5a6170);
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
}

/* Обеспечиваем, чтобы содержимое кнопки было поверх подсветки */
.modal-account-btn > * {
    position: relative;
    z-index: 1;
}

/* Название и баланс счета */
.account-name {
    flex-grow: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-balance {
    color: #f5f6fa;
    font-weight: 600;
    margin-left: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Поля ввода */
.modal-select,
.modal-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: none;
    font-size: 1em;
    background: #444a56;
    color: #f5f6fa;
    outline: none;
    box-sizing: border-box;
}

/* Специальный стиль для поля описания */
#opDescriptionInput {
    text-transform: capitalize;
}

/* Стиль для истории описаний */
#descHistory option {
    text-transform: capitalize;
}

/* Кнопка выбора категории */
.category-select-btn {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #444a56;
    border-radius: 8px;
    background: #444a56;
    color: #f5f6fa;
    font-size: 1em;
    cursor: pointer;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    transition: all 0.2s ease;
    outline: none;
    text-align: left;
    box-sizing: border-box;
}

.category-select-btn:hover {
    background: #555b67;
    border-color: #555b67;
}

.category-select-btn:focus {
    border-color: #a6b1c2;
}

.category-select-hidden {
    display: none;
}

/* Кнопки действий */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 14px;
}

.ok-btn {
    background: #44bd32;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 24px;
    font-size: 1em;
    cursor: pointer;
}

.close-btn {
    background: #e84118;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 18px;
    font-size: 1em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn svg {
    width: 16px;
    height: 16px;
    color: #fff;
}

/* ========================================
   МОДАЛЬНОЕ ОКНО ВЫБОРА КАТЕГОРИЙ
   ======================================== */

.category-modal-bg {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.category-modal-bg.active {
    display: flex;
}


@media (max-width: 600px) {
  .category-modal-bg {
    align-items: flex-end;
    padding: 0;
  }
  .category-modal {
    min-width: 0 !important;
    max-width: 100vw !important;
    width: 100vw !important;
    border-radius: 12px 12px 0 0 !important;
    padding: 10px 2vw !important;
    margin: 0;
    box-sizing: border-box;
    max-height: 70vh;
    overflow-y: auto;
  }
  .category-chips {
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }
}

/* --- Меньше вертикальные отступы между секциями и чипами --- */
.category-section {
  margin-bottom: 12px;
}
.category-section:last-child {
  margin-bottom: 0;
}
.category-chips {
    margin-bottom: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}


/* --- HEADER: выравнивание + и × справа на одной линии с Частые --- */
.category-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 0;
}
.category-section-title {
  flex: 1 1 auto;
  font-size: 1.1em;
  font-weight: 600;
  color: #a6b1c2;
  margin-bottom: 0;
}
.category-header-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin-left: 8px;
}
.add-category-btn, .category-modal-close {
  width: 28px;
  height: 28px;
  font-size: 1.2em;
  padding: 0;
  margin: 0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.add-category-btn {
  background: #44bd32;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.add-category-btn svg {
  width: 16px;
  height: 16px;
  color: #fff;
}

.add-category-btn:hover {
  background: #28631f;
}


.category-modal {
    background: #2e323a;
    border-radius: 12px;
    min-width: 400px;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    color: #f5f6fa;
    box-sizing: border-box;
    font-family: 'Segoe UI', sans-serif;
    padding: 20px;
}

.category-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.category-modal-close {
    background: #bd1b1b;
    border: none;
    color: #eff2f7;
    font-size: 1.2em;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-modal-close svg {
    width: 14px;
    height: 14px;
    color: #eff2f7;
}

.category-modal-close:hover {
    background: #444a56;
    color: #f5f6fa;
}

.category-modal-close:hover svg {
    color: #f5f6fa;
}

.category-section {
    margin-bottom: 20px;
}

.category-section:last-child {
    margin-bottom: 0;
}

.category-section-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #a6b1c2;
    margin-bottom: 12px;
}



.category-chip {
    padding: 8px 12px;
    border: 2px solid #444a56;
    border-radius: 20px;
    background: #444a56;
    color: #f5f6fa;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.category-chip:hover {
    background: #555b67;
    border-color: #555b67;
}

.category-chip.selected {
    background: #44bd32;
    border-color: #44bd32;
    color: #fff;
}

.category-chip.selected:hover {
    background: #3da829;
    border-color: #3da829;
}

/* Адаптивность для очень маленьких экранов */
@media (max-width: 480px) {
    /* Дополнительные настройки для очень маленьких экранов */
    .modal {
        max-width: 85vw !important;
        width: 85vw !important;
        padding: 16px 12px !important;
    }
    
    .date-modal, .category-modal, .transfer-modal {
        max-width: 85vw !important;
        width: 85vw !important;
        padding: 16px 12px !important;
    }
    
    .modal-header, .modal h3 {
        font-size: 0.95em !important;
    }
    
    .modal input, .modal select, .modal button {
        font-size: 0.85em !important;
        padding: 10px 8px !important;
    }
    
    .category-chip {
        font-size: 0.8em !important;
        padding: 6px 10px !important;
        margin: 3px !important;
    }
    
    .calendar-day {
        font-size: 0.8em !important;
        padding: 6px 3px !important;
        min-height: 28px !important;
    }
    
    .quick-date-btn {
        font-size: 0.75em !important;
        padding: 6px 8px !important;
    }
}

/* ========================================
   МОДАЛЬНОЕ ОКНО ВЫБОРА ДАТЫ (КАЛЕНДАРЬ)
   ======================================== */

.date-modal-bg {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 5000;
}

.date-modal-bg.active {
    display: flex;
}

.date-modal {
    background: #2e323a;
    border-radius: 12px;
    min-width: 320px;
    max-width: 350px;
    color: #f5f6fa;
    box-sizing: border-box;
    font-family: 'Segoe UI', sans-serif;
    padding: 20px;
}

.date-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.date-modal-header h3 {
    margin: 0;
    font-size: 1.2em;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #f5f6fa;
}

.date-nav-btn {
    background: none;
    border: none;
    color: #a6b1c2;
    font-size: 1.5em;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 600;
}

.date-nav-btn:hover {
    background: #444a56;
    color: #f5f6fa;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 10px;
}

.calendar-weekdays div {
    text-align: center;
    font-size: 0.85em;
    font-weight: 600;
    color: #a6b1c2;
    padding: 8px 4px;
    user-select: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 20px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
    user-select: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 500;
}

.calendar-day:hover {
    background: #444a56;
}

.calendar-day.selected {
    background: #44bd32;
    color: #fff;
    font-weight: 600;
}

.calendar-day.today {
    background: #2196F3;
    color: #fff;
    font-weight: 600;
}

.calendar-day.other-month {
    color: #666;
    cursor: default;
}

.calendar-day.other-month:hover {
    background: transparent;
}

.date-quick-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.quick-date-btn {
    padding: 8px 12px;
    border: 2px solid #444a56;
    border-radius: 6px;
    background: #444a56;
    color: #f5f6fa;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-date-btn:hover {
    background: #555b67;
    border-color: #555b67;
}

.quick-date-btn.selected {
    background: #44bd32;
    border-color: #44bd32;
    color: #fff;
}

/* ========================================
   МОДАЛЬНОЕ ОКНО ПЕРЕВОДА
   ======================================== */

.transfer-modal-bg {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1500;
}

.transfer-modal-bg.active {
    display: flex;
}

.transfer-modal {
    background: #2e323a;
    border-radius: 12px;
    padding: 24px;
    min-width: 320px;
    color: #f5f6fa;
    max-width: 400px;
    font-family: 'Segoe UI', sans-serif;
    user-select: none;
}

.transfer-modal__title {
    margin: 0 0 20px 0;
    font-size: 1.2em;
    text-align: center;
}

.transfer-modal__label {
    display: block;
    margin: 12px 0 6px 0;
    font-weight: 600;
    color: #a6b1c2;
}

.transfer-modal__account-btn {
    width: 100%;
    padding: 12px;
    background: #444a56;
    border: none;
    border-radius: 8px;
    color: #f5f6fa;
    font-size: 1em;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.transfer-modal__input {
    width: 100%;
    padding: 12px;
    background: #444a56;
    border: none;
    border-radius: 8px;
    color: #f5f6fa;
    font-size: 1em;
    outline: none;
    box-sizing: border-box;
    margin-bottom: 20px;
}

.transfer-modal__actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.transfer-modal__btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    font-weight: 700;
    transition: background-color 0.3s ease;
}

.transfer-modal__btn_ok {
    background: #44bd32;
    color: #fff;
}

.transfer-modal__btn_ok:hover {
    background-color: #379b28;
}

.transfer-modal__btn_cancel {
    background: #e84118;
    color: #fff;
}

.transfer-modal__btn_cancel:hover {
    background-color: #b73214;
} 

/* /////////////////////////////////////////////////////////////
   МЕДИАЗАПРОСЫ ДЛЯ МОБИЛЬНЫХ (до 600px)
   ///////////////////////////////////////////////////////////// */
@media (max-width: 500px) {
  /* Основные модальные окна */
  .modal {
    min-width: 0 !important;
    max-width: 80vw !important;
    width: 80vw !important;
    padding: 20px 16px !important;
    border-radius: 12px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
  }
  
  /* Заголовки */
  .modal-header, .modal h3 {
    font-size: 1em !important;
    margin-bottom: 12px !important;
    line-height: 1.3 !important;
  }
  
  /* Строки в модальных окнах */
  .modal-row {
    flex-direction: column !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
    width: 100% !important;
  }
  
  /* Поля ввода и кнопки - разделено */
  .modal input {
    font-size: 0.75em !important;
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 12px 10px !important;
    border-radius: 8px !important;
  }
  .modal select {
    font-size: 0.9em !important;
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 12px 10px !important;
    border-radius: 8px !important;
  }
  .modal button {
    font-size: 0.9em !important;
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 12px 10px !important;
    border-radius: 8px !important;
  }
  
  /* Кнопки действий */
  .modal-actions {
    flex-direction: row !important;
    gap: 10px !important;
    margin-top: 10px !important;
 }
  
  .modal-actions button {
    width: 100% !important;
    padding: 12px 16px !important;
    font-size: 0.8em !important;
  }
  
  /* Специальные модальные окна */
  .date-modal, .category-modal, .transfer-modal {
    min-width: 0 !important;
    max-width: 70vw !important;
    width: 70vw !important;
    padding: 20px 16px !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
  }

  .category-modal {
    min-width: 300px !important;
  }
  
  /* Заголовки специальных модальных окон */
  .date-modal-header {
    flex-direction: row !important;
    gap: 8px !important;
    margin-bottom: 16px !important;

  } 
  
  .category-section-header {
    flex-direction: row !important;
    gap: 8px !important;
    margin-bottom: 0px !important;
  }


  
  .date-modal-header h3 {
    font-size: 1em !important;
    margin: 0 !important;
  }
  
  /* Кнопки навигации календаря */
  .date-nav-btn {
    padding: 8px 12px !important;
    font-size: 0.9em !important;
    min-width: 40px !important;
  }
  
  /* Календарь */
  .calendar-weekdays div {
    font-size: 0.8em !important;
    padding: 8px 4px !important;
  }
  
  .calendar-day {
    font-size: 0.85em !important;
    padding: 8px 4px !important;
    min-height: 32px !important;
  }
  
  /* Быстрые кнопки дат */
  .quick-date-btn {
    padding: 8px 10px !important;
    font-size: 0.8em !important;
  }
  
  /* Категории */
  .category-chip {
    font-size: 0.85em !important;
    padding: 5px 10px !important;
    margin: 4px !important;
  }

  .category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0px;
    margin-bottom: -11px;
}
  
  /* Кнопки выбора счета и даты */
  .date-select-btn, .modal-account-btn, .category-select-btn {
    font-size: 0.9em !important;
    padding: 12px 10px !important;
  }

  .transfer-modal__title {
    font-size: 1em;
  }
  
  .transfer-modal__label {
    font-size: 14px;
    font-weight: 400;
  }
  /* Перевод */
  .transfer-modal__account-btn {
    font-size: 0.9em !important;
    padding: 12px 10px !important;
  }
  
  .transfer-modal__input {
    font-size: 0.9em !important;
    padding: 12px 10px !important;
  }
  
  .transfer-modal__btn {
    font-size: 0.9em !important;
    padding: 12px 16px !important;
  }
  
  /* Предотвращение горизонтального скролла */
  html, body {
    overflow-x: hidden !important;
  }
  
  /* Центрирование модальных окон */
  .modal-bg {
    align-items: center !important;
    justify-content: center !important;
  }

  .color-buttons-grid {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    grid-template-rows: repeat(2, 1fr) !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 180px !important;
    min-width: 140px !important;
    margin: 12px auto !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 0 !important;
  }
  .color-button {
    width: 28px !important;
    height: 28px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    border-radius: 5px !important;
    border: 2px solid transparent !important;
    box-shadow: 0 1px 3px #0001 !important;
    padding: 0 !important;
    background-clip: padding-box !important;
  }
  .color-button.selected {
    border: 2.5px solid #2196f3 !important;
    box-shadow: 0 0 0 2px #2196f366 !important;
  }
}

/* --- CATEGORY MODAL: увеличить высоту, убрать прокрутку --- */
.category-modal {
  min-height: 400px;
  max-height: 90vh;
  overflow-y: visible;
}
@media (max-width: 600px) {
  .category-modal {
    min-height: 320px;
    max-height: 95vh;
    overflow-y: visible;
  }
}

/* --- Эффект блюра для фона модальных окон --- */
.modal-bg,
.category-modal-bg,
.date-modal-bg,
.transfer-modal-bg {
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

/* ========================================
   ПОЛНОЭКРАННЫЙ ЭКРАН ВЫБОРА КАТЕГОРИЙ ДЛЯ МОБИЛЬНЫХ
   ======================================== */

.category-fullscreen {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #2e323a;
  z-index: 3000;
  flex-direction: column;
  overflow: hidden;
}

.category-fullscreen.active {
  display: flex;
}

.category-fullscreen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #444a56;
  border-bottom: 1px solid #5a6170;
  min-height: 60px;
  box-sizing: border-box;
}

.category-back-btn {
  background: #5a6170;
  border: none;
  color: #a6b1c2;
  font-size: 1em;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.category-back-btn:hover {
  background: #6a717f;
}

.category-fullscreen-title {
  font-size: 1.2em;
  font-weight: 600;
  color: #f5f6fa;
  margin: 0;
  flex: 1;
  text-align: center;
}

.category-add-btn {
  background: #44bd32;
  color: #fff;
  border: none;
  border-radius: 6px;
  width: 36px;
  height: 36px;
  font-size: 1.5em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

/* Стили для мобильной кнопки добавления категории */
.category-add-btn-container {
  display: none;
}

@media (max-width: 600px) {
  .category-add-btn-container {
    display: block;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
  }
  
  .category-add-btn-container .category-add-btn {
    background: #44bd32;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    font-size: 2em;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(68, 189, 50, 0.3);
  }
  
  .category-add-btn-container .category-add-btn:hover {
    background: #3da829;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(68, 189, 50, 0.4);
  }
  
  .category-add-btn-container .category-add-btn:active {
    transform: scale(0.95);
  }
}

/* Стили для кнопки добавления категории в полноэкранном режиме операций */
.operation-category-add-btn-container {
  display: none;
}

@media (max-width: 600px) {
  .operation-category-add-btn-container {
    display: block;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
  }
  
  .operation-category-add-btn-container .operation-category-add-btn {
    background: #44bd32;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    font-size: 2em;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(68, 189, 50, 0.3);
  }
  
  .operation-category-add-btn-container .operation-category-add-btn:hover {
    background: #3da829;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(68, 189, 50, 0.4);
  }
  
  .operation-category-add-btn-container .operation-category-add-btn:active {
    transform: scale(0.95);
  }
}

.category-add-btn:hover {
  background: #28631f;
}

.category-fullscreen-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  box-sizing: border-box;
}

.category-fullscreen-content .category-section {
  margin-bottom: 24px;
}

.category-fullscreen-content .category-section:last-child {
  margin-bottom: 0;
}

.category-fullscreen-content .category-section-title {
  font-size: 1.1em;
  font-weight: 600;
  color: #a6b1c2;
  margin-bottom: 16px;
}

.category-fullscreen-content .category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 0;
}

.category-fullscreen-content .category-chip {
  padding: 12px 16px;
  border: 2px solid #444a56;
  border-radius: 24px;
  background: #444a56;
  color: #f5f6fa;
  font-size: 1em;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Дополнительные свойства для Telegram Web App */
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  -webkit-tap-highlight-color: transparent;
}

.category-fullscreen-content .category-chip:hover {
  background: #555b67;
  border-color: #555b67;
}

.category-fullscreen-content .category-chip.selected {
  background: #44bd32;
  border-color: #44bd32;
  color: #fff;
}

.category-fullscreen-content .category-chip.selected:hover {
  background: #3da829;
  border-color: #3da829;
}

/* Адаптация для очень маленьких экранов */
@media (max-width: 480px) {
  .category-fullscreen-header {
    padding: 10px 14px;
    min-height: 52px;
    margin-top: 100px;
  }
  
  .category-back-btn {
    font-size: 0.9em;
    padding: 5px 5px;
    background: #5a6170;
  }
  
  .category-fullscreen-title {
    font-size: 1em;
  }
  
  .category-add-btn-container {
    bottom: 16px;
    right: 16px;
  }
  
  .category-add-btn-container .category-add-btn {
    width: 50px;
    height: 50px;
    font-size: 1.8em;
  }
  
  .operation-category-add-btn-container {
    bottom: 16px;
    right: 16px;
  }
  
  .operation-category-add-btn-container .operation-category-add-btn {
    width: 50px;
    height: 50px;
    font-size: 1.8em;
  }
  
  .category-fullscreen-content {
    padding: 12px;
  }
  
  .category-fullscreen-content .category-section {
    margin-bottom: 16px;
  }
  
  .category-fullscreen-content .category-section-title {
    font-size: 1em;
    margin-bottom: 12px;
  }
  
  .category-fullscreen-content .category-chip {
    padding: 8px 12px;
    font-size: 0.85em;
    min-height: 36px;
    border-radius: 10px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    /* Дополнительные свойства для Telegram Web App */
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    -webkit-tap-highlight-color: transparent;
  }
  
  .category-fullscreen-content .category-chips {
    gap: 2px;
  }
}

/* Адаптация для средних мобильных экранов */
@media (max-width: 600px) and (min-width: 481px) {
  .category-fullscreen {
    margin-top: 100px;
  }
  
  .category-fullscreen-header {
    padding: 12px 16px;
    min-height: 56px;
  }
  
  .category-back-btn {
    font-size: 0.95em;
    padding: 5px 5px;
    background: #5a6170;
  }
  
  .category-fullscreen-title {
    font-size: 1.05em;
  }
  
  .category-add-btn-container {
    bottom: 18px;
    right: 18px;
  }
  
  .category-add-btn-container .category-add-btn {
    width: 54px;
    height: 54px;
    font-size: 1.9em;
  }
  
  .operation-category-add-btn-container {
    bottom: 18px;
    right: 18px;
  }
  
  .operation-category-add-btn-container .operation-category-add-btn {
    width: 54px;
    height: 54px;
    font-size: 1.9em;
  }
  
  .category-fullscreen-content {
    padding: 14px;
  }
  
  .category-fullscreen-content .category-section {
    margin-bottom: 20px;
  }
  
  .category-fullscreen-content .category-section-title {
    font-size: 1.05em;
    margin-bottom: 14px;
  }
  
  .category-fullscreen-content .category-chip {
    padding: 10px 14px;
    font-size: 0.9em;
    min-height: 40px;
    border-radius: 20px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    /* Дополнительные свойства для Telegram Web App */
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    -webkit-tap-highlight-color: transparent;
  }
  
  .category-fullscreen-content .category-chips {
    gap: 10px;
  }
}

/* ========================================
   ПОЛНОЭКРАННЫЙ ЭКРАН ПЕРЕВОДОВ ДЛЯ МОБИЛЬНЫХ
   ======================================== */

.transfer-fullscreen {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #2e323a;
  z-index: 3000;
  flex-direction: column;
  overflow: hidden;
}

.transfer-fullscreen.active {
  display: flex;
}

.transfer-fullscreen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #444a56;
  border-bottom: 1px solid #5a6170;
  min-height: 60px;
  box-sizing: border-box;
}

.transfer-back-btn {
  background: #5a6170;
  border: none;
  color: #a6b1c2;
  font-size: 1em;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.transfer-back-btn:hover {
  background: #a7a8ac;
}

.transfer-fullscreen-title {
  font-size: 1.2em;
  font-weight: 600;
  color: #f5f6fa;
  margin: 0;
  flex: 1;
  text-align: center;
}

.transfer-ok-btn {
  background: #44bd32;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.2s;
}

.transfer-ok-btn:hover {
  background: #28631f;
}

.transfer-fullscreen-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.transfer-section {
  margin-bottom: 24px;
}

.transfer-section-title {
  font-size: 1.1em;
  font-weight: 600;
  color: #a6b1c2;
  margin-bottom: 8px;
}

.transfer-account-btn {
  width: 100%;
  padding: 16px;
  background: #444a56;
  border: 1px solid #38393d;
  border-radius: 12px;
  color: #f5f6fa;
  font-size: 1em;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.transfer-account-btn:hover {
  background: #555b67;
  border-color: #6a7170;
}

.transfer-account-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--account-color, #5a6170);
  opacity: 0.15;
  pointer-events: none;
}

.account-info {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.account-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.account-name {
  flex: 1;
  font-weight: 500;
}

.account-balance {
  font-weight: 500;
  color: #ffffff;
}

.transfer-amount-display {
  width: 100%;
  padding: 20px;
  background: #444a56;
  border: 1px solid #5a6170;
  border-radius: 12px;
  color: #f5f6fa;
  font-size: 1.5em;
  font-weight: 400;
  text-align: center;
  margin-bottom: 20px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.transfer-divider {
  width: 100%;
  height: 1px;
  background: #5a6170;
  margin: 20px 0;
}

.transfer-keypad {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
}

.keypad-row {
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.keypad-btn {
  flex: 1;
  height: 60px;
  background: #444a56;
  border: 2px solid #5a6170;
  border-radius: 12px;
  color: #f5f6fa;
  font-size: 1.2em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.keypad-btn:hover {
  background: #477de9;
  border-color: #343566;
}

.keypad-delete-btn {
  background: #e84118;
  border-color: #e84118;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.keypad-delete-btn svg {
  width: 18px;
  height: 18px;
  color: #fff;
}

.keypad-delete-btn:hover {
  background: #c23615;
  border-color: #c23615;
}

/* Адаптация для очень маленьких экранов */
@media (max-width: 480px) {
  .transfer-fullscreen-header {
    padding: 12px 25px;
    min-height: 56px;
    margin-top: 100px;
    margin-bottom: 20px;
  }
  
  .transfer-back-btn {
    font-size: 0.9em;
    padding: 5px 5px;
    background: #5a6170;
  }
  
  .transfer-fullscreen-title {
    font-size: 1.1em;
  }
  
  .transfer-ok-btn {
    padding: 5px 12px;
    font-size: 0.9em;
  }
  
  .transfer-fullscreen-content {
    padding: 16px;
  }
  
  .transfer-section {
    margin-bottom: 10px;
  }
  
  .transfer-section-title {
    font-size: 1em;
    margin-bottom: 10px;
    margin-top: 15px;
  }
  
  .transfer-account-btn {
    padding: 10px 14px;
    font-size: 1em;
  }
  
  .transfer-amount-display {
    padding: 8px;
    font-size: 1.1em;
    min-height: 40px;
  }
  
  .transfer-divider {
    margin: 15px 0;
  }
  
  .transfer-keypad {
    gap: 10px;
  }
  
  .keypad-row {
    gap: 10px;
  }
  
  .keypad-btn {
    height: 50px;
    font-size: 1.1em;
  }
}

/* Адаптация для средних мобильных экранов */
@media (max-width: 600px) and (min-width: 481px) {
  .transfer-fullscreen {
    margin-top: 100px;
  }
  
  .transfer-fullscreen-header {
    padding: 14px 18px;
    min-height: 58px;
  }
  
  .transfer-back-btn {
    font-size: 0.95em;
    padding: 5px 5px;
    background: #5a6170;
  }
  
  .transfer-fullscreen-title {
    font-size: 1.15em;
  }
  
  .transfer-ok-btn {
    padding: 7px 14px;
    font-size: 0.95em;
  }
  
  .transfer-fullscreen-content {
    padding: 18px;
  }
  
  .transfer-section {
    margin-bottom: 22px;
  }
  
  .transfer-section-title {
    font-size: 1.05em;
    margin-bottom: 7px;
  }
  
  .transfer-account-btn {
    padding: 15px;
    font-size: 0.95em;
  }
  
  .transfer-amount-display {
    padding: 0px;
    font-size: 1.4em;
    min-height: 45px;
  }
  
  .transfer-divider {
    margin: 18px 0;
  }
  
  .transfer-keypad {
    gap: 11px;
  }
  
  .keypad-row {
    gap: 11px;
  }
  
  .keypad-btn {
    height: 55px;
    font-size: 1.15em;
  }
}

/* ========================================
   ПОЛНОЭКРАННЫЙ ЭКРАН ДОБАВЛЕНИЯ ОПЕРАЦИЙ ДЛЯ МОБИЛЬНЫХ
   ======================================== */

.operation-fullscreen {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #2e323a;
  z-index: 3000;
  flex-direction: column;
  overflow: hidden;
}

.operation-fullscreen.active {
  display: flex !important;
}

/* Навигация между экранами */
.operation-screen {
  display: none;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

.operation-screen.active {
  display: flex;
}

.operation-fullscreen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #444a56;
  border-bottom: 1px solid #5a6170;
  min-height: 60px;
  box-sizing: border-box;
}

.operation-back-btn,
.operation-next-btn,
.operation-cancel-btn,
.operation-ok-btn {
  background: #5a6170;
  border: none;
  color: #f5f6fa;
  font-size: 1em;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.operation-back-btn:hover,
.operation-next-btn:hover {
  background: #6a717f;
}

.operation-cancel-btn {
  background: #6f6d6c;
  color: #ffffff;
}

.operation-cancel-btn:hover {
  background: #c23616;
  color: #fff;
}

.operation-ok-btn {
  background: #44bd32;
  color: #ffffff;
  font-size: 1.1em;
}

.operation-ok-btn:hover {
  background: #3da829;
  color: #fff;
}

.operation-fullscreen-title {
  font-size: 1.2em;
  font-weight: 600;
  color: #f5f6fa;
  margin: 0;
  flex: 1;
  text-align: center;
}

.operation-fullscreen-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  padding-bottom: 200px; /* Отступ для клавиатуры */
  box-sizing: border-box;
}

/* Секции на экране 1 */
.operation-section {
  margin-bottom: 24px;
}

.operation-section-title {
  font-size: 1.1em;
  font-weight: 600;
  color: #a6b1c2;
  margin-bottom: 12px;
}

.operation-date-btn,
.operation-account-btn {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #444a56;
  border-radius: 8px;
  background: #444a56;
  color: #f5f6fa;
  font-size: 1em;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
  outline: none;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

.operation-date-btn:hover,
.operation-account-btn:hover {
  background: #555b67;
  border-color: #555b67;
}

.operation-account-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--account-color, #5a6170);
  opacity: 0.15;
  pointer-events: none;
}

.account-color-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.account-name {
  flex: 1;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.account-balance {
  font-weight: 500;
  color: #ffffff;
  position: relative;
  z-index: 1;
}

.operation-amount-display {
  font-size: 2em;
  font-weight: 600;
  color: #f5f6fa;
  text-align: center;
  padding: 10px;
  background: #444a56;
  border-radius: 8px;
  margin-bottom: 20px;
  min-height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.operation-divider {
  height: 1px;
  background: #5a6170;
  margin: 20px 0;
}

/* Клавиатура для суммы */
.operation-keypad {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.keypad-row {
  display: flex;
  gap: 8px;
}

.keypad-btn {
  flex: 1;
  padding: 16px;
  border: none;
  border-radius: 8px;
  background: #444a56;
  color: #f5f6fa;
  font-size: 1.2em;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.keypad-btn:hover {
  background: #555b67;
}

.keypad-delete-btn {
  flex: 1;
  padding: 16px;
  border: none;
  border-radius: 8px;
  background: #e84118;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.keypad-delete-btn:hover {
  background: #c23616;
}

.keypad-delete-btn svg {
  width: 20px;
  height: 20px;
}

/* Экран 3: Описание */
.operation-description-display {
  font-size: 1.2em;
  font-weight: 600;
  color: #f5f6fa;
  text-align: center;
  padding: 7px;
  background: #444a56;
  border-radius: 8px;
  margin-bottom: 20px;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  word-wrap: break-word;
  overflow-wrap: break-word;
  text-transform: capitalize;
}

.operation-description-suggestions {
  margin-bottom: 20px;
  max-height: 200px;
  overflow-y: auto;
}

.operation-description-suggestion {
  padding: 5px 10px;
  background: #444a56;
  color: #f5f6fa;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid #5a6170;
}

.operation-description-suggestion:hover {
  background: #555b67;
}

.operation-description-suggestion:last-child {
  border-bottom: none;
}

/* Чипы автоподсказок для описания операции */
.operation-description-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
  justify-content: flex-start;
  font-size: 13px;
}

.operation-description-chip {
  background: #444a56;
  color: #f5f6fa;
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 0.9em;
  cursor: pointer;
  border: none;
  outline: none;
  transition: background 0.2s;
  margin-bottom: 3px;
  user-select: none;
  text-transform: capitalize;
}

.operation-description-chip:hover,
.operation-description-chip:active {
  background: #555b67;
}

/* Текстовая клавиатура */
.operation-text-keypad {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #2e323a;
  padding: 10px 5px 30px 5px;
  border-top: 1px solid #5a6170;
  z-index: 10;
}

.text-keypad-row {
  display: flex;
  gap: 6px;
}

.text-keypad-btn {
  flex: 1;
  padding: 12px 8px;
  border: none;
  border-radius: 6px;
  background: #444a56;
  color: #f5f6fa;
  font-size: 0.9em;
  cursor: pointer;
  transition: background 0.2s;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.text-keypad-btn:hover {
  background: #555b67;
}

.text-keypad-delete-btn {
  flex: 1;
  padding: 12px 8px;
  border: none;
  border-radius: 6px;
  background: #e84118;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.text-keypad-delete-btn:hover {
  background: #c23616;
}

.text-keypad-delete-btn svg {
  width: 16px;
  height: 16px;
}

.text-keypad-clear-btn {
  background: #e84118 !important;
  color: #ffffff !important;
}

.text-keypad-clear-btn:hover {
  background: #c23616 !important;
}

.text-keypad-space-btn {
  flex: 3 !important;
}

.text-keypad-ok-btn {
  background: #44bd32 !important;
  color: #ffffff !important;
}

.text-keypad-ok-btn:hover {
  background: #3da829 !important;
}

.text-keypad-backspace-btn {
  background: #314077  !important;
  color: #ffffff !important;
}

.text-keypad-backspace-btn:hover {
  background: #c23616 !important;
}

.text-keypad-backspace-btn svg {
  width: 16px;
  height: 16px;
}

/* Экран 4: Проверка */
.operation-review-section {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.operation-review-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: #444a56;
  border-radius: 8px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: background 0.2s;
  width: 70%;
  max-width: 280px;
}

/* Старый стиль переопределён новым */

/* Старый стиль переопределён новым */

.operation-review-item:hover {
  background: #555b67;
}

.review-label {
  font-size: 1em;
  color: #a6b1c2;
  font-weight: 500;
}

.review-value {
  font-size: 1em;
  color: #f5f6fa;
  font-weight: 600;
  text-align: left;
}

.review-date-icon {
  display: flex;
  align-items: center;
}

.review-date-icon svg {
  width: 20px;
  height: 20px;
  color: #a6b1c2;
}

/* Старый стиль переопределён новым */

/* Старые стили переопределены новыми */

/* Стили для категорий в полноэкранном режиме операций */
.operation-fullscreen-content .category-section {
  margin-bottom: 20px;
}

.operation-fullscreen-content .category-section:last-child {
  margin-bottom: 0;
}

.operation-fullscreen-content .category-section-title {
  font-size: 1.1em;
  font-weight: 600;
  color: #a6b1c2;
  margin-bottom: 12px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.operation-fullscreen-content .category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.operation-fullscreen-content .category-chip {
  background: #444a56;
  color: #f5f6fa;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 500;
  user-select: none;
}

.operation-fullscreen-content .category-chip:hover {
  background: #555c68;
}

.operation-fullscreen-content .category-chip.selected {
  color: #ffffff;
}

.operation-fullscreen-content .category-chip.income-selected {
  background: #44bd32;
}

.operation-fullscreen-content .category-chip.income-selected:hover {
  background: #3da829;
}

.operation-fullscreen-content .category-chip.expense-selected {
  background: #e84118;
}

.operation-fullscreen-content .category-chip.expense-selected:hover {
  background: #d63031;
}

/* Адаптация для очень маленьких экранов */
@media (max-width: 480px) {
    
  .operation-fullscreen-header {
    padding: 10px 14px;
    min-height: 52px;
    margin-top: 100px;
  }
  
  .operation-back-btn,
  .operation-next-btn,
  .operation-cancel-btn,
  .operation-ok-btn {
    font-size: 0.7em;
    padding: 5px 5px;
    justify-content: center;
    background: #5a6170;
  }
  
  .operation-fullscreen-title {
    font-size: 1em;
  }
  
  .operation-fullscreen-content {
    padding: 12px;
  }
  
  .operation-section {
    margin-bottom: 16px;
  }
  
  .operation-section-title {
    font-size: 1em;
    margin-bottom: 8px;
  }
  
  .operation-amount-display {
    font-size: 1.5em;
    padding: 16px;
    min-height: 60px;
  }
  
  .keypad-btn {
    padding: 12px;
    font-size: 1em;
    min-height: 40px;
  }
  
  .keypad-delete-btn {
    padding: 12px;
    font-size: 1em;
    min-height: 40px;
  }
  
  .text-keypad-btn {
    padding: 2px 2px;
        font-size: 1em;
        min-height: 40px;
        font-weight: 500;
  }
  
  .operation-description-display {
    font-size: 1.2em;
    padding: 10px;
    min-height: 50px;
  }
  
  .operation-review-item {
    padding: 12px;
  }
  
  .review-label,
  .review-value {
    font-size: 0.9em;
  }
}

/* Адаптация для средних мобильных экранов */
@media (max-width: 600px) and (min-width: 481px) {
  .operation-fullscreen {
    margin-top: 100px;
  }
  
  .operation-fullscreen-header {
    padding: 12px 16px;
    min-height: 56px;
  }
  
  .operation-back-btn,
  .operation-next-btn,
  .operation-cancel-btn,
  .operation-ok-btn {
    font-size: 0.95em;
    padding: 5px 5px;
    background: #5a6170;
  }
  
  .operation-fullscreen-title {
    font-size: 1.05em;
  }
  
  .operation-fullscreen-content {
    padding: 14px;
  }
  
  .operation-section {
    margin-bottom: 20px;
  }
  
  .operation-section-title {
    font-size: 1.05em;
    margin-bottom: 10px;
  }
  
  .operation-amount-display {
    font-size: 1.8em;
    padding: 18px;
    min-height: 70px;
  }
  
  .keypad-btn {
    padding: 14px;
    font-size: 1.1em;
    min-height: 45px;
  }
  
  .text-keypad-btn {
    padding: 10px 7px;
    font-size: 0.85em;
    min-height: 38px;
  }
  
  .operation-description-display {
    font-size: 1.2em;
    padding: 16px;
    min-height: 50px;
  }
  
  .operation-review-item {
    padding: 14px;
  }
  
  .review-label,
  .review-value {
    font-size: 0.95em;
  }
}

/* ========================================
   СТИЛИ ДЛЯ 4-ГО ЭКРАНА ОПЕРАЦИИ (ПРЕДВАРИТЕЛЬНЫЙ ПРОСМОТР)
   ========================================
*/

/* Стили для элементов счёта (как на 1-м экране) */
.operation-review-item#operationReviewAccount {
  background: #444a56;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: background 0.2s;
  width: 70%;
  max-width: 280px;
  border: 2px solid #444a56;
  position: relative;
  overflow: hidden;
}

.operation-review-item#operationReviewAccount:hover {
  background: #555b67;
  border-color: #555b67;
}

.operation-review-item#operationReviewAccount::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--account-color, #5a6170);
  opacity: 0.15;
  pointer-events: none;
}

.operation-review-item#operationReviewAccount .review-label {
  font-size: 1em;
  color: #a6b1c2;
  font-weight: 500;
  text-align: left;
}

.operation-review-item#operationReviewAccount .review-value {
  font-size: 1em;
  color: #f5f6fa;
  font-weight: 600;
  text-align: left;
  display: flex;
  align-items: center;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* Стили для описания на экране 4 */
.operation-review-item#operationReviewDescription .review-value {
  text-transform: capitalize;
}

/* Стили для суммы (по центру) */
.operation-review-item#operationReviewAmount {
  background: #444a56;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: background 0.2s;
  width: 70%;
  max-width: 280px;
}

.operation-review-item#operationReviewAmount .review-label {
  font-size: 1em;
  color: #a6b1c2;
  font-weight: 500;
  text-align: center;
  margin-bottom: 8px;
}

.operation-review-item#operationReviewAmount .review-value {
  font-size: 1.2em;
  color: #f5f6fa;
  font-weight: 700;
  text-align: center;
}

/* Уменьшенные стили для кнопок */
.operation-review-actions {
  display: flex;
  flex-direction: row;
  gap: 8px; /* Уменьшенный gap */
  margin-top: 20px;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0 20px;
}

.operation-confirm-btn {
  flex: 1;
  padding: 8px; /* Уменьшенный padding */
  border: none;
  border-radius: 8px;
  background: #44bd32;
  color: #ffffff;
  font-size: 0.9em; /* Уменьшенный размер шрифта */
  font-weight: 500; /* Уменьшенная жирность */
  cursor: pointer;
  transition: background 0.2s;
  text-align: center; /* Выравнивание по центру */
  min-width: 0; /* Позволяет кнопке сжиматься */
}

.operation-confirm-btn:hover {
  background: #3da829;
}

.operation-schedule-btn {
  flex: 1;
  padding: 8px; /* Уменьшенный padding */
  border: none;
  border-radius: 8px;
  background: #74b9ff;
  color: #ffffff;
  font-size: 0.9em; /* Уменьшенный размер шрифта */
  font-weight: 500; /* Уменьшенная жирность */
  cursor: pointer;
  transition: background 0.2s;
  text-align: center; /* Выравнивание по центру */
  min-width: 0; /* Позволяет кнопке сжиматься */
}

.operation-schedule-btn:hover {
  background: #5f9eff;
}

.operation-cancel-review-btn {
  flex: 1;
  padding: 8px; /* Уменьшенный padding */
  border: none;
  border-radius: 8px;
  background: #e84118;
  color: #ffffff;
  font-size: 0.9em; /* Уменьшенный размер шрифта */
  font-weight: 500; /* Уменьшенная жирность */
  cursor: pointer;
  transition: background 0.2s;
  text-align: center; /* Выравнивание по центру */
  min-width: 0; /* Позволяет кнопке сжиматься */
}

.operation-cancel-review-btn:hover {
  background: #d63031;
}

/* Адаптивные стили для мобильных устройств */
@media (max-width: 480px) {
  .operation-review-item#operationReviewAccount,
  .operation-review-item#operationReviewAmount {
    width: 70%;
    max-width: 280px;
  }
  
  .operation-review-actions {
    width: 100%;
    padding: 0 15px;
  }
  
  .operation-confirm-btn,
  .operation-schedule-btn,
  .operation-cancel-review-btn {
    padding: 6px; /* Ещё меньше для мобильных */
    font-size: 0.85em;
  }
}

@media (max-width: 600px) and (min-width: 481px) {
  .operation-review-item#operationReviewAccount,
  .operation-review-item#operationReviewAmount {
    width: 70%;
    max-width: 280px;
  }
  
  .operation-review-actions {
    width: 100%;
    padding: 0 20px;
  }
}

