/* Dashboard: the classic warm paper and spruce palette, with numbers first. */
.dashboard-live { --dash-line: rgba(32, 49, 42, .08); padding-top: 6px; }
.dashboard-live .dash-page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.dashboard-live .dash-page-head h1 { font-size: 1.85rem; line-height: 1.15; margin: 3px 0 0; letter-spacing: -.04em; }
.dash-page-head > div { min-width: 0; }
.dash-page-head .hh-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-history-button { flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 8px 11px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--brand-deep); font-size: .84rem; font-weight: 650; }
.dash-history-button .icon { width: 18px; height: 18px; }
.dash-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.dash-period-nav { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-width: 0; }
.dash-period-nav > strong { font-size: .98rem; text-align: center; white-space: nowrap; }
.dash-period-nav .icon-btn { min-width: 34px; min-height: 44px; padding: 5px; }
.dash-segmented { display: inline-flex; flex: none; gap: 3px; padding: 3px; border-radius: 12px; background: var(--surface-2); }
.dash-segmented > button { min-height: 44px; padding: 8px 13px; border-radius: 9px; color: var(--ink-2); font-size: .8rem; font-weight: 650; }
.dash-segmented > button[aria-pressed="true"] { background: var(--surface); box-shadow: var(--shadow); color: var(--brand-deep); }
.dash-panel { min-width: 0; margin: 0 0 16px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow); animation: dash-arrive 200ms ease both; }
.dash-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.dash-section-head h2 { font-size: 1.06rem; font-weight: 750; letter-spacing: -.02em; line-height: 1.25; }
.dash-section-meta { flex: none; color: var(--ink-2); font-size: .76rem; }
.dash-muted { color: var(--ink-2); font-size: .81rem; line-height: 1.5; }
.dash-empty-note { margin-top: 13px; }
.dash-summary { position: relative; overflow: hidden; border-color: #C5D7CB; background: linear-gradient(130deg, #F8FCF9 0%, var(--surface) 64%); }
.dash-summary-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.dash-summary-top > div { min-width: 0; }
.dash-eyebrow { color: var(--ink-2); font-size: .75rem; font-weight: 650; margin-bottom: 9px; }
.dash-summary h2 { color: var(--ink-2); font-size: .92rem; font-weight: 550; }
.dash-balance { color: var(--brand-deep); font-size: clamp(2rem, 8.2vw, 2.8rem); font-weight: 800; letter-spacing: -.045em; line-height: 1.15; margin-top: 4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dash-balance.is-over { color: var(--red); }
.dash-summary-mark { display: grid; place-items: center; flex: none; width: 54px; height: 54px; border-radius: 18px; background: var(--brand-tint); color: var(--brand); transform: rotate(-5deg); }
.dash-summary-mark .icon { width: 28px; height: 28px; }
.dash-summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding-top: 19px; margin-top: 18px; border-top: 1px solid var(--dash-line); }
.dash-summary-grid > div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dash-summary-grid > div + div { border-left: 1px solid var(--dash-line); padding-left: 16px; }
.dash-summary-grid span { color: var(--ink-2); font-size: .78rem; }
.dash-summary-grid strong { font-size: clamp(1rem, 4.4vw, 1.3rem); font-weight: 750; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dash-explainer { margin: 15px 0 -7px; color: var(--ink-2); font-size: .77rem; }
.dash-explainer > summary { display: flex; align-items: center; gap: 6px; width: fit-content; min-height: 44px; cursor: pointer; }
.dash-explainer > summary .icon { width: 15px; height: 15px; }
.dash-explainer > summary::-webkit-details-marker { display: none; }
.dash-explainer p { margin: 7px 0; line-height: 1.5; }
.dash-chart-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--ink-2); font-size: .72rem; }
.dash-chart-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.dash-chart-legend i { width: 8px; height: 8px; border-radius: 3px; }
.dash-chart-legend .is-monthly { background: var(--brand); }
.dash-chart-legend .is-yearly { background: #9BBBA8; }
.dash-chart-scale { text-align: right; color: var(--ink-2); font-size: .67rem; padding: 14px 0 4px; font-variant-numeric: tabular-nums; }
.dash-trend { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; position: relative; }
.dash-trend::before { content: ''; position: absolute; inset: 0 0 24px; background: repeating-linear-gradient(to top, var(--dash-line) 0 1px, transparent 1px 48px); pointer-events: none; }
.dash-trend-month { display: flex; flex-direction: column; align-items: stretch; min-width: 0; min-height: 172px; position: relative; border-radius: 5px; }
.dash-trend-month:focus-visible { outline-offset: 1px; z-index: 1; }
.dash-trend-columns { flex: 1; min-height: 148px; height: 148px; display: flex; align-items: flex-end; justify-content: center; gap: 2px; padding: 0 2px; }
.dash-trend-bar { display: block; flex: 1; max-width: 11px; min-width: 0; border-radius: 4px 4px 0 0; }
.dash-trend-bar.is-monthly { background: var(--brand); }
.dash-trend-bar.is-yearly { background: #9BBBA8; }
.dash-trend-label { display: block; color: var(--ink-2); font-size: .61rem; font-weight: 550; min-height: 24px; padding: 6px 0 3px; border-bottom: 2px solid transparent; }
.dash-trend-month.is-selected .dash-trend-label { border-bottom-color: var(--brand); color: var(--brand-deep); font-weight: 800; }
.dash-trend-month.is-partial .dash-trend-bar { background-image: repeating-linear-gradient(135deg, transparent 0 4px, rgba(255,255,255,.3) 4px 6px); }
.dash-trend-placeholder { width: 9px; height: 13px; border: 1px dashed var(--ink-3); border-radius: 3px 3px 0 0; }
.dash-trend-month.is-future .dash-trend-placeholder { border-style: dotted; opacity: .65; }
.dash-trend-month.is-future .dash-trend-label { color: var(--ink-3); }
.dash-chart-hint { margin-top: 10px; font-size: .72rem; color: var(--ink-2); line-height: 1.45; }
.dash-table-details { margin-top: 5px; }
.dash-table-details > summary, .dash-more > summary, .dash-change-details > summary { min-height: 44px; display: flex; align-items: center; gap: 7px; width: fit-content; color: var(--brand-deep); font-size: .8rem; font-weight: 650; cursor: pointer; }
.dash-table-details > summary::before, .dash-more > summary::before, .dash-change-details > summary::before { content: '+'; font-weight: 500; font-size: 1.2rem; }
.dash-table-details[open] > summary::before, .dash-more[open] > summary::before, .dash-change-details[open] > summary::before { content: '−'; }
.dash-table-details > summary::-webkit-details-marker, .dash-more > summary::-webkit-details-marker, .dash-change-details > summary::-webkit-details-marker { display: none; }
.dash-table-wrap { max-width: 100%; overflow-x: auto; border-top: 1px solid var(--border); }
.dash-data-table { border-collapse: collapse; width: 100%; font-size: .72rem; font-variant-numeric: tabular-nums; }
.dash-data-table caption { padding: 9px 0; text-align: left; color: var(--ink-2); font-size: .69rem; line-height: 1.4; }
.dash-data-table th, .dash-data-table td { padding: 10px 6px; text-align: right; border-bottom: 1px solid var(--border); }
.dash-data-table th:first-child { padding-left: 0; text-align: left; }
.dash-data-table th { font-weight: 650; }
.dash-data-table th small { display: block; color: var(--ink-2); font-size: .61rem; font-weight: 400; white-space: nowrap; }
.dash-data-table th button { min-height: 44px; min-width: 44px; text-align: left; color: var(--brand-deep); font-weight: 700; }
.dash-data-table td { white-space: nowrap; }
.dash-categories > .dash-segmented { display: flex; width: 100%; margin-bottom: 5px; }
.dash-categories > .dash-segmented > button { flex: 1; }
.dash-category-list { margin-top: 6px; }
.dash-category-extra { margin-top: 0; border-top: 1px solid var(--dash-line); }
.dash-category-extra[hidden] { display: none; }
.dash-category-toggle { display: block; width: 100%; min-height: 44px; margin-top: 6px; color: var(--brand-deep); font-size: .82rem; font-weight: 650; text-align: left; }

.dash-category-row { display: flex; width: 100%; align-items: center; gap: 10px; text-align: left; min-height: 67px; padding: 12px 0; border-bottom: 1px solid var(--dash-line); }
.dash-category-list li:last-child .dash-category-row { border-bottom: 0; }
.dash-category-icon { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 10px; color: var(--brand); background: #F0F5F1; }
.dash-category-icon .icon { width: 18px; height: 18px; }
.dash-category-content { display: block; min-width: 0; flex: 1; }
.dash-category-top { display: flex; align-items: baseline; justify-content: space-between; gap: 9px; }
.dash-category-name { font-size: .84rem; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.dash-category-money { flex: none; font-size: .84rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.dash-category-bottom { display: flex; align-items: center; gap: 10px; margin-top: 7px; }
.dash-category-track { flex: 1; height: 5px; border-radius: 5px; background: #EEF1EB; overflow: hidden; }
.dash-category-track > span { display: block; height: 100%; border-radius: inherit; }
.dash-category-bottom > small { min-width: 32px; text-align: right; color: var(--ink-2); font-size: .67rem; font-variant-numeric: tabular-nums; }
.dash-more { margin-top: 4px; }
.dash-when-open { display: none; }
.dash-more[open] > summary .dash-when-closed { display: none; }
.dash-more[open] > summary .dash-when-open { display: inline; }
.dash-empty { padding: 25px 4px 14px; text-align: center; color: var(--ink-2); font-size: .84rem; line-height: 1.5; }
.dash-empty > .icon { width: 30px; height: 30px; color: var(--brand); margin-bottom: 8px; }
.dash-empty > .btn { margin-top: 16px; }
.dash-comparison-label { color: var(--ink-2); font-size: .77rem; margin-bottom: 15px; line-height: 1.45; }
.dash-comparison-progress { margin: -8px 0 14px; }
.dash-change-number { font-size: 1.2rem; line-height: 1.4; font-weight: 750; letter-spacing: -.035em; margin-bottom: 5px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dash-before-after { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; margin: 18px 0 8px; padding: 13px 0; border-top: 1px solid var(--dash-line); border-bottom: 1px solid var(--dash-line); }
.dash-before-after > span:first-child, .dash-before-after > span:last-child { display: flex; flex-direction: column; min-width: 0; gap: 3px; }
.dash-before-after > span:last-child { text-align: right; }
.dash-before-after small { color: var(--ink-2); font-size: .71rem; }
.dash-before-after strong { font-size: .97rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dash-before-after .icon { width: 17px; height: 17px; color: var(--ink-2); }
.dash-change-details li { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 11px 0; border-top: 1px solid var(--dash-line); font-size: .76rem; }
.dash-change-details li > div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.dash-change-details li > div > strong { font-weight: 650; overflow-wrap: anywhere; }
.dash-change-details li small { color: var(--ink-2); font-size: .67rem; line-height: 1.6; }
.dash-change-details li small > span { display: block; }
.dash-change-details li > span { flex: none; font-variant-numeric: tabular-nums; }
.dash-debt-total { font-size: 1.9rem; line-height: 1.25; font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dash-debt-total > small { font-size: .8rem; font-weight: 500; letter-spacing: 0; color: var(--ink-2); white-space: nowrap; }
.dash-debt-progress { height: 9px; border-radius: 8px; overflow: hidden; background: var(--surface-2); margin-top: 13px; }
.dash-debt-progress > span { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
.dash-debt-paid { margin-top: 7px; }
.dash-pending { display: flex; align-items: flex-start; gap: 7px; background: var(--warn-tint); color: var(--warn); border-radius: 10px; padding: 10px; margin-top: 14px; font-size: .75rem; line-height: 1.45; }
.dash-pending .icon { width: 16px; height: 16px; margin-top: 2px; }
.dash-debt-list { margin-top: 17px; }
.dash-debt-row { display: block; width: 100%; text-align: left; padding: 14px 0; border-top: 1px solid var(--dash-line); }
.dash-debt-row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: .83rem; }
.dash-debt-row-head > strong:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-debt-row-head > strong:last-child { flex: none; font-variant-numeric: tabular-nums; }
.dash-debt-row .dash-debt-progress { margin-top: 9px; height: 5px; }
.dash-debt-row-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; margin-top: 6px; color: var(--ink-2); }
.dash-debt-row-foot > small { font-size: .69rem; }
.dash-debts > .dash-more .dash-debt-list { margin-top: 0; }
.dash-detail-grid, .dash-bottom-grid { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr); }
.dashboard-live .history-recent { margin-top: 0; box-shadow: var(--shadow); border: 1px solid var(--border); }
@keyframes dash-arrive { from { opacity: .6; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 410px) {
  .dash-toolbar { flex-wrap: wrap; }
  .dash-period-nav { flex: 1; }
  .dash-toolbar > .dash-segmented { margin-left: auto; }
  .dash-panel { padding: 17px; }
  .dash-trend { gap: 2px; }
  .dash-trend-columns { padding: 0 1px; gap: 1px; }
}
@media (min-width: 600px) {
  .dash-detail-grid, .dash-bottom-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
  .dash-detail-grid .dash-panel, .dash-bottom-grid .dash-panel { padding: 18px; }
  .dash-bottom-grid .history-recent .history-row { grid-template-columns: 25px minmax(0, 1fr); gap: 7px; }
  .dash-bottom-grid .history-recent .history-row-amount { grid-column: 2; text-align: left; }
  .dash-bottom-grid .history-card-head { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .dash-panel { animation: none; }
  .dashboard-live *, .dashboard-live *::before, .dashboard-live *::after { scroll-behavior: auto; }
}
