:root {
  color-scheme: light;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  --bg: #f5f5f7;
  --panel: rgba(255, 255, 255, 0.72);
  --panel-strong: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, 0.08);
  --primary: #2563eb;
  --primary-weak: #dbeafe;
  --cyan: #60a5fa;
  --soft: rgba(37, 99, 235, 0.1);
  --soft-2: rgba(255, 255, 255, 0.66);
  --success: #059669;
  --danger: #dc2626;
  --warning: #b45309;
  --radius: 18px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f7fbff;
  color: var(--text);
}

.hidden {
  display: none !important;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
  transition: grid-template-columns 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 82px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 14px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--text);
  border-right: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 12px 0 46px rgba(37, 99, 235, 0.1);
  backdrop-filter: blur(24px) saturate(180%);
  transition: padding 0.34s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.34s ease, background 0.34s ease;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
}

.sidebar-collapsed .brand {
  justify-content: center;
}

.brand > div:not(.brand-mark) {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.22s ease, transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), max-width 0.34s cubic-bezier(0.22, 1, 0.36, 1);
  max-width: 170px;
}

.sidebar-collapsed .brand > div:not(.brand-mark) {
  opacity: 0;
  max-width: 0;
  transform: translateX(-8px);
  pointer-events: none;
}

.sidebar-collapsed .nav-item {
  width: 52px;
  height: 52px;
  justify-content: center;
  padding: 0;
  gap: 0;
  margin-inline: auto;
  color: transparent;
  text-indent: -999px;
}

.sidebar-collapsed .nav-icon {
  margin: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.14);
  overflow: hidden;
}

.brand-mark img {
  display: block;
  width: 78%;
  height: 78%;
  object-fit: contain;
}

.brand span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.brand span:empty {
  display: none;
}

.nav-item {
  position: relative;
  overflow: hidden;
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: #3a3a3c;
  text-align: left;
  padding: 11px 12px;
  margin-bottom: 7px;
  cursor: pointer;
  transform: translateX(0);
  white-space: nowrap;
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, gap 0.34s ease, padding 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-item .nav-icon {
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar-collapsed .nav-item .nav-icon {
  color: var(--primary);
  text-indent: 0;
  transform: scale(1.04);
}

.nav-item.active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(37, 99, 235, 0.2);
  color: #0b0b0f;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.12);
  transform: translateX(4px);
}

.sidebar-collapsed .nav-item.active,
.sidebar-collapsed .nav-item:hover {
  color: transparent;
  transform: none;
}

.sidebar-collapsed .nav-item.active .nav-icon,
.sidebar-collapsed .nav-item:hover .nav-icon {
  color: var(--primary);
  transform: scale(1.08);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 999px;
  background: var(--primary);
}

.sidebar-collapsed .nav-item.active::before {
  left: 6px;
  top: 16px;
  bottom: 16px;
  width: 3px;
}

.sidebar-toggle {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transform: translateX(-50%);
  transition: transform 0.24s ease, background 0.24s ease;
}

.sidebar-toggle::before,
.sidebar-toggle::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 10px;
  height: 2px;
  border-radius: 999px;
  background: var(--primary);
}

.sidebar-toggle::before {
  left: 12px;
  transform: translateY(-50%) rotate(35deg);
}

.sidebar-toggle::after {
  right: 12px;
  transform: translateY(-50%) rotate(-35deg);
}

.sidebar-collapsed .sidebar-toggle::before {
  transform: translateY(-50%) rotate(-35deg);
}

.sidebar-collapsed .sidebar-toggle::after {
  transform: translateY(-50%) rotate(35deg);
}

.content {
  position: relative;
  isolation: isolate;
  padding: 28px;
  min-width: 0;
}

.content::before {
  content: "";
  position: fixed;
  right: -160px;
  top: 72px;
  width: 520px;
  height: 520px;
  border-radius: 999px;
  pointer-events: none;
  background: rgba(37, 99, 235, 0.1);
  filter: blur(2px);
  opacity: 0.72;
  z-index: -1;
}

