/* The main view (Pages/Home.razor). Self-contained: it does not rely on XAF's layout or theme. */
.home { box-sizing: border-box; max-width: 1180px; height: 100%; margin: 0 auto; padding: 10px 20px 0; display: flex; flex-direction: column; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #1f2933; }
.home h1 { font-size: 1.3rem; margin: 0; }
.home h2 { font-size: 1.05rem; margin: 0; }

/* The top of the page - title bar, the four boxes and net worth - stays where it is; only the transactions scroll (.home-scroll). */
.home-header { flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 8px; }
.home-title-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.home-entity { max-width: 100%; padding: 2px 6px; border: 1px solid #bcccdc; border-radius: 6px; background: #fff; font: inherit; font-size: 0.85rem; }
.home-subtitle { margin: 0; color: #52606d; font-size: 0.85rem; }
.home-links { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.home-links a { color: #0b5cad; text-decoration: none; font-size: 0.95rem; }
.home-links a:hover { text-decoration: underline; }

.home-message { flex: none; padding: 16px; background: #f5f7fa; border-radius: 6px; }
.home-error { background: #fdecea; color: #8a1c13; }

.home-summary { flex: none; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.home-tiles { flex: 0 1 560px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.home-tile { display: flex; flex-direction: column; justify-content: center; padding: 4px 10px; border: 1px solid #d9e2ec; border-radius: 6px; background: #fff; }
.home-tile-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; color: #52606d; line-height: 1.2; }
.home-tile-value { font-size: 1.05rem; font-weight: 600; line-height: 1.25; white-space: nowrap; }
.home-section { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.home-scroll { flex: 1; min-height: 0; overflow: auto; border-top: 1px solid #e4e7eb; }
.home-table thead th { position: sticky; top: 0; z-index: 2; background: #fff; }
.home-empty { margin: 0; padding: 12px 14px; background: #f5f7fa; border-radius: 6px; color: #52606d; }

.home-table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.home-table th { text-align: left; font-weight: 600; color: #52606d; box-shadow: inset 0 -2px 0 #d9e2ec; padding: 5px 10px; white-space: nowrap; }
.home-table td { padding: 5px 10px; border-bottom: 1px solid #e4e7eb; vertical-align: middle; }
.home-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.home-table tbody tr:hover { background: #f8fafc; }

.home-muted { color: #7b8794; font-size: 0.85rem; }

/* A transaction's category, chosen right in the list. */
.home-category-choose { padding: 2px 4px; margin: -2px -4px; border: 1px dashed transparent; border-radius: 4px; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.home-category-choose:hover, .home-category-choose:focus-visible { border-color: #9fb3c8; background: #f0f4f8; }
.home-category-pick { max-width: 100%; padding: 3px 4px; border: 1px solid #9fb3c8; border-radius: 4px; font: inherit; }
.home-amount-choose { padding: 2px 4px; margin: -2px -4px; border: 1px dashed transparent; border-radius: 4px; background: none; font: inherit; color: inherit; text-align: right; cursor: pointer; }
.home-amount-choose:hover, .home-amount-choose:focus-visible { border-color: #9fb3c8; background: #f0f4f8; }
.home-amount-edit { width: 7.5em; padding: 3px 4px; border: 1px solid #9fb3c8; border-radius: 4px; font: inherit; text-align: right; }
.home-others { margin-top: 4px; font-size: 0.85rem; color: #334e68; }
.home-file-others { margin-left: 4px; padding: 2px 8px; border: 1px solid #1f5fbf; border-radius: 4px; background: #1f5fbf; color: #fff; font: inherit; font-size: 0.8rem; cursor: pointer; }
/* Splitting a transaction into parts filed apart, right under its row. */
.home-split-open { margin-left: 6px; padding: 2px 8px; border: 1px solid #1f5fbf; border-radius: 4px; background: #fff; color: #1f5fbf; font: inherit; font-size: 0.8rem; cursor: pointer; }
.home-split-row td { background: #f5f8fc; }
.home-split { display: flex; flex-direction: column; gap: 6px; padding: 6px 0; }
.home-split-part { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.home-split-amount { width: 120px; }
.home-split-category { min-width: 200px; max-width: 100%; }
.home-split-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.home-split-left { color: #b42318; }
.home-split-save { padding: 4px 12px; border: 1px solid #1f5fbf; border-radius: 4px; background: #1f5fbf; color: #fff; font: inherit; cursor: pointer; }
.home-split-save:disabled { opacity: 0.5; cursor: default; }
.home-split-add, .home-split-cancel, .home-split-remove { padding: 4px 10px; border: 1px solid #9fb3c8; border-radius: 4px; background: #fff; color: #334e68; font: inherit; cursor: pointer; }
.home-error-text { color: #8d2b0b; font-size: 0.85rem; font-weight: 600; }
.home .negative { color: #b42318; }
.home .positive { color: #067647; }
.home-badge { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 10px; background: #e4e7eb; color: #52606d; font-size: 0.75rem; }

.home-table tr.home-row-planned td:not(.negative):not(.positive) { color: #52606d; background: #fafbfc; }
.home-table tr.home-today td { background: #eef4fb; color: #1b4f8a; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid #b6d4f2; }
.home-jump { color: #0b5cad; font-size: 0.9rem; text-decoration: none; }
.home-jump:hover { text-decoration: underline; }

/* The header's right side: the management links, then the New menu. */
.home-header-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px 18px; }
.home-new { position: relative; }
.home-new-button { padding: 7px 16px; border: 0; border-radius: 6px; background: #2f80ed; color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.home-new-button:hover { background: #1f6fdc; }
/* Clicking anywhere else closes the menu: a clear sheet over the page, under the menu. */
.home-new-backdrop { position: fixed; inset: 0; z-index: 10; }
.home-new-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 190px; margin: 0; padding: 4px 0; list-style: none; background: #fff; border: 1px solid #d9e2ec; border-radius: 6px; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15); }
.home-new-menu button { display: block; width: 100%; padding: 8px 14px; border: 0; background: none; text-align: left; font: inherit; color: #1f2933; cursor: pointer; }
.home-new-menu button:hover, .home-new-menu button:focus { background: #eef4fb; outline: none; }

/* A line you can click to edit. */
.home-table tr.home-clickable { cursor: pointer; }
.home-table tr.home-clickable:hover td { background: #eef4fb; }
.home-table tr.home-clickable:focus { outline: 2px solid #2f80ed; outline-offset: -2px; }

/* The editing popup: XAF's own detail view in a frame over the page. */
.home-modal-backdrop { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; background: rgba(15, 23, 42, 0.5); }
.home-modal { display: flex; flex-direction: column; width: min(980px, 95vw); height: min(720px, 92vh); overflow: hidden; border-radius: 8px; background: #fff; box-shadow: 0 16px 48px rgba(15, 23, 42, 0.35); }
.home-modal-bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; border-bottom: 1px solid #d9e2ec; background: #f5f7fa; }
.home-modal-title { font-weight: 600; }
.home-modal-close { border: 0; background: none; font-size: 1.6rem; line-height: 1; color: #52606d; cursor: pointer; }
.home-modal-close:hover { color: #1f2933; }
.home-modal-frame { flex: 1; width: 100%; border: 0; }

/* Inside the popup (embedded.js marks the page) XAF's own navigation and header are hidden: the popup is just the form. */
html.morgan-embedded .header,
html.morgan-embedded .xaf-sidebar,
html.morgan-embedded .xaf-skip-navigation-link { display: none !important; }

/* The net worth trend under the boxes: slim, solid for what has happened and dashed for what is expected. */
.home-chart { flex: 1 1 360px; min-width: 0; margin: 0; padding: 3px 10px 2px; align-self: stretch; border: 1px solid #d9e2ec; border-radius: 6px; background: #fff; }
.home-chart-title { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; color: #52606d; }
.home-chart-plot { display: flex; gap: 8px; }
.home-chart-scale { display: flex; flex-direction: column; justify-content: space-between; flex: 0 0 88px; text-align: right; font-size: 0.68rem; line-height: 1.1; color: #52606d; font-variant-numeric: tabular-nums; }
.home-chart-svg { display: block; flex: 1; min-width: 0; height: 34px; overflow: visible; }
.home-chart-past, .home-chart-future { fill: none; stroke: #2f80ed; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.home-chart-future { stroke-dasharray: 5 4; opacity: 0.75; }
.home-chart-today { stroke: #9aa5b1; stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 2 3; }
.home-section-head { flex: none; display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.home-section-head .home-filter { margin-left: auto; }
.home-filter, .home-window { max-width: 100%; padding: 4px 8px; border: 1px solid #bcccdc; border-radius: 6px; background: #fff; font: inherit; font-size: 0.9rem; }
.home-chart-day { fill: transparent; cursor: pointer; }
.home-chart-day:hover { fill: rgba(47, 128, 237, 0.08); }

/* What net worth was made of on a day of the chart. */
.home-modal.home-worth { width: min(760px, 95vw); height: auto; max-height: 92vh; }
.home-worth-body { padding: 14px 16px; overflow: auto; }
.home-worth-note { margin: 0 0 8px; color: #52606d; font-size: 0.9rem; }
.home-worth-sum { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 12px; font-variant-numeric: tabular-nums; }
.home-worth-total { color: #1f2933; }
.home-worth-sides { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px 20px; }
.home-worth-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.home-worth-table th { padding: 4px 6px; border-bottom: 1px solid #d9e2ec; text-align: left; font-size: 0.85rem; color: #52606d; }
.home-worth-table td { padding: 4px 6px; border-bottom: 1px solid #f0f4f8; }
.home-worth-table .num { text-align: right; white-space: nowrap; }
.home-worth-left-out { margin-top: 14px; }
.home-worth-hint { display: block; color: #8d2b0b; font-size: 0.8rem; }
.home-chart-axis { display: flex; align-items: baseline; gap: 8px; font-size: 0.68rem; line-height: 1.1; color: #52606d; font-variant-numeric: tabular-nums; }
.home-chart-axis .home-chart-title { flex: 0 0 88px; text-align: right; }
.home-chart-dates { flex: 1; display: flex; justify-content: space-between; }
@media (max-width: 640px) {
    .home { padding: 8px 10px 0; }
    .home-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .home-table { font-size: 0.85rem; }
}

/* The New menu's link out to the new-entity wizard, set apart from the record types. */
.home-new-menu .home-new-separated { border-top: 1px solid #e4e7eb; margin-top: 4px; padding-top: 4px; }
.home-new-menu a { display: block; padding: 8px 14px; color: #1f2933; text-decoration: none; }
.home-new-menu a:hover, .home-new-menu a:focus { background: #eef4fb; outline: none; }

/* The logo stands where the page's title was. It is square; it is scaled to the height of the title row and never stretched. */
.home .home-brand { display: flex; align-items: center; line-height: 0; }
.home-logo { display: block; width: 52px; height: 52px; object-fit: contain; }
.home-title-row { align-items: center; }

/* A date a year off says its year, so the column must not wrap it. */
.home-date { white-space: nowrap; }

/* An account that is, or is going to be, below the least it should be left with. */
.home-low { flex: none; list-style: none; margin: 0 0 8px; padding: 6px 10px; border: 1px solid #f0b429; border-radius: 6px; background: #fffbea; color: #8d2b0b; font-size: 0.9rem; }
.home-low li + li { margin-top: 2px; }
.home-below-minimum { color: #8d2b0b; font-weight: 600; }
/* The header is the same on every page Morgan draws (Shared/MorganHeader.razor), so what styles it does not depend on the page it is on. */
.home-brand { margin: 0; display: flex; align-items: center; line-height: 0; }
.home-brand a { display: block; }
.home-links a[aria-current="page"] { color: #102a43; font-weight: 600; text-decoration: none; cursor: default; }
.morgan-header { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #1f2933; }
.wizard-title { margin: 0 0 12px; font-size: 1.2rem; }

/* Under the list of transactions: whether more is being fetched, can be, or there is no more. */
.home-history { margin: 0; padding: 10px 0 14px; text-align: center; font-size: 0.85rem; color: #7b8794; }
.home-earlier { border: 0; background: none; padding: 0; font: inherit; color: #1f5fbf; cursor: pointer; }
.home-earlier:hover { text-decoration: underline; }
.home-find { margin: 0 0 8px; padding: 8px 14px; background: #eef4fb; border-radius: 6px; }

/* Uploading a statement: a small window, not the editor's large one. */
.home-upload-open { padding: 4px 12px; border: 1px solid #2f6f4f; border-radius: 6px; background: #2f6f4f; color: #fff; font: inherit; font-size: 0.9rem; cursor: pointer; }
.home-upload-open:hover { background: #245a3f; }
.home-modal.home-upload { width: min(520px, 95vw); height: auto; }
.home-upload-body { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.home-upload-field { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.home-upload-account { padding: 6px 8px; border: 1px solid #bcccdc; border-radius: 6px; font: inherit; font-weight: normal; }
.home-upload-file { font-weight: normal; }
.home-upload-optional { color: #52606d; font-weight: normal; font-size: 0.85rem; }
.home-upload-balance { padding: 6px 8px; border: 1px solid #bcccdc; border-radius: 6px; font: inherit; font-weight: normal; max-width: 12em; }
.home-upload-through { margin: -6px 0 0; color: #52606d; font-size: 0.9rem; }
.home-upload-actions { display: flex; align-items: flex-start; gap: 12px; }
.home-upload-go { padding: 6px 16px; border: 0; border-radius: 6px; background: #2f6f4f; color: #fff; font: inherit; cursor: pointer; }
.home-upload-go:disabled { background: #9fb3a8; cursor: default; }
.home-upload-done { color: #1f5135; }
.home-upload-error { color: #8d2b0b; font-weight: 600; }

/* A balance reconciliation Morgan made: marked so it is looked at. */
.home-row-reconciliation td { background: #fff4d6; }
.home-reconciliation-mark { display: inline-block; width: 1.2em; margin-right: 6px; border-radius: 50%; background: #c2410c; color: #fff; font-weight: 700; text-align: center; }