:root {
  color-scheme: light;
  font-family: "PingFang SC", "Microsoft YaHei UI", "Noto Sans CJK SC", "Source Han Sans SC", "Segoe UI", sans-serif;
  background: #f4f7fb;
  color: #15213a;
  --dash-sidebar-width: clamp(190px, 9.375vw, 240px);
  --dash-page-pad: clamp(10px, 0.55vw, 14px);
  --dash-gap: clamp(8px, 0.55vw, 14px);
  --dash-chart-gap: clamp(8px, 0.4vw, 10px);
  --dash-filter-gap: clamp(8px, 0.45vw, 12px);
  --dash-filter-user-space: clamp(176px, 8.3vw, 214px);
  --dash-card-pad-x: clamp(14px, 0.7vw, 18px);
  --dash-card-pad-y: clamp(8px, 0.4vw, 10px);
  --dash-metric-min-height: clamp(94px, 4vw, 102px);
  --dash-metric-icon-size: clamp(46px, 2.03vw, 52px);
  --dash-panel-head-height: clamp(40px, 1.72vw, 44px);
  --dash-share-panel-height: clamp(540px, 24.22vw, 620px);
  --dash-donut-height: clamp(310px, 14.85vw, 380px);
  --dash-mini-chart-height: clamp(182px, 8.44vw, 216px);
  --dash-trend-chart-height: clamp(304px, 14.14vw, 362px);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1000px;
  background: #f4f7fb;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  font-size: 20px;
}

body.authPending {
  pointer-events: none;
}

body.authPending .loginScreen,
body.authPending .appShell {
  visibility: hidden;
}

body.loginActive,
body:has(#loginScreen:not([hidden])) {
  min-width: 0;
}

.loginScreen {
  position: relative;
  min-height: 100vh;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 118px 64px 36px;
  overflow: hidden;
  background:
    radial-gradient(circle at 74% 18%, rgba(77, 170, 255, 0.18), transparent 28%),
    linear-gradient(120deg, rgba(255, 255, 255, 0.96), rgba(237, 247, 255, 0.94) 47%, rgba(250, 253, 255, 0.98)),
    #f7fbff;
}

.loginScreen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(54, 120, 214, 0.036) 1px, transparent 1px),
    linear-gradient(180deg, rgba(54, 120, 214, 0.042) 1px, transparent 1px);
  background-size: 74px 74px;
  opacity: 0.9;
}

.loginStage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(620px, 1fr) clamp(360px, 22vw, 430px);
  gap: clamp(34px, 4vw, 72px);
  width: min(1640px, 100%);
  min-height: 0;
  max-height: calc(100vh - 154px);
  align-items: center;
  z-index: 1;
}

.loginHero {
  position: relative;
  min-height: 0;
  padding: 0;
  color: #10233f;
  z-index: 1;
  transform: none;
  display: grid;
  gap: clamp(14px, 2vh, 24px);
}

.loginGridGlow,
.loginHeroText,
.loginDashboardPreview {
  position: relative;
  z-index: 1;
}

.loginGridGlow {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(115deg, transparent 0 18%, rgba(11, 118, 255, 0.11) 18.2%, transparent 18.55% 100%),
    linear-gradient(115deg, transparent 0 31%, rgba(255, 159, 26, 0.14) 31.2%, transparent 31.55% 100%),
    radial-gradient(circle at 78% 46%, rgba(31, 125, 244, 0.12), transparent 32%);
  opacity: 0.72;
}

.loginPageLogo {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
}

.loginPageLogo img {
  width: clamp(128px, 8vw, 158px);
  height: auto;
  display: block;
}

.loginHeroText {
  max-width: 860px;
  margin-bottom: 0;
}

.loginHeroText h1 {
  margin: 0 0 clamp(10px, 1.4vh, 18px);
  color: #0b1f3a;
  font-size: clamp(36px, 3vw, 58px);
  line-height: 1.12;
  letter-spacing: 0;
}

.loginHeroText p {
  position: relative;
  max-width: 820px;
  margin: 0;
  padding-bottom: clamp(10px, 1.4vh, 16px);
  color: #5c6f86;
  font-size: clamp(16px, 1.08vw, 21px);
  line-height: 1.55;
}

.loginHeroText p::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(69, 194, 255, 0.68), transparent);
  animation: loginScan 4.8s linear infinite;
}

.loginDashboardPreview {
  position: relative;
  width: min(980px, 100%);
  margin-top: 0;
  padding: clamp(14px, 1.25vw, 22px);
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 28px 70px rgba(30, 90, 160, 0.14);
  backdrop-filter: blur(14px);
}

.previewHead,
.previewMain,
.previewBottom {
  display: flex;
  gap: clamp(8px, 0.85vw, 14px);
}

.previewHead {
  align-items: center;
  justify-content: space-between;
  margin-bottom: clamp(8px, 1vh, 14px);
}

.previewHead strong {
  color: #10233f;
  font-size: 21px;
}

.previewHead span {
  padding: 8px 13px;
  border: 1px solid #d8e6f5;
  border-radius: 6px;
  color: #65778d;
  background: #fff;
  font-size: 13px;
}

.previewCards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(8px, 0.85vw, 14px);
  margin-bottom: clamp(8px, 1vh, 14px);
}

.previewCard,
.previewChart,
.previewDonut,
.previewTable,
.previewRoles {
  border: 1px solid #dfebf7;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
}

.previewCard {
  height: clamp(66px, 9vh, 104px);
  padding: clamp(10px, 1vw, 14px);
}

.previewCard span,
.previewChart span,
.previewDonut span {
  display: block;
  color: #314760;
  font-size: 14px;
  font-weight: 800;
}