.content::after {
  content: "";
  position: fixed;
  left: 120px;
  bottom: -180px;
  width: 520px;
  height: 520px;
  border-radius: 999px;
  pointer-events: none;
  background: rgba(96, 165, 250, 0.1);
  filter: blur(18px);
  z-index: -1;
}

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

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-actions span {
  color: var(--muted);
  font-size: 14px;
  padding: 8px 12px;
  border: 1px solid rgba(37, 99, 235, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.06);
}

.login-screen {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-screen::before,
.login-screen::after {
  content: "";
  position: absolute;
  width: 46vw;
  height: 46vw;
  min-width: 360px;
  min-height: 360px;
  border-radius: 999px;
  filter: blur(34px);
  opacity: 0.48;
  animation: colorDrift 12s ease-in-out infinite alternate;
}

.login-screen::before {
  left: -10vw;
  top: -14vh;
  background: rgba(37, 99, 235, 0.2);
}

.login-screen::after {
  right: -12vw;
  bottom: -18vh;
  background: rgba(96, 165, 250, 0.18);
  animation-delay: -4s;
}

@keyframes colorDrift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(34px);
  }
  to {
    transform: translate3d(7vw, 5vh, 0) scale(1.12);
    filter: blur(40px);
  }
}

.login-card {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
  width: min(520px, 100%);
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(180%);
}

.login-brand {
  color: var(--text);
  margin-bottom: 8px;
}

.login-link {
  justify-self: center;
  color: var(--primary);
  text-decoration: none;
  font-size: 14px;
}

.login-error {
  justify-self: center;
  width: 100%;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

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

.role-card {
  display: grid;
  gap: 7px;
  min-height: 118px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.role-card:hover,
.role-card.active {
  transform: translateY(-2px);
  border-color: rgba(0, 122, 255, 0.34);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 38px rgba(0, 122, 255, 0.12);
}

.role-card small {
  color: var(--muted);
  line-height: 1.5;
}

.role-orb {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #fff;
  background: var(--primary);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
}

.topbar p {
  margin-top: 6px;
  color: var(--muted);
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: viewIn 0.24s ease both;
}

.view.centered-view.active {
  display: grid;
  justify-items: center;
}

.centered-view > .panel,
.centered-view > .form-panel {
  width: min(760px, 100%);
}

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

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metrics article,
.panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  box-shadow: 0 20px 54px rgba(37, 99, 235, 0.1);
  backdrop-filter: blur(18px) saturate(180%);
}

.panel {
  position: relative;
  overflow: visible;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: rgba(255, 255, 255, 0.92);
  pointer-events: none;
}

.metrics article {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 46px 1fr;
  grid-template-rows: auto auto;
  column-gap: 14px;
  align-items: center;
  min-height: 128px;
  padding: 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metrics article:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 62px rgba(37, 99, 235, 0.12);
}

.metrics span,
.summary-grid span {
  color: var(--muted);
  font-size: 13px;
}

.metrics article > span {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}

.metrics strong {
  grid-column: 2;
  grid-row: 2;
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1;
  position: relative;
  z-index: 1;
}

.panel {
  padding: 18px;
}

.panel:hover,
.app-card:hover,
.account-group:hover {
  box-shadow: 0 24px 62px rgba(37, 99, 235, 0.13);
}

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

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.summary-grid div {
  padding: 14px;
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.summary-grid b {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

.dashboard-games-panel {
  margin-top: 16px;
}

.dashboard-filter-panel {
  margin-bottom: 16px;
  z-index: 12;
}

#apps > .game-manager > .panel,
#ecpm > .panel {
  z-index: 12;
}

.dashboard-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 0.55fr) minmax(150px, 0.55fr) auto auto;
  gap: 10px;
  align-items: center;
}

.dashboard-game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.dashboard-game-card,
.dashboard-empty {
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.dashboard-game-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.dashboard-detail {
  justify-self: end;
  padding-inline: 18px;
}

.dashboard-game-card strong {
  font-size: 16px;
}

.dashboard-game-card div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(37, 99, 235, 0.08);
}

.dashboard-game-card span,
.dashboard-empty {
  color: var(--muted);
  font-size: 13px;
}

.dashboard-game-card b {
  font-size: 17px;
}

.dashboard-empty {
  padding: 22px;
  text-align: center;
}

.boss-member-layout {
  align-items: start;
}

.grid.two-col {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 16px;
}

