:root {
  --bg: #f5f7fb;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --text: #17181c;
  --muted: #6e7480;
  --line: rgba(20, 24, 35, 0.09);
  --line-strong: rgba(20, 24, 35, 0.14);
  --blue: #1478ff;
  --blue-dark: #075ac8;
  --blue-soft: #eaf4ff;
  --apricot: #8067ef;
  --apricot-soft: #f3efff;
  --green: #24a874;
  --radius: 24px;
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei UI", "Segoe UI", sans-serif;
  --font-num: "SF Pro Display", Inter, "Segoe UI", Arial, sans-serif;
  --shadow-sm: 0 8px 28px rgba(35, 46, 72, 0.06);
  --shadow-md: 0 22px 70px rgba(35, 46, 72, 0.10);
}

html {
  scroll-behavior: smooth;
  background: #f5f7fb;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 0%, rgba(141, 213, 255, 0.24), transparent 34rem),
    radial-gradient(circle at 92% 8%, rgba(194, 178, 255, 0.22), transparent 36rem),
    linear-gradient(180deg, #fbfcff 0%, #f5f7fb 42%, #f7f8fb 100%);
  letter-spacing: -0.012em;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image: radial-gradient(rgba(30, 42, 70, 0.08) 0.55px, transparent 0.55px);
  background-size: 14px 14px;
  opacity: 0.16;
  mask-image: linear-gradient(to bottom, black, transparent 52%);
}

::selection {
  background: rgba(20, 120, 255, 0.18);
}

.topbar {
  height: 68px;
  border-bottom: 1px solid rgba(20, 24, 35, 0.08);
  background: rgba(250, 251, 254, 0.78);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.topbar__inner,
.page-shell {
  width: min(1320px, calc(100% - 56px));
}

.topbar__inner {
  gap: 22px;
}

.brand {
  gap: 10px;
  font-size: 20px;
  font-weight: 760;
  letter-spacing: -0.045em;
}

.brand__mark {
  width: 31px;
  height: 31px;
  filter: drop-shadow(0 5px 12px rgba(43, 92, 170, 0.14));
}

.brand__context {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-left: 2px;
  border-left: 1px solid rgba(20, 24, 35, 0.12);
  color: #777d88;
  padding-left: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

.module-nav {
  gap: 2px;
  border: 0;
  border-radius: 999px;
  background: rgba(23, 28, 42, 0.055);
  padding: 4px;
  box-shadow: inset 0 0 0 1px rgba(20, 24, 35, 0.045);
  scrollbar-width: none;
}

.module-nav::-webkit-scrollbar { display: none; }

.module-nav__button {
  height: 34px;
  border-radius: 999px;
  color: #6d7380;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 620;
  transition: color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.module-nav__button:hover {
  color: #16181d;
  transform: translateY(-1px);
}

.module-nav__button.is-active {
  background: rgba(255, 255, 255, 0.96);
  color: #111318;
  box-shadow: 0 4px 14px rgba(31, 39, 61, 0.10), inset 0 0 0 1px rgba(20, 24, 35, 0.04);
}

.topbar__tools {
  gap: 10px;
}

.source-state {
  gap: 12px;
  border: 1px solid rgba(20, 24, 35, 0.07);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  padding: 7px 12px;
  font-size: 11px;
}

.source-state__status {
  color: #66707c;
}

.source-state__status::before {
  width: 6px;
  height: 6px;
  background: #22ad75;
  box-shadow: 0 0 0 4px rgba(34, 173, 117, 0.10);
}

.upload-button,
.logout-button,
.secondary-button {
  border: 1px solid rgba(20, 24, 35, 0.10);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #383d47;
  box-shadow: 0 5px 16px rgba(25, 34, 54, 0.05);
  transition: transform 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.upload-button:hover,
.logout-button:hover,
.secondary-button:hover {
  border-color: rgba(20, 120, 255, 0.25);
  background: #fff;
  color: var(--blue);
  box-shadow: 0 8px 22px rgba(20, 120, 255, 0.10);
  transform: translateY(-1px);
}

.page-shell {
  padding: 46px 0 88px;
}

.page-view.is-active {
  animation: workbenchViewIn 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.query-panel,
.sync-panel,
.report-builder,
.leaderboard-filter-panel,
.account-leaderboard-filter-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.76);
  padding: 32px 34px 34px;
  box-shadow: var(--shadow-md), inset 0 0 0 1px rgba(20, 24, 35, 0.035);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.query-panel::before,
.sync-panel::before,
.report-builder::before,
.leaderboard-filter-panel::before {
  position: absolute;
  width: 280px;
  height: 280px;
  top: -210px;
  right: -70px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(20, 120, 255, 0.16), rgba(128, 103, 239, 0.04) 55%, transparent 72%);
  pointer-events: none;
  content: "";
}

.query-panel__heading,
.panel-title-row {
  position: relative;
  margin-bottom: 26px;
}

.query-panel h1,
.panel-title-row h1,
.leaderboard-title-row h1 {
  color: #15171b;
  font-size: clamp(23px, 2vw, 30px);
  line-height: 1.15;
  font-weight: 720;
  letter-spacing: -0.045em;
}

.query-panel__heading p,
.panel-title-row p,
.section-heading p {
  color: #737986;
  font-size: 13px;
  line-height: 1.65;
}

.query-form,
.report-form,
.leaderboard-filter-form,
.account-leaderboard-filter-form {
  position: relative;
}

.field {
  gap: 9px;
}

.field__label {
  color: #666d79;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.field__control {
  height: 50px;
  border: 1px solid rgba(20, 24, 35, 0.10);
  border-radius: 14px;
  background: rgba(250, 251, 254, 0.80);
  box-shadow: inset 0 1px 1px rgba(20, 24, 35, 0.02);
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.field__control:hover {
  background: #fff;
  border-color: rgba(20, 120, 255, 0.20);
}

.field__control:focus-within {
  border-color: rgba(20, 120, 255, 0.58);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(20, 120, 255, 0.10), 0 8px 24px rgba(20, 120, 255, 0.08);
  transform: translateY(-1px);
}

.field__control input,
.field__control select {
  color: #24272e;
  font-size: 14px;
}

.primary-button {
  height: 50px;
  border-radius: 999px;
  background: linear-gradient(135deg, #1685ff, #0668e8);
  color: #fff;
  font-size: 14px;
  font-weight: 680;
  box-shadow: 0 12px 28px rgba(20, 120, 255, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.primary-button:hover {
  background: linear-gradient(135deg, #2691ff, #096de9);
  box-shadow: 0 16px 34px rgba(20, 120, 255, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.34);
  transform: translateY(-2px);
}

.primary-button:active {
  transform: translateY(0) scale(0.985);
}

.result,
.report-output,
.leaderboard-result,
.account-leaderboard-result {
  animation: resultIn 560ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.result-context {
  margin: 26px 4px 12px;
  color: #7b818d;
}

.overview,
.leaderboard-overview,
.account-leaderboard-overview {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  background:
    radial-gradient(circle at 0% 0%, rgba(117, 204, 255, 0.22), transparent 38%),
    radial-gradient(circle at 100% 10%, rgba(184, 165, 255, 0.22), transparent 40%),
    rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-md), inset 0 0 0 1px rgba(20, 24, 35, 0.035);
}

.overview__primary,
.leaderboard-overview__primary,
.account-leaderboard-hero-card {
  background: transparent;
}

.overview__money,
.leaderboard-overview__primary strong,
.account-leaderboard-hero-card strong {
  background: linear-gradient(115deg, #12151b 10%, #1478ff 56%, #8067ef 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-family: var(--font-num);
  letter-spacing: -0.055em;
}

.overview__facts > div,
.leaderboard-overview__facts > div,
.account-leaderboard-overview-grid > article {
  border-color: rgba(20, 24, 35, 0.07);
  background: rgba(255, 255, 255, 0.54);
}

.section-block,
.leaderboard-quality-panel,
.account-leaderboard-section,
.quality-note,
.empty-state,
.leaderboard-empty,
.account-leaderboard-empty {
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px rgba(20, 24, 35, 0.035);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.section-block {
  margin-top: 18px;
  padding: 26px 28px;
}

.section-heading h2,
.overview h2,
.report-copy-row h2 {
  color: #1b1e24;
  font-size: 17px;
  font-weight: 690;
  letter-spacing: -0.025em;
}

.platform-item,
.account-row,
.report-summary > *,
.leaderboard-platforms > *,
.leaderboard-anomalies > * {
  border-color: rgba(20, 24, 35, 0.07);
  border-radius: 18px;
  background: rgba(248, 250, 254, 0.72);
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.platform-item:hover,
.account-row:hover,
.report-summary > *:hover,
.leaderboard-platforms > *:hover,
.leaderboard-anomalies > *:hover {
  border-color: rgba(20, 120, 255, 0.15);
  background: #fff;
  box-shadow: 0 14px 34px rgba(33, 43, 68, 0.08);
  transform: translateY(-2px);
}

.platform-item__symbol,
.empty-state__symbol {
  background: linear-gradient(135deg, #1685ff, #8168ef);
  color: #fff;
  box-shadow: 0 10px 24px rgba(20, 120, 255, 0.18);
}

.table-wrap,
.leaderboard-table-wrap,
.account-leaderboard-table-wrap {
  overflow: auto;
  border: 1px solid rgba(20, 24, 35, 0.07);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

thead th {
  background: rgba(244, 247, 252, 0.92);
  color: #727986;
  font-size: 11px;
  font-weight: 680;
  letter-spacing: 0.025em;
}

tbody td {
  border-color: rgba(20, 24, 35, 0.055);
  color: #333740;
}

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

tbody tr:hover {
  background: rgba(235, 245, 255, 0.58);
}

.leaderboard-range-buttons,
.account-leaderboard-period-buttons,
.sort-controls {
  border-radius: 999px;
  background: rgba(24, 29, 43, 0.055);
  padding: 4px;
}

.leaderboard-range-buttons button,
.account-leaderboard-period-buttons button,
.sort-controls button {
  border-radius: 999px;
}

.leaderboard-range-buttons button.is-active,
.account-leaderboard-period-buttons button.is-active,
.sort-controls button.is-active {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 4px 14px rgba(31, 39, 61, 0.09);
}

.leaderboard-data-time,
.sync-badge,
.leaderboard-count,
.leaderboard-detail-name,
.account-leaderboard-data-time,
.account-leaderboard-count,
.account-leaderboard-detail-name {
  border: 1px solid rgba(20, 24, 35, 0.07);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: #6f7682;
  padding: 7px 11px;
}

#reportText {
  border: 1px solid rgba(20, 24, 35, 0.07);
  border-radius: 18px;
  background: #f8faff;
  color: #343943;
  line-height: 1.75;
}

.form-message.is-success,
.sync-message.is-success {
  color: #14865b;
}

.form-message.is-error,
.sync-message.is-error {
  color: #cf4352;
}

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

@keyframes resultIn {
  from { opacity: 0; transform: translateY(16px) scale(0.992); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 1080px) {
  .topbar { height: auto; }
  .topbar__inner { min-height: 68px; flex-wrap: wrap; padding: 11px 0 12px; }
  .module-nav { order: 3; width: 100%; overflow-x: auto; }
  .module-nav__button { flex: 1 0 auto; }
  .source-state { max-width: 54vw; }
}

@media (max-width: 720px) {
  .topbar__inner,
  .page-shell { width: min(100% - 28px, 1320px); }
  .brand__context { display: none; }
  .source-state__name { display: none; }
  .query-panel,
  .sync-panel,
  .report-builder,
  .leaderboard-filter-panel,
  .account-leaderboard-filter-panel { border-radius: 22px; padding: 24px 20px; }
  .section-block { border-radius: 20px; padding: 22px 18px; }
  .page-shell { padding-top: 24px; }
  .query-panel h1,
  .panel-title-row h1,
  .leaderboard-title-row h1 { font-size: 24px; }
}

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

/* ZCC product labeling navigation */
.module-nav__button[href="/labeling"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  text-decoration: none;
}
/* Department navigation: visible secondary row, equal centered hit areas. */
.topbar .module-nav { display: grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(max-content, 1fr); align-items: stretch; gap: 4px; padding: 5px; }
.topbar .module-nav__button, .department-subnav .module-nav__button { display: flex; align-items: center; justify-content: center; min-height: 42px; line-height: 1.2; padding: 10px 14px; text-align: center; text-decoration: none; white-space: nowrap; }
.department-subnav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; width: min(540px, calc(100% - 32px)); margin: 20px auto 0; padding: 5px; border: 1px solid #e1e7f1; border-radius: 18px; background: rgba(255,255,255,.9); }
.department-subnav[hidden] { display: none; }
.department-subnav .is-active { color: #0869e9; background: #eaf2ff; box-shadow: none; }
@media (max-width: 600px) {
  .topbar .topbar__inner { display: flex; flex-wrap: wrap; gap: 12px; padding: 12px 16px; }
  .topbar .brand { flex: 1; }
  .topbar .module-nav { order: 3; width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: row; grid-auto-columns: auto; border-radius: 18px; }
  .topbar .module-nav__button { min-width: 0; padding: 10px 2px; font-size: 12px; }
  .department-subnav { margin-top: 14px; }
  .department-subnav .module-nav__button { min-width: 0; font-size: 13px; padding: 10px 4px; }
}