.previewCard i {
  display: block;
  height: clamp(22px, 3.4vh, 34px);
  margin-top: clamp(12px, 2vh, 24px);
  border-radius: 5px;
  background:
    linear-gradient(180deg, rgba(11, 118, 255, 0.18), rgba(11, 118, 255, 0)),
    linear-gradient(135deg, transparent 7%, #0b76ff 8%, transparent 9%, transparent 18%, #5aa7ff 19%, transparent 20%, transparent 31%, #0b76ff 32%, transparent 33%, transparent 48%, #ff9f1a 49%, transparent 50%);
  animation: metricPulse 3.2s ease-in-out infinite;
}

.previewCard.green i {
  filter: hue-rotate(92deg);
}

.previewCard.orange i {
  filter: hue-rotate(168deg);
}

.previewCard.violet i {
  filter: hue-rotate(248deg);
}

.previewMain {
  margin-bottom: clamp(8px, 1vh, 14px);
}

.previewChart {
  flex: 1 1 auto;
  height: clamp(140px, 21vh, 220px);
  padding: clamp(12px, 1.1vw, 18px);
}

.previewDonut {
  flex: 0 0 clamp(160px, 14vw, 240px);
  height: clamp(140px, 21vh, 220px);
  padding: clamp(12px, 1.1vw, 18px);
}

.previewLine {
  height: clamp(72px, 13vh, 140px);
  margin-top: clamp(14px, 2vh, 22px);
  border-bottom: 1px solid #e8eef6;
  background:
    linear-gradient(180deg, rgba(11, 118, 255, 0.18), rgba(11, 118, 255, 0) 74%),
    repeating-linear-gradient(0deg, transparent, transparent 31px, #eef3f8 32px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='130' viewBox='0 0 520 130'%3E%3Cpath d='M0 88 C38 40 62 106 98 58 S158 34 190 76 250 96 284 48 340 26 382 72 448 98 520 42' fill='none' stroke='%230b76ff' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

.previewDonut i {
  position: relative;
  display: block;
  width: clamp(76px, 8vh, 112px);
  height: clamp(76px, 8vh, 112px);
  margin: clamp(14px, 2.4vh, 26px) auto 0;
  border-radius: 50%;
  background: conic-gradient(#0b76ff 0 38%, #66a9ff 38% 60%, #ff9f1a 60% 76%, #20b486 76% 88%, #c8d2df 88% 100%);
}

.previewDonut i::after {
  content: "";
  position: absolute;
  inset: 28%;
  border-radius: 50%;
  background: #fff;
}

.previewBottom {
  height: clamp(66px, 11vh, 116px);
}

.previewTable {
  flex: 1 1 auto;
  padding: clamp(12px, 1.1vw, 18px);
  display: grid;
  grid-template-columns: 1.2fr repeat(2, 0.8fr);
  gap: 14px 20px;
}

.previewTable span,
.previewRoles b {
  display: block;
  border-radius: 5px;
  background: #e5ecf5;
}

.previewTable span:nth-child(2n) {
  background: linear-gradient(90deg, #0b76ff 8%, #b8d7ff 8% 18%, transparent 18% 22%, #5aa7ff 22% 32%, transparent 32%);
}

.previewRoles {
  flex: 0 0 clamp(160px, 14vw, 240px);
  padding: clamp(12px, 1.1vw, 18px);
  display: grid;
  gap: clamp(8px, 1vh, 12px);
}

.previewRoles b {
  height: 20px;
  background: linear-gradient(90deg, #0b76ff 0 20px, #eaf3ff 20px);
}

.loginPanel {
  position: relative;
  z-index: 1;
  align-self: center;
  width: 100%;
  margin-top: 0;
  border: 1px solid rgba(207, 222, 241, 0.96);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 28px 76px rgba(20, 71, 135, 0.18);
  padding: clamp(28px, 2.35vw, 40px);
  display: grid;
  gap: clamp(15px, 1.8vh, 20px);
  backdrop-filter: blur(18px);
}

.loginBrand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: clamp(4px, 1vh, 12px);
}

.loginBrand img {
  width: clamp(150px, 10vw, 188px);
  height: auto;
  display: block;
}

.loginMessage,
.formMessage {
  margin: 0;
  color: #667085;
  font-size: 13px;
}

.loginMessage {
  min-height: 18px;
  font-weight: 600;
  line-height: 1.4;
}

.loginMessage.pending {
  color: #1f67e8;
}

.loginMessage.error {
  color: #d92d20;
}

.loginMessage.success {
  color: #16824a;
}

.fieldHint {
  min-height: 18px;
  margin: -2px 0 0;
  color: #667085;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
}

.loginPanel label,
.optimizerForm label {
  display: grid;
  gap: 8px;
  color: #263244;
  font-size: 14px;
  font-weight: 600;
}

.loginPanel input {
  width: 100%;
  height: clamp(46px, 5.2vh, 52px);
  border: 1px solid #d8e2ee;
  border-radius: 6px;
  padding: 0 14px;
  color: #15213a;
  background: #fbfdff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.passwordField {
  position: relative;
  display: block;
}

.passwordField input {
  padding-right: 48px;
}

#loginPassword::-ms-reveal,
#loginPassword::-ms-clear {
  display: none;
}

.passwordToggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #8a9bb2;
  opacity: 1;
}

.passwordToggle:hover {
  color: #1f67e8;
  background: #eef5ff;
}

.passwordToggle svg {
  display: block;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.passwordToggle[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 2px;
  background: currentColor;
  transform: rotate(-38deg);
}

.loginPanel input:focus {
  outline: none;
  border-color: #1f7df4;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(31, 125, 244, 0.12);
}

.loginSubmit {
  height: clamp(48px, 5.4vh, 54px);
  margin-top: 4px;
  font-size: clamp(16px, 1vw, 18px);
  font-weight: 800;
  box-shadow: 0 16px 32px rgba(31, 103, 232, 0.22);
}

.loginSubmit:disabled {
  cursor: wait;
  opacity: 0.72;
  box-shadow: none;
}

.loginFootnote {
  margin: -6px 0 0;
  color: #98a7ba;
  font-size: 12px;
  line-height: 1.3;
  text-align: center;
  font-weight: 600;
}

@keyframes loginScan {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes metricPulse {
  0%,
  100% {
    transform: scaleX(0.55);
    opacity: 0.48;
  }
  50% {
    transform: scaleX(1);
    opacity: 1;
  }
}

@keyframes nodeFloat {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.78;
  }
  50% {
    transform: translateY(-7px);
    opacity: 1;
  }
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.appShell {
  display: grid;
  grid-template-columns: var(--dash-sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  overflow-x: clip;
  transition: grid-template-columns 220ms ease;
}

.sidebar {
  background: #fff;
  color: #344054;
  border-right: 1px solid #e4e9f0;
  padding: clamp(16px, 0.78vw, 20px) clamp(10px, 0.47vw, 12px);
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 1.02vw, 26px);
  position: sticky;
  top: 0;
  width: var(--dash-sidebar-width);
  height: 100vh;
  z-index: 20;
  transition: transform 220ms ease, visibility 0s linear;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 2px 38px 8px clamp(4px, 0.24vw, 6px);
  font-size: clamp(14px, 0.625vw, 16px);
  font-weight: 700;
  line-height: 1.35;
}

.brandIcon,
.navIcon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
}

.brandIcon {
  border-radius: 6px;
  background: #2f7df6;
}

.brandLogo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(100%, clamp(148px, 7vw, 180px));
  height: clamp(42px, 2.03vw, 52px);
  flex: 0 0 auto;
}

.brandLogo img {
  width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}

.brandText {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.navList {
  display: grid;
  gap: clamp(8px, 0.43vw, 11px);
}

.navItem,
.collapseBtn,
.themeBtn {
  border: 0;
  color: inherit;
  background: transparent;
}

.navItem {
  display: flex;
  align-items: center;
  gap: clamp(9px, 0.43vw, 11px);
  min-height: clamp(44px, 1.95vw, 50px);
  padding: 0 clamp(12px, 0.55vw, 14px);
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  color: #435168;
  transition: color 150ms ease, background 150ms ease;
}

.navItem:hover {
  color: #245fc7;
  background: #f5f8fc;
}

.navItem span:last-child,
.brand span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.navItem.active {
  background: #eaf1ff;
  color: #2f6fe4;
  box-shadow: none;
}

.navItem.active:hover {
  background: #eaf1ff;
  color: #2f6fe4;
}

@media (max-width: 900px) {
  body {
    min-width: 0;
  }

  .loginScreen {
    height: auto;
    padding: 104px 16px 24px;
  }

  .loginPageLogo {
    top: 24px;
    left: 18px;
  }

  .loginPageLogo img {
    width: 190px;
  }

  .loginStage {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 18px;
  }

  .loginHero {
    min-height: auto;
    padding: 0;
  }

  .loginHeroText {
    margin: 0 0 22px;
  }

  .loginHeroText h1 {
    font-size: 30px;
  }

  .loginDashboardPreview {
    display: none;
  }

  .loginPanel {
    margin-top: 0;
    padding: 28px;
  }
}

@media (max-width: 1500px) {
  .loginScreen {
    padding: 104px 48px 30px;
  }

  .loginStage {
    grid-template-columns: minmax(640px, 1fr) 410px;
    gap: 48px;
    max-height: calc(100vh - 134px);
  }

  .loginHero {
    transform: none;
  }

  .loginHeroText h1 {
    font-size: 50px;
  }

  .loginHeroText p {
    font-size: 19px;
  }

  .loginDashboardPreview {
    padding: 20px;
  }

  .previewCard {
    height: 98px;
  }

  .previewCard i {
    margin-top: 20px;
  }

  .previewChart,
  .previewDonut {
    height: 206px;
  }

  .previewLine {
    height: 126px;
  }

  .previewBottom {
    height: 104px;
  }

  .previewDonut,
  .previewRoles {
    flex-basis: 220px;
  }
}

@media (max-width: 1280px) {
  .loginScreen {
    padding: 96px 32px 28px;
  }

  .loginPageLogo {
    top: 34px;
    left: 34px;
  }

  .loginPageLogo img {
    width: 220px;
  }

  .loginStage {
    grid-template-columns: minmax(520px, 1fr) 388px;
    gap: 32px;
    max-height: calc(100vh - 124px);
  }

  .loginHero {
    transform: none;
  }

  .loginHeroText {
    margin-bottom: 18px;
  }

  .loginHeroText h1 {
    font-size: 43px;
  }

  .loginHeroText p {
    font-size: 17px;
  }

  .previewCards {
    gap: 10px;
    margin-bottom: 10px;
  }

  .previewCard {
    height: 84px;
    padding: 12px;
  }

  .previewCard i {
    height: 28px;
    margin-top: 14px;
  }

  .previewHead,
  .previewMain,
  .previewBottom {
    gap: 10px;
  }

  .previewHead {
    margin-bottom: 12px;
  }

  .previewHead strong {
    font-size: 18px;
  }

  .previewChart,
  .previewDonut {
    height: 184px;
    padding: 14px;
  }

  .previewDonut,
  .previewRoles {
    flex-basis: 190px;
  }

  .previewLine {
    height: 112px;
    margin-top: 20px;
  }

  .previewDonut i {
    width: 96px;
    height: 96px;
    margin-top: 24px;
  }

  .previewDonut i::after {
    inset: 28px;
  }

  .previewBottom {
    height: 88px;
  }

  .previewTable,
  .previewRoles {
    padding: 14px;
  }

  .loginPanel {
    padding: 34px;
  }
}

@media (max-width: 1080px) {
  .loginScreen {
    padding: 104px 24px 28px;
  }

  .loginStage {
    grid-template-columns: minmax(0, 1fr) 376px;
    gap: 24px;
    max-height: calc(100vh - 116px);
  }

  .loginHero {
    min-height: 0;
  }

  .loginHeroText h1 {
    font-size: 38px;
  }

  .loginHeroText p {
    font-size: 16px;
  }

  .loginDashboardPreview {
    padding: 16px;
  }

  .previewCard span,
  .previewChart span,
  .previewDonut span {
    font-size: 12px;
  }

  .previewCard {
    height: 74px;
  }

  .previewCard i {
    height: 24px;
    margin-top: 12px;
  }

  .previewChart,
  .previewDonut {
    height: 160px;
  }

  .previewLine {
    height: 88px;
  }

  .previewBottom {
    height: 76px;
  }

  .previewDonut,
  .previewRoles {
    flex-basis: 166px;
  }

  .loginPanel {
    padding: 30px;
  }
}

@media (max-width: 980px) {
  .loginScreen {
    align-items: flex-start;
    height: auto;
    min-height: 100svh;
    overflow-y: auto;
    padding: 96px 22px 28px;
  }

  .loginStage {
    grid-template-columns: 1fr;
    width: min(640px, 100%);
    min-height: auto;
    gap: 22px;
  }

  .loginHero {
    min-height: auto;
    transform: none;
  }

  .loginHeroText {
    max-width: 640px;
    margin: 0;
    text-align: center;
  }

  .loginHeroText h1 {
    margin-bottom: 12px;
    font-size: 34px;
  }

  .loginHeroText p {
    max-width: none;
    font-size: 16px;
  }

  .loginDashboardPreview {
    display: none;
  }

  .loginPanel {
    width: min(430px, 100%);
    margin: 0 auto;
  }
}

@media (max-width: 640px) {
  .loginScreen {
    padding: 88px 16px 22px;
  }

  .loginPageLogo {
    top: 24px;
    left: 16px;
  }

  .loginPageLogo img {
    width: 172px;
  }

  .loginHeroText h1 {
    font-size: 29px;
    line-height: 1.18;
  }

  .loginHeroText p {
    padding-bottom: 12px;
    font-size: 14px;
    line-height: 1.55;
  }

  .loginPanel {
    padding: 24px 20px;
    gap: 16px;
  }

  .loginBrand {
    margin-bottom: 4px;
  }

  .loginBrand img {
    width: 158px;
  }

  .loginPanel input {
    height: 48px;
  }

  .loginSubmit {
    height: 50px;
    font-size: 16px;
  }
}

@media (max-height: 760px) and (min-width: 981px) {
  .loginScreen {
    padding-top: 76px;
    padding-bottom: 18px;
  }

  .loginPageLogo {
    top: 24px;
  }

  .loginStage {
    max-height: calc(100vh - 94px);
  }

  .loginHero {
    min-height: 0;
    transform: none;
  }

  .loginHeroText h1 {
    margin-bottom: 10px;
    font-size: 38px;
  }

  .loginHeroText p {
    padding-bottom: 10px;
    font-size: 15px;
    line-height: 1.45;
  }

  .loginDashboardPreview {
    padding: 12px;
  }

  .previewBottom {
    height: 54px;
  }

  .previewChart,
  .previewDonut {
    height: 124px;
  }

  .previewLine {
    height: 58px;
  }

  .previewCard {
    height: 58px;
  }

  .previewCard i {
    height: 18px;
    margin-top: 8px;
  }

  .previewHead {
    margin-bottom: 6px;
  }

  .previewHead strong {
    font-size: 17px;
  }

  .previewHead span {
    padding: 6px 10px;
  }

  .previewCards,
  .previewMain {
    margin-bottom: 6px;
  }

  .loginPanel {
    padding: 24px;
    gap: 13px;
  }

  .loginBrand {
    margin-bottom: 2px;
  }

  .loginBrand img {
    width: 156px;
  }

  .loginPanel input {
    height: 46px;
  }

  .loginSubmit {
    height: 48px;
    font-size: 16px;
  }
}

.collapseBtn {
  position: fixed;
  top: 8px;
  left: calc(var(--dash-sidebar-width) - 40px);
  z-index: 30;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #dbe2ea;
  border-radius: 7px;
  color: #687588;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
  transition: left 220ms ease, color 150ms ease, background 150ms ease, transform 220ms ease;
}

.themeBtn {
  position: fixed;
  top: 8px;
  left: calc(var(--dash-sidebar-width) + 2px);
  z-index: 30;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #dbe2ea;
  border-radius: 7px;
  color: #687588;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
  transition: left 220ms ease, color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.collapseBtn:hover,
.collapseBtn:focus-visible,
.themeBtn:hover,
.themeBtn:focus-visible {
  color: #2f6fe4;
  background: #f6f9ff;
  border-color: #bfd1ef;
}

.collapseBtn:focus-visible,
.themeBtn:focus-visible {
  outline: 2px solid #9dc7ff;
  outline-offset: 2px;
}

/* Dashboard dark theme */
:root[data-theme="dark"] {
  color-scheme: dark;
  background: #0b1220;
  color: #dce6f3;
}

:root.themeTransition *,
:root.themeTransition *::before,
:root.themeTransition *::after {
  transition-property: background-color, border-color, color, fill, stroke, box-shadow !important;
  transition-duration: 260ms !important;
  transition-timing-function: ease !important;
}

:root[data-theme="dark"] body,
:root[data-theme="dark"] .appShell,
:root[data-theme="dark"] .workspace,
:root[data-theme="dark"] .wechatDashboardView,
:root[data-theme="dark"] .wechatDashboardView iframe {
  background: #0b1220;
  color: #dce6f3;
}

:root[data-theme="dark"] .sidebar {
  border-color: #243248;
  background: #111a2b;
  color: #dce6f3;
}

:root[data-theme="dark"] .navItem {
  color: #aab8cb;
}

:root[data-theme="dark"] .navItem:hover {
  color: #8db8ff;
  background: #17243a;
}

:root[data-theme="dark"] .navItem.active,
:root[data-theme="dark"] .navItem.active:hover {
  color: #8db8ff;
  background: #1c3152;
}

:root[data-theme="dark"] .collapseBtn,
:root[data-theme="dark"] .themeBtn,
:root[data-theme="dark"] .appShell.sidebarCollapsed .collapseBtn {
  border-color: #34445b;
  color: #b8c5d8;
  background: #172236;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] .collapseBtn:hover,
:root[data-theme="dark"] .collapseBtn:focus-visible,
:root[data-theme="dark"] .themeBtn:hover,
:root[data-theme="dark"] .themeBtn:focus-visible,
:root[data-theme="dark"] .appShell.sidebarCollapsed .collapseBtn:hover,
:root[data-theme="dark"] .appShell.sidebarCollapsed .collapseBtn:focus-visible {
  border-color: #4f72a7;
  color: #8db8ff;
  background: #1d2c45;
}

:root[data-theme="dark"] .pageTitleBar,
:root[data-theme="dark"] .filters {
  border-color: #26354a;
  background: #111a2b;
}

:root[data-theme="dark"] .pageTitleBar h1,
:root[data-theme="dark"] .filterGroup,
:root[data-theme="dark"] .metricLabel,
:root[data-theme="dark"] .panelHead span,
:root[data-theme="dark"] .barRow span,
:root[data-theme="dark"] th,
:root[data-theme="dark"] td,
:root[data-theme="dark"] .permissionEditorHead,
:root[data-theme="dark"] .modalHead h3,
:root[data-theme="dark"] .systemRoleForm label,
:root[data-theme="dark"] .systemPasswordForm label,
:root[data-theme="dark"] .optimizerForm label {
  color: #dce6f3;
}

:root[data-theme="dark"] .metricCard,
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .passwordForm,
:root[data-theme="dark"] .permissionItem,
:root[data-theme="dark"] .modalPanel,
:root[data-theme="dark"] .systemPasswordForm,
:root[data-theme="dark"] .optimizerTableWrap,
:root[data-theme="dark"] .roleTableWrap,
:root[data-theme="dark"] .segmented,
:root[data-theme="dark"] .segmented button {
  border-color: #2b3a51;
  background: #111a2b;
  color: #dce6f3;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14);
}

:root[data-theme="dark"] .segmented button.active {
  border-color: #397be8;
  background: #397be8;
  color: #fff;
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] .dateRangeButton,
:root[data-theme="dark"] .dateRangePanel,
:root[data-theme="dark"] .datePickerCancel,
:root[data-theme="dark"] .ghostBtn,
:root[data-theme="dark"] .modalCloseButton,
:root[data-theme="dark"] .optimizerForm input,
:root[data-theme="dark"] .optimizerForm select,
:root[data-theme="dark"] .systemRoleForm > label input {
  border-color: #3a4a62;
  background: #172236;
  color: #dce6f3;
}

:root[data-theme="dark"] input::placeholder {
  color: #718198;
}

:root[data-theme="dark"] .datePickerDraft,
:root[data-theme="dark"] .datePickerFooter,
:root[data-theme="dark"] .tableHead,
:root[data-theme="dark"] .permissionEditor {
  border-color: #26354a;
}

:root[data-theme="dark"] .datePickerDay,
:root[data-theme="dark"] .datePickerMonthTitle,
:root[data-theme="dark"] .datePickerShortcuts button,
:root[data-theme="dark"] .datePickerDraft {
  color: #c2cee0;
}

:root[data-theme="dark"] .datePickerDay:hover,
:root[data-theme="dark"] .datePickerShortcuts button:hover,
:root[data-theme="dark"] .barRow:hover,
:root[data-theme="dark"] .legendItem:hover,
:root[data-theme="dark"] .userMenuAction:hover {
  background: #1d2a40;
}

:root[data-theme="dark"] .barRow.selected,
:root[data-theme="dark"] .legendItem.selected,
:root[data-theme="dark"] .summaryRow td {
  background: #1d3153;
}

:root[data-theme="dark"] .barTrack,
:root[data-theme="dark"] .barChart::-webkit-scrollbar-track {
  background: #223047;
}

:root[data-theme="dark"] .barChart::-webkit-scrollbar-thumb {
  background: #53657d;
}

:root[data-theme="dark"] .barRow strong,
:root[data-theme="dark"] .legendItem,
:root[data-theme="dark"] .legendItem strong,
:root[data-theme="dark"] .tableHead span,
:root[data-theme="dark"] .placeholderPanel p,
:root[data-theme="dark"] .statusBar,
:root[data-theme="dark"] em,
:root[data-theme="dark"] .metricCard small,
:root[data-theme="dark"] .userMenuRole,
:root[data-theme="dark"] .mutedPassword {
  color: #91a0b5;
}

:root[data-theme="dark"] .legendItem {
  border-color: #2b3a51;
  background: #172236;
  color: #c2cee0;
}

:root[data-theme="dark"] .legendName {
  color: #c2cee0;
}

:root[data-theme="dark"] .legendMeta,
:root[data-theme="dark"] .legendItem em {
  color: #91a0b5;
}

:root[data-theme="dark"] .gameLegend,
:root[data-theme="dark"] .optimizerLegend,
:root[data-theme="dark"] .materialDesignerLegend {
  scrollbar-color: #53657d #172236;
}

:root[data-theme="dark"] .gameLegend::-webkit-scrollbar,
:root[data-theme="dark"] .optimizerLegend::-webkit-scrollbar,
:root[data-theme="dark"] .materialDesignerLegend::-webkit-scrollbar {
  width: 8px;
}

:root[data-theme="dark"] .gameLegend::-webkit-scrollbar-track,
:root[data-theme="dark"] .optimizerLegend::-webkit-scrollbar-track,
:root[data-theme="dark"] .materialDesignerLegend::-webkit-scrollbar-track {
  background: #172236;
}

:root[data-theme="dark"] .gameLegend::-webkit-scrollbar-thumb,
:root[data-theme="dark"] .optimizerLegend::-webkit-scrollbar-thumb,
:root[data-theme="dark"] .materialDesignerLegend::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: #53657d;
}

:root[data-theme="dark"] .userMenuTrigger,
:root[data-theme="dark"] .userMenuDropdown {
  border-color: #2b3a51;
  background: #172236;
  color: #dce6f3;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] .userMenuAction {
  color: #dce6f3;
}

:root[data-theme="dark"] th {
  background: #172236;
}

:root[data-theme="dark"] th,
:root[data-theme="dark"] td,
:root[data-theme="dark"] .tableWrap,
:root[data-theme="dark"] .columnResizeHandle::after {
  border-color: #2b3a51;
}

:root[data-theme="dark"] tbody tr:hover td {
  background: #17243a;
}

:root[data-theme="dark"] .sortableHeader,
:root[data-theme="dark"] .sortButton,
:root[data-theme="dark"] .metricLink,
:root[data-theme="dark"] .metricText,
:root[data-theme="dark"] .accountLink,
:root[data-theme="dark"] .adgroupLink {
  color: #c2cee0;
}

:root[data-theme="dark"] .metricLink:hover {
  color: #8db8ff;
}

:root[data-theme="dark"] .pager,
:root[data-theme="dark"] .pageEllipsis {
  color: #91a0b5;
}

:root[data-theme="dark"] .pageButtons button {
  border-color: #3a4a62;
  background: #172236;
  color: #c2cee0;
}

:root[data-theme="dark"] .pageButtons button:hover:not(:disabled):not(.active) {
  border-color: #4f72a7;
  background: #1d2a40;
  color: #8db8ff;
}

:root[data-theme="dark"] .pageButtons button.active {
  border-color: #397be8;
  background: #397be8;
  color: #fff;
}

:root[data-theme="dark"] .pageButtons button:disabled {
  border-color: #2b3a51;
  background: #111a2b;
  color: #53657d;
}

:root[data-theme="dark"] #dashboardView.dataLoading .metricCard::after,
:root[data-theme="dark"] #dashboardView.dataLoading .panel::after,
:root[data-theme="dark"] #materialsView.dataLoading .tablePanel::after,
:root[data-theme="dark"] .panel.panelLoading::after {
  background: rgba(11, 18, 32, 0.76);
}

:root[data-theme="dark"] .permissionItem span::before {
  border-color: #53657d;
  background: #172236;
}

:root[data-theme="dark"] .dangerBtn {
  border-color: #7f3b42;
  background: #311d27;
  color: #ff9ca3;
}

:root[data-theme="dark"] .dangerBtn:hover {
  background: #43222c;
}

:root[data-theme="dark"] .echartsDonut text,
:root[data-theme="dark"] .echartsLine text {
  fill: #c2cee0 !important;
}

@media (prefers-reduced-motion: reduce) {
  :root.themeTransition *,
  :root.themeTransition *::before,
  :root.themeTransition *::after {
    transition: none !important;
  }
}

.collapseBtn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 220ms ease;
}

.themeIcon {
  grid-area: 1 / 1;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity 180ms ease, transform 220ms ease;
}

.themeIconSun {
  opacity: 0;
  transform: rotate(-35deg) scale(0.72);
}

:root[data-theme="dark"] .themeIconMoon {
  opacity: 0;
  transform: rotate(35deg) scale(0.72);
}

:root[data-theme="dark"] .themeIconSun {
  opacity: 1;
  transform: rotate(0) scale(1);
}

.appShell.sidebarCollapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}

.appShell.sidebarCollapsed .sidebar {
  visibility: hidden;
  transform: translateX(-100%);
  transition: transform 220ms ease, visibility 0s linear 220ms;
}

.appShell.sidebarCollapsed .collapseBtn {
  top: 15px;
  left: 12px;
  width: 32px;
  height: 32px;
  color: #687588;
  background: #fff;
  border: 1px solid #dbe2ea;
  border-radius: 7px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}

.appShell.sidebarCollapsed .themeBtn {
  left: 54px;
}

.appShell.sidebarCollapsed .collapseBtn svg {
  width: 16px;
  height: 16px;
}

.appShell.sidebarCollapsed .collapseBtn:hover,
.appShell.sidebarCollapsed .collapseBtn:focus-visible {
  color: #2f6fe4;
  background: #f6f9ff;
  border-color: #bfd1ef;
}

.appShell.hasPageTitle .collapseBtn {
  top: clamp(11px, calc(1.29vw - 16px), 17px);
  left: calc(var(--dash-sidebar-width) + clamp(24px, 1.2vw, 30px));
}

.appShell.hasPageTitle .themeBtn {
  top: clamp(11px, calc(1.29vw - 16px), 17px);
  left: calc(var(--dash-sidebar-width) + clamp(24px, 1.2vw, 30px) + 42px);
}

.appShell.hasPageTitle.sidebarCollapsed .collapseBtn {
  left: clamp(24px, 1.2vw, 30px);
}

.appShell.hasPageTitle.sidebarCollapsed .themeBtn {
  left: calc(clamp(24px, 1.2vw, 30px) + 42px);
}

@media (prefers-reduced-motion: reduce) {
  .appShell,
  .sidebar,
  .collapseBtn,
  .collapseBtn svg,
  .themeBtn,
  .themeIcon,
  .filters {
    transition: none;
  }
}

.workspace {
  min-height: 100vh;
  min-width: 0;
  padding: 0 var(--dash-page-pad) clamp(20px, 1.1vw, 28px);
  display: flex;
  flex-direction: column;
  position: relative;
}

.workspace.wechatDashboardWorkspace {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.wechatDashboardView {
  width: 100%;
  height: auto;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
  background: #f4f7fb;
}

.wechatDashboardView iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #f4f7fb;
}

.workspaceTopbar {
  position: sticky;
  top: 0;
  height: 0;
  z-index: 9;
  pointer-events: none;
}

.pageTitleBar {
  min-height: clamp(54px, 2.58vw, 66px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--dash-page-pad);
  border-bottom: 1px solid #edf1f6;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 6;
  flex: 0 0 clamp(54px, 2.58vw, 66px);
}

.pageTitleBar h1 {
  margin: 0;
  color: #172033;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
}

.userMenu {
  position: absolute;
  top: clamp(8px, 0.4vw, 10px);
  right: var(--dash-page-pad);
  z-index: 9;
  pointer-events: auto;
}

.userMenuTrigger {
  min-width: clamp(160px, 7.8vw, 200px);
  height: clamp(46px, 2.03vw, 52px);
  padding: 0 clamp(12px, 0.625vw, 16px) 0 clamp(7px, 0.32vw, 8px);
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #344054;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
  transition: box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.userMenuTrigger:hover,
.userMenu.open .userMenuTrigger {
  border-color: #d4dbe7;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
}

.userMenuTrigger:focus-visible {
  outline: 2px solid rgba(31, 103, 232, 0.24);
  outline-offset: 2px;
}

.userMenuAvatar {
  width: clamp(32px, 1.4vw, 36px);
  height: clamp(32px, 1.4vw, 36px);
  flex: 0 0 clamp(32px, 1.4vw, 36px);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 228, 175, 0.98) 0 18%, transparent 19%),
    linear-gradient(135deg, #ffb24d 0%, #f08a24 100%);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55);
}

.userMenuInfo {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 2px;
  justify-items: center;
  text-align: center;
}

.userMenuName {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.1;
}

.userMenuRole {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #64748b;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.1;
}

.userMenuChevron {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: #697586;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.18s ease;
}

.userMenu.open .userMenuChevron {
  transform: rotate(180deg);
}

.userMenuDropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.12);
  z-index: 30;
}

.userMenuAction {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #344054;
  text-align: left;
  padding: 0 14px;
  font-size: 17px;
  font-weight: 600;
}

.userMenuAction:hover {
  background: #f3f6fb;
}

[hidden] {
  display: none !important;
}

.filters {
  min-height: clamp(58px, 2.58vw, 66px);
  display: grid;
  grid-template-columns: max-content repeat(3, minmax(180px, 1fr)) minmax(112px, 130px);
  gap: var(--dash-filter-gap);
  align-items: center;
  padding: clamp(8px, 0.4vw, 10px) var(--dash-filter-user-space) clamp(8px, 0.4vw, 10px) var(--dash-page-pad);
  border-bottom: 1px solid #dbe3ef;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 5;
  transition: padding-left 220ms ease;
}

.workspace.hasPageTitle .filters {
  top: clamp(54px, 2.58vw, 66px);
}

.appShell.sidebarCollapsed .filters {
  padding-left: 42px;
}

.appShell.hasPageTitle.sidebarCollapsed .filters {
  padding-left: var(--dash-page-pad);
}

.filterGroup {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: clamp(7px, 0.35vw, 9px);
  color: #172033;
  font-size: 18px;
  font-weight: 600;
}

.dateFilter {
  position: relative;
  display: block;
  z-index: 20;
}

.dateFilter input[type="hidden"] {
  display: none;
}

.dateRangeButton {
  height: clamp(32px, 1.4vw, 36px);
  width: max-content;
  max-width: 100%;
  border: 0;
  border-radius: 12px;
  background: #fff;
  color: #344054;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 clamp(14px, 0.55vw, 16px);
  font-size: 18px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(31, 49, 76, 0.08);
  white-space: nowrap;
}

.dateRangeButton:hover,
.dateRangeButton[aria-expanded="true"] {
  color: #1f67e8;
  box-shadow: 0 10px 28px rgba(31, 103, 232, 0.16);
}

.dateRangeIcon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dateRangePanel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 620px;
  border: 1px solid #dce4f0;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 30, 55, 0.18);
  color: #2f3542;
  overflow: hidden;
}

