:root {
  color-scheme: light;
  --brand-yellow: #f6c400;
  --brand-yellow-soft: #fff4bf;
  --brand-yellow-pale: #fff9dd;
  --brand-black: #050505;
  --accent: #f6c400;
  --accent-dark: #050505;
  --accent-soft: #fff4bf;
  --amber: #f6c400;
  --bg: #f7f6f0;
  --border: #d9dee7;
  --danger: #b42318;
  --danger-soft: #fde8e5;
  --ink: #111111;
  --muted: #666a73;
  --panel: #ffffff;
  --shadow: 0 10px 30px rgba(35, 45, 65, 0.08);
  --staff-bg: #f6c400;
  --staff-panel: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-dark);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 12px 10px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

td {
  color: #303846;
}

textarea {
  resize: vertical;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #ffffff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  align-items: center;
  color: var(--ink);
  display: flex;
  gap: 12px;
}

.brand-mark,
.brand-logo {
  align-items: center;
  background: var(--accent);
  border-radius: 8px;
  color: var(--brand-black);
  display: inline-flex;
  font-weight: 800;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.brand-logo {
  object-fit: cover;
}

.brand small,
.topbar-kicker,
.eyebrow {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-list a {
  border-radius: 8px;
  color: #3d4654;
  font-weight: 700;
  padding: 10px 12px;
}

.nav-list a.active,
.nav-list a:hover {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.staff-body {
  background:
    linear-gradient(140deg, rgba(11, 107, 87, 0.16), rgba(183, 121, 31, 0.12)),
    var(--staff-bg);
  color: #eef5f2;
}

.staff-page {
  display: grid;
  gap: 20px;
  margin: 0 auto;
  max-width: 1240px;
  min-height: 100vh;
  padding: 28px;
}

.staff-hero {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.staff-brand {
  color: #9de3d1;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.staff-hero h1 {
  color: #ffffff;
  font-size: 42px;
  line-height: 1.1;
  margin: 8px 0;
}

.staff-hero p {
  color: #bdd1ca;
  margin: 0;
}

.staff-filter,
.staff-scoreboard,
.race-cards,
.podium,
.staff-grid {
  display: grid;
  gap: 14px;
}

.staff-filter {
  align-items: end;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  grid-template-columns: minmax(280px, 1.4fr) repeat(3, minmax(140px, 1fr)) auto;
  padding: 16px;
}

.range-tabs {
  background: #eef2f4;
  border-radius: 8px;
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 4px;
}

.range-tabs label {
  display: block;
}

.range-tabs input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.range-tabs span {
  align-items: center;
  border-radius: 6px;
  color: #4b5563;
  display: flex;
  font-size: 13px;
  font-weight: 900;
  justify-content: center;
  min-height: 34px;
  padding: 6px 8px;
  text-align: center;
}

.range-tabs input:checked + span {
  background: #ffffff;
  color: var(--accent-dark);
  box-shadow: 0 1px 8px rgba(20, 30, 40, 0.08);
}

.staff-scoreboard {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.staff-stat,
.staff-panel,
.race-card,
.podium-card {
  background: var(--staff-panel);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.16);
  color: var(--ink);
}

.staff-stat {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.staff-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.staff-stat strong {
  font-size: 24px;
  line-height: 1.15;
}

.race-cards {
  grid-template-columns: 1.35fr 1fr;
}

.race-card {
  display: grid;
  gap: 8px;
  min-height: 174px;
  padding: 20px;
}

.race-card h2 {
  font-size: 24px;
  line-height: 1.15;
  margin: 0;
}

.race-card strong {
  font-size: 32px;
  line-height: 1.05;
}

.race-card p {
  color: var(--muted);
  font-weight: 800;
  margin: 0;
}

.leader-card {
  background: linear-gradient(135deg, #fff7dc, #ffffff);
  border-color: #e8c56b;
}

.chase-card {
  background: linear-gradient(135deg, #e7f4ef, #ffffff);
  border-color: #b7ded2;
}

.podium {
  align-items: end;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.podium-card {
  display: grid;
  gap: 8px;
  min-height: 184px;
  padding: 20px;
}

.podium-card.rank-1 {
  background: #fff8e6;
  border-color: #e8c56b;
  min-height: 220px;
}

.podium-card.rank-2,
.podium-card.rank-3 {
  background: #ffffff;
}

.podium-rank {
  align-items: center;
  background: var(--accent);
  border-radius: 8px;
  color: #ffffff;
  display: inline-flex;
  font-size: 18px;
  font-weight: 900;
  height: 40px;
  justify-content: center;
  width: 52px;
}

.podium-card h2 {
  font-size: 24px;
  line-height: 1.15;
  margin: 0;
}

.podium-card p,
.podium-card small {
  color: var(--muted);
  margin: 0;
}

.podium-card strong {
  font-size: 28px;
}

.staff-grid {
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.8fr);
}

.staff-panel {
  padding: 18px;
}

.staff-panel-header {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.staff-panel-header h2 {
  margin: 2px 0 0;
}

.staff-panel-header > span {
  color: var(--muted);
  font-weight: 800;
}

.staff-ranking,
.staff-side,
.recent-list {
  display: grid;
  gap: 12px;
}

.staff-rank-row {
  border: 1px solid #e1e6ee;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: 48px minmax(0, 1fr);
  padding: 12px;
}

.staff-rank-row.is-leader {
  background: #fffaf0;
  border-color: #e8c56b;
}

.staff-rank-number {
  align-items: center;
  background: #eef1f5;
  border-radius: 8px;
  color: #445061;
  display: inline-flex;
  font-size: 18px;
  font-weight: 900;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.staff-rank-main {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-width: 0;
}

.staff-rank-main strong {
  font-size: 16px;
}

.staff-rank-main small,
.gap-note,
.recent-list small {
  color: var(--muted);
}

.staff-rank-row .bar-track,
.staff-rank-row .staff-badges,
.staff-rank-row .gap-note {
  grid-column: 2;
}

.staff-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.staff-badges span {
  background: #eef1f5;
  border-radius: 999px;
  color: #4b5563;
  font-size: 11px;
  font-weight: 900;
  padding: 4px 8px;
  text-transform: uppercase;
}

.leader-note {
  color: var(--accent-dark);
  font-weight: 800;
}

.recent-list article {
  align-items: center;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 0;
}

.recent-list article:last-child {
  border-bottom: 0;
}

.recent-list span {
  font-weight: 900;
  white-space: nowrap;
}

.sidebar-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 16px;
}

.main-shell {
  min-width: 0;
}

.topbar {
  align-items: center;
  background: rgba(246, 247, 249, 0.92);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  min-height: 72px;
  padding: 16px 28px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.content {
  display: grid;
  gap: 20px;
  padding: 28px;
}

.auth-page {
  align-items: center;
  display: grid;
  min-height: 100vh;
  padding: 24px;
}

.login-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  margin: 0 auto;
  max-width: 880px;
  padding: 36px;
  width: 100%;
}

.login-copy h1,
.page-heading h1 {
  font-size: 32px;
  line-height: 1.15;
  margin: 8px 0;
}

.login-copy p,
.page-heading p,
.empty-state p {
  color: var(--muted);
  margin: 0;
}

.auth-form,
.stack-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
}

label > span {
  color: #3d4654;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  background: #ffffff;
  border: 1px solid #cdd4df;
  border-radius: 8px;
  color: var(--ink);
  min-height: 42px;
  padding: 9px 11px;
  width: 100%;
}

textarea {
  min-height: 84px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 107, 87, 0.14);
  outline: none;
}

.button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  display: inline-flex;
  font-weight: 800;
  gap: 8px;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  white-space: nowrap;
}

.button-primary {
  background: var(--brand-black);
  color: #ffffff;
}

.button-primary:hover {
  background: #242424;
  color: #ffffff;
}

.button-muted {
  background: #eef1f5;
  color: #2f3846;
}

.button-muted:hover {
  background: #e1e6ee;
  color: #202733;
}

.button-ghost {
  background: #ffffff;
  border-color: var(--border);
  color: #364152;
}

.button-danger {
  background: var(--danger);
  color: #ffffff;
}

.button-danger:hover {
  background: #8f1d14;
  color: #ffffff;
}

.full-width {
  width: 100%;
}

.page-heading {
  align-items: end;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.page-heading.compact {
  align-items: center;
}

.filter-bar {
  align-items: end;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(140px, 1fr)) auto;
  padding: 16px;
}

.compact-filter {
  box-shadow: none;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: 16px;
}

.compact-filter > * {
  min-width: 0;
}

.filter-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.metric-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.metric-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.metric-card strong {
  font-size: 24px;
  line-height: 1.2;
}

.dashboard-grid,
.split-layout {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.split-layout {
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
}

.panel {
  min-width: 0;
  padding: 18px;
}

.wide-panel,
.narrow-panel {
  min-width: 0;
}

.narrow-panel {
  max-width: 680px;
}

.panel-header {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-header h2 {
  font-size: 18px;
  margin: 2px 0 0;
}

.rank-list {
  display: grid;
  gap: 14px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.rank-list li,
.branch-bars > div {
  display: grid;
  gap: 8px;
}

.rank-main,
.bar-label {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.rank-main small {
  color: var(--muted);
  display: block;
}

.rank-number {
  align-items: center;
  background: #eef1f5;
  border-radius: 8px;
  color: #4b5563;
  display: inline-flex;
  font-weight: 800;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.bar-track {
  background: #edf1f6;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.bar-fill {
  background: var(--accent);
  border-radius: inherit;
  display: block;
  height: 100%;
}

.bar-fill.branch {
  background: var(--amber);
}

.branch-bars {
  display: grid;
  gap: 14px;
}

.chart-panel {
  overflow: hidden;
}

.trend-chart {
  align-items: stretch;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(66px, 1fr));
  min-height: 260px;
}

.trend-item {
  display: grid;
  gap: 8px;
  grid-template-rows: auto minmax(150px, 1fr) auto auto;
  min-width: 0;
}

.trend-value {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  min-height: 32px;
  overflow-wrap: anywhere;
  text-align: center;
}

.trend-bar-wrap {
  align-items: end;
  background:
    linear-gradient(to top, #edf1f6 1px, transparent 1px) 0 0 / 100% 25%,
    #f8fafc;
  border: 1px solid #e1e7ef;
  border-radius: 8px;
  display: flex;
  min-height: 150px;
  overflow: hidden;
  padding: 8px;
}

.trend-bar {
  background: linear-gradient(180deg, #159575, var(--accent-dark));
  border-radius: 7px 7px 4px 4px;
  display: block;
  min-height: 0;
  width: 100%;
}

.trend-label,
.trend-item small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.staff-panel .trend-value {
  color: var(--ink);
}

.compact-table th,
.compact-table td {
  padding: 10px 6px;
}

.table-wrap {
  overflow-x: auto;
}

.numeric {
  text-align: right;
}

.row-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.row-actions form {
  margin: 0;
}

.link-button {
  background: transparent;
  border: 0;
  color: var(--accent);
  font-weight: 700;
  padding: 0;
}

.link-button:hover {
  color: var(--accent-dark);
}

.link-button.danger {
  color: var(--danger);
}

.tab-links {
  background: #eef1f5;
  border-radius: 8px;
  display: inline-flex;
  padding: 3px;
}

.tab-links a {
  border-radius: 6px;
  color: #4b5563;
  font-weight: 800;
  padding: 7px 10px;
}

.tab-links a.active {
  background: #ffffff;
  color: var(--accent-dark);
}

.status-pill,
.role-pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 9px;
  text-transform: uppercase;
}

.status-active,
.role-pill {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.status-inactive {
  background: #eef1f5;
  color: #626b79;
}

.flash,
.form-error,
.field-error {
  border-radius: 8px;
  font-weight: 700;
}

.flash,
.form-error {
  padding: 10px 12px;
}

.flash-success {
  background: var(--accent-soft);
  border: 1px solid #b7ded2;
  color: var(--accent-dark);
}

.flash-error,
.form-error {
  background: var(--danger-soft);
  border: 1px solid #fac5bd;
  color: var(--danger);
}

.field-error {
  color: var(--danger);
  font-size: 12px;
}

.field-error.standalone {
  display: block;
  margin-top: -8px;
}

.empty-state,
.empty-inline {
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  display: grid;
  justify-items: start;
  padding: 24px;
}

.empty-state {
  background: #ffffff;
  gap: 10px;
}

.empty-state.small,
.empty-inline {
  background: #f9fafb;
  padding: 18px;
}

.empty-state h1,
.empty-state h3 {
  margin: 0;
}

.two-field-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.check-row {
  align-items: center;
  display: flex;
  gap: 10px;
}

.check-row input {
  height: 18px;
  min-height: 0;
  width: 18px;
}

.delete-strip {
  align-items: center;
  border-top: 1px solid var(--border);
  color: var(--muted);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 16px;
}

@media (max-width: 1080px) {
  .staff-filter,
  .race-cards,
  .staff-grid {
    grid-template-columns: 1fr;
  }

  .filter-bar,
  .compact-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .split-layout,
  .podium {
    grid-template-columns: 1fr;
  }

  .podium-card,
  .podium-card.rank-1 {
    min-height: 0;
  }
}

@media (max-width: 780px) {
  .staff-page {
    padding: 18px;
  }

  .staff-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .staff-hero h1 {
    font-size: 34px;
  }

  .staff-scoreboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .range-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    border-bottom: 1px solid var(--border);
    border-right: 0;
    height: auto;
    position: static;
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav-list a {
    text-align: center;
  }

  .sidebar-footer {
    align-items: center;
    display: flex;
    justify-content: space-between;
  }

  .topbar {
    position: static;
  }

  .content {
    padding: 18px;
  }

  .login-panel {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .page-heading {
    align-items: start;
    flex-direction: column;
  }

  .filter-bar,
  .compact-filter,
  .metric-grid,
  .two-field-grid {
    grid-template-columns: 1fr;
  }

  .filter-actions .button,
  .button-row .button {
    flex: 1 1 auto;
  }
}

@media (max-width: 520px) {
  .staff-page {
    padding: 14px;
  }

  .staff-filter,
  .staff-panel,
  .staff-stat,
  .race-card,
  .podium-card {
    padding: 14px;
  }

  .staff-scoreboard {
    grid-template-columns: 1fr;
  }

  .staff-rank-row {
    grid-template-columns: 1fr;
  }

  .staff-rank-row .bar-track,
  .staff-rank-row .staff-badges,
  .staff-rank-row .gap-note {
    grid-column: 1;
  }

  .staff-rank-main,
  .recent-list article {
    align-items: flex-start;
    flex-direction: column;
  }

  .content {
    padding: 14px;
  }

  .panel,
  .metric-card {
    padding: 14px;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar-footer,
  .delete-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .rank-main,
  .bar-label {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .rank-main > span:last-child,
  .bar-label > span {
    grid-column: 2;
  }
}

body.staff-body {
  background: #f4f6f7;
  color: var(--ink);
}

.staff-race-page {
  display: grid;
  gap: 18px;
  margin: 0 auto;
  max-width: 1180px;
  min-height: 100vh;
  padding: 22px;
}

.staff-race-top {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.staff-race-brand {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.staff-race-top h1 {
  font-size: 28px;
  line-height: 1.1;
  margin: 4px 0 0;
}

.staff-admin-link {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.staff-race-filter {
  align-items: end;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(240px, 1.4fr) repeat(3, minmax(130px, 1fr)) auto;
  padding: 12px;
}

.minimal-tabs {
  background: #f0f3f5;
}

.minimal-tabs input:checked + span {
  background: var(--ink);
  color: #ffffff;
}

.sales-race-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 20px;
  padding: 18px;
}

.sales-race-head {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.sales-race-head h2 {
  font-size: 20px;
  margin: 2px 0 0;
}

.race-leader-chip {
  align-items: center;
  background: #fff7dc;
  border: 1px solid #e8c56b;
  border-radius: 8px;
  color: #4e3b12;
  display: flex;
  gap: 9px;
  padding: 8px 10px;
}

.race-leader-chip span {
  background: #e8c56b;
  border-radius: 6px;
  color: #2c2109;
  font-size: 12px;
  font-weight: 900;
  padding: 3px 6px;
}

.race-leader-chip strong {
  font-size: 13px;
}

.race-lanes {
  display: grid;
  gap: 12px;
}

.race-lane {
  align-items: center;
  background: #fbfcfd;
  border: 1px solid #e4e9ef;
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(190px, 0.78fr) minmax(260px, 1.4fr) minmax(150px, 0.5fr);
  min-height: 76px;
  padding: 12px;
}

.race-lane.is-leader {
  background: #fffaf0;
  border-color: #e8c56b;
}

.race-lane-person {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 0;
}

.race-rank {
  align-items: center;
  background: var(--ink);
  border-radius: 8px;
  color: #ffffff;
  display: inline-flex;
  font-size: 16px;
  font-weight: 900;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.race-lane.is-leader .race-rank {
  background: #b7791f;
}

.race-lane-person strong,
.race-lane-score strong {
  display: block;
  overflow-wrap: anywhere;
}

.race-lane-person small,
.race-lane-score small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
}

.race-lane-track {
  background: #edf1f4;
  border: 1px solid #dfe5ec;
  border-radius: 999px;
  height: 18px;
  overflow: hidden;
  position: relative;
}

.race-lane-track::after {
  background: rgba(32, 39, 51, 0.42);
  content: "";
  height: 100%;
  position: absolute;
  right: 0;
  top: 0;
  width: 2px;
}

.race-lane-track span {
  background: linear-gradient(90deg, var(--accent), #19a486);
  border-radius: inherit;
  display: block;
  height: 100%;
}

.race-lane.is-leader .race-lane-track span {
  background: linear-gradient(90deg, #d99b2b, #b7791f);
}

.race-lane-score {
  text-align: right;
}

@media (max-width: 980px) {
  .staff-race-filter,
  .race-lane {
    grid-template-columns: 1fr;
  }

  .race-lane-score {
    text-align: left;
  }
}

@media (max-width: 620px) {
  .staff-race-page {
    padding: 14px;
  }

  .staff-race-top,
  .sales-race-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .staff-race-filter,
  .sales-race-card,
  .race-lane {
    padding: 12px;
  }

  .minimal-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .race-leader-chip {
    width: 100%;
  }
}

.login-logo {
  border-radius: 8px;
  display: block;
  height: 56px;
  margin-bottom: 18px;
  object-fit: cover;
  width: 56px;
}

body.staff-body {
  background: #f7f6f0;
  color: var(--brand-black);
}

.staff-race-page {
  max-width: 1200px;
  padding: 26px;
}

.staff-race-top h1 {
  color: var(--brand-black);
  font-size: 44px;
  font-weight: 900;
  margin-top: 10px;
}

.staff-race-brand {
  align-items: center;
  color: var(--brand-black);
  display: inline-flex;
  gap: 10px;
}

.staff-race-brand img {
  border: 2px solid var(--brand-black);
  border-radius: 8px;
  height: 46px;
  object-fit: cover;
  width: 46px;
}

.staff-race-filter {
  background: #ffffff;
  border: 1px solid #dedbd0;
  box-shadow: 0 14px 40px rgba(17, 17, 17, 0.06);
  align-items: center;
  padding: 10px;
}

.staff-race-filter > label > span {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.staff-kpi-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.staff-kpi-card {
  background: #ffffff;
  border: 1px solid #dedbd0;
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(17, 17, 17, 0.05);
  display: grid;
  gap: 14px;
  min-height: 128px;
  padding: 20px;
  position: relative;
}

.staff-kpi-card::before {
  background: var(--brand-yellow);
  border-radius: 999px;
  content: "";
  height: 6px;
  left: 20px;
  position: absolute;
  top: 18px;
  width: 34px;
}

.staff-kpi-card .eyebrow {
  color: #7a7467;
  margin-top: 16px;
}

.staff-kpi-card strong {
  display: block;
  font-size: 34px;
  line-height: 1.05;
  margin-top: 8px;
  overflow-wrap: anywhere;
}

.staff-kpi-card p {
  align-self: end;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
  margin: 0;
}

.staff-kpi-card .positive {
  color: #127a4a;
}

.staff-kpi-card .negative {
  color: var(--danger);
}

.minimal-tabs {
  background: #f0f0ea;
}

.minimal-tabs input:checked + span {
  background: var(--brand-black);
  color: #ffffff;
}

.sales-race-card {
  background: #ffffff;
  border: 1px solid #dedbd0;
  box-shadow: 0 18px 50px rgba(17, 17, 17, 0.08);
  color: var(--brand-black);
}

.sales-race-head .eyebrow {
  color: #8a6d00;
}

.sales-race-head h2 {
  color: var(--brand-black);
  font-size: 24px;
  font-weight: 900;
}

.race-leader-chip {
  background: var(--brand-yellow-pale);
  border-color: #ecd25b;
  color: var(--brand-black);
}

.race-leader-chip span {
  background: var(--brand-yellow);
  color: var(--brand-black);
}

.race-lane {
  background: #fbfbf8;
  border-color: #e6e1d4;
  color: var(--brand-black);
}

.race-lane.is-leader {
  background: var(--brand-yellow-pale);
  border-color: #e6c100;
}

.race-rank {
  background: var(--brand-black);
  color: #ffffff;
}

.race-lane.is-leader .race-rank {
  background: var(--brand-yellow);
  color: var(--brand-black);
}

.race-lane-person small,
.race-lane-score small {
  color: var(--muted);
}

.race-lane-track {
  background: #eeeae0;
  border-color: #e1dccf;
}

.race-lane-track::after {
  background: rgba(17, 17, 17, 0.32);
}

.race-lane-track span,
.race-lane.is-leader .race-lane-track span {
  background: var(--brand-yellow);
}

.race-lane-score strong {
  color: var(--brand-black);
}

@media (max-width: 980px) {
  .staff-kpi-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .staff-race-page {
    padding: 16px;
  }

  .staff-race-top h1 {
    font-size: 34px;
  }

  .staff-race-filter,
  .sales-race-card {
    box-shadow: 0 12px 30px rgba(17, 17, 17, 0.08);
  }
}
