/* Shared Finance refinement. Loaded after legacy styles. */
:root{--bg:#080f1b;--panel:#101d30;--border:#2a3e59;--text:#edf3fc;--muted:#a7b7cd;--sidebar:216px;color-scheme:dark}
body{background:#080f1b;color:var(--text);line-height:1.6}
main{width:calc(100% - 64px);max-width:1500px;min-width:0;margin:0 auto;padding:32px 0}
.sidebar{background:#0b1523;padding:24px 14px}.brand{padding-left:8px}.sidebar nav{gap:5px}.sidebar nav a{font-size:13px;padding:10px 12px;min-height:44px}
.top{margin-bottom:24px;gap:16px}.top h1{font-size:28px;letter-spacing:-.035em;margin:4px 0 8px}.lead{font-size:14px;color:var(--muted)}
.eyebrow,.section-label{font-size:10px;letter-spacing:.14em;color:#94baf7}
.integration-card{padding:18px 22px;margin-bottom:20px;gap:18px;flex-wrap:wrap;background:#102137;border:1px solid var(--border);border-radius:14px}
.integration-main{min-width:0}.integration-main h2{font-size:15px}.integration-main p:last-child{font-size:12px;line-height:1.7}.integration-icon{width:36px;height:36px}.integration-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
button,select,input{font:inherit}button,select{min-height:40px}button{cursor:pointer}button:disabled{opacity:.55;cursor:wait}
.integration-actions button,.page-back{border:1px solid #3b5677;background:#172c46;color:#dfeaff;border-radius:8px;padding:8px 12px;font-size:12px}
:focus-visible{outline:3px solid #9dc1ff;outline-offset:3px}section[id],article[id]{scroll-margin-top:24px}
.kpis{gap:12px;margin-bottom:24px;grid-template-columns:repeat(5,minmax(0,1fr))}.kpis article{padding:20px 18px;min-height:140px;background:#101d30;border:1px solid var(--border);border-radius:12px;box-shadow:none}.kpis article:first-child{background:#122b3d;border-color:#37667a}.kpis label{font-size:12px;color:#b8c8df}.kpis strong{font-size:clamp(20px,1.8vw,30px);line-height:1.4;margin:12px 0 8px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.kpis small{font-size:11px;line-height:1.6}
#dashboard>.grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;align-items:start}.panel{border:1px solid var(--border);background:#101d30;border-radius:14px;box-shadow:none;padding:22px;min-width:0;min-height:0}.panel header{margin-bottom:18px;gap:12px;flex-wrap:wrap}.panel h2{font-size:17px}.panel header p{font-size:10px;color:#96b6df;letter-spacing:.1em}
.compact-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;align-items:start}.compact-grid .panel,#tax,#cardPayments,#history,#cashflow,#projectMonthlyRevenue{min-height:0}.compact-stack{gap:20px}.compact-grid .panel header{margin-bottom:18px}.schedule-summary{gap:12px}.schedule-summary strong{font-variant-numeric:tabular-nums}.schedule-item{padding:16px 0;border-bottom:1px solid var(--border)}.schedule-item-title{flex-wrap:wrap}.schedule-item-meta{color:#acbdd3;line-height:1.8}.schedule-item-actions button{min-height:36px}.schedule-delete{color:#ffc0c4!important}.schedule-badge{white-space:nowrap}.schedule-toolbar{gap:12px;flex-wrap:wrap}.schedule-toolbar select{max-width:100%}
#projectMonthlyRevenueList{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}#projectMonthlyRevenueList>div{display:flex;flex-direction:column;gap:4px;padding:10px 12px;background:#0c1829;border-radius:8px;font-size:12px}#projectMonthlyRevenueList strong{font-variant-numeric:tabular-nums;font-size:15px}
.history-table{overflow-x:auto}.history-head,.history-row{display:grid;grid-template-columns:110px minmax(200px,1fr) 70px 130px;gap:16px;padding:14px 12px;min-width:570px;border-bottom:1px solid var(--border);font-size:13px}.history-head{color:var(--muted);background:#0a1728}.history-row span:last-child{text-align:right;font-variant-numeric:tabular-nums}.history-row span:nth-child(2){overflow-wrap:anywhere}.empty-row{padding:32px 16px;color:var(--muted)}
.holdings-page .shell{display:block;max-width:1440px;width:calc(100% - 64px);min-height:0;margin:28px auto}.holdings-page .panel{margin-top:20px}.holdings-page .card{background:#101d30;border:1px solid var(--border);border-radius:12px;box-shadow:none}.holdings-page .card strong{font-size:28px}.holdings-page .table-wrap{overflow-x:auto}.holdings-page .table{min-width:1250px}.holdings-page .page-back{display:inline-block;margin-bottom:20px}.holdings-page .form-grid{gap:16px}.holdings-page input,.holdings-page select{min-height:44px}.holdings-page .trend{font-size:12px;color:var(--muted)}
@media(max-width:1250px){.kpis{grid-template-columns:repeat(3,minmax(0,1fr))}#dashboard>.grid{grid-template-columns:1fr}.compact-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:900px){.shell{grid-template-columns:1fr}.sidebar{position:static;height:auto;padding:14px 20px}.sidebar .brand{border:0;padding-bottom:8px}.sidebar nav{display:flex;overflow-x:auto;margin-top:8px;gap:8px}.sidebar nav a{flex-shrink:0}.sidebar .back{margin-top:12px}.compact-grid{grid-template-columns:1fr}main{width:calc(100% - 32px);padding:24px 0}.holdings-page .shell{width:calc(100% - 32px)}.integration-main p:last-child{max-width:100%}}
@media(max-width:560px){.kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.kpis article{padding:16px 12px;min-height:125px}.kpis article:last-child{grid-column:1/-1}.panel{padding:18px 14px}.top h1{font-size:24px}.integration-card{padding:16px}.integration-icon{display:none}#projectMonthlyRevenueList{grid-template-columns:repeat(2,minmax(0,1fr))}.schedule-summary{grid-template-columns:1fr}.holdings-page .summary-cards{grid-template-columns:repeat(2,minmax(0,1fr))}.holdings-page .form-grid{grid-template-columns:1fr}.holdings-page .top{flex-wrap:wrap}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*{transition:none!important}}

/* Match card edges within each row without clipping variable content. */
#dashboard > .grid,
#dashboard .compact-grid { align-items: stretch; }
#dashboard .compact-stack { align-self: stretch; grid-template-rows: auto 1fr; }
#dashboard .kpis { align-items: stretch; grid-auto-rows: 1fr; }
#dashboard .kpis article { display: flex; flex-direction: column; }
#dashboard .kpis article > label { min-height: 3.2em; }
#dashboard .kpis article > small { margin-top: auto; }
#dashboard .compact-grid > .panel,
#dashboard .compact-stack > .panel { align-self: stretch; }
#dashboard #assets { display: flex; flex-direction: column; }
#dashboard #assets > .total { margin-top: auto; padding-top: 16px; }
.holdings-page .summary-cards { align-items: stretch; grid-auto-rows: 1fr; }
@media (max-width: 900px) {
  #dashboard .compact-stack { grid-template-rows: auto; }
}
@media (max-width: 560px) {
  #dashboard .kpis { grid-auto-rows: auto; }
}
