body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background-color: #f0f2f5;
    color: #1c1e21;
}

header {
    background-color: #fff;
    padding: 10px 20px;
    border-bottom: 1px solid #dddfe2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

header h1 {
    margin: 0;
    font-size: 1.5em;
    color: #1c1e21;
    border-bottom: none; /* Override generic h1 style */
}

header p {
    margin: 5px 0 0;
    color: #606770;
}

.container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    align-items: flex-start;
    padding: 20px;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.form-container {
    flex: 2;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.summary-container {
    flex: 1;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 20px;
}

h1, h2 {
    color: #1c1e21;
    border-bottom: 1px solid #dddfe2;
    padding-bottom: 10px;
    margin-top: 0;
}

form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

fieldset {
    border: 1px solid #dddfe2;
    border-radius: 6px;
    padding: 15px;
    margin: 0;
}

legend {
    font-size: 1.2em;
    font-weight: 600;
    padding: 0 10px;
    color: #606770;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 15px;
}

.form-group:last-child {
    margin-bottom: 0;
}

label {
    font-weight: 500;
    color: #606770;
}

input[type="text"], select {
    padding: 10px;
    border: 1px solid #dddfe2;
    border-radius: 6px;
    font-size: 1em;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus, select:focus {
    outline: none;
    border-color: #1877f2;
    box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.2);
}

input.error {
    border-color: #fa383e;
    box-shadow: 0 0 0 2px rgba(250, 56, 62, 0.2);
}

#add-expense-btn {
    background-color: #e7f3ff;
    color: #1877f2;
    border: none;
    border-radius: 6px;
    padding: 10px 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    align-self: flex-start;
}

#add-expense-btn:hover {
    background-color: #dceafc;
}

.expense-row {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f2f5;
}

.expense-group {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
}

.expense-group > * {
    margin-bottom: 0;
}

.expense-group .expense-amount,
.expense-group .expense-category,
.expense-group .expense-comment {
    width: 100%; /* Let flexbox handle the sizing */
}

.expense-group .expense-amount {
    flex: 2;
}

.expense-group .expense-category {
    flex: 2;
}

.expense-group .expense-comment {
    flex: 3;
}

.remove-expense-btn {
    background-color: #fa383e; /* Red color */
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 1.2em;
    font-weight: bold;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s;
    padding: 0;
}

.remove-expense-btn:hover {
    background-color: #d92b2b; /* Darker red on hover */
}

/* Summary Styles */
#summary-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    font-size: 1em;
}

.summary-item span:first-child {
    color: #606770;
}

.summary-item span:last-child {
    font-weight: 600;
}

.summary-item.total {
    font-size: 1.1em;
    font-weight: bold;
    border-top: 1px solid #dddfe2;
    padding-top: 10px;
    margin-top: 5px;
}

.summary-item span.synced {
    color: #389e0d; /* Green */
}

.summary-item span.local {
    color: #d46b08; /* Orange */
}

/* Summary Messages */
#summary-messages {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.summary-message {
    padding: 15px;
    border-radius: 6px;
    background-color: #fffbe6;
    border: 1px solid #ffe58f;
}

.summary-message h3 {
    margin: 0 0 5px 0;
    font-size: 1.1em;
    color: #d46b08;
}

.summary-message p {
    margin: 0;
    color: #614700;
}

.summary-message.placeholder {
    background-color: #f0f2f5;
    border-color: #dddfe2;
    text-align: center;
}

.summary-message.placeholder p {
    color: #606770;
}