/* Light dashboard refinement: a centered page, quiet overview, and total-first cards. */
:root {
 --accent:#0f766e;
 --accent-hover:#115e59;
 --accent-soft:#e6f4f1;
 --overview:#f0f8f6;
 --interest:#92400e;
 --danger:#b42318;
}
.shell { width:calc(100% - 64px); max-width:1120px; margin-inline:auto; }
.topbar { border-bottom:1px solid #e2e2e2; background:#fff; }
.topbar-inner { display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:88px; }
.brand { display:inline-flex; gap:0; margin:0; font-size:28px; line-height:36px; }
.brand .dot { margin:0; }
.topbar nav { display:flex; gap:8px; margin-top:0; padding-bottom:16px; overflow-x:auto; flex-wrap:nowrap; }
.topbar nav a { display:flex; align-items:center; min-height:44px; padding:10px 20px; white-space:nowrap; }
main.shell { width:calc(100% - 64px); max-width:1120px; margin:0 auto; padding:48px 0 32px; transform:none; }
.page-heading { margin-bottom:28px; align-items:center; }
h1 { margin:0 0 8px; font-size:36px; line-height:44px; }
.page-meta { margin:0; color:#5e5e5e; font-size:14px; line-height:20px; }
.stats { display:grid; grid-template-columns:1.5fr 1fr 1fr; gap:0; padding:28px 0; margin-bottom:32px; background:#f3f3f3; border:0; border-radius:16px; }
.stats article,.stats article:first-child { padding:0 28px; background:transparent; color:#000; border:0; border-radius:0; }
.stats article + article { border-left:1px solid #dedede; }
.stats article:first-child .eyebrow,.stats article:first-child .sub { color:#5e5e5e; }
.stats strong { margin:8px 0 0; font-size:32px; line-height:40px; }
.stats .sub { margin-top:4px; }
.toolbar { display:flex; align-items:center; gap:16px; margin-bottom:24px; flex-wrap:wrap; }
.search-field { position:relative; flex:1; min-width:220px; max-width:420px; }
.search-field input { max-width:none; padding-left:46px; background:#fff; border-color:#d8d8d8; }
.search-icon { position:absolute; left:18px; top:12px; color:#5e5e5e; font-size:24px; line-height:24px; pointer-events:none; }
.filter-chips { display:flex; gap:8px; overflow-x:auto; }
.filter-chips button { min-height:44px; padding:10px 16px; background:#efefef; color:#4b4b4b; font-size:14px; line-height:20px; white-space:nowrap; }
.filter-chips button[aria-pressed="true"] { background:#000; color:#fff; }
.filter-chips button:hover { background:#e2e2e2; color:#000; }
.filter-chips button[aria-pressed="true"]:hover { background:#282828; color:#fff; }
.toolbar #count { margin-left:auto; font-size:12px; }
.grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; }
.debt { overflow:visible; border-color:#e2e2e2; padding:28px; }
.card-top { margin-bottom:24px; }
.avatar { width:40px; height:40px; flex-basis:40px; font-size:16px; }
.card-top h2 { font-size:18px; line-height:24px; font-weight:500; }
.total { display:flex; flex-direction:column; align-items:flex-start; gap:4px; padding:0; margin:0 0 24px; border:0; }
.total span { font-size:14px; line-height:20px; text-transform:none; }
.total strong { font-size:36px; line-height:44px; letter-spacing:normal; }
.details { padding-top:24px; border-top:1px solid #e2e2e2; gap:20px; }
.details label { text-transform:none; font-size:12px; }
.details b { font-size:16px; line-height:24px; font-weight:500; }
.card-actions { display:flex; justify-content:flex-end; margin-top:24px; }
.card-actions button { min-height:44px; padding:10px 18px; font-size:14px; }
.card-actions button span,.topbar button span { margin-left:8px; }
.card-menu { position:relative; margin:0 0 0 auto; padding:0; border:0; }
.card-menu summary { display:flex; align-items:center; justify-content:center; width:44px; height:44px; padding:0; border-radius:50%; list-style:none; color:#000; font-size:24px; }
.card-menu summary::-webkit-details-marker { display:none; }
.card-menu summary:hover,.card-menu[open] summary { background:#efefef; }
.menu-items { position:absolute; right:0; top:48px; z-index:2; min-width:204px; padding:8px; background:#fff; border:1px solid #e2e2e2; border-radius:12px; box-shadow:0 4px 16px #00000014; }
.menu-items button { display:block; width:100%; padding:12px; border-radius:8px; background:#fff; color:#000; text-align:left; font-size:14px; }
.menu-items button:hover { background:#efefef; }
dialog { position:fixed; width:calc(100% - 32px); max-width:480px; max-height:calc(100dvh - 48px); padding:32px; overflow-y:auto; border:1px solid #e2e2e2; border-radius:16px; background:#fff; color:#000; box-shadow:0 12px 48px #00000026; }
dialog::backdrop { background:#00000066; }
dialog h2 { margin:0 48px 8px 0; font-size:24px; line-height:32px; }
dialog p { font-size:14px; }
dialog label input { margin:8px 0 16px; }
dialog form > button { width:100%; margin-top:8px; }
dialog .dialog-close { position:absolute; top:16px; right:16px; width:44px; min-height:44px; padding:0; font-size:24px; line-height:24px; }
dialog.login .dialog-close { width:44px; margin:0; }
dialog .add-form { grid-template-columns:1fr; gap:4px; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
#empty { padding:48px 24px; background:#f3f3f3; border-radius:16px; text-align:center; color:#5e5e5e; }
footer { display:flex; justify-content:space-between; gap:16px; margin-top:48px; }
footer span:first-child { font-weight:500; color:#000; }
@media(max-width:767px) {
 .shell,main.shell { width:calc(100% - 32px); }
 .topbar-inner { min-height:76px; }
 main.shell { padding-top:32px; }
 .page-heading { align-items:flex-start; flex-wrap:wrap; gap:16px; }
 h1 { font-size:28px; line-height:36px; }
 .stats { grid-template-columns:repeat(2,minmax(0,1fr)); padding:24px 20px; }
 .stats article,.stats article:first-child { padding:0; }
 .stats article:first-child { grid-column:span 2; padding-bottom:20px; margin-bottom:20px; border-bottom:1px solid #dedede; }
 .stats article:nth-child(2) { border-left:0; }
 .stats article:nth-child(3) { padding-left:20px; }
 .stats article:first-child strong { font-size:32px; line-height:40px; }
 .stats strong { font-size:24px; line-height:32px; }
 .search-field { flex-basis:100%; max-width:none; min-width:0; }
 .filter-chips { max-width:calc(100% - 64px); gap:6px; }
 .filter-chips button { padding:10px 14px; }
 .toolbar { gap:12px; }
 .grid { grid-template-columns:1fr; gap:16px; }
 .debt { padding:24px; }
 .total strong { font-size:32px; line-height:40px; }
 dialog { padding:28px 24px; }
}

/* Restrained accents: keep cards and page white, emphasize actions and amounts. */
button,.button { background:var(--accent); color:#fff; }
button:hover,.button:hover { background:var(--accent-hover); }
button:active,.button:active { background:#134e4a; }
.secondary { background:#f3f4f4; color:#374151; border-color:#e2e6e5; }
.secondary:hover { background:#e7ecea; color:#111827; }
.topbar-inner > button { background:var(--accent); color:#fff; border-color:transparent; }
.topbar-inner > button:hover { background:var(--accent-hover); }
.topbar nav a.selected { background:var(--accent-soft); color:var(--accent-hover); }
.topbar nav a:hover { background:#f0f8f6; color:var(--accent-hover); }
.stats { background:var(--overview); }
.stats article + article,.stats article:first-child { border-color:#d3e6df; }
.stats article:first-child strong,.total strong { color:var(--accent-hover); }
.gold { color:var(--interest); }
.filter-chips button { background:#f2f4f3; color:#4b5563; }
.filter-chips button[aria-pressed="true"] { background:var(--accent-soft); color:var(--accent-hover); }
.filter-chips button:hover,.filter-chips button[aria-pressed="true"]:hover { background:#d5ece5; color:var(--accent-hover); }
.avatar { background:#edf6f2; color:var(--accent-hover); }
.card-actions button { background:var(--accent-soft); color:var(--accent-hover); border-color:transparent; }
.card-actions button:hover { background:#d5ece5; }
.menu-items button { background:#fff; color:#111827; }
.menu-items button:hover { background:var(--overview); color:var(--accent-hover); }
.notice { background:#edf8f1; color:#166534; border-color:#cce8d4; }
.alert { background:#fff1f0; color:var(--danger); border-color:#f3cfcb; }
button:focus-visible,a:focus-visible,summary:focus-visible,input:focus,select:focus { outline-color:var(--accent); }
.brand,footer span:first-child { color:#111827; }
.sort-field { width:224px; flex-shrink:0; }
.sort-field select { width:100%; max-width:none; min-height:48px; padding:12px 18px; border-radius:999px; background:#f0f8f6; color:#115e59; border-color:#d3e6df; font-size:14px; }
@media(max-width:767px) { .sort-field { flex:1; width:auto; } .sort-field select { max-width:none; } }
/* Responsive polish for real phones, tablets and desktop browsers. */
html { -webkit-text-size-adjust:100%; scroll-padding-top:24px; }
body { overflow-wrap:break-word; }
button,input,select,textarea { font-family:var(--font); }
input,select,textarea { font-size:16px; }
button,a,summary { -webkit-tap-highlight-color:transparent; touch-action:manipulation; }
a:focus-visible,button:focus-visible,summary:focus-visible { outline:3px solid #0f766e; outline-offset:3px; }
.topbar-inner { flex-wrap:wrap; padding-block:16px; }
.topbar-inner > .secondary { display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:10px 18px; border-radius:999px; margin-left:auto; }
.topbar-inner > form { margin:0; }
.stats strong,.total strong,.details b { font-variant-numeric:tabular-nums; letter-spacing:normal; overflow-wrap:anywhere; }
.details > div,.stats article,.card-top h2 { min-width:0; }
.card-top h2 { overflow-wrap:anywhere; }
.search-field input { min-height:48px; font-size:16px; }
.sort-field select { cursor:pointer; }
dialog { overscroll-behavior:contain; scrollbar-gutter:stable; }
body:has(dialog[open]) { overflow:hidden; }
dialog input { font-size:16px; }
footer { flex-wrap:wrap; line-height:1.6; letter-spacing:normal; }
@media (hover:hover) {
 .debt { transition:border-color .18s,box-shadow .18s; }
 .debt:hover { border-color:#bdd8cf; box-shadow:0 4px 20px #173b2d08; }
}
@media (min-width:768px) and (max-width:1024px) {
 .shell,main.shell { width:calc(100% - 48px); }
 .grid { gap:18px; }
 .debt { padding:24px; }
 .stats article,.stats article:first-child { padding-inline:22px; }
 .stats strong,.total strong { font-size:28px; line-height:1.3; }
}
@media (max-width:767px) {
 .brand { font-size:24px; line-height:32px; flex-shrink:0; }
 .topbar-inner { gap:8px; min-height:72px; }
 .topbar-inner button,.topbar-inner>.secondary { font-size:14px; padding:10px 14px; min-height:44px; }
 .topbar-inner > form button { padding-inline:12px; }
 main.shell { padding-top:24px; }
 .page-heading { margin-bottom:20px; }
 h1 { font-size:clamp(24px,6vw,28px); line-height:1.3; }
 .stats { padding:22px 20px; margin-bottom:24px; }
 .stats strong { font-size:clamp(20px,5.4vw,26px); line-height:1.3; }
 .stats article:first-child strong { font-size:clamp(28px,7.2vw,34px); line-height:1.3; }
 .toolbar { margin-bottom:20px; }
 .sort-field { min-width:0; }
 .sort-field select { font-size:16px; padding-inline:16px; }
 .debt { padding:22px; }
 .card-top { margin-bottom:18px; }
 .total { margin-bottom:20px; }
 .total strong { font-size:clamp(28px,7vw,34px); line-height:1.3; }
 .details { padding-top:20px; gap:18px 16px; }
 .details label { font-size:12px; letter-spacing:0; line-height:1.5; }
 .details b { font-size:16px; }
 dialog { padding:28px 20px; max-height:calc(100dvh - 24px); }
 footer { margin-top:32px; padding-bottom:env(safe-area-inset-bottom); }
}
@media (max-width:380px) {
 .stats { padding:20px 16px; }
 .stats article:nth-child(3) { padding-left:12px; }
 .debt { padding:20px 18px; }
 .topbar-inner:has(>form)>.secondary { margin-left:0; }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto!important; transition:none!important; animation:none!important; } }