.datePickerDraft {
  height: 44px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-bottom: 1px solid #e5eaf2;
  font-size: 16px;
  font-weight: 500;
  color: #303846;
}

.datePickerBody {
  position: relative;
  padding: 12px 28px 6px;
}

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

.datePickerNavButton {
  position: absolute;
  top: 15px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #98a2b3;
  font-size: 28px;
  line-height: 1;
}

.datePickerNavButton:hover {
  color: #1f67e8;
  background: #f2f6ff;
}

#datePickerPrev {
  left: 18px;
}

#datePickerNext {
  right: 18px;
}

.datePickerMonthTitle {
  margin-bottom: 10px;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: #303846;
}

.datePickerWeekdays,
.datePickerGrid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.datePickerWeekdays {
  color: #a1a8b3;
  font-size: 16px;
  text-align: center;
  margin-bottom: 6px;
}

.datePickerWeekdays span,
.datePickerDay {
  height: 34px;
  display: grid;
  place-items: center;
}

.datePickerDay {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #343b48;
  font-size: 16px;
  font-weight: 400;
}

.datePickerDay:hover {
  color: #1f67e8;
  background: #edf4ff;
}

.datePickerDay.outside {
  color: #b9bec8;
}

.datePickerDay.disabled {
  color: #d0d5dd;
  background: transparent;
  cursor: not-allowed;
  opacity: 0.72;
}