.game-manager {
  display: grid;
  gap: 16px;
}

.game-manager > .form-panel {
  max-width: none;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  align-items: end;
}

.game-manager .panel-head,
.game-manager .form-actions {
  grid-column: 1 / -1;
}

.game-list-head {
  align-items: center;
  display: grid;
  grid-template-columns: auto minmax(360px, 720px) auto;
  justify-content: space-between;
  margin-bottom: 14px;
}

.game-table {
  min-width: 980px;
}

.game-toolbar {
  display: grid;
  grid-template-columns: 170px minmax(220px, 1fr) auto;
  gap: 10px;
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 10px;
  border: 1px solid rgba(37, 99, 235, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.game-toolbar select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 42px;
  border-color: rgba(37, 99, 235, 0.14);
  background-color: rgba(255, 255, 255, 0.86);
  background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7l4 4 4-4' fill='none' stroke='%232563eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 10px 24px rgba(37, 99, 235, 0.06);
  cursor: pointer;
}

.game-toolbar select:hover,
.game-toolbar input:hover {
  border-color: rgba(37, 99, 235, 0.28);
  background-color: rgba(255, 255, 255, 0.96);
}

.game-toolbar select option {
  color: var(--text);
  background: #ffffff;
}

.game-toolbar .secondary-btn {
  padding-inline: 18px;
}

.search-suggest-wrap {
  position: relative;
  min-width: 0;
}

.search-suggest-wrap input {
  width: 100%;
}

.search-suggest {
  position: absolute;
  z-index: 70;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  overflow: hidden;
  padding: 8px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 44px rgba(37, 99, 235, 0.16);
  backdrop-filter: blur(18px) saturate(180%);
}

.search-suggest button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.search-suggest button:hover {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
}

.account-list-head {
  align-items: center;
}

.account-search {
  display: grid;
  grid-template-columns: minmax(180px, 260px) auto;
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(37, 99, 235, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.account-search .secondary-btn {
  padding-inline: 18px;
}

.game-table th:first-child,
.game-table td:first-child {
  width: 70px;
  text-align: center;
}

.game-table td:nth-child(4) {
  color: var(--muted);
}

.secret-cell {
  max-width: 260px;
  overflow-wrap: anywhere;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
  line-height: 1.55;
}

.link-game-ecpm {
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.link-game-ecpm:hover {
  text-decoration: underline;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(37, 99, 235, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  font-size: 13px;
}

.pager .row-actions {
  margin-left: auto;
}

.pager-jump input {
  width: 76px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  text-align: center;
}

.form-panel {
  display: grid;
  gap: 12px;
  align-content: start;
}

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

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.muted-text {
  color: var(--muted);
  font-size: 13px;
}

.rule-list {
  display: grid;
  gap: 10px;
}

.rule-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft-2);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.rule-row:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.18);
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.08);
}

.rule-color {
  min-height: 42px;
  padding: 4px;
  cursor: pointer;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

input:focus,
select:focus {
  outline: 3px solid rgba(125, 167, 255, 0.16);
  border-color: var(--primary);
}

.date-field {
  position: relative;
}

.date-input {
  cursor: pointer;
  background: rgba(255, 255, 255, 0.86);
}

.date-popover {
  position: absolute;
  z-index: 50;
  width: 284px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 24px 70px rgba(125, 167, 255, 0.2);
  backdrop-filter: blur(24px) saturate(180%);
  animation: dateIn 0.18s ease both;
}

@keyframes dateIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.date-head,
.date-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.date-head {
  margin-bottom: 12px;
}

.date-head strong {
  font-size: 14px;
}

.date-nav {
  position: relative;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: var(--soft);
  cursor: pointer;
}

.date-nav::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 11px;
  width: 8px;
  height: 8px;
  border-left: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  transform: rotate(45deg);
}

.date-nav.next::before {
  left: 11px;
  transform: rotate(225deg);
}

.date-week,
.date-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.date-week {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.date-day {
  position: relative;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.date-day:hover {
  background: rgba(125, 167, 255, 0.12);
}

.date-day.muted {
  color: #a3a3aa;
}

.date-day.today {
  color: var(--primary);
  font-weight: 700;
}

.date-day.has-data {
  border: 1px solid rgba(37, 99, 235, 0.34);
  background: rgba(37, 99, 235, 0.14);
  color: var(--primary);
  font-weight: 700;
}

.date-day.has-data::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--primary);
  transform: translateX(-50%);
}

.date-day.selected {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

.date-day.selected::after {
  background: #fff;
}

.date-hint-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.06);
  color: var(--muted);
  font-size: 12px;
}

