body {
    font-family: 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px 0;
}

.container {
    max-width: 500px;
    width: 100%;
    margin: auto;
    padding: 0 15px;
}

h1 {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
}

h2 {
    font-size: 20px;
    font-weight: 600;
}

.card {
    padding: 24px;
    border-radius: 16px;
    background: white;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
}

.card:hover {
    transform: translateY(-3px);
    transition: 0.2s;
}

.summary-items {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.summary-items p {
    flex: 1;
    text-align: center;
    font-weight: 500;
}

#balance {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
}

#income {
    color: #2ecc71;
    text-align: center;
}

#expense {
    color: #e74c3c;
    text-align: center;
    margin-bottom: 10px;
}

#income, #expense {
    text-align: center;
    margin: 5px 0;
}

input, select {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border-radius: 10px;
    border: 1px solid #ddd;
    font-size: 14px;
    box-sizing: border-box;
}

input:focus, select:focus {
    outline: none;
    border: 1px solid #6366f1;
    box-shadow: 0 0 5px rgba(99, 102, 241, 0.4);
}

#add-btn {
    width: 100%;
    padding: 12px;
    border: none;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
}

#add-btn:hover {
    transform: scale(1.02);
}

.tracker {
    display: flex;
    gap: 8px;
    margin: 15px 0;
}

.filter-btn {
    flex: 1;
    padding: 8px;
    border: none;
    background: #eee;
    border-radius: 20px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 13px;
}

.filter-btn:hover {
    background: #dcdcdc;
}

.filter-btn.active {
    background: #4caf50;
    color: white;
}

ul {
    list-style: none;
    padding: 0;
}

li {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeIn 0.3s forwards;

    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 10px;
    margin: 8px 0;
    border-radius: 8px;
    transition: 0.2s;
}

li .text {
    flex: 1;
    font-size: 14px;
}

li div {
    display: flex;
    gap: 5px;
}

li.income {
    border-left: 5px solid #4caf50;
    background: #f0fff4;
}

li.expense {
    border-left: 5px solid #f44336;
    background: #fff5f5;
}

li button {
    margin-left: 5px;
}

li input, li select {
    margin-bottom: 6px;
    font-size: 13px;
}

li:hover {
    transform: scale(1.02);
}

.save-btn {
    background: #4caf50;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
}

.cancel-btn {
    background: #ccc;
    padding: 6px 10px;
    border-radius: 6px;
    margin-left: 5px;
}

.delete-btn {
    background: #ff4d4d;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
}

.delete-btn:hover {
    background: #e60000;
}

.edit-btn {
    background: #f1f1f1;
    color: #333;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 5px;
    font-size: 12px;
    transition: all 0.2s ease;
}

.edit-btn:hover {
    background: #ddd;
}

canvas {
    max-width: 280px;
    margin: 20px auto 10px;
    display: block;
}

#chart-empty {
    display: none;
}

button {
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}

button:active {
    transform: scale(0.95);
}

button:hover {
    opacity: 0.9;
}

button:active {
    transform: scale(0.95);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    display: flex;
    justify-content: center;
    align-items: center;

    background: rgba(0, 0, 0, 0.5);

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    animation: fadeIn 0.3s ease;
}

.empty {
    text-align: center;
    color: #888;
    margin-top: 20px;
}

body.dark {
    background: linear-gradient(135deg, #1e1e2f, #121212);
    color: white;
}

body.dark .card {
    background: #1f1f2e;
    color: white;
}

body.dark input,
body.dark select {
    background: #2c2c3a;
    color: white;
    border: 1px solid #444;
}

body.dark button {
    opacity: 0.9;
}

#toggle-theme {
    display: block;
    margin: 10px auto 20px;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