.datePickerDay.inRange {
  background: #cfdcff;
}

.datePickerDay.selected {
  background: #2f7df6;
  color: #fff;
  font-weight: 600;
}

.datePickerDay.disabled:hover {
  color: #d0d5dd;
  background: transparent;
}

.datePickerFooter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  border-top: 1px solid #edf1f7;
}

.datePickerShortcuts {
  display: flex;
  align-items: center;
  gap: 2px;
}

.datePickerShortcuts button {
  height: 32px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #4a5260;
  padding: 0 8px;
  font-size: 16px;
}

.datePickerShortcuts button:hover {
  color: #1f67e8;
  background: #f2f6ff;
}

.datePickerActions {
  display: flex;
  gap: 10px;
}

.datePickerCancel,
.datePickerConfirm {
  height: 36px;
  min-width: 76px;
  border-radius: 6px;
  font-size: 16px;
}

.datePickerCancel {
  border: 1px solid #d8dee8;
  background: #fff;
  color: #303846;
}

.datePickerConfirm {
  border: 1px solid #1f67e8;
  background: #2f7df6;
  color: #fff;
}

input,
select {
  height: clamp(30px, 1.25vw, 32px);
  min-width: 0;
  border: 1px solid #cfd8e6;
  border-radius: 4px;
  background: #fff;
  color: #263244;
  padding: 0 10px;
  outline: none;
}

