/* Transactions CSS */
.filter-card {
    background-color: var(--color-card);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    padding-bottom: 0;
    transition: padding 0.2s, border-color 0.2s;
}

.filter-header.active {
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.75rem;
}

.filter-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--color-heading);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-header .toggle-icon {
    font-size: 0.8rem;
    color: var(--color-muted);
    transition: transform 0.2s;
}

.filter-header.active .toggle-icon {
    transform: rotate(180deg);
}

.filter-body {
    display: none;
    margin-top: 1rem;
}

.filter-body.active {
    display: block;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
    margin-bottom: 1.2rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.filter-group.flex-2 {
    grid-column: span 1;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-soft);
}

.filter-group input,
.filter-group select {
    background-color: var(--color-bg);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-group input:focus,
.filter-group select:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(78, 115, 223, 0.15);
}

.date-range,
.amount-range {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-range input,
.amount-range input {
    flex: 1;
}

.filter-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    border-top: 1px solid var(--color-border);
    padding-top: 1rem;
}

.period-summary {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background-color: var(--color-bg);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    gap: 1rem;
    border-top: none;
    font-size: 0.95rem;
}

.period-summary .summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.period-summary .summary-item.total {
    border-left: 1px solid var(--color-border);
    padding-left: 2rem;
}

.period-summary .label {
    font-size: 0.8rem;
    color: var(--color-muted);
}

.period-summary .val {
    font-size: 1.1rem;
    font-weight: bold;
}

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

/* Table */
.tx-table-wrapper {
    overflow-x: auto;
}

.tx-table {
    width: 100%;
    border-collapse: collapse;
}

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

.tx-table th {
    background-color: var(--color-bg);
    color: var(--color-heading);
    font-weight: bold;
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.pay-method {
    font-size: 0.8rem;
    color: var(--color-muted);
}

.memo-text {
    font-size: 0.85rem;
    color: var(--color-text);
}

.income-text { color: var(--color-income); font-weight: bold; }
.expense-text { color: var(--color-expense); font-weight: bold; }

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-edit {
    background: #f6c23e;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    text-decoration: none;
    display: inline-block;
}

.btn-delete {
    background: #e74a3b;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.form-actions .btn {
    flex: 1;
}

/* Radio Toggle for Form */
.type-toggle {
    display: flex;
    gap: 0;
    width: 100%;
}
.radio-label {
    flex: 1;
    cursor: pointer;
}
.radio-label input {
    display: none;
}
.radio-btn {
    display: block;
    text-align: center;
    padding: 0.8rem;
    border: 1px solid var(--color-border);
    background: var(--color-card);
    font-weight: bold;
    color: var(--color-muted);
    transition: all 0.2s;
}
.radio-label:first-child .radio-btn {
    border-radius: 4px 0 0 4px;
}
.radio-label:last-child .radio-btn {
    border-radius: 0 4px 4px 0;
    border-left: none;
}

.radio-label input:checked + .expense-btn {
    background: var(--color-expense);
    color: white;
    border-color: var(--color-expense);
}
.radio-label input:checked + .income-btn {
    background: var(--color-income);
    color: white;
    border-color: var(--color-income);
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-muted);
}

.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.btn-more {
    font-size: 0.85rem;
    color: var(--color-primary);
    font-weight: bold;
}

.mt-3 { margin-top: 1rem; }

/* Mobile Card List */
.tx-mobile-list {
    display: none;
    flex-direction: column;
    gap: 1rem;
}

.mobile-tx-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    padding: 1rem;
    background: var(--color-card);
}

.mtx-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    font-size: 0.85rem;
    color: var(--color-muted);
}

.action-buttons-mobile {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.btn-edit-icon {
    text-decoration: none;
    font-size: 1.1rem;
}

.btn-delete-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
}

.mtx-body {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mtx-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.mtx-info {
    flex: 1;
}

.mtx-title {
    font-weight: bold;
    color: var(--color-heading);
    margin-bottom: 0.2rem;
}

.mtx-cat {
    font-size: 0.8rem;
    color: var(--color-muted);
}

.mtx-amount {
    font-weight: bold;
    font-size: 1.1rem;
}

.mtx-memo {
    margin-top: 0.8rem;
    font-size: 0.85rem;
    color: var(--color-text);
    background: var(--color-bg);
    padding: 0.5rem;
    border-radius: 4px;
}

@media (max-width: 767px) {
    .tx-table-wrapper { display: none; }
    .tx-mobile-list { display: flex; }
    
    .filter-header { display: flex; }
    .filter-body { display: none; margin-top: 1rem; }
    .filter-body.active { display: block; }
    
    .filter-row { flex-direction: column; }
    .filter-actions { flex-direction: column; }
    .filter-actions .btn { width: 100%; text-align: center; }
    
    .period-summary { flex-direction: column; gap: 0.5rem; }
}
