:root {
    --primary: #4834d4;
    --success: #2ecc71;
    --danger: #e74c3c;
    --bg: #f7f7f7;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg);
    font-family: 'Segoe UI', Tahoma, sans-serif;
    display: flex; justify-content: center; padding: 40px 10px;
}

.app-container { width: 100%; max-width: 450px; }

header { text-align: center; margin-bottom: 25px; color: var(--primary); }

.balance-card {
    background: var(--primary); color: white;
    padding: 30px 20px; border-radius: 20px; text-align: center;
    box-shadow: 0 10px 25px rgba(72, 52, 212, 0.3);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.balance-card h1 {
    font-size: 1.8rem;
    margin-top: 5px;
    word-break: break-all;
    line-height: 1.2;
}

.stats-container {
    display: flex; justify-content: space-between;
    background: white; padding: 20px; border-radius: 15px;
    margin: -20px auto 30px; width: 90%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.stat-box { flex: 1; text-align: center; }
.stat-box:first-child { border-right: 1px solid #eee; }
.stat-box p { font-weight: bold; word-break: break-all; font-size: 0.9rem; }
.income p { color: var(--success); }
.expense p { color: var(--danger); }

h3 { border-bottom: 2px solid #ddd; padding-bottom: 10px; margin: 30px 0 15px; font-size: 1.1rem; }

.list { list-style: none; margin-bottom: 40px; }
.list li {
    background: white; display: flex; justify-content: space-between;
    padding: 15px; margin-bottom: 10px; border-radius: 10px;
    position: relative; box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.list li.plus { border-right: 5px solid var(--success); }
.list li.minus { border-right: 5px solid var(--danger); }

.delete-btn {
    cursor: pointer; background: var(--danger); color: white;
    border: 0; padding: 5px 10px; border-radius: 5px;
    position: absolute; left: -10px; top: 50%; transform: translateY(-50%);
    opacity: 0; transition: 0.3s;
}

.list li:hover .delete-btn { opacity: 1; }

.form-control label { display: block; margin: 10px 0; font-weight: bold; font-size: 0.9rem; }
input { width: 100%; padding: 12px; border-radius: 10px; border: 1px solid #ddd; outline: none; }
input:focus { border-color: var(--primary); }

.btn {
    width: 100%; cursor: pointer; background: var(--primary);
    color: white; border: 0; padding: 15px; margin-top: 20px;
    border-radius: 10px; font-size: 1rem; font-weight: bold;
    transition: 0.3s;
}
.btn:hover { background: #3a29b3; }

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
}

.social-links img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.1));
}

.social-links img:hover {
    transform: scale(1.2) rotate(5deg);
}

footer {
    text-align: center; margin-top: 25px; padding: 20px 0;
    border-top: 1px solid #eee; color: #888; font-size: 0.85rem;
}