/* Focused admin financial report and compact responsive navigation. */
.financial-report-view { --financial-green:#12805a; --financial-red:#bd433d; }
.financial-report-hero {
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:24px;
  margin-bottom:16px;
  padding:22px 24px;
  border:1px solid #d7e7ed;
  border-radius:20px;
  background:linear-gradient(135deg,#f7fcfe 0%,#edf7fb 100%);
}
.financial-report-hero h1 { margin:4px 0 6px; color:#12384a; font-size:30px; letter-spacing:-.04em; }
.financial-report-hero p:last-child { margin:0; color:#667f8b; font-size:13px; }
.financial-report-hero .secondary-button { flex:0 0 auto; background:#fff; }

.financial-balance-card {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  margin-bottom:13px;
  padding:22px 24px;
  border-radius:19px;
  background:linear-gradient(120deg,#073f61,#0d6681);
  color:#fff;
  box-shadow:0 16px 36px rgba(6,58,84,.14);
}
.financial-balance-card>div { display:flex; align-items:center; gap:16px; min-width:0; }
.financial-balance-icon { display:grid; width:48px; height:48px; flex:0 0 auto; place-items:center; border-radius:14px; background:rgba(255,255,255,.12); color:#aee4f7; }
.financial-balance-icon svg { width:22px; }
.financial-balance-card>div>div { display:grid; gap:4px; min-width:0; }
.financial-balance-card small { color:#b7d7e3; font-size:11px; font-weight:800; }
.financial-balance-card strong { overflow:hidden; font-size:clamp(26px,2.3vw,36px); font-variant-numeric:tabular-nums; letter-spacing:-.035em; text-overflow:ellipsis; white-space:nowrap; }
.financial-balance-card p { margin:0; color:#bad5df; font-size:10px; }
.financial-balance-status { flex:0 0 auto; padding:8px 11px; border-radius:999px; font-size:10px; font-weight:850; }
.financial-balance-status.good { background:#daf5e8; color:#147754; }
.financial-balance-status.risk { background:#ffe5e2; color:#ab3e39; }
.financial-balance-status.neutral { background:rgba(255,255,255,.13); color:#e4f3f8; }

.financial-summary { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:11px; margin-bottom:16px; }
.financial-summary article { display:grid; gap:5px; min-height:104px; padding:17px 18px; border:1px solid #dbe7ec; border-radius:16px; background:#fff; box-shadow:0 9px 26px rgba(8,49,71,.045); }
.financial-summary article.inflow { border-color:#b7dfcb; background:linear-gradient(145deg,#eef9f4,#fff); }
.financial-summary article.investment { border-color:#abd8eb; background:linear-gradient(145deg,#edf8fd,#fff); }
.financial-summary article.investment strong { color:#1374a3; }
.financial-summary small { color:#687f8a; font-size:11px; font-weight:800; }
.financial-summary strong { color:#183d4e; font-size:clamp(17px,1.5vw,22px); font-variant-numeric:tabular-nums; letter-spacing:-.025em; }
.financial-summary .inflow strong { color:var(--financial-green); }
.financial-summary span { color:#8a9ba3; font-size:9px; }

.financial-project-card,.financial-transaction-card { margin-bottom:15px; }
.financial-count { padding:7px 10px; border-radius:999px; background:#eef5f8; color:#53717f; font-size:9px; font-weight:850; }
.financial-project-table { overflow:hidden; margin:0 -18px -18px; border-top:1px solid #e3ecef; border-radius:0 0 16px 16px; }
.financial-project-head,.financial-project-row { display:grid; grid-template-columns:minmax(230px,1.6fr) repeat(6,minmax(106px,.78fr)); align-items:center; gap:12px; min-width:1050px; }
.financial-project-head { padding:11px 18px; background:#f2f7f9; color:#718893; font-size:9px; font-weight:850; letter-spacing:.055em; text-transform:uppercase; }
.financial-project-row { width:100%; min-height:72px; padding:12px 18px; border:0; border-top:1px solid #edf2f4; background:#fff; color:#294956; font:inherit; font-size:11px; text-align:right; cursor:pointer; transition:.18s ease; }
.financial-project-row:hover { transform:translateY(-1px); background:#f2f9fc; box-shadow:inset 3px 0 #44a8d5,0 8px 22px rgba(8,49,71,.06); }
.financial-project-row:focus-visible { outline:3px solid rgba(44,142,190,.22); outline-offset:-3px; }
.financial-project-name { display:grid; grid-template-columns:38px minmax(0,1fr); align-items:center; gap:10px; min-width:0; text-align:left; }
.financial-project-name>i { display:grid; width:38px; height:38px; place-items:center; border-radius:11px; background:#e6f2f8; color:#176b94; font-size:9px; font-style:normal; font-weight:900; }
.financial-project-name>span { display:grid; gap:3px; min-width:0; }
.financial-project-name b { overflow:hidden; color:#173847; font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
.financial-project-name small { color:#81949d; font-size:9px; }
.financial-project-row>span:not(.financial-project-name) { font-variant-numeric:tabular-nums; white-space:nowrap; }
.financial-project-balance { font-weight:900; }
.financial-project-balance.good { color:var(--financial-green); }
.financial-project-balance.risk { color:var(--financial-red); }
.financial-project-balance.neutral { color:#6f858f; }

.financial-transaction-list { display:grid; margin:0 -18px -18px; }
.financial-transaction-row { display:grid; grid-template-columns:38px minmax(0,1fr) 150px 100px; align-items:center; gap:12px; min-height:67px; padding:11px 18px; border-top:1px solid #edf2f4; }
.financial-transaction-icon { display:grid; width:34px; height:34px; place-items:center; border-radius:10px; font-size:15px; font-weight:900; }
.financial-transaction-icon.in { background:#e1f5eb; color:var(--financial-green); }
.financial-transaction-icon.out { background:#fff0df; color:#aa6716; }
.financial-transaction-row>div { display:grid; gap:4px; min-width:0; }
.financial-transaction-row b { overflow:hidden; color:#203e4c; font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
.financial-transaction-row small { overflow:hidden; color:#7b9099; font-size:9px; text-overflow:ellipsis; white-space:nowrap; }
.financial-transaction-row strong { font-size:11px; font-variant-numeric:tabular-nums; text-align:right; white-space:nowrap; }
.financial-transaction-row strong.in { color:var(--financial-green); }
.financial-transaction-row strong.out { color:#a65e13; }
.financial-transaction-row time { color:#8598a1; font-size:9px; text-align:right; white-space:nowrap; }
.financial-empty { display:grid; min-height:180px; place-items:center; align-content:center; gap:7px; color:#728893; text-align:center; }
.financial-empty>span { display:grid; width:42px; height:42px; place-items:center; border-radius:12px; background:#edf5f8; color:#397894; }
.financial-empty svg { width:20px; }
.financial-empty b { color:#294956; font-size:12px; }
.financial-empty p { margin:0; font-size:10px; }

@media(max-width:1100px) {
  .financial-summary { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .financial-project-table { overflow-x:auto; scrollbar-width:thin; }
}

@media(max-width:700px) {
  .topbar .install-button { display:none; }
  .mobile-nav { grid-template-columns:repeat(auto-fit,minmax(54px,1fr)); gap:2px; }
  .mobile-nav:has(.admin-only[hidden]) { grid-template-columns:repeat(auto-fit,minmax(58px,1fr)); }
  .mobile-nav button { min-width:0; padding:7px 1px; }
  .mobile-nav button b { overflow:hidden; max-width:100%; text-overflow:ellipsis; white-space:nowrap; }
  .financial-report-hero { align-items:stretch; flex-direction:column; gap:16px; padding:18px; border-radius:17px; }
  .financial-report-hero h1 { font-size:25px; }
  .financial-report-hero p:last-child { font-size:12px; line-height:1.5; }
  .financial-report-hero .secondary-button { width:100%; justify-content:center; }
  .financial-balance-card { align-items:flex-start; flex-direction:column; padding:18px; }
  .financial-balance-card>div { align-items:flex-start; }
  .financial-balance-icon { width:42px; height:42px; }
  .financial-balance-card strong { font-size:25px; white-space:normal; }
  .financial-balance-card p { font-size:9px; line-height:1.45; }
  .financial-summary { grid-template-columns:1fr 1fr; gap:9px; }
  .financial-summary article { min-height:96px; padding:14px; }
  .financial-summary strong { font-size:16px; }
  .financial-project-card,.financial-transaction-card { padding:16px; }
  .financial-project-table { margin:0 -16px -16px; overflow:visible; border-radius:0; }
  .financial-project-head { display:none; }
  .financial-project-row { grid-template-columns:1fr 1fr; gap:10px 12px; min-width:0; padding:15px 16px; text-align:left; }
  .financial-project-name { grid-column:1/-1; padding-bottom:5px; }
  .financial-project-row>span:not(.financial-project-name) { display:grid; gap:3px; white-space:normal; }
  .financial-project-row>span:not(.financial-project-name)::before { content:attr(data-label); color:#81949d; font-size:8px; font-weight:750; }
  .financial-project-balance { padding:8px 10px; border-radius:9px; background:#f1f6f8; }
  .financial-transaction-list { margin:0 -16px -16px; }
  .financial-transaction-row { grid-template-columns:34px minmax(0,1fr) auto; gap:10px; padding:12px 16px; }
  .financial-transaction-row time { grid-column:2; text-align:left; }
  .financial-transaction-row strong { align-self:start; }
  .project-detail-tabs { position:sticky; top:calc(var(--topbar) + 7px); z-index:20; box-shadow:0 10px 24px rgba(8,49,71,.12); }
  .finance-detail-tabs { grid-template-columns:1fr 1fr; gap:5px; padding:5px; border-radius:13px; }
  .finance-detail-tabs button { display:flex; justify-content:center; min-height:42px; padding:8px 10px; text-align:center; }
  .finance-detail-tabs button>span:first-child,.finance-detail-tabs button small { display:none; }
  .finance-detail-tabs button b { font-size:10px; line-height:1.25; }
  .project-page-hero-actions { display:grid; grid-template-columns:1fr 1fr; }
  .project-page-hero-actions>* { width:100%; }
  .project-page-hero-actions .project-health { grid-column:1/-1; width:max-content; }
}

@media(max-width:390px) {
  .financial-summary { grid-template-columns:1fr; }
  .financial-summary article { min-height:84px; }
  .mobile-nav button b { font-size:6.5px; }
}

/* Final project-detail sizing overrides (this stylesheet loads last). */
#view-project-detail .project-page-metrics article>span:last-child { min-width:0; }
#view-project-detail .project-page-metrics b {
  overflow:visible;
  font-size:clamp(14px,1.25vw,18px);
  line-height:1.15;
  overflow-wrap:anywhere;
  text-overflow:clip;
  white-space:normal;
}
#view-project-detail .finance-pair-values b {
  overflow:visible;
  font-size:clamp(14px,1.3vw,17px);
  line-height:1.2;
  overflow-wrap:anywhere;
  text-overflow:clip;
  white-space:normal;
}
#view-project-detail .project-share-overview { align-items:start; }
#view-project-detail .project-share-overview>section { align-content:start; align-self:start; }
#view-project-detail .project-share-grid em,
#view-project-detail .share-value-pair small { overflow:visible; overflow-wrap:anywhere; text-overflow:clip; white-space:normal; }

@media(max-width:1350px) {
  #view-project-detail .project-page-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

@media(max-width:1200px) and (min-width:701px) {
  #view-project-detail .finance-pair-values { grid-template-columns:1fr; }
  #view-project-detail .finance-pair-arrow { width:24px; height:24px; margin:-4px 0; justify-self:center; transform:rotate(90deg); }
}
