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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    color: #333;
    padding-bottom: 2rem;
}

nav {
    background: #2c3e50;
    padding: 1rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

nav button {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}

nav button:hover {
    background: #2980b9;
}

.page {
    display: none;
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.page.active {
    display: block;
}

h1 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

h2 {
    margin-bottom: 1rem;
    color: #34495e;
}

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

.card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.card h3 {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 0.5rem;
}

.card p {
    font-size: 1.8rem;
    font-weight: bold;
    color: #2c3e50;
}

form {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 500px;
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 600;
}

input, select {
    width: 100%;
    padding: 0.6rem;
    margin-top: 0.3rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
}

button[type="submit"] {
    background: #27ae60;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    width: 100%;
    transition: background 0.2s;
}

button[type="submit"]:hover {
    background: #219150;
}

#payment-msg, #bill-msg {
    margin-top: 0.5rem;
    font-weight: 600;
}

.success { color: #27ae60; }
.error { color: #e74c3c; }

#upcoming-bills-list, #bills-list {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.bill-item, .payment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
}

.bill-item:last-child, .payment-item:last-child {
    border-bottom: none;
}

.bill-item .info, .payment-item .info {
    flex: 1;
}

.bill-item .amount, .payment-item .amount {
    font-weight: bold;
    color: #e74c3c;
    margin-right: 1rem;
}

.bill-item .date {
    color: #7f8c8d;
    font-size: 0.85rem;
}

.actions button {
    background: #e67e22;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    margin-left: 0.3rem;
}

.actions button.delete {
    background: #e74c3c;
}

.actions button:hover {
    opacity: 0.9;
}

.edit-form {
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 6px;
    margin-top: 0.5rem;
}

.edit-form input, .edit-form select {
    margin-bottom: 0.5rem;
}

.no-data {
    color: #7f8c8d;
    text-align: center;
    padding: 2rem;
}

.savings-edit {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.savings-edit label {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

.savings-edit button {
    background: #27ae60;
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
}

.savings-edit button:hover {
    background: #219150;
}

#savings-msg {
    color: #27ae60;
    font-weight: 600;
}
