/* ===== Team & roles → Performance (TEAM-04, built in v1.5): toolbar, KPI cards (shared .kpis), leaderboard table / phone cards, detail panel, incentive settings ===== */
.pf-bar-top{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:12px;position:relative;z-index:25}   /* lifted so the date popover sits above the table */
.pf-dates{display:flex;align-items:center;gap:10px;min-width:0}
.pf-note{margin-bottom:12px}

.pf-t tbody tr{cursor:pointer}
.pf-t tbody tr:focus-visible{outline:2px solid var(--brand-orange-ui);outline-offset:-2px}
.pf-t th.pf-sort{cursor:pointer;white-space:nowrap}
.pf-t th.pf-sort:hover,.pf-t th.pf-sort.on{color:var(--text-primary)}
.pf-t th.pf-sort svg{vertical-align:-2px;margin-left:2px;color:var(--brand-orange-ui)}
.pf-t td{white-space:nowrap}
.pf-rank{color:var(--text-muted);font-weight:600}
.pf-t tbody tr:first-child .pf-rank,.pf-card:first-child .pf-rank{color:var(--brand-orange-ui)}
.pf-dl{display:inline-flex;flex-direction:column;gap:4px}
.pf-bar{display:block;width:72px;height:4px;border-radius:9px;background:var(--bg-chip);overflow:hidden}
.pf-bar i{display:block;height:100%;border-radius:9px;background:var(--success)}
.pf-dl.low b{color:var(--negative)} .pf-dl.low .pf-bar i{background:var(--negative)}
.pf-gate{display:inline-flex;align-items:center;gap:4px;color:var(--negative);font-weight:600}
.pf-rules{display:flex;align-items:flex-start;gap:8px;margin-top:12px;line-height:19px;max-width:1100px}
.pf-rules svg{flex:none;margin-top:2px}

/* Phones: one card per person */
.pf-card .mc-top{gap:10px}
.pf-card .pf-rank{width:18px}
.pf-cgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 12px;margin-top:10px}
.pf-cgrid>div{display:flex;flex-direction:column;gap:2px;min-width:0}

/* Detail panel */
.pf-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:12px}
.pf-stats.two{grid-template-columns:repeat(2,minmax(0,1fr));margin:0}
.pf-stat{display:flex;flex-direction:column;gap:2px;padding:12px 14px;border-radius:14px;background:var(--bg-chip);min-width:0}
.pf-stat b{font-size:20px;line-height:26px;font-weight:600}
.pf-gated{margin-bottom:12px;background:color-mix(in srgb,var(--negative) 10%,var(--bg-chip));color:var(--negative)}
.pf-line{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1.2fr) minmax(0,1.6fr) 90px;gap:10px;align-items:center;padding:10px 0;border-top:1px solid var(--border);font-size:13px}
.pf-line>b{text-align:right}
.pf-basis{padding-top:8px}
.pf-two{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.pf-ord{display:grid;grid-template-columns:56px minmax(0,1fr) auto auto 16px;gap:10px;align-items:center;width:100%;padding:10px 4px;border-top:1px solid var(--border);text-align:left;font-size:13px;border-radius:8px;transition:background var(--t-fast)}
.pf-ord:hover{background:var(--row-sel)}
.pf-ord .nm{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* Incentive settings dialog */
.pf-set .rp-lv{display:flex;flex-direction:column;gap:6px}
.pf-rates{display:grid;grid-template-columns:minmax(0,1fr) 130px 110px;gap:8px 10px;align-items:center}
.pf-rates .tk .input{width:100%}
.pf-gmin{max-width:220px}
.pf-total{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 14px;border-radius:14px;background:var(--bg-chip)}
.pf-total b{font-size:20px;line-height:26px;font-weight:600}
.pf-set .input.bad{box-shadow:0 0 0 1.5px var(--negative)}

@media (max-width:1100px){ .pf-stats{grid-template-columns:repeat(2,minmax(0,1fr))} .pf-two{grid-template-columns:minmax(0,1fr)} }
@media (max-width:760px){
  .pf-dates{width:100%} .pf-dates .db-date{flex:1}
  .pf-line{grid-template-columns:minmax(0,1fr) auto} .pf-line>.caption{grid-column:1/-1;order:3} .pf-line>span.num{text-align:right}
  .pf-rates{grid-template-columns:minmax(0,1fr) 100px 90px}
}
/* Compact leaderboard: orders over amount in each cell, tighter padding, long headers may wrap */
.pf-t th,.pf-t td{padding-left:10px;padding-right:10px}
.pf-t th{white-space:normal;line-height:16px;vertical-align:bottom}
.pf-v{display:inline-flex;flex-direction:column;line-height:18px}
.pf-v .caption{font-size:12px}
.pf-cgrid .pf-v{flex-direction:row;gap:6px;align-items:baseline}
/* Width: the global table minimum (1240px) is too wide here. On narrow screens Speed, then the rank number, hide first;
   the Incentive column stays pinned at the right edge so it is always in view when the table scrolls sideways */
.pf-tbl{container-type:inline-size}
table.tbl.pf-t{min-width:1000px}
.pf-t th:last-child,.pf-t td:last-child{position:sticky;right:0;z-index:1;background:var(--bg-sidebar);box-shadow:inset 1px 0 0 var(--border)}
[data-theme="dark"] .pf-t th:last-child,[data-theme="dark"] .pf-t td:last-child{background:var(--bg-card)}
@container (max-width:1010px){ .pf-t col.pf-c-sp,.pf-t th:nth-child(10),.pf-t td:nth-child(10){display:none} table.tbl.pf-t{min-width:930px} }
@container (max-width:930px){ .pf-t col.pf-c-rank,.pf-t th:nth-child(1),.pf-t td:nth-child(1){display:none} table.tbl.pf-t{min-width:880px} }
