:root{color-scheme:light;--bg:#f5f6f8;--surface:#fff;--surface2:#f0f2f5;--ink:#181c24;--muted:#69717e;--border:#e1e5eb;--accent:#161b24;--accentInk:#fff;--shadow:0 5px 24px rgba(18,24,34,.045)}
:root[data-theme=dark]{color-scheme:dark;--bg:#101216;--surface:#1b1f26;--surface2:#262c35;--ink:#f5f6f8;--muted:#adb6c3;--border:#353b45;--accent:#f4f6fa;--accentInk:#11151b;--shadow:0 5px 24px rgba(0,0,0,.15)}
*{box-sizing:border-box}html{font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Arial,sans-serif}body{margin:0;background:var(--bg);color:var(--ink);line-height:1.5}button{font:inherit;cursor:pointer}button:focus-visible,a:focus-visible{outline:3px solid #718fce;outline-offset:3px}a{color:inherit}.skip{position:absolute;top:-100px;left:12px;background:var(--surface);padding:10px;z-index:20}.skip:focus{top:10px}.app-shell{min-height:100vh;display:grid;grid-template-columns:264px minmax(0,1fr)}.sidebar{background:#11151b;color:#f4f5f7;padding:26px 16px;display:flex;flex-direction:column;min-height:100vh}.brand{display:block;padding:7px 5px 22px}.brand img{width:100%;height:auto;display:block}.sidebar-label{font-size:10px;letter-spacing:.16em;color:#a2a9b3;margin:24px 12px 10px;font-weight:500}.nav{display:grid;gap:5px}.nav-item{text-align:left;border:0;background:transparent;color:#bec5d0;padding:12px 14px;border-radius:10px;min-height:44px}.nav-item:hover,.nav-item.active{background:#303742;color:#fff}.sidebar-foot{margin-top:auto;padding:26px 12px 0;font-size:12px;color:#c5cbd4}.sidebar-foot span{color:#8f98a7}.workspace{min-width:0;display:flex;flex-direction:column}.topbar{background:var(--surface);border-bottom:1px solid var(--border);padding:17px clamp(16px,3vw,38px);display:flex;justify-content:space-between;align-items:center;gap:14px;min-height:88px}.top-title{display:grid;gap:1px}.top-title strong{font-size:20px}.eyebrow{color:var(--muted);font-size:11px;letter-spacing:.12em;font-weight:500;margin:0}.top-actions{display:flex;align-items:center;gap:12px}.preview-tag,.pill{font-size:11px;font-weight:500;letter-spacing:.04em;border:1px solid var(--border);background:var(--surface2);padding:7px 10px;border-radius:999px}.theme-button,.icon-button{min-height:44px;padding:8px 13px;border:1px solid var(--border);background:var(--surface);color:var(--ink);border-radius:10px}.mobile-only{display:none}main{padding:clamp(16px,3vw,38px);width:100%;max-width:1600px;margin:0 auto;flex:1}.page-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:22px}.page-heading h1{font-size:clamp(26px,3vw,34px);letter-spacing:-.035em;line-height:1.2;margin:7px 0}.muted{color:var(--muted)}.page-heading .muted{margin:0}.notice{padding:13px 16px;border:1px solid var(--border);border-radius:12px;background:var(--surface);margin-bottom:22px;font-size:13px}.stats-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}.stat-card,.panel{background:var(--surface);border:1px solid var(--border);border-radius:16px;box-shadow:var(--shadow)}.stat-card{min-height:224px;padding:22px 16px;display:flex;flex-direction:column;align-items:center;text-align:center;justify-content:center;gap:9px}.stat-card.featured{grid-column:span 2;align-items:stretch;text-align:center;padding:24px}.stat-icon{width:40px;height:40px;border-radius:12px;background:var(--surface2);display:grid;place-items:center;font-size:23px;font-weight:500;margin:0 auto}.stat-card h2{font-size:14px;font-weight:500;margin:0}.stat-value{font-size:clamp(27px,3.4vw,39px);font-weight:500;letter-spacing:-.045em;line-height:1.15;margin:0;font-variant-numeric:tabular-nums}.stat-help{color:var(--muted);font-size:12px;margin:0}.receivable-breakdown{border-top:1px solid var(--border);margin-top:12px;padding-top:11px;display:grid;gap:8px;text-align:left}.receivable-breakdown div{display:flex;justify-content:space-between;gap:12px;font-size:12px}.receivable-breakdown strong{white-space:nowrap;font-variant-numeric:tabular-nums}.small{font-size:12px}.featured .small{margin:5px 0 0}.two-column{display:grid;grid-template-columns:1.2fr 1fr;gap:16px;margin-top:16px}.panel{padding:23px}.panel-head{display:flex;justify-content:space-between;align-items:center;gap:12px}.panel h2{font-size:16px;margin:0}.subtle{font-size:12px;color:var(--muted)}.legend{display:flex;flex-wrap:wrap;gap:10px 18px;margin:22px 0 13px;font-size:12px}.legend span{display:flex;align-items:center;gap:6px}.dot{display:inline-block;width:10px;height:10px;border-radius:3px}.a,.bar-a{background:#4e667f}.b,.bar-b{background:#97a6b6}.c,.bar-c{background:#c8d1dc}.stacked-bar{height:15px;display:flex;overflow:hidden;border-radius:100px;margin-bottom:18px}.status-list{padding:0;margin:18px 0 0;list-style:none;display:grid;gap:14px;font-size:13px}.status-list li{display:flex;align-items:center;gap:10px}.status-dot{height:10px;width:10px;border-radius:50%;flex:none}.complete{background:#329e72}.planned{background:#adb4bf}.footer{padding:20px;text-align:center;color:var(--muted);font-size:12px}.hidden{display:none!important}.placeholder{text-align:center;max-width:650px;margin:36px auto;padding:44px 26px}.placeholder-icon{font-size:48px;color:var(--muted)}.placeholder p{color:var(--muted)}
@media(max-width:1100px){.app-shell{grid-template-columns:220px minmax(0,1fr)}.stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.two-column{grid-template-columns:1fr}}
@media(max-width:700px){.app-shell{display:block}.sidebar{position:fixed;z-index:10;top:0;bottom:0;left:0;width:min(82vw,300px);transform:translateX(-102%);transition:transform .2s;box-shadow:0 0 40px #0003;overflow-y:auto}.sidebar.open{transform:translateX(0)}.mobile-only{display:inline-flex;align-items:center}.topbar{min-height:72px;padding:12px 16px}.top-title strong{font-size:17px}.top-title .eyebrow{font-size:9px}.preview-tag{display:none}.page-heading{align-items:flex-start;flex-direction:column}.page-heading .pill{align-self:flex-start}.stats-grid{grid-template-columns:1fr}.stat-card.featured{grid-column:auto}.stat-card{min-height:170px}.two-column{grid-template-columns:1fr}.panel{padding:18px}.footer{font-size:11px}.receivable-breakdown div{font-size:11px}}
@media(max-width:350px){.top-actions{gap:4px}.theme-button{padding:8px;font-size:12px}.receivable-breakdown div{flex-wrap:wrap}.receivable-breakdown strong{margin-left:auto}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important}}
@media print{.sidebar,.topbar,.footer,.theme-button{display:none!important}.app-shell{display:block}main{padding:0}.stat-card,.panel{box-shadow:none;break-inside:avoid}.notice{display:none}}

/* Milestone frontend refinement */
.brand{display:flex;align-items:center;gap:12px;padding:7px 5px 22px;text-decoration:none;min-width:0}
.brand-mark{width:45px;height:45px;flex:0 0 45px;border-radius:12px;background:#303742;display:grid;place-items:center;color:#f4f5f7}
.brand-text{display:flex;flex-direction:column;gap:3px;min-width:0}.brand-text strong{font-size:19px;letter-spacing:-.04em;line-height:1.25;color:#f4f5f7}.brand-text small{font-size:9px;letter-spacing:.07em;line-height:1.4;font-weight:500;color:#aab2bf;white-space:nowrap}
.theme-button{width:44px;height:44px;display:grid;place-items:center;padding:0}.theme-button svg{width:21px;height:21px}
.stat-card.featured{grid-column:auto;align-items:center;padding:22px 16px}.receivable-card{position:relative;padding-top:30px}.info-button{position:absolute;top:11px;right:11px;width:36px;height:36px;display:grid;place-items:center;border:0;border-radius:9px;background:transparent;color:var(--muted)}.info-button:hover{background:var(--surface2);color:var(--ink)}
.receivables-dialog{width:min(440px,calc(100vw - 28px));max-height:min(85vh,650px);overflow:auto;background:var(--surface);color:var(--ink);border:1px solid var(--border);border-radius:16px;padding:22px;box-shadow:0 20px 70px #0006}.receivables-dialog::backdrop{background:rgba(0,0,0,.62)}.dialog-head{display:flex;justify-content:space-between;align-items:center;gap:12px}.dialog-head h2{font-size:19px;margin:0}.receivables-rows{display:grid;gap:14px;margin:24px 0}.receivables-rows>div{display:flex;justify-content:space-between;gap:12px;align-items:baseline;font-size:13px}.receivables-rows strong{white-space:nowrap;font-variant-numeric:tabular-nums}.receivables-rows .receivables-total{border-top:1px solid var(--border);padding-top:14px;font-size:15px}
.nav-backdrop{display:none}.sidebar-close{display:none}
@media(max-width:700px){
 .nav-backdrop{display:block;position:fixed;inset:0;background:rgba(0,0,0,.65);z-index:29;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .2s,visibility .2s}
 body.nav-open .nav-backdrop{opacity:1;visibility:visible;pointer-events:auto;touch-action:none}
 .sidebar{z-index:30;overscroll-behavior:contain}.sidebar-close{display:grid;place-items:center;position:absolute;right:12px;top:12px;color:#f4f5f7;background:#303742;border-color:#404854;font-size:25px;line-height:1;width:40px;height:40px;min-height:40px;padding:0}
 body.nav-open{overflow:hidden;touch-action:none}body.nav-open .workspace{pointer-events:none}
 .brand{padding-right:35px}.brand-text strong{font-size:18px}.brand-text small{font-size:8px}
 .stats-grid{grid-template-columns:1fr}.stat-card{min-height:190px}
}
@media(min-width:701px) and (max-width:1100px){.stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Milestone 6 refinements */
/* Segoe UI is preferred to match Windows typography; fallbacks remain platform-dependent. */
html{font-family:Inter,Arial,system-ui,sans-serif}
.sidebar-close{display:none!important}
@media(max-width:700px){.brand{padding-right:5px}}
.receivable-card{padding-top:22px}
.receivable-amount{display:flex;align-items:center;justify-content:center;gap:5px;max-width:100%}
.receivable-amount .stat-value{font-size:clamp(24px,2.8vw,35px)}
.receivable-amount .info-button{position:static;flex:0 0 36px;width:36px;height:36px}
.logout-button{border:1px solid var(--border);border-radius:10px;padding:9px 12px;background:var(--surface);color:var(--ink);min-height:44px;font-size:13px}
.logout-button:hover{background:var(--surface2)}
.signed-in-name{font-size:12px;color:var(--muted);max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:700px){.signed-in-name{display:none}.logout-button{padding:8px 9px;font-size:12px}.top-actions{gap:6px}}

/* Milestone 6 polish: consistent Inter and visible signed-in identity */
html,body,button,input{font-family:"Inter",Arial,sans-serif}
.signed-in-name{font-size:14px;font-weight:500;color:var(--ink);max-width:230px;display:block;line-height:1.3}
.user-identity{display:flex;align-items:center;gap:9px;min-width:0;padding:6px 10px;border:1px solid var(--border);border-radius:11px;background:var(--surface2)}
.user-avatar{display:grid;place-items:center;flex:0 0 30px;width:30px;height:30px;border-radius:9px;background:var(--surface);color:var(--ink)}
.user-identity-text{min-width:0;display:grid;gap:1px}
.user-role{font-size:10px;color:var(--muted);font-weight:500}
@media(max-width:700px){.topbar{gap:8px}.top-title{display:none}.top-actions{gap:6px;min-width:0;flex:1;justify-content:flex-end}.user-identity{min-width:0;flex:1;padding:4px 6px;border:0;background:transparent;gap:6px}.user-avatar{width:28px;height:28px;flex-basis:28px}.signed-in-name{display:block;font-size:12px;max-width:none}.user-role{font-size:9px}.logout-button{font-size:11px;padding:6px 7px}.theme-button{width:40px;height:40px;flex:0 0 40px}}

/* Milestone 6 typography and signed-in identity refinement */
html,body,button,input,select,textarea{font-family:"Segoe UI",system-ui,-apple-system,BlinkMacSystemFont,"Roboto","Helvetica Neue",Arial,sans-serif}
.user-identity{gap:0;padding:5px 10px}
.user-identity-text{min-width:0}
.signed-in-name{font-size:14px;font-weight:500;max-width:240px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media(max-width:700px){
 .topbar{gap:6px;padding-inline:10px}
 .top-actions{gap:6px;min-width:0;flex:1;justify-content:flex-end}
 .user-identity{flex:1;min-width:0;padding:3px 4px;border:0;background:transparent}
 .signed-in-name{display:block;max-width:100%;font-size:12px}
 .user-role{font-size:10px}
 .logout-button{flex:none;white-space:nowrap}
 .preview-tag{display:none}
}

/* Milestone 6 final: Google Sans Flex, self-hosted, weights 200–500 */
@font-face{font-family:"Google Sans Flex";src:url("/assets/fonts/GoogleSansFlex-Variable.woff2") format("woff2");font-style:normal;font-weight:200 500;font-display:swap}
:root{font-synthesis: none}
html,body,button,input,select,textarea,option,dialog{font-family:"Google Sans Flex",system-ui,sans-serif}
body{font-weight:400}
.sidebar-label,.eyebrow,.subtle,.stat-help,.footer,.sidebar-foot,.login-foot{font-weight:300}
.top-title strong,.brand-text strong,.page-heading h1,.stat-value,.stat-card h2,.panel h2,.login-card h1{font-weight:500}
.nav-item,.login-card input,.login-card button,.theme-button{font-weight:400}
/* Shared desktop/mobile account dropdown */
.account-menu{position:relative;min-width:0;flex:none}
.account-trigger{display:flex;align-items:center;gap:9px;min-height:44px;max-width:min(260px,42vw);padding:6px 11px;border:1px solid var(--border);border-radius:11px;background:var(--surface2);color:var(--ink);text-align:left;font-weight:400}
.account-trigger:hover,.account-trigger[aria-expanded="true"]{background:var(--surface);border-color:var(--muted)}
.account-trigger:focus-visible,.account-logout:focus-visible{outline:3px solid #718fce;outline-offset:2px}
.account-trigger .user-identity-text{min-width:0;display:grid;gap:1px}
.account-trigger .signed-in-name{display:block;max-width:100%;min-width:0;font-size:14px;font-weight:500;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.account-trigger .user-role{display:block;font-size:11px;font-weight:300;line-height:1.2;color:var(--muted)}
.account-chevron{flex:0 0 16px;transition:transform .15s;color:var(--muted)}
.account-trigger[aria-expanded="true"] .account-chevron{transform:rotate(180deg)}
.account-dropdown{position:absolute;top:calc(100% + 6px);right:0;z-index:50;min-width:170px;background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:6px;box-shadow:0 16px 45px #0004}
.account-dropdown[hidden]{display:none!important}
.account-logout{width:100%;display:flex;align-items:center;gap:10px;border:0;border-radius:8px;padding:11px 12px;text-align:left;color:var(--ink);background:transparent;font-weight:400}
.account-logout:hover{background:var(--surface2)}
@media(max-width:700px){.top-actions{flex:1;min-width:0;justify-content:flex-end}.account-trigger{max-width:min(55vw,230px);padding:5px 8px;gap:5px}.account-trigger .signed-in-name{font-size:12px}.account-trigger .user-role{font-size:10px}.account-chevron{flex-basis:13px;width:13px}.theme-button{flex:0 0 40px}}
@media(max-width:350px){.account-trigger{max-width:49vw}}

/* M6 header alignment and account-menu polish (2026-11-21) */
.topbar{padding-block:20px;min-height:0;align-items:center}
.top-title{gap:4px;line-height:1.25}
.top-title .eyebrow{line-height:1.35}
.top-title strong{line-height:1.25}
.account-trigger{min-height:52px;padding:8px 12px;gap:10px;background:var(--surface);border-color:var(--border);border-radius:12px}
.account-trigger:hover,.account-trigger[aria-expanded="true"]{background:var(--surface2);border-color:var(--border)}
.account-trigger .user-identity-text{gap:6px}
.account-trigger .signed-in-name,.account-trigger .user-role{line-height:1.2}
.account-trigger:focus-visible,.account-logout:focus-visible{outline:2px solid #718fce;outline-offset:2px}
.account-dropdown{top:calc(100% + 5px);min-width:150px;padding:4px;border-radius:10px;box-shadow:0 8px 24px #0003}
.account-logout{min-height:38px;padding:8px 10px;gap:8px;font-size:13px}
.account-logout svg{width:15px;height:15px;flex:none}
@media(max-width:700px){.topbar{padding-block:14px}.account-trigger{min-height:48px;padding:6px 9px}.account-trigger .user-identity-text{gap:5px}}

/* M6 account menu alignment: shared text rhythm and exact dropdown width */
.top-title,
.account-trigger .user-identity-text {
  gap: 6px;
}
.top-title .eyebrow,
.top-title strong,
.account-trigger .signed-in-name,
.account-trigger .user-role {
  line-height: 1.25;
}
.account-menu {
  position: relative;
  display: inline-block;
  width: max-content;
  max-width: 100%;
}
.account-trigger {
  width: 100%;
  box-sizing: border-box;
}
.account-dropdown {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  left: 0;
  right: auto;
}
.account-trigger:focus-visible,
.account-logout:focus-visible {
  outline: 2px solid var(--muted);
  outline-offset: 1px;
}
