:root {
    --primary-color: #4a90e2;
    --income-color: #2ecc71;
    --expense-color: #e74c3c;
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-light: #777777;
    --border-color: #dddddd;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --card-bg: #2d2d2d;
    --text-color: #f4f4f4;
    --text-light: #aaaaaa;
    --border-color: #444444;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: var(--transition);
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
}

/* Theme Switch */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
}

.theme-switch {
    display: inline-block;
    height: 34px;
    position: relative;
    width: 60px;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 5px;
}

.slider i {
    color: #f1c40f;
    font-size: 14px;
}

.slider:before {
    background-color: #fff;
    bottom: 4px;
    content: "";
    height: 26px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 26px;
    z-index: 2;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Cards */
.card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    transition: var(--transition);
}

.card h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: var(--text-light);
}

/* Dashboard */
.dashboard {
    margin-bottom: 20px;
}

.balance-card {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, var(--primary-color), #357abd);
    color: white;
}

.balance-card h3 {
    color: rgba(255, 255, 255, 0.8);
}

.amount {
    font-size: 2.5rem;
    font-weight: 700;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.plus {
    color: var(--income-color);
}

.minus {
    color: var(--expense-color);
}

.income-card .amount, .expense-card .amount {
    font-size: 1.8rem;
}

/* Savings Goal */
.savings-section {
    display: flex;
    flex-direction: column;
}

.savings-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.progress-bar-container {
    background-color: var(--border-color);
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.5s ease-in-out;
}

/* Layout Grid */
.main-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
}

/* Form Styles */
.form-control {
    margin-bottom: 15px;
}

.form-control label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

input, select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--card-bg);
    color: var(--text-color);
    font-size: 1rem;
}

.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #357abd;
}

.btn-secondary {
    background-color: var(--border-color);
    color: var(--text-color);
}

.btn-small {
    padding: 5px 10px;
    width: auto;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 1rem;
}

/* List Styles */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

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

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group select {
    width: auto;
    padding: 5px;
}

.list {
    list-style-type: none;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.list-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .list-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.list-item-info {
    display: flex;
    flex-direction: column;
}

.list-item-text {
    font-weight: 600;
}

.list-item-subtext {
    font-size: 0.8rem;
    color: var(--text-light);
}

.list-item-actions {
    display: flex;
    gap: 10px;
}

.delete-btn {
    color: var(--expense-color);
    cursor: pointer;
    background: none;
    border: none;
}

.edit-btn {
    color: var(--primary-color);
    cursor: pointer;
    background: none;
    border: none;
}

/* Stats Chart */
.chart-container {
    height: 200px;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding-top: 20px;
}

.bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}

.bar {
    width: 100%;
    background-color: var(--primary-color);
    border-radius: 4px 4px 0 0;
    min-height: 5px;
    transition: height 0.5s ease;
    position: relative;
}

.bar:hover::after {
    content: attr(data-value);
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-color);
    color: var(--card-bg);
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
}

.bar-label {
    font-size: 0.7rem;
    margin-top: 5px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
}

.modal-content {
    position: relative;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 500px;
    width: 90%;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 24px;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
}