.date-hint-strip button {
  border: 0;
  border-radius: 999px;
  padding: 4px 7px;
  color: var(--primary);
  background: rgba(37, 99, 235, 0.12);
  cursor: pointer;
}

.date-actions {
  margin-top: 12px;
}

.date-actions button {
  border: 0;
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--primary);
  background: transparent;
  cursor: pointer;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.2);
  backdrop-filter: blur(14px);
  animation: modalFade 0.18s ease both;
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  overflow: auto;
  border-color: rgba(37, 99, 235, 0.14);
  box-shadow: 0 34px 90px rgba(15, 23, 42, 0.22);
  animation: modalPop 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.confirm-panel {
  width: min(420px, 100%);
}

.confirm-message {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.7;
}

.icon-btn {
  position: relative;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.08);
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}

.icon-btn:hover {
  transform: translateY(-1px);
  background: rgba(37, 99, 235, 0.14);
}

.icon-btn::before,
.icon-btn::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: var(--primary);
}

.icon-btn::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.icon-btn::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

@keyframes modalFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

.primary-btn,
.secondary-btn {
  border: 0;
  border-radius: 14px;
  padding: 10px 14px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.primary-btn {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
}

.primary-btn:hover,
.secondary-btn:hover {
  transform: translateY(-1px);
}

.secondary-btn {
  background: var(--soft);
  color: var(--primary);
}

.primary-btn:disabled,
.secondary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
  box-shadow: none;
}

.list {
  display: grid;
  gap: 10px;
}

.app-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft-2);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.app-card:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.16);
}

.app-card small {
  display: block;
  color: var(--muted);
  margin-top: 5px;
}

.account-group {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(125, 167, 255, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.account-group-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 4px 8px;
}

.account-group-title small {
  color: var(--muted);
}

.account-card.member-card {
  margin-left: 18px;
  background: rgba(255, 255, 255, 0.62);
}

.boss-member-card,
.admin-account-card {
  grid-template-columns: 1fr;
}

.boss-member-main {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.member-games {
  border-top: 1px solid rgba(37, 99, 235, 0.1);
  padding-top: 10px;
}

.member-games summary {
  width: max-content;
  cursor: pointer;
  color: var(--primary);
  font-size: 13px;
  user-select: none;
}

.member-game-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.member-game-item {
  padding: 10px 12px;
  border: 1px solid rgba(37, 99, 235, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
}

.member-game-item strong,
.member-game-item small {
  display: block;
}

.member-game-detail {
  margin-top: 8px;
  padding: 7px 12px;
  font-size: 12px;
}

.member-games-empty {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.danger {
  color: var(--danger);
  background: #fff1f2;
  border: 0;
  border-radius: 14px;
  padding: 8px 10px;
  cursor: pointer;
}

.filters {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 0.7fr) minmax(220px, 1.15fr) minmax(150px, 0.7fr) auto;
  gap: 10px;
  margin-bottom: 14px;
}

.native-select-hidden {
  display: none;
}

.ecpm-app-picker {
  position: relative;
  min-width: 0;
}

.ecpm-app-picker-button {
  width: 100%;
  height: 44px;
  padding: 0 42px 0 14px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 10px 24px rgba(37, 99, 235, 0.06);
}

.ecpm-app-picker-button::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  transform: translateY(-65%) rotate(45deg);
}

.ecpm-app-picker-menu {
  position: absolute;
  z-index: 90;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 44px rgba(37, 99, 235, 0.16);
}

.ecpm-app-option {
  display: block;
  width: 100%;
  border: 0;
  padding: 10px 14px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.ecpm-app-option:hover {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
}

.ecpm-app-option.sticky-all {
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid rgba(37, 99, 235, 0.12);
  background: #fff;
  font-weight: 700;
}

.ecpm-day-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.ecpm-day-summary div {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border: 1px solid rgba(37, 99, 235, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86), 0 16px 42px rgba(37, 99, 235, 0.07);
}

.ecpm-day-summary span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.ecpm-day-summary b {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1320px;
  background: rgba(255, 255, 255, 0.82);
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 11px;
  text-align: left;
  font-size: 14px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #475569;
  font-weight: 650;
  background: rgba(248, 250, 252, 0.96);
  box-shadow: inset 0 -1px 0 var(--line);
}

tbody tr:hover {
  background: rgba(37, 99, 235, 0.04);
}

.list > p,
tbody td[colspan] {
  color: var(--muted);
}

tbody td[colspan] {
  padding: 34px 16px;
  text-align: center;
  background: rgba(255, 255, 255, 0.44);
}

.revenue-badge {
  display: inline-flex;
  min-width: 72px;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--text);
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

code {
  color: var(--primary);
  background: var(--soft);
  border-radius: 10px;
  padding: 5px 7px;
}

.status-sent {
  color: var(--success);
}

.status-stored {
  color: var(--warning);
}

.toast {
  position: fixed;
  z-index: 110;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -46%) scale(0.98);
  display: none;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(29, 29, 31, 0.92);
  color: #fff;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.toast.show {
  display: block;
  transform: translate(-50%, -50%) scale(1);
}

.progress-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(8px) saturate(140%);
}

.progress-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(340px, calc(100vw - 32px));
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.22);
  color: var(--text);
}

