/* Finances & NIL: compact statistical layout. Every color comes from the
   theme tokens in base.html, so all themes work. */
.fin { display: flex; flex-direction: column; gap: 14px; padding-bottom: 40px; }
.fin h2 { font-size: 16px; margin: 0 0 6px; }
.fin h3 { font-size: 14px; margin: 0 0 4px; color: var(--fg-bright); }
.fin-head { display: flex; flex-direction: column; gap: 8px; }
.fin-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; }
.fin-title h1 { margin: 0; font-size: 20px; line-height: 1.2; }
.fin-title h1 .fin-sub { color: var(--fg-dim); font-weight: 500; }
.fin-dyn { color: var(--fg-mid); font-size: 14px; }
.fin-season { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.fin-links { margin-left: auto; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; }
.fin-links a { text-decoration: underline; text-underline-offset: 3px; }
.fin-ctl, .fin-season select { min-height: 32px; padding: 0 8px; border-radius: var(--btn-radius, 4px); border: 1px solid var(--control-border); background: var(--bg-alt); color: var(--fg-bright); font: 400 14px var(--font-ui); }
.fin-btn { min-height: 32px; padding: 0 12px; border-radius: var(--btn-radius, 4px); border: 1px solid var(--control-border); background: var(--bg-alt); color: var(--fg-bright); font: 600 14px var(--font-ui); cursor: pointer; }
.fin-strip { display: flex; flex-wrap: wrap; gap: 2px 22px; margin: 0; padding: 6px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 14px; }
.fin-strip > div { display: flex; gap: 6px; align-items: baseline; }
.fin-strip dt { color: var(--fg-dim); }
.fin-strip dd { margin: 0; font-family: var(--font-num); font-variant-numeric: tabular-nums; color: var(--fg-bright); font-weight: 600; }
.fin-strip dd small { font-weight: 400; color: var(--fg-dim); font-size: 13px; }
.fin-tabs, .fin-subtabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.fin-tabs a, .fin-subtabs a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; white-space: nowrap; color: var(--fg-mid); text-decoration: none; border-bottom: 2px solid transparent; font-size: 15px; }
.fin-subtabs { border-bottom: 0; }
.fin-subtabs a { min-height: 30px; font-size: 14px; padding: 0 10px; }
.fin-tabs a:hover, .fin-subtabs a:hover { color: var(--fg-bright); text-decoration: none; }
.fin-tabs a[aria-current="page"], .fin-subtabs a[aria-current="page"] { color: var(--fg-bright); border-bottom-color: var(--accent); font-weight: 600; }
.fin-filters { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 14px; }
.fin-filters label { display: inline-flex; align-items: center; gap: 6px; color: var(--fg-mid); }
.fin-note { font-size: 13px; color: var(--fg-dim); margin: 0; }
.fin-note a { text-decoration: underline; text-underline-offset: 3px; }
.fin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 18px 28px; align-items: start; }
.fin-grid-main { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 1fr); gap: 18px 28px; align-items: start; }
.fin-grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px 24px; align-items: start; }

