:root {
  color-scheme: dark;
  --bg: #090b0d;
  --surface: rgba(24, 27, 31, 0.68);
  --surface-strong: rgba(34, 38, 43, 0.78);
  --ink: #f1f4f2;
  --muted: #9fa9a7;
  --line: rgba(255, 255, 255, 0.13);
  --blue: #66a6ff;
  --teal: #45d6bd;
  --green: #7bd88f;
  --amber: #f0b85a;
  --red: #ff6f61;
  --violet: #b89cff;
  --cyan: #67d6ff;
  --rank-1: #f3b23f;
  --rank-2: #6f8cff;
  --rank-3: #ff6f9f;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.34);
  --glass-highlight: rgba(255, 255, 255, 0.16);
  --glass-lowlight: rgba(255, 255, 255, 0.05);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(118deg, rgba(69, 214, 189, 0.12), transparent 26%, rgba(240, 184, 90, 0.08) 54%, transparent 78%),
    linear-gradient(24deg, rgba(255, 255, 255, 0.035), transparent 32%, rgba(103, 214, 255, 0.055) 68%, transparent),
    linear-gradient(135deg, #090b0d 0%, #11100e 48%, #07110f 100%);
  color: var(--ink);
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    Arial,
    sans-serif;
  letter-spacing: 0;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 78%);
}

button,
input,
select {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 26px max(28px, calc((100vw - 1360px) / 2 + 28px)) 22px;
  background: rgba(11, 13, 15, 0.76);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 4px;
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  margin-top: 3px;
  font-size: 18px;
  line-height: 1.3;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.toolbar,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.field,
.compact-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

select,
input {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(8, 10, 12, 0.6);
  color: var(--ink);
  outline: none;
}

select {
  min-width: 154px;
  padding: 0 34px 0 11px;
}

input {
  width: 112px;
  padding: 0 10px;
}

select:focus,
input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(69, 214, 189, 0.15);
}

.dashboard,
main {
  display: grid;
  gap: 28px;
  max-width: 1360px;
  margin: 0 auto;
  padding: 26px 28px 42px;
}

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

.overview-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1.25fr) minmax(300px, 0.75fr);
  gap: 18px;
  align-items: stretch;
}

.overview-layout .summary-strip {
  grid-template-columns: 1fr;
}

.section-band {
  display: grid;
  gap: 14px;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  min-height: 34px;
  padding: 0 2px;
}

.section-title h2 {
  font-size: 20px;
}

.metric,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(150%);
  position: relative;
  overflow: hidden;
}

.metric::before,
.panel::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(135deg, var(--glass-highlight), transparent 38%),
    linear-gradient(315deg, rgba(69, 214, 189, 0.08), transparent 42%);
  opacity: 0.85;
}

.metric > *,
.panel > * {
  position: relative;
  z-index: 1;
}

.metric {
  display: grid;
  gap: 8px;
  min-height: 92px;
  padding: 18px;
  background: linear-gradient(145deg, rgba(31, 36, 39, 0.78), rgba(18, 20, 23, 0.6));
  animation: glassRise 520ms ease both;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric strong {
  color: #ffffff;
  font-size: 28px;
  line-height: 1;
  text-shadow: 0 0 22px rgba(69, 214, 189, 0.18);
}

.hero-card {
  display: grid;
  align-content: space-between;
  min-height: 304px;
  background:
    linear-gradient(145deg, rgba(39, 48, 49, 0.78), rgba(12, 15, 17, 0.72)),
    var(--surface);
}

.hero-card::before {
  background:
    linear-gradient(120deg, rgba(69, 214, 189, 0.22), transparent 34%),
    linear-gradient(300deg, rgba(240, 184, 90, 0.14), transparent 42%);
}

.hero-number {
  color: #ffffff;
  font-size: clamp(56px, 7vw, 92px);
  font-weight: 800;
  line-height: 0.92;
  font-variant-numeric: tabular-nums;
  text-shadow:
    0 0 34px rgba(69, 214, 189, 0.26),
    0 0 80px rgba(102, 166, 255, 0.12);
}

.hero-caption {
  color: var(--muted);
  font-size: 14px;
}

.layout-two {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 18px;
}

.group-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(360px, 0.72fr);
  gap: 18px;
  align-items: start;
}

.allocation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.58fr);
  gap: 18px;
  align-items: start;
}

