.kpi-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.kpi-toolbar h2 { margin: 0 0 5px; font-size: 18px; }
.kpi-toolbar p { margin: 0; color: var(--muted); }
.kpi-toolbar form { display: flex; align-items: end; gap: 8px; }
.kpi-toolbar label { display: grid; gap: 6px; color: #64748b; font-size: 12px; font-weight: 700; }
.kpi-panel { overflow: hidden; }
.kpi-panel .table-wrap { min-height: 420px; }
.kpi-table { min-width: 2780px; }
.kpi-table th { min-width: 125px; white-space: normal; line-height: 1.4; vertical-align: bottom; }
.kpi-table th:first-child { min-width: 180px; }
.kpi-table th:nth-child(2) { min-width: 190px; }
.kpi-employee-filter { margin-top: 8px; text-transform: none; letter-spacing: 0; }
.kpi-employee-filter summary { min-width: 160px; }
.kpi-filter-apply { display: flex; align-items: center; justify-content: flex-end; gap: 7px; margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--line); }
.kpi-filter-apply button,.kpi-filter-apply a { padding: 7px 10px; border-radius: 7px; font-size: 12px; }
.kpi-filter-apply a { border: 1px solid var(--line); background: #fff; color: #64748b; }
.kpi-table th:nth-child(3) { min-width: 175px; }
.kpi-table td { text-align: right; vertical-align: middle; }
.kpi-table td:first-child,.kpi-table td:nth-child(2),.kpi-table td:nth-child(3) { text-align: left; }
.kpi-table tbody tr:hover { background: #fafbff; }
.kpi-table .employee-name { position: sticky; left: 0; z-index: 2; background: #fff; }
.kpi-table thead th:first-child { position: sticky; left: 0; z-index: 3; }
.kpi-table .period-cell { color: #64748b; white-space: nowrap; }
.kpi-table .page-cell small { display: block; max-width: 180px; overflow: hidden; color: #9aa3b4; text-overflow: ellipsis; white-space: nowrap; }
.kpi-table .calculated { background: #f5f3ff; color: #5b21b6; font-weight: 700; }
.kpi-table .performance { color: #0369a1; font-weight: 800; }
.kpi-table .commission { color: #047857; font-weight: 800; white-space: nowrap; }

@media(max-width:700px) {
  .kpi-toolbar { align-items: stretch; flex-direction: column; }
  .kpi-toolbar form { align-items: stretch; flex-direction: column; }
  .kpi-panel .table-wrap { min-height: 360px; }
}
