/* CATEGORIES LIST */

/* ===== CATEGORIES OVERRIDES ===== */
.categories_list{
  max-width: 575px;
}

.categories_list .tx_row{
  gap: 12px;
  padding: 12px 14px;
}


.categories_list .tx_date{
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
  color: #6b6f74;
  background: #f1f2f3;
  padding: 4px 8px;
  border-radius: 999px;
  width: 88px;        
  text-align: center;
}


.categories_list .tx_category{
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  color: #232629;
}


.categories_list .tx_amount{
  flex: 0 0 auto;
  min-width: 44px;
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  color: #6b6f74;
}


.categories_list .tx_amount.count{
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 72px;
}


.categories_list .count_label{
  font-size: 11px;
  color: #9aa0a6;
  font-weight: 500;
  line-height: 1;
}


.categories_list .count_value{
  font-size: 14px;
  font-weight: 700;
}


.categories_list .tx_amount.count.income .count_value{
  color: #1e9e57;
}
.categories_list .tx_amount.count.expense .count_value{
  color: #e74c3c;
}



/* TRANSACTIONS LIST */

/* EMPTY STATE */
.tx_empty{
  padding: 16px 14px;
  color: #6b6f74;
  font-size: 14px;
}

.txs_list{
  background: #fff;
  border: 1px solid #dfe0e1;
  border-radius: 12px;
  overflow: hidden;
}

.tx_row{
  display: flex;
  position: relative;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid #eef0f2;
}

.tx_row:last-child{
  border-bottom: 0;
}

.tx_row:hover{
  background: #f6f7f8;
}

/* date */
.tx_date{
  flex: 0 0 96px;
  font-size: 13px;
  color: #6b6f74;
  white-space: nowrap;
}