/* Tables */
.fin-scroll { overflow: auto; max-height: calc(100vh - 120px); border-top: 1px solid var(--line); }
.fin-scroll.short { max-height: none; }
.fin-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.fin-table th, .fin-table td { padding: 3px 8px; white-space: nowrap; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.fin-table thead th { position: sticky; top: 0; z-index: 2; background: var(--bg); color: var(--fg-dim); font-size: 12px; font-weight: 600; letter-spacing: .01em; border-bottom: 1px solid var(--control-border); }
.fin-table th.num, .fin-table td.num { text-align: right; font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.fin-table td.num { font-size: 13px; }
.fin-table tbody th[scope=row] { font-weight: 600; font-size: 13px; color: var(--fg-bright); }
.fin-table tbody tr > * { background: var(--bg); }
.fin-table tbody tr:hover > * { background: var(--row-hover); }
.fin-table .c-rank { position: sticky; left: 0; z-index: 1; width: 40px; min-width: 40px; max-width: 40px; color: var(--fg-dim); }
.fin-table .c-id { position: sticky; left: 40px; z-index: 1; }
.fin-table .c-id:first-child { left: 0; }
.fin-table thead .c-rank, .fin-table thead .c-id { z-index: 3; }
.fin-table tr.mine > * { font-weight: 700; }
.fin-table td.neg, .fin-neg { color: var(--red); }
.fin-table td.wrap { white-space: normal; min-width: 220px; }
.fin-table .sub { color: var(--fg-dim); font-weight: 400; }
.fin-used { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; }
.fin-bar { display: inline-block; width: 56px; height: 4px; background: var(--chip); border-radius: 2px; overflow: hidden; }
.fin-bar i { display: block; height: 4px; background: var(--meter, var(--accent)); }
.fin-bar.over i { background: var(--red); }
.fin-hbar { display: inline-block; height: 8px; border-radius: 2px; background: var(--accent); vertical-align: middle; }
.fin-empty { font-size: 14px; color: var(--fg-mid); margin: 6px 0; }
.fin-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 24px; margin: 0; font-size: 13px; }
.fin-kv > div { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.fin-kv dt { color: var(--fg-dim); }
.fin-kv dd { margin: 0; font-family: var(--font-num); font-variant-numeric: tabular-nums; color: var(--fg-bright); text-align: right; }

/* Charts */
.fin-svg { display: block; max-width: 640px; height: auto; font: 11px var(--font-ui); }
.fin-svg .lbl { fill: var(--fg-mid); }
.fin-svg .val, .fin-svg .tick { fill: var(--fg-dim); }
.fin-svg .bar, .fin-svg .box { fill: var(--accent); }
.fin-svg .box { fill-opacity: .35; stroke: var(--accent); stroke-width: 1; }
.fin-svg .med { stroke: var(--fg-bright); stroke-width: 2; }
.fin-svg .whisk { stroke: var(--fg-dim); stroke-width: 1; }
.fin-svg .grid { stroke: var(--line); stroke-width: 1; }
.fin-svg .ln { fill: none; stroke-width: 2; }
.fin-svg .ln.s1 { stroke: var(--accent); }
.fin-svg .ln.s2 { stroke: var(--fg-dim); stroke-dasharray: 5 3; }
.fin-svg .pt.s1 { fill: var(--accent); }
.fin-svg .pt.s2 { fill: var(--fg-dim); }
.fin-svg .pt { stroke: var(--bg); stroke-width: 2; }
.fin-legend { display: flex; gap: 14px; font-size: 13px; color: var(--fg-mid); margin: 2px 0 4px; }
.fin-legend i { display: inline-block; width: 16px; height: 0; border-top: 2px solid var(--accent); vertical-align: middle; margin-right: 5px; }
.fin-legend i.s2 { border-top: 2px dashed var(--fg-dim); }

/* Front office cards kept from the old team page, tightened. */
.fin-people { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px 28px; }
.fin-who { display: flex; gap: 12px; align-items: center; }
.fin-who img, .fin-noface { width: 56px; height: 56px; border-radius: 8px; flex-shrink: 0; background: var(--chip); }

@media (max-width: 768px) {
  .fin-tabs a, .fin-subtabs a, .fin-links a, .fin-ctl, .fin-btn, .fin-season select { min-height: 44px; }
  .fin-links a { display: inline-flex; align-items: center; }
  .fin-links { margin-left: 0; }
  .fin-grid, .fin-grid-main { grid-template-columns: 1fr; }
  .fin-scroll { max-height: 75vh; }
  .fin-table td.wrap { min-width: 180px; }
}

/* Sort links in headers of server sorted tables, and the pager. */
.fin-table a.th-link { color: inherit; text-decoration: none; display: inline-flex; align-items: center; min-height: 24px; }
.fin-table a.th-link:hover { color: var(--fg-bright); text-decoration: underline; }
.fin-pager { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.fin-pager .fin-btn { display: inline-flex; align-items: center; text-decoration: none; }
@media (max-width: 768px) { .fin-table a.th-link { min-height: 44px; } }