.people-layout {
  display: grid;
  grid-template-columns: minmax(340px, 0.72fr) minmax(0, 1.28fr);
  gap: 18px;
  align-items: start;
}

.insight-column {
  display: grid;
  gap: 18px;
  align-content: start;
}

.primary-panel {
  min-height: 100%;
}

.group-layout .primary-panel {
  min-height: 0;
}

.panel {
  padding: 22px;
}

.panel.compact {
  box-shadow: none;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  min-height: 38px;
  margin-bottom: 18px;
}

.panel-heading > strong {
  color: var(--teal);
  font-size: 16px;
  white-space: nowrap;
}

.bar-list {
  display: grid;
  gap: 13px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(88px, 136px) minmax(0, 1fr) 76px;
  align-items: center;
  gap: 12px;
  min-height: 36px;
}

.bar-label,
.designer-name {
  overflow: hidden;
  color: #e8ece9;
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04)),
    rgba(0, 0, 0, 0.34);
  border-radius: 999px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.1) inset,
    0 -1px 0 rgba(0, 0, 0, 0.35) inset;
}

.bar-fill {
  width: 0;
  min-width: 3px;
  height: 100%;
  border-radius: inherit;
  box-shadow:
    0 0 18px color-mix(in srgb, currentColor 44%, transparent),
    0 1px 0 rgba(255, 255, 255, 0.38) inset;
  position: relative;
  transform-origin: left center;
  animation: fillFlow 900ms cubic-bezier(0.19, 1, 0.22, 1) both;
}

.bar-fill::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.36), transparent);
  transform: translateX(-120%);
  animation: liquidSweep 2.8s ease-in-out infinite;
}

.bar-value {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.share-wrap {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  align-items: center;
  gap: 14px;
}

.donut {
  width: 220px;
  height: 220px;
  filter: drop-shadow(0 20px 28px rgba(0, 0, 0, 0.35));
}

.legend {
  display: grid;
  gap: 10px;
  width: 100%;
  max-height: 228px;
  overflow: auto;
  padding-right: 4px;
}

.legend-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  box-shadow: 0 0 14px currentColor;
}

.legend-name {
  overflow: hidden;
  color: var(--ink);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.designer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.cost-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.46fr);
  gap: 18px;
  align-items: start;
}

.cost-row {
  grid-template-columns: minmax(88px, 136px) minmax(0, 1fr) 112px;
}

.compact-bars {
  gap: 10px;
}

.compact-bars .bar-row {
  min-height: 30px;
  grid-template-columns: minmax(76px, 104px) minmax(0, 1fr) 104px;
}

.detail-panel {
  padding-top: 18px;
}

.designer-row {
  display: grid;
  grid-template-columns: minmax(80px, 120px) minmax(0, 1fr) 68px;
  align-items: center;
  gap: 10px;
  min-height: 32px;
}

.designer-row.rank-highlight {
  min-height: 34px;
  padding: 2px 8px 2px 0;
  border-radius: 6px;
}

.designer-row.rank-1 {
  background: linear-gradient(90deg, rgba(243, 178, 63, 0.16), transparent 76%);
}

.designer-row.rank-2 {
  background: linear-gradient(90deg, rgba(111, 140, 255, 0.14), transparent 76%);
}

.designer-row.rank-3 {
  background: linear-gradient(90deg, rgba(255, 111, 159, 0.13), transparent 76%);
}

.rank-badge {
  display: inline-grid;
  width: 20px;
  height: 20px;
  margin-right: 7px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.rank-1 .rank-badge {
  background: var(--rank-1);
}

.rank-2 .rank-badge {
  background: var(--rank-2);
}

.rank-3 .rank-badge {
  background: var(--rank-3);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--blue);
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(69, 214, 189, 0.95), rgba(102, 166, 255, 0.82));
  color: #fff;
  cursor: pointer;
  padding: 0 13px;
  font-weight: 700;
  text-decoration: none;
}

.button.ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}

.button:hover {
  filter: brightness(0.96);
}

.link-button {
  min-width: 88px;
}

.hidden {
  display: none !important;
}

.admin-auth {
  max-width: 620px;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 12px;
}

.admin-tools {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: -2px 0 16px;
  flex-wrap: wrap;
}

.file-button {
  position: relative;
  overflow: hidden;
}

.file-button input {
  position: absolute;
  inset: 0;
  cursor: pointer;
  opacity: 0;
}

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

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 14px;
}

.compact-table table {
  min-width: 100%;
}