.progress-ring {
  width: 42px;
  height: 42px;
  border: 4px solid rgba(37, 99, 235, 0.14);
  border-top-color: var(--primary);
  border-radius: 999px;
  animation: spin 0.82s linear infinite;
}

.progress-card strong {
  font-size: 18px;
}

.progress-card span {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.progress-track {
  overflow: hidden;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
}

.progress-track i {
  display: block;
  width: 10%;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 0.28s ease;
}

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

.nav-icon,
.field-icon,
.metric-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  font-style: normal;
}

.nav-icon {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  font-size: 12px;
}

.field-head {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.field-icon {
  width: 24px;
  height: 24px;
  border-radius: 9px;
  color: var(--primary);
  background: rgba(37, 99, 235, 0.1);
  font-size: 11px;
  font-weight: 700;
}

.metric-icon {
  position: relative;
  grid-column: 1;
  grid-row: 1 / span 2;
  left: auto;
  top: auto;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  color: #fff;
  background: var(--primary);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.2);
  z-index: 1;
}

.nav-icon::before,
.nav-icon::after,
.field-icon::before,
.field-icon::after,
.metric-icon::before,
.metric-icon::after,
.role-orb::before,
.role-orb::after {
  content: "";
  position: absolute;
  display: block;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.nav-icon,
.field-icon,
.metric-icon,
.role-orb {
  position: relative;
}

.i-grid::before {
  width: 4px;
  height: 4px;
  border-radius: 1px;
  background: currentColor;
  transform: translate(-5px, -5px);
  box-shadow: 7px 0 0 currentColor;
}

.i-grid::after {
  width: 4px;
  height: 4px;
  border-radius: 1px;
  background: currentColor;
  transform: translate(-5px, 2px);
  box-shadow: 7px 0 0 currentColor;
}

.i-user::before {
  width: 7px;
  height: 7px;
  top: 38%;
  border-radius: 999px;
  background: currentColor;
}

.i-user::after {
  width: 14px;
  height: 7px;
  top: 63%;
  border-radius: 999px 999px 4px 4px;
  background: currentColor;
}

.i-members::before {
  width: 7px;
  height: 7px;
  top: 39%;
  left: 42%;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 7px 1px 0 -1px currentColor;
}

.i-members::after {
  width: 15px;
  height: 7px;
  top: 64%;
  left: 48%;
  border-radius: 999px 999px 4px 4px;
  background: currentColor;
}

.i-app::before {
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-radius: 5px;
}

.i-app::after {
  width: 5px;
  height: 5px;
  border-radius: 2px;
  background: currentColor;
}

.i-chart::before {
  width: 14px;
  height: 10px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.i-chart::after {
  width: 13px;
  height: 8px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: translate(-50%, -50%) rotate(-25deg);
}

.i-link::before,
.i-link::after {
  width: 10px;
  height: 6px;
  border: 2px solid currentColor;
  border-radius: 999px;
}

.i-link::before {
  transform: translate(-78%, -50%) rotate(-25deg);
}

.i-link::after {
  transform: translate(-22%, -50%) rotate(-25deg);
}

.i-gear::before {
  width: 14px;
  height: 14px;
  border: 2px dashed currentColor;
  border-radius: 999px;
}

.i-gear::after {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
}

.i-sliders::before {
  width: 15px;
  height: 12px;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.i-sliders::after {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 7px -5px 0 currentColor, -5px 5px 0 currentColor;
}

.i-pulse::before {
  width: 16px;
  height: 9px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: skewX(-26deg);
}

.i-money::before {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 999px;
}

.i-money::after {
  width: 7px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.i-time::before {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 999px;
}

.i-time::after {
  width: 6px;
  height: 6px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translate(-35%, -62%);
}

.i-event::before {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: currentColor;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

.i-id::before {
  width: 15px;
  height: 11px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.i-id::after {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
}

.i-os::before {
  width: 15px;
  height: 11px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.i-os::after {
  width: 8px;
  height: 2px;
  top: 70%;
  border-radius: 999px;
  background: currentColor;
}

.i-platform::before {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid currentColor;
}

.i-platform::after {
  width: 2px;
  height: 16px;
  background: currentColor;
  box-shadow: 6px 0 0 -0.5px currentColor, -6px 0 0 -0.5px currentColor;
}

.i-brand::before {
  width: 13px;
  height: 13px;
  border-radius: 4px;
  border: 2px solid currentColor;
  transform: translate(-50%, -50%) rotate(45deg);
}

.i-phone::before {
  width: 10px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.i-phone::after {
  width: 4px;
  height: 2px;
  top: 76%;
  border-radius: 999px;
  background: currentColor;
}

.i-ip::before {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 999px;
}

.i-ip::after {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
}

.i-city::before {
  width: 4px;
  height: 9px;
  border-radius: 1px;
  background: currentColor;
  box-shadow: 6px -4px 0 0 currentColor, 12px 2px 0 0 currentColor;
  transform: translate(-8px, -50%);
}

.i-source::before {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 2px solid currentColor;
  transform: translate(-50%, -50%) rotate(45deg);
}

.i-source::after {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
}

@media (max-width: 1000px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
    height: auto;
    padding: 14px;
    overflow: auto;
  }

  .sidebar-toggle {
    display: none;
  }

  .sidebar-collapsed .brand strong,
  .sidebar-collapsed .brand span,
  .sidebar-collapsed .nav-item {
    font-size: inherit;
  }

  .sidebar-collapsed .brand > div:not(.brand-mark) {
    opacity: 1;
    max-width: 170px;
    transform: none;
  }

  .sidebar-collapsed .nav-item,
  .sidebar-collapsed .nav-item.active,
  .sidebar-collapsed .nav-item:hover {
    color: #3a3a3c;
    justify-content: flex-start;
    gap: 10px;
    padding: 11px 12px;
    width: auto;
    height: auto;
    text-indent: 0;
  }

  .sidebar nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
  }

  .nav-item {
    width: auto;
    min-width: max-content;
  }

  .metrics,
  .summary-grid,
  .ecpm-day-summary,
  .grid.two-col,
  .game-manager > .form-panel,
  .game-list-head,
  .game-toolbar,
  .dashboard-toolbar {
    grid-template-columns: 1fr;
  }

  .game-list-head {
    justify-content: stretch;
  }

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

  .top-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .filters {
    grid-template-columns: 1fr;
  }

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

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

  .pager .row-actions {
    width: 100%;
    margin-left: 0;
  }

  .pager .row-actions button {
    flex: 1;
  }
}

@media (max-width: 680px) {
  .content {
    padding: 16px;
  }

  .login-card {
    padding: 24px;
    border-radius: 24px;
  }

  .login-role-grid {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 14px;
  }

  .modal {
    align-items: end;
    padding: 12px;
  }

  .modal-panel {
    max-height: calc(100vh - 24px);
    border-radius: 22px;
  }
}

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