:root {
    --bg-color: #f0f4f8;
    --card-bg: #ffffff;
    --text-main: #1a202c;
    --primary: #0f172a;
    --accent-expense: #dc2626;
    --accent-budget: #16a34a;
    --border-color: #e2e8f0;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    padding: 10px;
    display: flex;
    justify-content: center;
}

#app-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 15px;
}

header h2 {
    font-size: 1.4rem;
    font-weight: 700;
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.card h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 2px solid var(--bg-color);
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 4px;
}

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

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
}

button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary { background: var(--primary); color: white; }
.btn-secondary { background: #475569; color: white; }
.btn-close { background: #e2e8f0; color: var(--text-main); }

#configToggleBtn {
    width: auto;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.9rem;
}

/* Data Table Adjustments */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

th, td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: #f8fafc;
    font-weight: 600;
}

/* Chart Canvas Adjustments */
.chart-container {
    position: relative;
    height: 260px;
    width: 100%;
}

/* Responsiveness Grid Structure */
.main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 768px) {
    .main-grid {
        grid-template-columns: 4fr 7fr;
    }
}

/* Modal Config Window UI */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}