th,
td {
  height: 48px;
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: middle;
}

tbody tr {
  transition:
    background 180ms ease,
    transform 180ms ease;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

td.number {
  font-variant-numeric: tabular-nums;
}

.target-input {
  width: 116px;
}

.rate-cell {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 58px;
  align-items: center;
  gap: 10px;
  max-width: 280px;
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  min-height: 28px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.status.done {
  background: rgba(123, 216, 143, 0.22);
  color: #bdf7c8;
  border: 1px solid rgba(123, 216, 143, 0.42);
}

.status.pending {
  background: rgba(240, 184, 90, 0.2);
  color: #ffd48a;
  border: 1px solid rgba(240, 184, 90, 0.4);
}

.status.empty {
  background: rgba(159, 169, 167, 0.18);
  color: #ccd4d1;
  border: 1px solid rgba(159, 169, 167, 0.34);
}

.money {
  color: var(--green);
  font-weight: 800;
}

.source-info {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.source-panel {
  margin-top: -8px;
}

.empty-state {
  min-height: 120px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.donut-segment {
  stroke-dasharray: 0 999;
  animation: donutDraw 1000ms cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

.glass-pulse {
  animation: glassPulse 5s ease-in-out infinite;
}

@keyframes glassRise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fillFlow {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes liquidSweep {
  0%,
  46% {
    transform: translateX(-120%);
  }
  72%,
  100% {
    transform: translateX(120%);
  }
}

@keyframes donutDraw {
  to {
    stroke-dasharray: var(--arc-length) 999;
  }
}

@keyframes glassPulse {
  0%,
  100% {
    opacity: 0.72;
  }
  50% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 900px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
    padding: 22px 18px;
  }

  main {
    padding: 18px;
  }

  .summary-strip,
  .overview-layout,
  .layout-two,
  .group-layout,
  .allocation-layout,
  .people-layout,
  .cost-layout,
  .designer-grid {
    grid-template-columns: 1fr;
  }

  .overview-layout .summary-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .share-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .legend {
    width: 100%;
  }
}

@media (max-width: 540px) {
  h1 {
    font-size: 24px;
  }

  .panel {
    padding: 16px;
  }

  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .bar-row,
  .designer-row {
    grid-template-columns: minmax(70px, 98px) minmax(0, 1fr) 60px;
    gap: 8px;
  }

  .overview-layout .summary-strip {
    grid-template-columns: 1fr;
  }

  .hero-card {
    min-height: 236px;
  }

  .compact-bars .bar-row,
  .cost-row {
    grid-template-columns: minmax(70px, 92px) minmax(0, 1fr) 86px;
  }

  .toolbar,
  .inline-actions,
  .auth-grid {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  select,
  input,
  .button {
    width: 100%;
  }
}

/* Data screen layout */
.screen-body {
  overflow-x: hidden;
}

.screen-topbar {
  align-items: center;
  min-height: 82px;
  padding-top: 18px;
  padding-bottom: 16px;
}

.screen-topbar h1 {
  font-size: clamp(26px, 2.6vw, 42px);
  line-height: 1;
}

.screen-dashboard {
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 82px);
  padding: 16px;
  gap: 12px;
}

.screen-metrics {
  display: grid;
  grid-template-columns: minmax(360px, 1.9fr) repeat(3, minmax(180px, 1fr));
  gap: 12px;
  min-height: 132px;
}

.screen-total {
  min-height: 132px;
  display: grid;
  grid-template-columns: minmax(170px, 0.7fr) minmax(220px, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
}

.screen-total .hero-number {
  font-size: clamp(48px, 5.6vw, 82px);
  text-align: right;
}

.screen-total .panel-heading,
.screen-total .hero-caption {
  display: none;
}

.screen-total > strong {
  color: var(--teal);
  font-size: 18px;
  white-space: nowrap;
}

.screen-kpi {
  min-height: 132px;
  align-content: center;
  padding: 18px 20px;
}

.screen-kpi strong {
  font-size: clamp(30px, 3vw, 48px);
}

.screen-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.86fr) minmax(520px, 1.55fr) minmax(300px, 0.95fr);
  grid-template-rows: minmax(360px, 1.12fr) minmax(280px, 0.88fr);
  grid-template-areas:
    "group share cost"
    "designer bonus allocation";
  gap: 12px;
  min-height: calc(100vh - 260px);
}

.screen-panel {
  min-height: 0;
  padding: 18px;
  border-color: rgba(103, 214, 255, 0.2);
  background:
    linear-gradient(145deg, rgba(25, 31, 34, 0.74), rgba(9, 12, 14, 0.72)),
    var(--surface);
}

.screen-panel::after {
  position: absolute;
  inset: 9px;
  z-index: 0;
  pointer-events: none;
  content: "";
  border: 1px solid rgba(103, 214, 255, 0.12);
  border-radius: 6px;
}

.screen-panel > * {
  position: relative;
  z-index: 1;
}

.group-rank-panel {
  grid-area: group;
}

.share-panel {
  grid-area: share;
}

.cost-panel {
  grid-area: cost;
}

.designer-rank-panel {
  grid-area: designer;
}

.bonus-panel {
  grid-area: bonus;
}

.allocation-table-panel {
  grid-area: allocation;
}

.screen-panel .panel-heading {
  min-height: 30px;
  margin-bottom: 12px;
}

.screen-panel h2 {
  font-size: clamp(16px, 1.2vw, 20px);
}

.screen-bars {
  gap: 9px;
}

.screen-bars .bar-row,
.screen-bars .designer-row {
  min-height: 30px;
  grid-template-columns: minmax(72px, 112px) minmax(0, 1fr) 82px;
}

.cost-panel .screen-bars .bar-row {
  grid-template-columns: minmax(72px, 112px) minmax(0, 1fr) 104px;
}

.screen-bars .bar-label,
.screen-bars .designer-name {
  font-size: 13px;
}

.screen-bars .bar-value {
  font-size: 12px;
}

.screen-share {
  height: calc(100% - 44px);
  grid-template-columns: minmax(240px, 0.82fr) minmax(220px, 1fr);
  align-items: center;
  justify-items: center;
  gap: 16px;
}

.screen-share .donut {
  width: min(34vw, 320px);
  height: min(34vw, 320px);
  max-width: 320px;
  max-height: 320px;
}

.screen-legend {
  align-self: stretch;
  max-height: none;
  align-content: center;
}

.screen-legend .legend-row {
  min-height: 24px;
  font-size: 13px;
}

.screen-table {
  max-height: calc(100% - 46px);
  overflow: auto;
}

.screen-table table {
  min-width: 100%;
  font-size: 13px;
}

.screen-table th,
.screen-table td {
  height: 38px;
  padding: 6px 8px;
}

.bonus-panel .screen-table table {
  min-width: 680px;
}

.rate-cell {
  grid-template-columns: minmax(80px, 1fr) 54px;
}

.screen-source {
  padding: 10px 14px;
  box-shadow: none;
}

.screen-source .source-info {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 1200px) {
  .screen-body {
    height: 100vh;
    overflow: hidden;
  }

  .screen-dashboard {
    height: calc(100vh - 97px);
    min-height: 0;
    grid-template-rows: 132px minmax(0, 1fr) 32px;
    overflow: hidden;
  }

  .screen-grid {
    min-height: 0;
    height: 100%;
    grid-template-rows: minmax(0, 1.1fr) minmax(0, 0.9fr);
  }

  .screen-panel {
    overflow: hidden;
  }

  .screen-source {
    min-height: 0;
    padding-top: 7px;
    padding-bottom: 7px;
  }
}

@media (max-width: 1180px) {
  .screen-body {
    overflow-y: auto;
  }

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

  .screen-total {
    grid-column: 1 / -1;
  }

  .screen-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    grid-template-areas:
      "share share"
      "group cost"
      "designer allocation"
      "bonus bonus";
    min-height: 0;
  }

  .screen-share {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .screen-dashboard {
    padding: 12px;
  }

  .screen-metrics,
  .screen-grid,
  .screen-share {
    grid-template-columns: 1fr;
    grid-template-areas: none;
  }

  .screen-grid > * {
    grid-area: auto;
  }

  .screen-total {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .screen-total .hero-number {
    text-align: left;
  }

  .screen-share .donut {
    width: 240px;
    height: 240px;
  }
}

/* Reference image inspired light dashboard */
.reference-body {
  color-scheme: light;
  min-height: 100vh;
  overflow: auto;
  background: #eef2f8;
  color: #1f2430;
}

.reference-body::before {
  display: none;
}

.app-frame {
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr);
  gap: 0;
  width: min(1680px, calc(100vw - 96px));
  min-height: min(820px, calc(100vh - 96px));
  margin: 48px auto;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #e5ebf5;
  border-radius: 20px;
  box-shadow: 0 22px 55px rgba(49, 76, 120, 0.12);
}

.side-rail {
  background: #ffffff;
  border-right: 1px solid #e8edf6;
  padding: 24px 0;
}

.brand-mark {
  display: grid;
  width: 114px;
  height: 66px;
  margin: 0 auto 18px;
  place-items: center;
}

.logo-mark img {
  display: block;
  width: 108px;
  height: 63px;
  object-fit: contain;
}

.side-nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  position: relative;
  min-height: 38px;
  display: flex;
  align-items: center;
  padding-left: 30px;
  color: #7d8798;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.nav-item::before {
  width: 7px;
  height: 7px;
  margin-right: 10px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.nav-item.active {
  color: #2f72ff;
  background: #eef4ff;
}

.nav-item.active::after {
  position: absolute;
  top: 8px;
  right: 0;
  bottom: 8px;
  width: 3px;
  border-radius: 3px 0 0 3px;
  background: #2f72ff;
  content: "";
}

.workbench {
  min-width: 0;
  background: #f4f7fc;
}

.reference-topbar {
  min-height: 86px;
  padding: 20px 24px 16px;
  background: #f4f7fc;
  border-bottom: 1px solid #e6edf7;
  box-shadow: none;
  backdrop-filter: none;
}

.reference-topbar h1 {
  color: #111827;
  font-size: 28px;
  font-weight: 900;
}

.reference-topbar .eyebrow,
.reference-dashboard .eyebrow {
  color: #2f72ff;
}

.reference-dashboard {
  max-width: none;
  min-height: 0;
  padding: 16px;
  gap: 12px;
}

.kpi-row {
  display: grid;
  grid-template-columns: 1.15fr repeat(3, 1fr);
  gap: 12px;
}

.reference-body .panel,
.reference-body .metric {
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #e6edf7;
  border-radius: 0;
  box-shadow: 0 10px 24px rgba(61, 97, 150, 0.07);
  backdrop-filter: none;
}

.reference-body .panel::before,
.reference-body .panel::after,
.reference-body .metric::before {
  display: none;
}

.reference-body .panel > *,
.reference-body .metric > * {
  position: relative;
  z-index: 1;
}

.kpi-card {
  min-height: 132px;
  padding: 20px 24px;
}

.kpi-primary {
  background:
    linear-gradient(135deg, rgba(47, 114, 255, 0.92), rgba(114, 158, 255, 0.88)),
    #2f72ff !important;
  color: #ffffff;
}

.kpi-primary::after {
  position: absolute;
  right: -38px;
  bottom: -66px;
  width: 180px;
  height: 180px;
  border: 18px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  content: "";
}

.kpi-primary .eyebrow,
.kpi-primary strong,
.kpi-primary .hero-number {
  color: #ffffff;
}

.kpi-primary .hero-number {
  margin-top: 8px;
  font-size: clamp(38px, 4.4vw, 58px);
  text-align: left;
  text-shadow: none;
}

.kpi-primary strong {
  display: block;
  margin-top: 10px;
  font-size: 15px;
  opacity: 0.92;
}

.reference-body .metric {
  align-content: center;
  min-height: 132px;
  animation: none;
}

.reference-body .metric span {
  color: #404a5d;
  font-size: 14px;
}

.reference-body .metric strong {
  color: #20242c;
  font-size: 34px;
  text-shadow: none;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(360px, 1.15fr) minmax(300px, 0.95fr);
  grid-template-rows: 300px 300px minmax(260px, 1fr);
  grid-template-areas:
    "share group cost"
    "share designer allocation"
    "bonus bonus bonus";
  gap: 12px;
}

.chart-card {
  min-height: 0;
  padding: 18px;
}

.share-card {
  grid-area: share;
}

.group-card {
  grid-area: group;
}

.cost-card {
  grid-area: cost;
}

.designer-card {
  grid-area: designer;
}

.bonus-card {
  grid-area: bonus;
}

.allocation-card {
  grid-area: allocation;
}

.reference-body .panel-heading {
  min-height: 28px;
  margin-bottom: 12px;
}

.reference-body h2 {
  color: #171b24;
  font-size: 17px;
  font-weight: 900;
}

.reference-body .panel-heading > strong {
  color: #2f72ff;
  font-size: 14px;
}

.reference-body select,
.reference-body input {
  color-scheme: light;
  background: #ffffff;
  border-color: #dce5f2;
  color: #1f2430;
}

.reference-body select:focus,
.reference-body input:focus {
  border-color: #2f72ff;
  box-shadow: 0 0 0 3px rgba(47, 114, 255, 0.13);
}

.reference-body .button {
  min-height: 32px;
  border-color: #2f72ff;
  background: #2f72ff;
  box-shadow: 0 8px 16px rgba(47, 114, 255, 0.18);
}

.reference-body .bar-track {
  height: 9px;
  background: #e9eef7;
  box-shadow: none;
}

.reference-body .bar-fill {
  box-shadow: 0 4px 12px rgba(47, 114, 255, 0.18);
}

.reference-body .bar-fill::after {
  display: none;
}

.reference-body .bar-label,
.reference-body .designer-name,
.reference-body .legend-name {
  color: #2c3442;
}

.reference-body .bar-value,
.reference-body .legend-row,
.reference-body .source-info {
  color: #6d7788;
}

.reference-body .bar-list,
.reference-body .designer-grid {
  gap: 10px;
}

.reference-body .bar-row,
.reference-body .designer-row {
  min-height: 28px;
}

.share-card .share-wrap {
  height: calc(100% - 42px);
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 8px;
}

.share-card .donut {
  width: min(230px, 100%);
  height: min(230px, 100%);
  filter: none;
}

.share-card .legend {
  max-height: 200px;
  overflow: auto;
}

.reference-body .donut-segment {
  filter: none !important;
}

.reference-body .donut text {
  fill: #20242c;
}

.reference-body .legend-row,
.reference-body .legend-row *,
.reference-body .legend-name {
  text-shadow: none;
  filter: none;
}

.reference-body .legend-swatch {
  box-shadow: none;
}

.reference-body .legend,
.reference-body .table-wrap,
.reference-body .bonus-card .table-wrap {
  scrollbar-color: #c8d5ea #f3f6fb;
  scrollbar-width: thin;
}

.reference-body .legend::-webkit-scrollbar,
.reference-body .table-wrap::-webkit-scrollbar,
.reference-body .bonus-card .table-wrap::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.reference-body .legend::-webkit-scrollbar-track,
.reference-body .table-wrap::-webkit-scrollbar-track,
.reference-body .bonus-card .table-wrap::-webkit-scrollbar-track {
  background: #f3f6fb;
  border-radius: 999px;
}

.reference-body .legend::-webkit-scrollbar-thumb,
.reference-body .table-wrap::-webkit-scrollbar-thumb,
.reference-body .bonus-card .table-wrap::-webkit-scrollbar-thumb {
  background: #c8d5ea;
  border: 2px solid #f3f6fb;
  border-radius: 999px;
}

.reference-body .legend::-webkit-scrollbar-thumb:hover,
.reference-body .table-wrap::-webkit-scrollbar-thumb:hover,
.reference-body .bonus-card .table-wrap::-webkit-scrollbar-thumb:hover {
  background: #9fb7dc;
}

.reference-body table {
  min-width: 100%;
  color: #2b3340;
}

.reference-body th,
.reference-body td {
  height: 36px;
  border-bottom-color: #edf2f8;
  padding: 6px 8px;
}

.reference-body th {
  color: #7b8495;
}

.reference-body tbody tr:hover {
  background: #f6f9ff;
}

.reference-body .money {
  color: #2f72ff;
}

.reference-body .status.done {
  background: #e9f7ef;
  color: #1f9c55;
  border-color: #bce8cc;
}

.reference-body .status.pending {
  background: #fff5e6;
  color: #c87912;
  border-color: #ffdca3;
}

.reference-body .status.empty {
  background: #eef2f7;
  color: #697386;
  border-color: #d9e1ed;
}

.reference-body .status.fixed {
  background: #eaf2ff;
  color: #2f72ff;
  border-color: #bdd4ff;
}

.bonus-card .table-wrap {
  max-height: 240px;
  overflow: auto;
}

.source-panel {
  padding: 10px 14px;
  box-shadow: none !important;
}

.reference-body .source-panel {
  background: transparent;
  border-color: transparent;
}

@media (max-width: 1180px) {
  .app-frame {
    width: calc(100vw - 32px);
    margin: 16px;
    grid-template-columns: 1fr;
  }

  .side-rail {
    display: none;
  }

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

  .kpi-primary {
    grid-column: 1 / -1;
  }

  .content-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    grid-template-areas:
      "share group"
      "cost designer"
      "allocation allocation"
      "bonus bonus";
  }
}

@media (max-width: 720px) {
  .reference-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .kpi-row,
  .content-grid {
    grid-template-columns: 1fr;
    grid-template-areas: none;
  }

  .content-grid > * {
    grid-area: auto;
  }
}

/* Admin page aligned with the reference dashboard style */
.admin-frame {
  min-height: min(820px, calc(100vh - 96px));
}

.admin-reference-body .nav-link {
  text-decoration: none;
}

.admin-dashboard {
  grid-template-columns: 1fr;
  grid-template-areas:
    "data"
    "settings"
    "password"
    "note";
  align-items: start;
}

.admin-login-card {
  max-width: 760px;
  margin: 0 auto;
}

.admin-dashboard .admin-login-card {
  grid-column: 1 / -1;
}

.admin-data-card {
  grid-area: data;
}

.admin-settings-card {
  grid-area: settings;
}

.admin-password-card {
  grid-area: password;
}

.admin-note-card {
  grid-area: note;
}

.admin-reference-body .chart-card {
  padding: 20px;
}

.admin-reference-body .panel-heading {
  align-items: flex-start;
  gap: 16px;
}

.admin-reference-body .panel-heading .inline-actions {
  justify-content: flex-end;
}

.admin-reference-body .auth-grid {
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  gap: 14px;
}

.admin-reference-body .field,
.admin-reference-body .compact-field {
  color: #6d7788;
}

.admin-reference-body input,
.admin-reference-body select {
  min-height: 36px;
  background: #ffffff;
}

.admin-reference-body .field input {
  width: 100%;
}

.admin-reference-body .compact-field input {
  width: 126px;
}

.admin-reference-body #fixedDesignerInput {
  width: 172px;
}

.admin-reference-body .button.ghost {
  border-color: #dce5f2;
  background: #ffffff;
  color: #2f72ff;
  box-shadow: none;
}

.admin-reference-body .admin-tools {
  align-items: center;
  min-height: 56px;
  margin: 0;
  padding: 14px;
  background: #f6f9ff;
  border: 1px solid #e6edf7;
}

.admin-reference-body .admin-tools-split {
  margin-bottom: 14px;
}

.fixed-bonus-section,
.performance-bonus-section {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  background: #fbfdff;
  border: 1px solid #e6edf7;
}

.performance-bonus-section {
  margin-bottom: 0;
}

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

.subsection-heading h3 {
  margin: 3px 0 0;
  color: #171b24;
  font-size: 16px;
  line-height: 1.25;
}

.fixed-bonus-wrap {
  max-height: 220px;
  overflow: auto;
}

.admin-reference-body .fixed-bonus-wrap table {
  min-width: 620px;
}

.admin-reference-body .table-action {
  min-height: 30px;
}

.admin-reference-body .source-info {
  max-width: 760px;
}

.admin-reference-body #dataUploadMessage,
.admin-reference-body #authMessage,
.admin-reference-body #passwordMessage {
  min-height: 22px;
}

.admin-table-wrap {
  max-height: 520px;
  overflow: auto;
}

.admin-reference-body .admin-table-wrap table {
  min-width: 1050px;
}

.admin-reference-body .admin-table-wrap th,
.admin-reference-body .admin-table-wrap td {
  height: 46px;
  padding: 8px 12px;
}

.admin-reference-body .target-input {
  width: 116px;
  text-align: right;
}

.admin-reference-body .attendance-input {
  width: 96px;
}

.admin-reference-body .money {
  font-weight: 900;
}

.admin-reference-body .admin-note-card {
  padding: 12px 16px;
}

@media (max-width: 1180px) {
  .admin-dashboard {
    grid-template-columns: 1fr;
    grid-template-areas:
      "data"
      "settings"
      "password"
      "note";
  }
}

@media (max-width: 720px) {
  .admin-reference-body .auth-grid,
  .admin-reference-body .panel-heading,
  .admin-reference-body .panel-heading .inline-actions,
  .admin-reference-body .subsection-heading,
  .admin-reference-body .subsection-heading .inline-actions,
  .admin-reference-body .admin-tools,
  .admin-reference-body .admin-tools .inline-actions {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .admin-reference-body .compact-field input,
  .admin-reference-body .compact-field select,
  .admin-reference-body .button {
    width: 100%;
  }
}
