/* General Body & Layout */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    background-color: #f4f7f9;
    color: #333;
    max-width: 900px;
    margin: 2rem auto;
    padding: 1rem 2rem;
}

#app-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

h1, h2, h3 { color: #111; }
h2 { border-bottom: 1px solid #eee; padding-bottom: 10px; margin-top: 0; }
hr { border: none; border-top: 1px solid #eee; margin: 2rem 0; }

/* Header & View Switcher */
.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid #ddd;
}
.header-bar h1 { margin: 0; border: none; font-size: 1.8rem; }

#view-switcher { display: flex; gap: 0.5rem; }
.tab-button {
    padding: 8px 16px;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid transparent;
    border-radius: 6px;
    background-color: #e9ecef;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}
.tab-button:hover { background-color: #dee2e6; }
.tab-button.active {
    background-color: #fff;
    color: #0c6133;
    border-color: #0c6133;
}

/* Auth Section */
#auth-container { max-width: 400px; margin: 4rem auto; text-align: center; }
.auth-form { display: flex; flex-direction: column; gap: 0.75rem; padding: 1.5rem; border: 1px solid #eee; border-radius: 8px; background-color: #fff; text-align: left; }
.auth-form input { padding: 10px; font-size: 1rem; border: 1px solid #ccc; border-radius: 4px; }
.auth-form button, .full-width-button {
    padding: 12px; font-size: 1.1rem; color: #fff; background-color: #2a6442;
    border: none; border-radius: 4px; cursor: pointer; margin-top: 1rem;
}
.auth-form button:hover, .full-width-button:hover { background-color: #1e4930; }

/* Content Boxes */
.content-box {
    padding: 1.5rem;
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
}

/* Net Worth & Goal Metrics */
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1.5rem; text-align: center; }
.summary-label { display: block; font-size: 0.9rem; color: #555; margin-bottom: 0.25rem; }
.summary-value { display: block; font-size: 1.75rem; font-weight: 600; color: #111; }
.summary-value.loading { color: #999; }
.goal-metrics { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 1rem; align-items: center; margin: 1.5rem 0; }
.metric { text-align: center; padding: 1rem; background-color: #f9f9f9; border-radius: 6px; }
.metric-label { display: block; font-size: 0.9rem; color: #555; margin-bottom: 0.5rem; }
.metric-value { display: block; font-size: 1.2rem; font-weight: 600; color: #111; }
.progress-bar-container { width: 100%; height: 20px; background-color: #e0e0e0; border-radius: 10px; overflow: hidden; }
.progress-bar-fill { height: 100%; width: 0%; background-color: #2a6442; border-radius: 10px; transition: width 0.5s ease-in-out; text-align: center; color: white; font-size: 0.8rem; line-height: 20px; }

/* Chart & Projection */
#projection-controls { margin: 1.5rem 0; padding: 1rem; background-color: #f9f9f9; border: 1px solid #eee; border-radius: 6px; display: flex; align-items: center; gap: 1rem; justify-content: center; }
#projection-controls label { font-weight: 600; }
#projection-controls input { width: 80px; padding: 8px; font-size: 1rem; border: 1px solid #ccc; border-radius: 4px; }
.chart-container { width: 100%; max-height: 350px; margin-top: 1rem; }

/* Manage View Tables */
.data-table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
.data-table th, .data-table td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #ddd; }
.data-table thead th { background-color: #f4f7f9; font-weight: 600; }
.data-table tbody tr:hover { background-color: #f9f9f9; }
.data-table .total-row { font-weight: bold; background-color: #f8f9fa; }
.data-table .total-row td { border-top: 2px solid #ccc; }
.data-table .total-row td:nth-child(2) { text-align: right; }
.data-table .action-buttons { display: flex; gap: 0.5rem; }
.action-button {
    padding: 5px 10px; font-size: 0.9rem; border-radius: 4px; cursor: pointer;
    border: 1px solid #ccc; background-color: #fff;
}
.action-button:hover { background-color: #f0f0f0; }
.details-button { color: #0c6133; border-color: #0c6133; }
.details-button:hover { background-color: #e3fcef; }
.delete-button { color: #a51818; border-color: #a51818; }
.delete-button:hover { background-color: #fce8e8; }


/* Manage View Forms */
.inline-form { display: flex; align-items: center; gap: 0.75rem; margin-top: 1rem; padding: 1rem; background-color: #f9f9f9; border: 1px solid #eee; border-radius: 6px; flex-wrap: wrap; }
.inline-form input, .inline-form select { flex: 1; min-width: 150px; padding: 8px; font-size: 1rem; border: 1px solid #ccc; border-radius: 4px; }
.inline-form button { padding: 8px 16px; font-size: 1rem; color: #fff; background-color: #2a6442; border: none; border-radius: 4px; cursor: pointer; }
.inline-form button:hover { background-color: #1e4930; }

/* Household Members */
#member-list { margin: 1rem 0; }
.member-item { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 0; border-bottom: 1px solid #f0f0f0; }
.member-item:last-child { border-bottom: none; }
.member-info .email { font-weight: 600; }
.member-info .role { font-size: 0.85rem; color: #555; background-color: #f0f0f0; padding: 2px 6px; border-radius: 4px; text-transform: capitalize; }
.remove-member-button { padding: 5px 10px; font-size: 0.9rem; color: #a51818; background-color: transparent; border: 1px solid #fce8e8; border-radius: 4px; cursor: pointer; }
.remove-member-button:hover { background-color: #fce8e8; }

/* Account Details View */
.details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.details-header h2 {
    margin: 0;
    border: none;
}
#csv-uploader {
    display: block;
    margin-top: 0.5rem;
    font-size: 1rem;
}

/* Status Message */
.status { padding: 1rem; margin-top: 1rem; border-radius: 4px; display: none; }
.status.success { background-color: #e3fcef; color: #0d6a50; display: block; }
.status.error { background-color: #fce8e8; color: #a51818; display: block; }

/* Differentiate the cancel button in inline forms */
.inline-form button[type="button"] {
    background-color: #6c757d; /* A neutral grey */
}
.inline-form button[type="button"]:hover {
    background-color: #5a6268;
}

/* Style the new button container in the details page header */
.details-header .page-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}