/* category (before description; semi-fixed, can ellipsis) */
.tx_category{
  flex: 0 0 150px;          /* підкрути 130-180 під свої назви */
  min-width: 120px;
  font-size: 13px;
  font-weight: 600;
  color: #232629;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* description (takes all remaining space) */
.tx_description{
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  color: #6b6f74;           /* робимо тихіше за категорію */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* amount */
.tx_amount{
  flex: 0 0 120px;
  text-align: right;
  font-size: 14px;
  font-weight: 600;
  color: #232629;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.tx_link{
  position: absolute;
  inset: 0;
  border-radius: 12px; /* якщо треба */
}
.tx_row:hover{ background: #f6f7f8; cursor: pointer; }

/* RED / GREEN TXS LIST */

.tx_row{
  position: relative;
}

.tx_row::before{
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 3px;
}

.tx_row.income::before{ background: #2ecc71; }
.tx_row.expense::before{ background: #e74c3c; }

.tx_amount.income{ color: #1e9e57; }
.tx_amount.expense{ color: #d64545; }

/* FILTERS */

/* toggle */

.filters-toggle {
    display: inline-flex;
    align-items: center;
}


.filters-toggle.active {
    background: #e2e8f0;
    border-color: #94a3b8;
    color: #0f172a;
}

/* ПАНЕЛЬ ФІЛЬТРІВ */
.filters-panel {
    display: none; /* Схована за замовчуванням */
    width: 100%;
    padding-top: 15px;
    border-top: 1px solid #eef0f2;
    margin-top: 10px;
}

.filters-panel.show {
    display: block;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group select, 
.filter-group input {
    height: 38px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0 10px;
    font-size: 14px;
    background: #fff;
}

.filters-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.filters-actions .btn {
    height: 36px;
    font-size: 13px;
}

@media (max-width: 640px) {
    .filters-grid {
        grid-template-columns: 1fr 1fr; /* По два в ряд на мобільних */
    }
    .filters-actions {
        flex-direction: column;
    }
    .filters-actions .btn {
        width: 100%;
    }
}

.filters-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 20px;
}

.filter-col {
    flex: 1;
    min-width: 280px;
}

.filter-block {
    margin-bottom: 20px;
}

.filter-title {
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    margin: 0 0 10px 0;
}

.inputs-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filters-field {
    width: 100%;
    height: 40px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 0 12px;
    font-size: 14px;
}

.categories-container {
    margin-top: 10px;
    max-height: 200px;
    overflow-y: auto;
    width: 100%
}

.chk {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    cursor: pointer;
    font-size: 14px;
}

.filters-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
    border-top: 1px solid #eef0f2;
    padding-top: 20px;
}

.radio-group input[type="radio"],
.radio-group input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

/* FILTERS TAGS */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
    align-items: center;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9; /* Світло-сірий з блакитним відтінком */
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 4px 10px 4px 14px; /* Зліва більше місця для тексту */
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    transition: all 0.2s;
}

.filter-tag:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.remove-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #cbd5e1; /* Кружечок навколо хрестика */
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    margin-left: 8px;
    padding: 0;
    cursor: pointer;
    color: #ffffff;
    font-size: 14px; /* Розмір самого хрестика */
    line-height: 1;
    transition: background 0.2s;
}

.remove-filter:hover {
    background: #f87171; /* Стає червоним при наведенні */
}

/* Символ хрестика іноді треба трохи підняти вручну */
.remove-filter span {
    position: relative;
    top: -1px; 
}

.clear-all-filters {
    font-size: 13px;
    font-weight: 600;
    color: #3b82f6;
    text-decoration: none;
    padding: 4px 8px;
}

.clear-all-filters:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* SELECTION MODE */

/* Режим виділення: прибираємо посилання, щоб не заважало */
.selection-mode .tx_link {
    display: none !important;
}

.selection-mode .tx_row {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

/* Стильне виділення */
.tx_row.selected {
    background-color: rgba(59, 130, 246, 0.08) !important; /* Дуже легкий блакитний */
    border-left: 4px solid #3b82f6 !important; /* Яскрава лінія зліва */
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2); /* Тонка внутрішня рамка */
}

/* Щоб текст не виділявся синім при клацанні */
.tx_row {
    user-select: none;
    -webkit-user-select: none;
}

/* ПОШУК КАТЕГОРІЙ */

.categories-search-box{
    display: flex;
    justify-content: flex-start;
    height: 100%;
    margin-bottom: 20px;
    width: 570px;
    font-weight: 400;
    font-size: 15px;
}

.categories-search-box .categories-search-input {
    all: unset;
    width: 100%;
    background-color: #f8fafc;
    height: 40px;
    padding: 0 10px;
    border: 1px solid #dfe0e1;
    border-radius: 10px 0 0 10px;
}

.categories-search-box input::placeholder{
  color: #858585;
}

.categories-search-box input:focus {
  background: #f2f3f5;
  color: #b3b3b3;
}

.categories-search-box .categories-search-button {
    all: unset;
    background-color: #f8fafc;
    color: #9ca3af; /* Сірий колір тексту */
    border-radius: 0 10px 10px 0;
    padding: 0 15px;
    cursor: pointer;
    font-size: 15px;
    height: 40px;
    transition: all 0.2s;
    border: 1px solid #dfe0e1;

}

.categories-search-box:focus-within input,
.categories-search-box:focus-within button {

    color: #444;
}

.categories-search-box button:hover {
    color: #c8c8c9; 

}

/* PROFILE */
.profile{
  max-width: 760px;
}

.profile__header{
  margin-bottom: 12px;
}

.profile__title{
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.profile__card, .change_pass_card{
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255,255,255,.6);
  backdrop-filter: blur(6px);
}

.profile__row{
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0,0,0,.08);
}

.profile__row:last-child{
  border-bottom: none;
}

.profile__label{
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.profile__label:after {
  content: ":";
}

.profile__value{
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
}

.profile__value .action-secondary {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
}

.profile__value .action-secondary svg{
  width: 20px;
  height: 20px;
}

.profile__value--wrap{
  flex-wrap: wrap;
}

.profile__actions{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

/* badges */
.badge{
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}

.badge--ok{
  background: rgba(16,185,129,.12);
  border-color: rgba(16,185,129,.35);
  color: #065f46;
}

.badge--warn{
  background: rgba(245,158,11,.12);
  border-color: rgba(245,158,11,.35);
  color: #92400e;
  gap: 10px;
}

.badge--warn .action-secondary {
  margin: 0;
}

.profile__card a {
  margin-top: 15px;
}

.profile__card .action-secondary {
  margin: 0;
}

.change_pass_card legend {
  font-size: 13px;
  font-weight: 600;
  color: #334155;  
}