.expense-page-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.expense-tab {
    flex: 1;
    border-radius: 50px;
    min-height: 40px;
    font-size: 0.9rem;
    padding: 6px 12px;
    background: #f1f3f5;
    color: #6c757d;
    border: 1px solid #e9ecef;
    transition: all 0.15s;
}

.expense-tab:hover {
    background: #e9ecef;
    color: #495057;
    border-color: #dee2e6;
}

.expense-tab.active {
    background: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
    box-shadow: 0 2px 6px rgba(13, 110, 253, 0.3);
}

.expense-tab.active:hover {
    background: #0d6efd;
    color: #fff;
}

.expense-group {
    background: #fff;
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.expense-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #f8f9fa;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.85rem;
}

.expense-group-date {
    font-weight: 600;
    color: #495057;
}

.expense-group-total {
    color: #dc3545;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.expense-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.15s;
}

.expense-item:last-child {
    border-bottom: none;
}

.expense-item:hover {
    background: #fafbfc;
}

.expense-item:active {
    background: #f0f0f0;
}

.expense-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.expense-item-body {
    flex: 1;
    min-width: 0;
}

.expense-item-type {
    font-weight: 600;
    font-size: 0.95rem;
    color: #212529;
    margin-bottom: 2px;
}

.expense-item-sub {
    font-size: 0.8rem;
    color: #999;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.expense-item-right {
    text-align: right;
    flex-shrink: 0;
}

.expense-item-amount {
    font-weight: bold;
    font-size: 1.05rem;
    color: #dc3545;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.expense-item-meta {
    font-size: 0.75rem;
    color: #aaa;
    margin-top: 3px;
}

.expense-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.expense-empty i {
    font-size: 3rem;
    color: #d0d7de;
    display: block;
    margin-bottom: 12px;
}

.expense-empty p {
    margin: 0;
    font-size: 0.9rem;
}

.expense-total-card {
    background: #ffffff;
    border: 1px solid #eaf0fb;
    border-radius: 14px;
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 200px;
}

.expense-total-label {
    font-size: 0.82rem;
    color: #6b7280;
    font-weight: 500;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.expense-total-amount {
    font-size: 2rem;
    font-weight: 800;
    color: #0d6efd;
    font-variant-numeric: tabular-nums;
    margin: 0 0 6px;
    line-height: 1.1;
}

.expense-total-range {
    font-size: 0.72rem;
    color: #aab2be;
    margin: 0;
    font-variant-numeric: tabular-nums;
}

.expense-chart-card {
    background: #fff;
    border-radius: 14px;
    padding: 14px 16px 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f4fa;
}

.expense-chart-header {
    font-size: 0.88rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.expense-chart-header i {
    color: #0d6efd;
}

.expense-chart-body {
    position: relative;
    height: 260px;
}

.type-sort-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 4px;
}

.type-sort-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #fafbfc;
    border: 1px solid #eef1f5;
    border-radius: 10px;
}

.type-sort-item:hover {
    background: #f0f6ff;
    border-color: #cfe2ff;
}

.type-sort-index {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e7f1ff;
    color: #0d6efd;
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.type-sort-name {
    flex: 1;
    font-size: 0.92rem;
    color: #212529;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.type-sort-name i {
    color: #0d6efd;
    font-size: 1rem;
    flex-shrink: 0;
}

.type-sort-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.type-sort-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #e1e6ee;
    background: #fff;
    color: #6b7280;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: unset;
    padding: 0;
}

.type-sort-btn:hover:not(:disabled) {
    background: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
}

.type-sort-btn.danger:hover:not(:disabled) {
    background: #dc3545;
    color: #fff;
    border-color: #dc3545;
}

.type-sort-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.type-sort-tip {
    font-size: 0.75rem;
    color: #98a2b3;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 4px;
}

#typeSortList.type-sort-list {
    max-height: 42vh;
    overflow-y: auto;
    padding-right: 6px;
    overscroll-behavior: contain;
}

#typeSortList.type-sort-list::-webkit-scrollbar {
    width: 6px;
}

#typeSortList.type-sort-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

#typeSortList.type-sort-list::-webkit-scrollbar-track {
    background: transparent;
}

@media (max-width: 576px) {
    .expense-tab {
        font-size: 0.82rem;
        padding: 6px 8px;
    }
    .expense-group {
        border-radius: 10px;
        margin-bottom: 10px;
    }
    .expense-group-header {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    .expense-item {
        padding: 11px 12px;
        gap: 10px;
    }
    .expense-item-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    .expense-item-type {
        font-size: 0.9rem;
    }
    .expense-item-sub {
        font-size: 0.75rem;
    }
    .expense-item-amount {
        font-size: 1rem;
    }
    .expense-item-meta {
        font-size: 0.7rem;
    }
    #expenseTrendChart,
    #expenseTypeChart {
        height: 200px !important;
    }
    #expenseStatsView .card .row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
        padding: 5px;
    }
    #expenseStatsView .card .btn {
        width: 100%;
        margin-bottom: 5px;
    }
    .expense-total-card {
        min-height: auto;
        padding: 16px;
    }
    .expense-total-amount {
        font-size: 1.6rem;
    }
    .expense-chart-body {
        height: 200px;
    }
    #typeSortList.type-sort-list {
        max-height: 38vh;
    }
    #expensesView .card .row > [class*="col-"] {
        flex: 0 0 50%;
        max-width: 50%;
        padding: 4px;
    }
    #expensesView .card .btn {
        width: 100%;
    }
}