.searchFilterInput {
  width: 100%;
}

.searchFilterInput::-webkit-search-cancel-button {
  cursor: pointer;
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #667085 50%),
    linear-gradient(135deg, #667085 50%, transparent 50%);
  background-position:
    calc(100% - 15px) 13px,
    calc(100% - 10px) 13px;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}

.filterActions {
  display: flex;
  justify-content: flex-end;
  gap: clamp(6px, 0.32vw, 8px);
  min-width: 0;
}

.filters.materialsFilters {
  grid-template-columns: max-content 1fr 130px;
}

.filters.materialsFilters .filterGroup:not(.dateFilter),
.filters.materialsFilters .filterActions {
  display: none;
}

.filters.materialsFilters .filterActions {
  display: flex;
  grid-column: 3;
}

.primaryBtn,
.ghostBtn {
  height: clamp(30px, 1.25vw, 32px);
  min-width: clamp(58px, 2.5vw, 64px);
  border-radius: 4px;
  padding: 0 clamp(12px, 0.625vw, 16px);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.primaryBtn {
  border: 1px solid #1f67e8;
  background: #1f67e8;
  color: #fff;
  box-shadow: 0 5px 12px rgba(31, 103, 232, 0.2);
}

.loginPanel .loginSubmit {
  height: 44px;
  width: 100%;
  font-size: 18px;
}

.ghostBtn {
  border: 1px solid #cfd8e6;
  background: #fff;
  color: #344054;
}

.primaryBtn:disabled,
.ghostBtn:disabled,
.datePickerConfirm:disabled {
  cursor: wait;
  opacity: 0.72;
}

.statusBar .isLoading::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: loadingSpin 0.72s linear infinite;
}

.statusBar {
  color: #667085;
  font-size: clamp(11px, 0.47vw, 12px);
  min-height: clamp(24px, 1.1vw, 28px);
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.statusBar #syncState {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.statusBar #syncState.isLoading {
  color: #1f67e8;
}

@keyframes loadingSpin {
  to {
    transform: rotate(360deg);
  }
}

.metricGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--dash-gap);
}

.metricCard,
.panel {
  position: relative;
  border: 1px solid #d7e0ec;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 8px 22px rgba(16, 35, 64, 0.04);
}

#dashboardView.dataLoading .metricCard::after,
#dashboardView.dataLoading .panel::after,
#materialsView.dataLoading .tablePanel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 8;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(1px);
  pointer-events: none;
}

#dashboardView.dataLoading .metricCard::before,
#dashboardView.dataLoading .panel::before,
#materialsView.dataLoading .tablePanel::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 9;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border: 3px solid #1f67e8;
  border-right-color: transparent;
  border-radius: 999px;
  animation: loadingSpin 0.72s linear infinite;
  pointer-events: none;
}

.panel.panelLoading::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 8;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(1px);
  pointer-events: none;
}

.panel.panelLoading::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 9;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border: 3px solid #1f67e8;
  border-right-color: transparent;
  border-radius: 999px;
  animation: loadingSpin 0.72s linear infinite;
  pointer-events: none;
}

.metricCard {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  justify-content: stretch;
  column-gap: clamp(14px, 0.7vw, 18px);
  min-height: var(--dash-metric-min-height);
  padding: var(--dash-card-pad-y) var(--dash-card-pad-x);
}

.metricCard > div {
  width: 100%;
  min-width: 0;
  text-align: center;
}

.metricLabel {
  display: block;
  color: #263244;
  font-size: 18px;
}

.metricCard strong {
  display: block;
  margin: clamp(3px, 0.2vw, 5px) 0;
  font-size: 31px;
  line-height: 1.1;
  letter-spacing: 0;
}

.metricValueRow {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  white-space: nowrap;
}

.metricValueRow strong {
  grid-column: 2;
}

.metricValueRow small {
  grid-column: 3;
  justify-self: start;
  margin-left: clamp(8px, 0.45vw, 12px);
}

.metricCard small {
  color: #667085;
}

.deltaUp {
  color: #0a9a5b !important;
}

.deltaDown {
  color: #e33131 !important;
}

.deltaSlightDown {
  color: #d49a00 !important;
}

.chartGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--dash-chart-gap);
  margin-top: var(--dash-chart-gap);
  min-width: 0;
}

.leftChartStack {
  display: contents;
}

.chartGrid > .widePanel {
  display: none;
}

.panel {
  min-height: clamp(248px, 11.17vw, 286px);
  overflow: hidden;
}

.spanBar,
.optimizerPanel,
.materialDesignerPanel,
.trendPanel {
  min-height: clamp(370px, 16.8vw, 430px);
}

.spanBar,
.optimizerPanel,
.materialDesignerPanel {
  display: flex;
  flex-direction: column;
  height: var(--dash-share-panel-height);
}

.leftChartStack .spanBar {
  min-height: var(--dash-share-panel-height);
  order: 1;
}

.miniTrendPanel {
  min-height: clamp(236px, 10.4vw, 286px);
}

.panelHead {
  min-height: var(--dash-panel-head-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(10px, 0.55vw, 14px);
  padding: clamp(10px, 0.47vw, 12px) var(--dash-page-pad) clamp(7px, 0.32vw, 8px);
}

.panelHead h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: 0;
}

.panelHead span {
  color: #263244;
  font-size: 16px;
}

.barChart {
  padding: 2px 16px 12px;
  display: grid;
  gap: 10px;
  max-height: 372px;
  overflow-y: auto;
  padding-right: 10px;
}

.deliveryMiniGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--dash-chart-gap);
  grid-column: 1 / -1;
  order: 5;
  min-width: 0;
}

.miniTrendLayout {
  height: calc(var(--dash-mini-chart-height) + 10px);
  padding: 0 clamp(8px, 0.47vw, 12px) clamp(8px, 0.4vw, 10px);
}

.miniTrendLayout canvas,
.miniTrendLayout .echartsLine {
  display: block;
  width: 100%;
  height: var(--dash-mini-chart-height);
}

.barChart::-webkit-scrollbar {
  width: 8px;
}

.barChart::-webkit-scrollbar-track {
  background: #eef3fb;
}

.barChart::-webkit-scrollbar-thumb {
  background: #b8c7db;
  border-radius: 8px;
}

.barRow {
  display: grid;
  grid-template-columns: 78px minmax(120px, 1fr) 154px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 1px 0;
  border-radius: 4px;
}

.barRow:hover,
.legendItem:hover {
  background: #f4f8ff;
}

.barRow.selected,
.legendItem.selected {
  background: #e9f2ff;
  box-shadow: inset 0 0 0 1px #9ec3ff;
}

.barRow span {
  color: #263244;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.barTrack {
  height: 10px;
  background: #eef3fb;
  border-radius: 0;
  overflow: hidden;
}

.barTrack i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2f7df6, #63a3ff);
}

.barRow strong {
  color: #344054;
  font-weight: 500;
  text-align: right;
}

em {
  color: #667085;
  font-style: normal;
}

.donutLayout {
  display: grid;
  grid-template-columns: clamp(150px, 7vw, 180px) minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 4px var(--dash-page-pad) clamp(12px, 0.7vw, 18px);
}

canvas {
  width: clamp(150px, 7vw, 180px);
  height: clamp(150px, 7vw, 180px);
}

.echartsDonut,
#gameDonut,
#optimizerDonut,
#materialDesignerDonut {
  width: 100%;
  max-width: min(520px, 100%);
}

.echartsDonut,
#gameDonut,
#optimizerDonut {
  height: var(--dash-donut-height);
}

#materialDesignerDonut {
  height: var(--dash-donut-height);
}

.optimizerPanel,
.materialDesignerPanel {
  grid-column: auto;
}

.optimizerPanel {
  order: 2;
}

.materialDesignerPanel {
  order: 3;
}

.gameDonutLayout,
.optimizerDonutLayout,
.materialDesignerDonutLayout {
  display: flex;
  flex-direction: column;
  align-items: start;
  position: relative;
  min-height: 0;
  flex: 1 1 auto;
  padding: 0 var(--dash-page-pad) clamp(8px, 0.4vw, 10px);
  overflow: hidden;
  row-gap: 8px;
  column-gap: 0;
}

.materialDesignerDonutLayout {
  position: relative;
}

.gameDonutCanvasWrap,
.optimizerDonutCanvasWrap,
.materialDesignerDonutCanvasWrap {
  display: grid;
  flex: 0 0 auto;
  align-items: center;
  justify-items: center;
  width: 100%;
  min-height: var(--dash-donut-height);
  padding-top: 0;
}

.materialDesignerDonutCanvasWrap {
  min-height: var(--dash-donut-height);
}

.gameDonutCanvasWrap {
  min-height: var(--dash-donut-height);
}

.trendPanel {
  min-width: 0;
  min-height: calc(var(--dash-trend-chart-height) + var(--dash-panel-head-height) + 24px);
  grid-column: 1 / -1;
  order: 4;
}

.chartHeadRight {
  display: flex;
  align-items: center;
  gap: clamp(8px, 0.47vw, 12px);
}

.chartMode {
  flex: 0 0 auto;
}

.chartMode button {
  height: clamp(24px, 1.02vw, 26px);
  padding: 0 clamp(8px, 0.4vw, 10px);
  font-size: clamp(11px, 0.47vw, 12px);
}

.trendLayout {
  height: calc(var(--dash-trend-chart-height) + 10px);
  padding: 0 clamp(8px, 0.47vw, 12px) clamp(8px, 0.4vw, 10px);
}

#trendChart {
  display: block;
  width: 100%;
  height: var(--dash-trend-chart-height);
}

.echartsLine {
  min-width: 0;
}

.donutTooltip {
  position: absolute;
  z-index: 8;
  min-width: 190px;
  border: 1px solid #dde3ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(16, 35, 64, 0.14);
  padding: 14px 16px;
  pointer-events: none;
}

.tooltipName {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #1f2937;
  font-size: 16px;
  font-weight: 700;
}

.tooltipName i {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex: 0 0 12px;
}

.tooltipMetric {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 14px;
  margin-top: 14px;
  color: #535f70;
  font-size: 15px;
}

.tooltipMetric strong {
  color: #202632;
  font-size: 20px;
  font-weight: 600;
  text-align: right;
}

.tooltipMetric em {
  color: #8a94a6;
}

.legend {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.gameLegend,
.optimizerLegend,
.materialDesignerLegend {
  align-self: stretch;
  align-content: start;
  flex: 1 1 auto;
  gap: clamp(5px, 0.24vw, 6px);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding-top: 0;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  padding-right: 4px;
}

.optimizerLegend {
  align-content: end;
}

.legend.twoCol {
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  column-gap: 16px;
}

.legendItem {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  align-items: start;
  font-size: 15px;
  color: #344054;
  border: 1px solid #e0e7f1;
  background: #fff;
  border-radius: 6px;
  padding: clamp(7px, 0.32vw, 8px) clamp(8px, 0.4vw, 10px) clamp(6px, 0.27vw, 7px);
  text-align: left;
}

.gameLegend .legendItem,
.optimizerLegend .legendItem,
.materialDesignerLegend .legendItem {
  min-height: clamp(52px, 2.27vw, 58px);
}

.legendItem span {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.legendName {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legendMeta {
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: nowrap;
}

.legendItem i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex: 0 0 8px;
}

.legendItem strong {
  font-weight: 500;
  white-space: nowrap;
}

.legendItem em {
  white-space: nowrap;
  margin-left: auto;
  text-align: right;
}

.legendTwoLine .legendItem {
  grid-template-rows: auto auto;
}

.legendTwoLine .legendName {
  align-self: start;
}

.legendTwoLine .legendMeta {
  align-self: end;
  justify-content: flex-start;
}

.legendMetaText {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tablePanel {
  margin-top: var(--dash-gap);
  min-height: 0;
}

.materialsView {
  margin-top: var(--dash-gap);
  flex: 1 1 auto;
  min-height: 0;
}

.optimizersView,
.systemView,
.placeholderView {
  margin-top: var(--dash-gap);
}

.optimizerAdminPanel {
  min-height: 640px;
}

.optimizerAdminBody {
  padding: 16px;
}

.optimizerAdminForms {
  display: grid;
  align-content: start;
  gap: 14px;
}

.optimizerForm {
  display: grid;
  align-content: start;
  gap: 14px;
}

.passwordForm {
  background: #fff;
}

.permissionEditor {
  border-top: 1px solid #e1e8f2;
  padding-top: 12px;
}

.permissionEditorHead {
  color: #263244;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
}

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

.permissionItem {
  position: relative;
  display: flex !important;
  grid-template-columns: none !important;
  flex-direction: row;
  align-items: center;
  gap: 0 !important;
  min-height: 38px;
  border: 1px solid #dfe6f0;
  border-radius: 6px;
  background: #fff;
  padding: 0 12px;
  color: #263244;
  font-size: 14px !important;
  font-weight: 500 !important;
}

.systemRoleForm .permissionItem input[type="checkbox"] {
  appearance: none;
  position: absolute;
  left: 12px;
  top: 50%;
  width: 14px !important;
  height: 14px !important;
  margin: 0;
  opacity: 0;
  transform: translateY(-50%);
  cursor: pointer;
}

.permissionItem span {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  line-height: 1.25;
}

.permissionItem span::before {
  content: "";
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  border: 1.5px solid #b7c6d9;
  border-radius: 2px;
  background: #fff;
  box-sizing: border-box;
}

.permissionItem span::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 50%;
  width: 6px;
  height: 3px;
  border-left: 1.7px solid #fff;
  border-bottom: 1.7px solid #fff;
  transform: translateY(-58%) rotate(-45deg) scale(0);
  transform-origin: center;
}

.systemRoleForm .permissionItem input[type="checkbox"]:checked + span::before {
  border-color: #2f6fed;
  background: linear-gradient(180deg, #2f7df6 0%, #2567df 100%);
}

.systemRoleForm .permissionItem input[type="checkbox"]:checked + span::after {
  transform: translateY(-58%) rotate(-45deg) scale(1);
}

.systemRoleForm .permissionItem input[type="checkbox"]:disabled + span::before {
  border-color: #cfd8e6;
  background: #f2f4f7;
}

.systemRoleForm .permissionItem input[type="checkbox"]:disabled + span::after {
  border-color: #98a2b3;
}

.optimizerFormActions {
  display: flex;
  gap: 10px;
}

.optimizerTableWrap {
  overflow: auto;
}

.optimizerTable {
  min-width: 980px;
}

.optimizerTable th:nth-child(1),
.optimizerTable td:nth-child(1) {
  width: 120px;
}

.optimizerTable th:nth-child(2),
.optimizerTable td:nth-child(2) {
  width: 170px;
}

.optimizerTable th:nth-child(3),
.optimizerTable td:nth-child(3) {
  width: 190px;
}

.optimizerTable th:nth-child(4),
.optimizerTable td:nth-child(4) {
  width: 86px;
}

.optimizerTable th:nth-child(5),
.optimizerTable td:nth-child(5) {
  width: auto;
}

.optimizerTable th:nth-child(6),
.optimizerTable td:nth-child(6) {
  width: 310px;
}

.accountCell,
.passwordCell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mutedPassword {
  color: #8a94a6;
}

.tableActionGroup {
  display: flex;
  justify-content: flex-start;
  gap: 6px;
  flex-wrap: wrap;
}

.optimizerTable .tableActionGroup .ghostBtn {
  padding: 7px 10px;
  white-space: nowrap;
}

.dangerBtn {
  color: #b42318;
  border-color: #f0b8b2;
  background: #fffafa;
}

.dangerBtn:hover {
  background: #fff0ee;
}

.systemPanel {
  min-height: clamp(360px, 19vw, 460px);
}

.optimizerAdminPanel,
.systemPanel {
  overflow: hidden;
}

.optimizerAdminPanel .tableHead,
.systemPanel .tableHead {
  align-items: center;
}

.optimizerAdminPanel .tableHead > div,
.systemPanel .tableHead > div {
  min-width: 0;
}

.optimizerAdminPanel .tableHead h2,
.systemPanel .tableHead h2 {
  margin: 0;
}

.optimizerAdminPanel .tableHead span,
.systemPanel .tableHead span {
  color: #667085;
}

.optimizerAdminBody {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
}

.systemBody {
  padding: 16px;
}

.systemRoleForm {
  display: grid;
  align-content: start;
  gap: 14px;
}

.modalPanel {
  border: 1px solid #dfe6f0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 56px rgba(16, 24, 40, 0.22);
}

.formModalPanel {
  width: min(520px, calc(100vw - 48px));
  padding: 18px;
  display: grid;
  gap: 16px;
}

.pageActionMessage {
  margin: 0;
  min-height: 30px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #667085;
}

.pageActionMessage:empty {
  min-height: 0;
  padding: 0;
}

.pageActionMessage.toastMessage {
  position: fixed;
  left: 50%;
  top: 84px;
  z-index: 120;
  min-height: 0;
  padding: 10px 18px 10px 42px;
  border-radius: 6px;
  border: 1px solid #9edfb0;
  background: #f0fff3;
  color: #176b36;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.12);
  transform: translateX(-50%);
}

.pageActionMessage.toastMessage::before {
  content: "✓";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #2fac4f;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  transform: translateY(-50%);
}

.pageActionMessage.success {
  border-color: #bae7c8;
  background: #f0fff5;
  color: #07803f;
}

.pageActionMessage.error {
  border-color: #ffd0cc;
  background: #fff4f2;
  color: #b42318;
}

.pageActionMessage.pending {
  border-color: #c9d9ff;
  background: #f4f7ff;
  color: #1f67e8;
}

.systemPasswordForm {
  width: 360px;
  border: 1px solid #dfe6f0;
  border-radius: 6px;
  background: #fff;
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 14px;
  box-shadow: 0 20px 56px rgba(16, 24, 40, 0.22);
}

.modalBackdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.38);
}

.formModalPanel,
.systemPasswordForm {
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.modalBackdrop[hidden] {
  display: none;
}

.modalHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modalHead h3 {
  margin: 0;
  color: #0f243f;
  font-size: 18px;
  line-height: 1.3;
}

.modalCloseButton {
  width: 30px;
  height: 30px;
  border: 1px solid #d8e2ee;
  border-radius: 4px;
  background: #fff;
  color: #344054;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.modalCloseButton:hover {
  border-color: #9db5d8;
  color: #1f67e8;
}

.systemRoleForm label,
.systemPasswordForm label,
.optimizerForm label {
  display: grid;
  gap: 8px;
  color: #263244;
  font-size: 14px;
  font-weight: 600;
}

.optimizerForm input,
.optimizerForm select,
.systemRoleForm > label input {
  width: 100%;
  height: 38px;
  border: 1px solid #d8e2ee;
  border-radius: 6px;
  padding: 0 12px;
  color: #15213a;
  background: #fff;
}

.optimizerForm input:focus,
.optimizerForm select:focus,
.systemRoleForm > label input:focus {
  outline: none;
  border-color: #2f7df6;
  box-shadow: 0 0 0 3px rgba(47, 125, 246, 0.12);
}

.roleTableWrap {
  overflow: auto;
}

.optimizerTableWrap,
.roleTableWrap {
  border: 1px solid #dfe6f0;
  border-radius: 8px;
  background: #fff;
}

.optimizerTableWrap table,
.roleTableWrap table {
  margin: 0;
}

.roleTable {
  min-width: 760px;
}

.roleTable th:nth-child(1),
.roleTable td:nth-child(1) {
  width: 160px;
}

.roleTable th:nth-child(2),
.roleTable td:nth-child(2) {
  width: 110px;
}

.roleTable th:nth-child(4),
.roleTable td:nth-child(4) {
  width: 120px;
}

.placeholderPanel {
  min-height: 280px;
  padding: 28px;
}

.placeholderPanel h2 {
  margin: 0 0 10px;
  font-size: 20px;
}

.placeholderPanel p {
  margin: 0;
  color: #667085;
}

.creativeTablePanel {
  height: calc(100vh - clamp(104px, 4.77vw, 122px));
  min-height: clamp(460px, 20.31vw, 520px);
  display: flex;
  flex-direction: column;
}

.creativeTablePanel .tableWrap {
  flex: 1 1 auto;
  min-height: 0;
}

.tableHead {
  border-bottom: 1px solid #dfe6f0;
  padding: clamp(9px, 0.4vw, 10px) var(--dash-page-pad);
}

.tableHead > div {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.tableTitleGroup {
  align-items: center;
  flex-wrap: wrap;
}

.tableTitleGroup .subSegmented {
  margin-left: 2px;
  margin-right: 0;
}

.tableActions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.segmented {
  display: inline-flex;
  border: 1px solid #cfd8e6;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}

.segmented button {
  height: clamp(28px, 1.17vw, 30px);
  border: 0;
  border-right: 1px solid #cfd8e6;
  background: #fff;
  color: #344054;
  padding: 0 clamp(9px, 0.47vw, 12px);
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button.active {
  background: #2f7df6;
  color: #fff;
}

.subSegmented {
  margin-right: 4px;
}

.subSegmented button {
  min-width: 52px;
}

.iconBtn::before {
  content: "⇩";
  margin-right: 6px;
}

.tableWrap {
  overflow: auto;
}

table {
  width: 100%;
  min-width: 1320px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 16px;
}

.creativeTable {
  min-width: 1480px;
}

th,
td {
  border-right: 1px solid #dfe6f0;
  border-bottom: 1px solid #dfe6f0;
  padding: clamp(7px, 0.32vw, 8px) clamp(8px, 0.4vw, 10px);
  text-align: center;
  color: #263244;
  line-height: 1.25;
}

.textCell {
  text-align: left;
  white-space: normal;
  word-break: break-word;
}

th {
  background: #f7faff;
  color: #263244;
  font-weight: 600;
}

.columnResizableTable th {
  position: relative;
}

.columnResizeHandle {
  position: absolute;
  top: 0;
  right: -5px;
  z-index: 4;
  width: 10px;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: col-resize;
  touch-action: none;
}

.columnResizeHandle::after {
  content: "";
  position: absolute;
  top: 20%;
  right: 4px;
  width: 1px;
  height: 60%;
  background: transparent;
  transition: background 120ms ease;
}

.columnResizeHandle:hover::after,
.columnResizeHandle:focus-visible::after,
body.columnResizing .columnResizeHandle::after {
  background: #2f7df6;
}

.columnResizeHandle:focus-visible {
  outline: 2px solid rgba(47, 125, 246, 0.28);
  outline-offset: -2px;
}

body.columnResizing {
  cursor: col-resize;
  user-select: none;
}

.sortableHeader {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  min-height: 20px;
}

.sortHeaderLabel {
  line-height: 1.2;
}

.sortButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 12px;
  width: 12px;
  height: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.sortIcon {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 8px;
  height: 11px;
}

.sortIcon::before,
.sortIcon::after {
  display: block;
  width: 7px;
  height: 4px;
  content: "";
  background: #9aa7b8;
}

.sortIcon::before {
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.sortIcon::after {
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.sortButton:hover .sortIcon::before,
.sortButton:hover .sortIcon::after {
  background: #66758a;
}

.sortButton.active.asc .sortIcon::before {
  background: #1e6de8;
}

.sortButton.active.desc .sortIcon::after {
  background: #1e6de8;
}

.sortButton:focus-visible {
  outline: 2px solid rgba(30, 109, 232, 0.28);
  outline-offset: 1px;
  border-radius: 4px;
}

.srOnly {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

th:first-child,
td:first-child {
  width: 58px;
}

th:nth-child(2),
td:nth-child(2) {
  width: 100px;
}

th:nth-child(3),
td:nth-child(3) {
  width: 104px;
}

th:nth-child(13),
td:nth-child(13),
th:nth-child(14),
td:nth-child(14) {
  width: 150px;
}

.statusPill {
  display: inline-grid;
  place-items: center;
  min-width: 54px;
  height: 24px;
  border-radius: 4px;
  padding: 0 8px;
  font-weight: 600;
}

.statusPill.running {
  color: #07815d;
  background: #dff8ed;
  border: 1px solid #9be5c9;
}

.statusPill.learning {
  color: #1264e8;
  background: #e4efff;
  border: 1px solid #bad6ff;
}

.statusPill.limited {
  color: #b65c00;
  background: #fff0d7;
  border: 1px solid #ffd292;
}

.statusPill.paused {
  color: #475467;
  background: #eef1f5;
  border: 1px solid #d3d8e0;
}

.metricLink {
  border: 0;
  background: transparent;
  color: #263244;
  padding: 0;
  width: 100%;
  height: 100%;
  display: grid;
  gap: 2px;
  place-items: center;
}

.metricLink:hover {
  color: #1f67e8;
  text-decoration: underline;
}

.metricText {
  width: 100%;
  display: grid;
  gap: 2px;
  place-items: center;
}

.summaryMetric {
  font-weight: 600;
}

.accountLink,
.adgroupLink {
  border: 0;
  background: transparent;
  color: #1f67e8;
  padding: 2px 6px;
  border-radius: 4px;
}

.accountLink:hover,
.accountLink.selected,
.adgroupLink:hover,
.adgroupLink.selected {
  background: #e9f2ff;
  box-shadow: inset 0 0 0 1px #9ec3ff;
}

.cellCompare {
  display: block;
  font-size: clamp(10px, 0.43vw, 11px);
  line-height: 1.1;
}

.summaryRow td {
  background: #f8fbff;
  font-weight: 600;
}

.emptyCell,
.emptyBlock {
  color: #98a2b3;
  text-align: center;
  padding: 26px;
}

.pager {
  min-height: clamp(56px, 2.58vw, 66px);
  display: flex;
  align-items: center;
  gap: clamp(10px, 0.625vw, 16px);
  padding: clamp(10px, 0.47vw, 12px) var(--dash-page-pad);
  color: #263244;
  font-size: clamp(12px, 0.51vw, 13px);
}

.pageButtons {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: clamp(6px, 0.32vw, 8px);
}

.pageButtons button {
  width: clamp(29px, 1.25vw, 32px);
  height: clamp(29px, 1.25vw, 32px);
  border: 1px solid #d7e0ec;
  background: #fff;
  border-radius: 4px;
  color: #344054;
}

.pageButtons button.active {
  background: #2f7df6;
  color: #fff;
  border-color: #2f7df6;
}

.pageButtons button:disabled {
  color: #b9c3d0;
  cursor: not-allowed;
  background: #f8fafc;
}

.pageEllipsis {
  min-width: 18px;
  text-align: center;
  color: #667085;
}

.jumpPage {
  display: flex;
  align-items: center;
  gap: 8px;
}

.jumpPage input {
  width: 52px;
  text-align: center;
}

@media (max-width: 1300px) {
  body {
    min-width: 1000px;
  }

  .filters {
    grid-template-columns: max-content repeat(2, minmax(200px, 1fr));
    padding-right: var(--dash-page-pad);
  }

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

  .optimizerPanel,
  .materialDesignerPanel {
    height: var(--dash-share-panel-height);
  }

  .trendPanel,
  .deliveryMiniGrid {
    grid-column: 1 / -1;
  }

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

/* Login responsive v2: 2K-based desktop composition that scales as a whole. */
.loginScreen {
  --login-canvas-width: 2560;
  --login-canvas-height: 1440;
  height: 100vh;
  min-height: 100vh;
  padding: 0;
  display: block;
  overflow: hidden;
}

.loginScreen::before {
  background:
    linear-gradient(90deg, rgba(54, 120, 214, 0.024) 1px, transparent 1px),
    linear-gradient(180deg, rgba(54, 120, 214, 0.028) 1px, transparent 1px);
  background-size: 92px 92px;
  opacity: 0.5;
}

.loginCanvas {
  position: absolute;
  top: var(--login-canvas-top, 0px);
  left: var(--login-canvas-left, 0px);
  width: calc(var(--login-canvas-width) * 1px);
  height: calc(var(--login-canvas-height) * 1px);
  transform: scale(var(--login-scale, 1));
  transform-origin: top left;
}

.loginScreen > .loginPageLogo {
  display: block;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 3;
}

.loginScreen > .loginPageLogo img {
  width: 148px;
  height: auto;
  display: block;
}

.loginStage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  min-height: 0;
  display: grid;
  grid-template-columns: 1320px 560px;
  grid-template-rows: minmax(0, 1fr);
  align-items: start;
  gap: 0 190px;
  padding: 220px 190px 100px;
}

.loginStage > .loginPageLogo {
  display: none;
}

.loginHero {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  gap: 28px;
  align-self: center;
  min-height: 0;
  padding: 0;
  transform: translateY(-34px);
}

.loginHeroText {
  max-width: 1160px;
  margin: 0;
}

.loginHeroText h1 {
  margin: 0 0 22px;
  font-size: 76px;
  line-height: 1.12;
  letter-spacing: 0;
}

.loginHeroText p {
  max-width: 1080px;
  padding-bottom: 18px;
  font-size: max(27px, calc(16px * var(--login-readable-scale, 1)));
  line-height: 1.55;
}

.loginDashboardPreview {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 1320px;
  margin: 0;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(244, 250, 255, 0.58)),
    linear-gradient(135deg, rgba(11, 118, 255, 0.08), transparent 44%);
  border: 1px solid rgba(190, 215, 241, 0.72);
  box-shadow: 0 36px 92px rgba(44, 121, 204, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(22px);
}

.loginDashboardPreview::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background:
    linear-gradient(115deg, transparent 0 58%, rgba(31, 125, 244, 0.1) 58.2%, transparent 58.55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), transparent 30%);
  opacity: 0.72;
  pointer-events: none;
}

.previewHead,
.previewCards,
.previewMain,
.previewBottom {
  position: relative;
  z-index: 1;
}

.previewCard,
.previewChart,
.previewDonut,
.previewTable,
.previewRoles {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(248, 252, 255, 0.72));
  border-color: rgba(202, 222, 244, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 12px 30px rgba(54, 112, 178, 0.08);
}

.previewHead,
.previewMain,
.previewBottom {
  gap: 18px;
}

.previewHead {
  margin-bottom: 18px;
}

.previewHead strong {
  font-size: max(24px, calc(16px * var(--login-readable-scale, 1)));
  line-height: 1.2;
}

.previewHead span {
  font-size: max(15px, calc(12px * var(--login-readable-scale, 1)));
}

.previewCards {
  gap: 18px;
  margin-bottom: 18px;
}

.previewCard {
  height: 122px;
  padding: 18px;
}

.previewCard span,
.previewChart span,
.previewDonut span {
  font-size: max(16px, calc(12px * var(--login-readable-scale, 1)));
  line-height: 1.35;
}

.previewCard i {
  height: 42px;
  margin-top: 26px;
  opacity: 0.92;
}

.previewChart,
.previewDonut {
  height: 282px;
  padding: 22px;
}

.previewLine {
  height: 184px;
  margin-top: 26px;
  border-top: 1px solid rgba(232, 241, 250, 0.92);
}

.previewDonut,
.previewRoles {
  flex-basis: 292px;
}

.previewDonut i {
  width: 150px;
  height: 150px;
  margin-top: 30px;
  box-shadow: 0 18px 42px rgba(33, 123, 255, 0.18);
}

.previewBottom {
  height: 150px;
}

.previewTable,
.previewRoles {
  padding: 22px;
}

.previewTable {
  align-items: center;
  grid-template-rows: repeat(2, 26px);
}

.previewRoles {
  align-content: center;
}

.previewTable span {
  min-height: 24px;
}

.previewRoles b {
  height: 22px;
}

.loginPanel {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  width: 560px;
  min-height: 700px;
  margin: 0;
  padding: 64px 54px 58px;
  gap: 0;
  align-content: stretch;
  grid-template-rows: minmax(112px, auto) auto auto minmax(54px, auto) auto;
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(202, 220, 242, 0.9);
  box-shadow: 0 34px 88px rgba(30, 93, 164, 0.2);
  transform: translateY(64px);
}

.loginBrand {
  min-height: 112px;
  margin: 0 0 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loginBrand img {
  width: 238px;
  height: auto;
  display: block;
  transform: none;
}

.loginPanel label {
  gap: 12px;
  font-size: calc(16px * var(--login-readable-scale, 1));
  line-height: 1.35;
  font-weight: 700;
}

.loginPanel label + label {
  margin-top: 26px;
}

.loginPanel input {
  height: 62px;
  padding: 0 18px;
  font-size: calc(16px * var(--login-readable-scale, 1));
  line-height: 1;
  font-weight: 600;
}

.loginPanel input::placeholder {
  color: #7d8fa8;
  font-size: calc(15px * var(--login-readable-scale, 1));
  font-weight: 500;
}

.passwordField input {
  padding-right: 60px;
}

.passwordToggle {
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.passwordToggle svg {
  width: 22px;
  height: 22px;
}

.passwordToggle[aria-pressed="true"]::after {
  width: 24px;
}

.loginPanel .loginSubmit {
  height: 66px;
  margin-top: 34px;
  font-size: calc(18px * var(--login-readable-scale, 1));
}

.loginFootnote {
  min-height: 34px;
  margin: 32px 0 0;
  padding: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(13px * var(--login-readable-scale, 1));
  line-height: 1.2;
  transform: none;
}

.loginMessage {
  margin-top: 12px;
  min-height: 22px;
  font-size: calc(14px * var(--login-readable-scale, 1));
}

.loginMessage:empty {
  display: none;
}

@media (max-width: 980px) {
  .loginScreen {
    height: auto;
    min-height: 100svh;
    padding: 28px 22px;
    place-items: start center;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .loginCanvas {
    position: relative;
    top: auto;
    left: auto;
    width: min(640px, 100%);
    height: auto;
    min-height: calc(100svh - 56px);
    transform: none;
    display: grid;
    gap: 24px;
  }

  .loginStage {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 24px;
    padding: 0;
    transform: none;
  }

  .loginScreen > .loginPageLogo {
    top: 12px;
    left: 12px;
  }

  .loginScreen > .loginPageLogo img {
    width: 132px;
  }

  .loginHero {
    grid-column: 1;
    grid-row: auto;
    gap: 0;
  }

  .loginHeroText {
    max-width: 640px;
    text-align: center;
  }

  .loginHeroText h1 {
    margin-bottom: 12px;
    font-size: 34px;
    line-height: 1.18;
  }

  .loginHeroText p {
    max-width: none;
    padding-bottom: 12px;
    font-size: 16px;
    line-height: 1.55;
  }

  .loginDashboardPreview {
    display: none;
  }

  .loginPanel {
    grid-column: 1;
    grid-row: auto;
    width: min(430px, 100%);
    min-height: 0;
    justify-self: center;
    padding: 38px 30px 34px;
    gap: 0;
    grid-template-rows: auto auto auto auto auto;
    align-content: stretch;
    transform: none;
  }

  .loginBrand {
    min-height: 78px;
    margin: 0 0 22px;
  }

  .loginBrand img {
    transform: none;
  }

  .loginPanel label {
    gap: 8px;
    font-size: 16px;
  }

  .loginPanel label + label {
    margin-top: 20px;
  }

  .loginPanel input {
    height: 54px;
    padding: 0 15px;
    font-size: 16px;
  }

  .loginPanel input::placeholder {
    font-size: 15px;
  }

  .passwordField input {
    padding-right: 54px;
  }

  .passwordToggle {
    right: 9px;
    width: 36px;
    height: 36px;
  }

  .passwordToggle svg {
    width: 20px;
    height: 20px;
  }

  .loginFootnote,
  .loginMessage {
    font-size: 13px;
  }

  .loginPanel .loginSubmit {
    margin-top: 26px;
  }

  .loginFootnote {
    min-height: 28px;
    margin-top: 24px;
    transform: none;
  }
}

@media (max-width: 560px) {
  .loginScreen {
    padding: 22px 16px;
  }

  .loginCanvas {
    min-height: calc(100svh - 44px);
    gap: 20px;
  }

  .loginScreen > .loginPageLogo img {
    width: 118px;
  }

  .loginHeroText h1 {
    font-size: 29px;
  }

  .loginHeroText p {
    font-size: 14px;
  }

  .loginPanel {
    padding: 30px 20px 28px;
    gap: 0;
  }

  .loginBrand {
    min-height: 58px;
    margin-bottom: 18px;
  }

  .loginBrand img {
    width: 158px;
    transform: none;
  }

  .loginPanel label + label {
    margin-top: 18px;
  }

  .loginPanel input {
    height: 48px;
    font-size: 16px;
  }

  .loginSubmit {
    height: 50px;
    font-size: 16px;
  }

  .loginPanel .loginSubmit {
    height: 50px;
    margin-top: 22px;
    font-size: 16px;
  }

  .loginPanel label {
    font-size: 15px;
  }

  .loginFootnote,
  .loginMessage {
    font-size: 12px;
  }

  .loginFootnote {
    min-height: 24px;
    margin-top: 18px;
    transform: none;
  }
}

/* Signed-in dashboard typography is reduced by 2px; sidebar and login stay unchanged. */
.appShell .workspace {
  font-size: 18px;
}

.appShell .pageTitleBar h1 {
  font-size: 23px;
}

.appShell .userMenuAvatar,
.appShell .userMenuName,
.appShell .userMenuAction {
  font-size: 15px;
}

.appShell .userMenuRole {
  font-size: 12px;
}

.appShell .filterGroup,
.appShell .dateRangeButton,
.appShell .datePickerMonthTitle {
  font-size: 16px;
}

.appShell .datePickerDraft,
.appShell .datePickerWeekdays,
.appShell .datePickerDay,
.appShell .datePickerShortcuts button,
.appShell .datePickerCancel,
.appShell .datePickerConfirm {
  font-size: 14px;
}

.appShell .datePickerNavButton {
  font-size: 26px;
}

.appShell .statusBar,
.appShell .chartMode button {
  font-size: 10px;
}

.appShell .metricLabel {
  font-size: 16px;
}

.appShell .metricCard strong {
  font-size: 29px;
}

.appShell .panelHead h2 {
  font-size: 17px;
}

.appShell .panelHead span {
  font-size: 14px;
}

.appShell .tooltipName {
  font-size: 14px;
}

.appShell .tooltipMetric {
  font-size: 13px;
}

.appShell .tooltipMetric strong {
  font-size: 18px;
}

.appShell .legendItem {
  font-size: 13px;
}

.appShell .permissionEditorHead,
.appShell .systemRoleForm label,
.appShell .systemPasswordForm label,
.appShell .optimizerForm label,
.appShell .pageActionMessage.toastMessage {
  font-size: 12px;
}

.appShell .permissionItem {
  font-size: 12px !important;
}

.appShell .pageActionMessage.toastMessage::before {
  font-size: 10px;
}

.appShell .modalHead h3 {
  font-size: 16px;
}

.appShell .modalCloseButton,
.appShell .placeholderPanel h2 {
  font-size: 18px;
}

.appShell table {
  font-size: 14px;
}

.appShell .cellCompare {
  font-size: 10px;
}

.appShell .pager {
  font-size: 11px;
}
