:root {
  color-scheme: light;
  --bg: #e3e8ef;
  --surface: #f7f9fc;
  --surface-soft: #eef3f8;
  --line: #dfe6ef;
  --line-strong: #cbd5e1;
  --text: #111827;
  --muted: #667085;
  --blue: #55a7ff;
  --blue-soft: #eaf2ff;
  --green: #16805f;
  --green-soft: #e9f8f2;
  --amber: #9a6700;
  --amber-soft: #fff4d8;
  --red: #c9352b;
  --red-soft: #fff0ee;
  --ink-soft: #eef2f7;
  --shadow-sm: 0 8px 22px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 18px 42px rgba(15, 23, 42, 0.10);
}

/* Campaign delivery controls */
.delivery-control-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(85, 167, 255, 0.18);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(246, 250, 255, 0.96), rgba(255, 255, 255, 0.98));
}

.delivery-control-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.delivery-control-head div {
  display: grid;
  gap: 4px;
}

.delivery-control-head strong {
  color: #17223b;
  font-size: 15px;
}

.delivery-control-head span,
.delivery-control-note {
  color: #74809a;
  font-size: 12px;
}

.delivery-control-note {
  margin: -4px 0 0;
}

.device-targeting {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(216, 225, 239, 0.9);
  border-radius: 8px;
  background: #fff;
}

.device-targeting legend {
  padding: 0 6px;
  color: #5c6983;
  font-size: 12px;
}

.device-targeting label {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #e1e8f2;
  border-radius: 6px;
  background: #f8fbff;
  color: #35415b;
  font-size: 12px;
}

.device-targeting input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #55a7ff;
}

@media (max-width: 720px) {
  .delivery-control-card .form-row.three {
    grid-template-columns: 1fr;
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 1120px;
  background:
    linear-gradient(180deg, #dbe2eb 0, #edf1f6 260px, #e3e8ef 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

body.auth-locked {
  --accent: #55a7ff;
  --accent-2: #16805f;
  --accent-shadow: rgba(85, 167, 255, 0.24);
  --accent-border: rgba(85, 167, 255, 0.22);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background:
    linear-gradient(135deg, rgba(85, 167, 255, 0.075), rgba(22, 128, 95, 0.04) 42%, rgba(226, 232, 240, 0) 74%),
    linear-gradient(90deg, rgba(17, 24, 39, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(17, 24, 39, 0.035) 1px, transparent 1px),
    #e8edf3;
  background-size: auto, 44px 44px, 44px 44px, auto;
}

body.auth-locked[data-portal="merchant"] {
  --accent: #16805f;
  --accent-2: #55a7ff;
  --accent-shadow: rgba(22, 128, 95, 0.24);
  --accent-border: rgba(22, 128, 95, 0.22);
}

body.auth-locked::before {
  content: "";
  position: fixed;
  inset: auto -12vw -18vh 38vw;
  height: 52vh;
  transform: skewY(-8deg);
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.08), rgba(85, 167, 255, 0.08), rgba(22, 128, 95, 0.06));
  pointer-events: none;
}

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

button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

button:hover {
  border-color: var(--line-strong);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.07);
  transform: translateY(-1px);
}

button.primary,
.primary {
  border-color: var(--blue);
  background: linear-gradient(135deg, #55a7ff, #348fff);
  color: #fff;
  box-shadow: 0 10px 22px rgba(85, 167, 255, 0.18);
}

button.danger {
  border-color: #f0b8b2;
  background: var(--red-soft);
  color: var(--red);
}

button.success {
  border-color: #a4dec7;
  background: var(--green-soft);
  color: var(--green);
}

.hidden {
  display: none !important;
}

body.auth-locked .metric-grid,
body.auth-locked .admin-grid,
body.auth-locked .user-data-panel,
body.auth-locked .invite-tree-panel,
body.auth-locked .review-panel,
body.auth-locked .reward-rules-panel,
body.auth-locked .ops-panel,
body.auth-locked .report-panel,
body.auth-locked .merchant-command,
body.auth-locked .editor-drawer {
  display: none !important;
}

/* Authentication is a whitelist: future merchant modules stay private by default. */
body.auth-locked .portal-shell > :not(.portal-header):not(.login-panel):not(.status-line) {
  display: none !important;
}

body.auth-locked .portal-shell {
  min-height: 100vh;
  width: min(1160px, calc(100vw - 56px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 64px;
  align-items: center;
  padding: 40px 0;
}

body.auth-locked .portal-header {
  display: block;
  margin: 0;
}

body.auth-locked .portal-header h1 {
  max-width: 500px;
  font-size: 46px;
  line-height: 1.12;
  font-weight: 800;
}

body.auth-locked .portal-header p:not(.eyebrow) {
  max-width: 480px;
  margin-top: 14px;
  color: #475467;
  font-size: 16px;
  line-height: 1.75;
}

body.auth-locked .eyebrow {
  width: fit-content;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

body.auth-locked .header-actions {
  display: none;
}

body.auth-locked .login-panel {
  min-height: 430px;
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 18px;
  padding: 30px;
  margin: 0;
  border-color: rgba(203, 213, 225, 0.82);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.15);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

body.auth-locked .login-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), #111827);
}

body.auth-locked .login-panel label {
  gap: 8px;
}

body.auth-locked .login-panel input {
  min-height: 48px;
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.9);
  border-color: #d8e0eb;
}

body.auth-locked .login-panel button.primary {
  min-height: 48px;
  margin-top: 4px;
  border-radius: 8px;
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent), #111827);
  font-weight: 720;
  box-shadow: 0 14px 30px var(--accent-shadow);
}

body.auth-locked .status-line {
  grid-column: 2;
  min-height: 24px;
  margin: -50px 0 0;
  padding: 0 4px;
}

.login-card-head {
  display: none;
}

body.auth-locked .login-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(218, 226, 238, 0.9);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

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

.login-card-head strong {
  display: block;
  font-size: 17px;
  font-weight: 780;
}

.login-card-head small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.login-showcase {
  display: none;
}

body.auth-locked .login-showcase {
  width: min(520px, 100%);
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: end;
  margin-top: 34px;
}

.showcase-phone {
  min-height: 292px;
  position: relative;
  padding: 18px;
  border: 1px solid rgba(203, 213, 225, 0.78);
  border-radius: 28px;
  background: linear-gradient(180deg, #111827, #1f2937);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.26);
}

.phone-top {
  width: 70px;
  height: 7px;
  margin: 0 auto 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
}

.video-tile {
  min-height: 96px;
  display: grid;
  align-content: end;
  gap: 4px;
  padding: 14px;
  border-radius: 12px;
}

.video-tile span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.74);
}

.video-tile strong {
  color: #fff;
  font-size: 16px;
}

.primary-video {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 44%),
    linear-gradient(135deg, var(--accent), #111827);
}

.secondary-video {
  min-height: 76px;
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.showcase-data {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.showcase-data div {
  min-height: 72px;
  display: grid;
  gap: 4px;
  align-content: center;
  padding: 12px 14px;
  border: 1px solid rgba(203, 213, 225, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

.showcase-data span {
  color: var(--muted);
  font-size: 12px;
}

.showcase-data strong {
  color: #111827;
  font-size: 23px;
  font-weight: 800;
}

.portal-shell {
  width: min(1480px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.portal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  padding: 22px 24px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(85, 167, 255, 0.24), rgba(22, 128, 95, 0.15) 44%, rgba(17, 24, 39, 0.92) 100%),
    #111827;
  box-shadow: var(--shadow-md);
}

.eyebrow {
  margin: 0 0 4px;
  width: fit-content;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border: 1px solid rgba(219, 234, 254, 0.88);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #348fff;
  font-size: 12px;
  font-weight: 820;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.portal-header h1 {
  margin: 0;
  color: #fff;
  font-size: 28px;
  font-weight: 800;
}

.portal-header p:not(.eyebrow) {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.72);
}

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

.review-pulse {
  min-height: 42px;
  display: grid;
  grid-template-columns: auto auto;
  column-gap: 8px;
  row-gap: 1px;
  align-items: center;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.20);
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  text-align: left;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.10);
}

.review-pulse span {
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 700;
}

.review-pulse strong {
  font-size: 18px;
  font-weight: 860;
}

.review-pulse small {
  grid-column: 1 / -1;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.66);
  font-size: 11px;
}

.review-pulse:not(.is-empty) {
  border-color: rgba(255, 209, 102, 0.54);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.28), rgba(255, 255, 255, 0.12));
}

.ghost-link {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
  text-decoration: none;
}

.account-badge {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  white-space: nowrap;
}

.portal-header .header-actions button {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.portal-header .header-actions .review-pulse:not(.is-empty) {
  border-color: rgba(255, 209, 102, 0.54);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.28), rgba(255, 255, 255, 0.12));
}

body[data-portal="merchant"]:not(.auth-locked) .portal-header {
  background:
    linear-gradient(135deg, rgba(22, 128, 95, 0.34), rgba(85, 167, 255, 0.16) 48%, rgba(17, 24, 39, 0.94) 100%),
    #111827;
}

body[data-portal="merchant"]:not(.auth-locked) .eyebrow {
  border-color: rgba(209, 250, 229, 0.92);
  background: rgba(255, 255, 255, 0.94);
  color: #0f6249;
}

.login-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

label span,
legend {
  color: var(--muted);
  font-size: 12px;
}

input,
textarea,
select {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(85, 167, 255, 0.12);
}

.password-field {
  position: relative;
  min-width: 0;
}

.password-field input {
  padding-right: 46px;
}

.password-field button {
  width: 34px;
  min-height: 30px;
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  font-size: 18px;
  line-height: 1;
  box-shadow: none;
}

.password-field button:hover {
  transform: translateY(-50%);
  background: #eef4ff;
  color: var(--blue);
  box-shadow: none;
}

.password-field button[aria-pressed="true"] {
  background: var(--blue-soft);
  color: var(--blue);
}

.status-line {
  min-height: 22px;
  margin-bottom: 14px;
  color: var(--muted);
}

.status-line.ok {
  color: var(--green);
}

.status-line.warn {
  color: var(--amber);
}

.status-line.error {
  color: var(--red);
}

.action-toast {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  left: 50%;
  z-index: 3000;
  min-width: 180px;
  max-width: min(420px, calc(100vw - 32px));
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(85, 167, 255, 0.22);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.16);
  color: #1d4f82;
  font-size: 14px;
  font-weight: 850;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -14px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.action-toast.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.action-toast.ok {
  border-color: rgba(22, 128, 95, 0.2);
  color: #166b4f;
}

.action-toast.warn {
  border-color: rgba(245, 158, 11, 0.26);
  color: #92400e;
}

.action-toast.error {
  border-color: rgba(220, 38, 38, 0.2);
  color: #b91c1c;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(112px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 8px;
  min-height: 104px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: #94a3b8;
}

.metric:nth-child(1)::before,
.metric:nth-child(2)::before {
  background: var(--blue);
}

.metric:nth-child(3)::before {
  background: var(--amber);
}

.metric:nth-child(4)::before,
.metric:nth-child(5)::before {
  background: var(--green);
}

.metric:nth-child(7)::before {
  background: #7c3aed;
}

.metric:nth-child(8)::before {
  background: var(--red);
}

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

.metric strong {
  font-size: 26px;
  font-weight: 820;
}

.metric:nth-child(1),
.metric:nth-child(2) {
  border-color: rgba(85, 167, 255, 0.22);
  background: linear-gradient(180deg, #ffffff, #f4f8ff);
}

body[data-portal="merchant"] .merchant-metric-grid .metric:nth-child(1),
body[data-portal="merchant"] .merchant-metric-grid .metric:nth-child(2) {
  border-color: rgba(22, 128, 95, 0.24);
  background: linear-gradient(180deg, #ffffff, #f2fbf7);
}

body[data-portal="merchant"] .merchant-metric-grid .metric:nth-child(1)::before,
body[data-portal="merchant"] .merchant-metric-grid .metric:nth-child(2)::before {
  background: var(--green);
}

.merchant-command {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 16px;
  margin-bottom: 16px;
}

.merchant-finance-panel {
  border-color: rgba(22, 128, 95, 0.24);
  box-shadow: 0 20px 46px rgba(22, 128, 95, 0.10);
}

.merchant-finance-panel > .panel-title {
  min-height: 68px;
  border-bottom-color: rgba(22, 128, 95, 0.16);
  background:
    linear-gradient(90deg, rgba(22, 128, 95, 0.12), rgba(85, 167, 255, 0.06), transparent),
    #fff;
}

.merchant-finance-panel > .panel-title h2 {
  color: var(--green);
  font-size: 18px;
}

.merchant-finance-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 16px;
}

.merchant-finance-card {
  min-height: 106px;
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 6px;
  align-content: center;
  padding: 14px;
  border: 1px solid #dbe6f3;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
}

.merchant-finance-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--blue);
}

.merchant-finance-card.green::before {
  background: var(--green);
}

.merchant-finance-card.amber::before {
  background: var(--amber);
}

.merchant-finance-card span,
.merchant-finance-card small {
  color: var(--muted);
  font-size: 12px;
}

.merchant-finance-card span {
  font-weight: 700;
}

.merchant-finance-card strong {
  font-size: 24px;
  font-weight: 840;
}

.merchant-guide {
  display: grid;
  gap: 10px;
  padding: 0 16px 16px;
}

.merchant-guide > strong {
  font-size: 14px;
}

.merchant-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.merchant-checklist span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.merchant-checklist span.done {
  border-color: #a4dec7;
  background: var(--green-soft);
  color: var(--green);
}

.merchant-ledger-panel {
  align-self: stretch;
}

.merchant-ledger-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding: 14px;
}

.merchant-ledger-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.merchant-ledger-item.recharge {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.merchant-ledger-item.spend {
  border-color: #fed7aa;
  background: #fff7ed;
}

.merchant-ledger-item div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.merchant-ledger-item div:last-child {
  text-align: right;
}

.merchant-ledger-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.merchant-ledger-item.spend div:last-child strong {
  color: #c2410c;
}

.merchant-ledger-item.recharge div:last-child strong {
  color: #15803d;
}

.merchant-ledger-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.merchant-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  gap: 16px;
  margin-bottom: 16px;
}

.merchant-action-panel,
.merchant-audit-timeline {
  min-width: 0;
  border: 1px solid rgba(22, 128, 95, 0.18);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.merchant-action-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.36fr);
  gap: 10px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(22, 128, 95, 0.12), rgba(85, 167, 255, 0.06), transparent 70%),
    #fff;
}

.merchant-action-card {
  min-height: 118px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid #dbe6f3;
  border-radius: 8px;
  background: #fff;
}

.merchant-action-card.compact {
  display: grid;
  align-content: center;
}

.merchant-action-card.blue {
  border-color: rgba(85, 167, 255, 0.22);
  background: linear-gradient(180deg, #fff, #f4f8ff);
}

.merchant-action-card.green {
  border-color: rgba(22, 128, 95, 0.22);
  background: linear-gradient(180deg, #fff, #f2fbf7);
}

.merchant-action-card.amber {
  border-color: rgba(245, 158, 11, 0.28);
  background: linear-gradient(180deg, #fff, #fff8e6);
}

.merchant-action-card span,
.merchant-action-card p {
  color: var(--muted);
  font-size: 12px;
}

.merchant-action-card strong {
  display: block;
  margin: 5px 0;
  font-size: 20px;
  font-weight: 850;
}

.merchant-action-card p {
  margin: 0;
  line-height: 1.5;
}

.merchant-action-card button {
  min-width: 112px;
  border-color: rgba(22, 128, 95, 0.26);
  background: var(--green);
  color: #fff;
}

.merchant-timeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 0;
}

.merchant-timeline-head strong {
  font-size: 15px;
}

.merchant-timeline-head span {
  color: var(--muted);
  font-size: 12px;
}

.merchant-timeline-list {
  display: grid;
  gap: 8px;
  padding: 12px 14px 14px;
}

.merchant-timeline-list article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 9px;
  border: 1px solid #e5edf6;
  border-radius: 8px;
  background: #fbfdff;
}

.merchant-timeline-list .status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #94a3b8;
}

.merchant-timeline-list .status-active {
  background: var(--green);
}

.merchant-timeline-list .status-pending_review {
  background: var(--amber);
}

.merchant-timeline-list .status-rejected {
  background: var(--red);
}

.merchant-timeline-list div {
  min-width: 0;
}

.merchant-timeline-list strong,
.merchant-timeline-list p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.merchant-timeline-list strong {
  display: block;
  font-size: 13px;
}

.merchant-timeline-list p,
.merchant-timeline-list small {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.merchant-campaign-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfdff;
}

.merchant-campaign-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #dfe8f3;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.045);
}

.merchant-campaign-card > img,
.campaign-card-empty {
  width: 86px;
  height: 78px;
  border-radius: 8px;
  object-fit: cover;
  background: #eef4f8;
}

.campaign-card-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.campaign-card-main {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.campaign-card-main > div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
}

.campaign-card-main strong,
.campaign-card-main p,
.campaign-card-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.campaign-card-main p,
.campaign-card-main small,
.campaign-card-stats span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.campaign-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.campaign-card-stats span {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
}

.delivery-pill {
  width: fit-content;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid #dbe6f3;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.delivery-pill.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.delivery-pill.warn {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}

.campaign-completeness {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5edf6;
}

.campaign-completeness i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.merchant-review-panel {
  border-color: rgba(148, 163, 184, 0.28);
}

.reward-rules-panel {
  margin-bottom: 16px;
}

.reward-rules-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
}

.reward-rules-form button {
  white-space: nowrap;
}

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

.reward-report-card {
  min-height: 78px;
  display: grid;
  gap: 4px;
  align-content: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #f8fafc);
}

.reward-report-card span,
.reward-report-card small {
  color: var(--muted);
  font-size: 12px;
}

.reward-report-card strong {
  color: var(--text);
  font-size: 20px;
  font-weight: 760;
}

.ops-panel {
  margin-bottom: 16px;
  border-color: rgba(85, 167, 255, 0.22);
  box-shadow: 0 20px 46px rgba(85, 167, 255, 0.10);
}

.ops-panel > .panel-title {
  min-height: 68px;
  border-bottom-color: rgba(85, 167, 255, 0.16);
  background:
    linear-gradient(90deg, rgba(85, 167, 255, 0.10), rgba(22, 128, 95, 0.06), transparent),
    #fff;
}

.ops-panel > .panel-title h2 {
  color: #348fff;
  font-size: 18px;
}

.status-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.status-filter button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: #475569;
  background: #fff;
}

.status-filter button.active {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 700;
}

.status-filter button.has-count {
  border-color: rgba(245, 158, 11, 0.38);
  background: #fff8e6;
  color: #9a5a00;
}

.campaign-scope-bar {
  min-height: 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(219, 229, 240, 0.92);
  background:
    linear-gradient(90deg, rgba(85, 167, 255, 0.08), rgba(22, 128, 95, 0.045)),
    #fbfdff;
}

.campaign-scope-bar:empty {
  display: none;
}

.campaign-scope-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.campaign-scope-main span,
.campaign-scope-main small,
.campaign-scope-stats span {
  color: #667085;
  font-size: 12px;
}

.campaign-scope-main strong {
  min-width: 0;
  overflow: hidden;
  color: #173153;
  font-size: 16px;
  font-weight: 820;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.campaign-scope-stats,
.campaign-scope-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.campaign-scope-stats span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(219, 229, 240, 0.92);
  border-radius: 999px;
  background: #fff;
  color: #3f5063;
  font-weight: 760;
}

.campaign-scope-actions button {
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid rgba(85, 167, 255, 0.16);
  border-radius: 999px;
  background: #fff;
  color: #55a7ff;
  font-size: 12px;
  font-weight: 780;
  box-shadow: 0 5px 14px rgba(85, 167, 255, 0.06);
}

.ops-board {
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(300px, 1.14fr) minmax(280px, 1fr) minmax(280px, 1fr);
  gap: 12px;
  padding: 16px;
}

.ops-board > section {
  min-width: 0;
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 12px;
  border: 1px solid #e7edf5;
  border-radius: 8px;
  background: #fbfdff;
}

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

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

.ops-section-head span {
  color: var(--muted);
  font-size: 12px;
}

.ops-list {
  display: grid;
  gap: 8px;
  max-height: 330px;
  overflow: auto;
  padding-right: 2px;
}

.ops-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.04);
}

.ops-queue-item.has-thumb {
  grid-template-columns: 58px minmax(0, 1fr) auto;
}

.ops-thumb {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
  background: #eef2f7;
}

.ops-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.ops-main strong,
.ops-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-main strong {
  font-size: 13px;
}

.ops-main span {
  color: var(--muted);
  font-size: 12px;
}

.ops-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.ops-meta small {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.ops-empty {
  min-height: 74px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfdff;
}

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

.invite-root-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(32, 106, 255, 0.12);
  border-radius: 18px;
  padding: 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(245, 249, 255, 0.9)),
    radial-gradient(circle at 18% 0%, rgba(56, 134, 255, 0.16), transparent 38%);
  box-shadow: 0 16px 34px rgba(32, 71, 150, 0.08);
}

.invite-root-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #4f9bff, #6d6af6);
}

.invite-root-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.invite-root-head strong {
  display: block;
  color: #14213d;
  font-size: 16px;
}

.invite-root-head small {
  display: block;
  margin-top: 4px;
  color: rgba(20, 33, 61, 0.52);
  font-size: 12px;
}

.invite-root-head code {
  border-radius: 999px;
  padding: 6px 9px;
  background: rgba(32, 106, 255, 0.1);
  color: #1f64df;
  font-size: 12px;
  white-space: nowrap;
}

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

.invite-root-metrics span {
  border-radius: 12px;
  padding: 10px 8px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(32, 106, 255, 0.08);
}

.invite-root-metrics em {
  display: block;
  color: rgba(20, 33, 61, 0.48);
  font-size: 11px;
  font-style: normal;
}

.invite-root-metrics strong {
  display: block;
  margin-top: 4px;
  color: #102955;
  font-size: 18px;
}

.invite-root-levels {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 13px;
}

.invite-root-levels span {
  border-radius: 999px;
  padding: 6px 9px;
  background: rgba(20, 33, 61, 0.06);
  color: rgba(20, 33, 61, 0.68);
  font-size: 12px;
}

.invite-root-recharge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid rgba(32, 106, 255, 0.1);
}

.invite-root-recharge > span {
  color: rgba(20, 33, 61, 0.58);
  font-size: 12px;
}

.invite-root-recharge > span strong {
  display: block;
  margin-top: 3px;
  color: #14213d;
  font-size: 15px;
}

.invite-root-recharge button {
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  background: linear-gradient(135deg, #2e75f0, #655cf5);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(46, 117, 240, 0.2);
}

.delivery-diagnostics {
  display: grid;
  gap: 9px;
}

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

.delivery-summary-card {
  min-height: 64px;
  display: grid;
  gap: 3px;
  align-content: center;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.delivery-summary-card span {
  color: var(--muted);
  font-size: 12px;
}

.delivery-summary-card strong {
  font-size: 20px;
  font-weight: 850;
}

.delivery-summary-card.ok strong {
  color: #0f9f6e;
}

.delivery-summary-card.warn strong,
.delivery-summary-card.review strong {
  color: #d97706;
}

.delivery-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.delivery-reason-chip {
  padding: 5px 8px;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
  font-weight: 760;
}

.delivery-diagnostic-list {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow: auto;
  padding-right: 2px;
}

.delivery-diagnostic-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 0.56fr);
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.04);
}

.delivery-diagnostic-item > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.delivery-diagnostic-item strong,
.delivery-diagnostic-item span,
.delivery-diagnostic-item b,
.delivery-diagnostic-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-diagnostic-item strong,
.delivery-diagnostic-item b {
  color: #101828;
  font-size: 13px;
}

.delivery-diagnostic-item span,
.delivery-diagnostic-item small {
  color: var(--muted);
  font-size: 12px;
}

.delivery-diagnostic-item.review,
.delivery-diagnostic-item.budget,
.delivery-diagnostic-item.balance {
  border-color: #fed7aa;
  background: #fffaf2;
}

.delivery-diagnostic-item.reject {
  border-color: #fecaca;
  background: #fff7f7;
}

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

.ops-report-card {
  min-height: 76px;
  display: grid;
  gap: 4px;
  align-content: center;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.04);
}

.ops-report-card span,
.ops-report-card small {
  color: var(--muted);
  font-size: 12px;
}

.ops-report-card strong {
  font-size: 19px;
  font-weight: 820;
}

.report-panel {
  overflow: hidden;
}

.report-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 16px;
  background: #f8fbff;
  border-bottom: 1px solid var(--line);
}

.report-card {
  min-height: 88px;
  display: grid;
  gap: 5px;
  align-content: center;
  padding: 14px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 8px 20px rgba(85, 167, 255, 0.06);
}

.report-card span,
.report-card small {
  color: var(--muted);
  font-size: 12px;
}

.report-card strong {
  color: var(--text);
  font-size: 22px;
  font-weight: 850;
}

.report-tables {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.88fr);
  gap: 14px;
  padding: 14px 16px 16px;
}

.merchant-report-panel .report-tables {
  grid-template-columns: 1fr;
}

.merchant-report-panel .report-card-grid {
  background: linear-gradient(180deg, #f7fcfb, #f8fbff);
}

.report-tables > section {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.report-list {
  display: grid;
  gap: 9px;
}

.report-row {
  min-height: 70px;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) repeat(4, minmax(74px, 0.28fr));
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.report-row.merchant {
  grid-template-columns: minmax(170px, 1fr) repeat(4, minmax(70px, 0.3fr));
}

.report-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.report-main strong,
.report-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-main strong {
  color: var(--text);
  font-size: 14px;
}

.report-main span {
  color: var(--muted);
  font-size: 12px;
}

.report-metric {
  min-width: 0;
  display: grid;
  gap: 3px;
  text-align: right;
}

.report-metric span {
  color: var(--muted);
  font-size: 11px;
}

.report-metric strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 780;
}

.admin-grid {
  display: grid;
  grid-template-columns: 430px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

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

.panel-title {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #fbfdff);
}

.panel-title h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 780;
}

.panel-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.account-form {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfdff;
}

.merchant-insight {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f4f8ff, #fbfdff);
}

.merchant-insight h3 {
  margin: 0;
  font-size: 14px;
}

.merchant-insight p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.merchant-insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.merchant-insight-grid div {
  min-height: 58px;
  display: grid;
  gap: 3px;
  align-content: center;
  padding: 9px;
  border: 1px solid #dbe6f3;
  border-radius: 8px;
  background: #fff;
}

.merchant-insight-grid span {
  color: var(--muted);
  font-size: 12px;
}

.merchant-insight-grid strong {
  font-size: 16px;
}

.merchant-campaign-mini {
  display: grid;
  gap: 6px;
}

.merchant-campaign-mini article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.merchant-campaign-mini strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.account-list {
  display: grid;
  gap: 8px;
  padding: 14px;
  max-height: 760px;
  overflow: auto;
}

.user-data-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.user-data-item {
  display: grid;
  grid-template-columns: minmax(160px, 0.9fr) minmax(0, 2.2fr);
  gap: 14px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid rgba(220, 229, 242, 0.9);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.92));
  box-shadow: 0 10px 26px rgba(28, 55, 90, 0.05);
}

.user-data-main,
.user-data-meta {
  display: flex;
  align-items: center;
}

.user-data-main {
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.user-data-main strong {
  max-width: 100%;
  overflow: hidden;
  color: #172033;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-data-main span {
  color: #667085;
  font-size: 12px;
}

.user-data-meta {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.user-data-meta span {
  padding: 6px 9px;
  border-radius: 999px;
  background: #f1f6ff;
  color: #47627f;
  font-size: 12px;
}

.user-data-meta button {
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #55a7ff, #6a80ff);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 10px 20px rgba(85, 167, 255, 0.22);
}

.user-data-meta button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(85, 167, 255, 0.28);
}

.account-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.merchant-item {
  gap: 9px;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.merchant-item:hover {
  border-color: #b9c6d8;
  background: #fff;
}

.merchant-item.active {
  border-color: var(--blue);
  background: linear-gradient(180deg, #f4f8ff, #eaf2ff);
  box-shadow: 0 0 0 3px rgba(85, 167, 255, 0.10), 0 12px 26px rgba(85, 167, 255, 0.12);
}

.merchant-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.merchant-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.merchant-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.merchant-actions button {
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  color: #475569;
  background: #fff;
}

.merchant-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.merchant-stats span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: #475569;
  font-size: 12px;
}

.account-item strong {
  font-size: 14px;
}

.account-item span {
  color: var(--muted);
  font-size: 12px;
}

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

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

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

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  background: var(--surface-soft);
  position: sticky;
  top: 0;
  z-index: 1;
}

td {
  line-height: 1.45;
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr {
  transition: background 0.14s ease;
}

tbody tr:hover {
  background: #f8fbff;
}

.empty {
  height: 120px;
  color: var(--muted);
  text-align: center;
}

.campaign-title {
  display: grid;
  gap: 3px;
  min-width: 220px;
}

.campaign-title strong {
  font-size: 14px;
}

.campaign-title span {
  color: var(--muted);
  font-size: 12px;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill,
.status-pill {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.pill {
  background: var(--ink-soft);
  color: #334155;
}

.status-pill {
  border: 1px solid var(--line);
  background: #fff;
}

.status-active {
  border-color: #a4dec7;
  background: var(--green-soft);
  color: var(--green);
}

.status-pending_review {
  border-color: #f1d189;
  background: var(--amber-soft);
  color: var(--amber);
}

.status-paused,
.status-draft {
  border-color: var(--line);
  background: var(--ink-soft);
  color: #475569;
}

.status-rejected {
  border-color: #f0b8b2;
  background: var(--red-soft);
  color: var(--red);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 210px;
}

.row-actions button,
.merchant-actions button,
.ops-meta button {
  min-height: 29px;
  padding: 0 9px;
  font-size: 12px;
}

.money {
  white-space: nowrap;
}

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

.editor-drawer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(3px);
}

.editor-card {
  width: min(720px, calc(100vw - 56px));
  height: 100vh;
  overflow: auto;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
  box-shadow: -22px 0 52px rgba(15, 23, 42, 0.22);
}

.editor-card > label,
.editor-card > .form-row,
.editor-card > fieldset,
.editor-card > .ad-preview,
.editor-card > .form-actions,
.editor-card > button.primary {
  margin: 14px;
}

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

.form-row.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

fieldset label {
  display: inline-flex;
  grid-template-columns: auto;
  align-items: center;
  gap: 6px;
  color: var(--text);
}

fieldset input {
  width: auto;
  min-height: auto;
}

.creative-upload {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.creative-upload input[type="file"] {
  display: none;
}

.creative-upload button {
  min-height: 34px;
  border-radius: 8px;
}

.creative-upload small {
  color: var(--muted);
  font-size: 12px;
}

.creative-upload.uploading button {
  opacity: 0.68;
  pointer-events: none;
}

.creative-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.creative-thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid #dbe6f3;
  border-radius: 8px;
  background: var(--surface-soft);
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.05);
}

.creative-thumb.is-primary {
  border-color: #55a7ff;
  box-shadow: 0 0 0 2px rgba(85, 167, 255, 0.14);
}

.creative-thumb img,
.creative-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.creative-thumb span {
  position: absolute;
  left: 5px;
  top: 5px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 11px;
}

.creative-thumb-actions {
  position: absolute;
  inset: auto 4px 4px;
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.creative-thumb-actions button {
  min-height: 24px;
  padding: 3px 6px;
  border: 0;
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  font-size: 11px;
  line-height: 1;
}

.ad-preview {
  min-height: 340px;
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid #dbe6f3;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(85, 167, 255, 0.08), rgba(20, 184, 166, 0.08)),
    #fff;
}

.ad-preview-head {
  display: grid;
  gap: 10px;
}

.ad-preview-head strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 780;
}

.ad-preview-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.ad-preview-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.ad-preview-tabs button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #475569;
  font-size: 12px;
}

.ad-preview-tabs button.active {
  border-color: #55a7ff;
  background: #55a7ff;
  color: #fff;
  box-shadow: 0 10px 22px rgba(85, 167, 255, 0.22);
}

.ad-preview-body {
  display: grid;
  grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.ad-phone-preview {
  min-height: 360px;
  padding: 10px;
  border-radius: 18px;
  background: #0f172a;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.20);
}

.ad-preview-screen {
  position: relative;
  overflow: hidden;
  min-height: 340px;
  height: 100%;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fafc, #e2e8f0);
}

.ad-preview-media {
  width: 100%;
  height: 100%;
  min-height: 180px;
  object-fit: cover;
  display: block;
  background: #e2e8f0;
}

video.ad-preview-media,
.creative-thumb video,
.merchant-campaign-card video,
.ops-thumb:is(video) {
  background: #020617;
}

.ad-preview-media.placeholder {
  display: grid;
  place-items: center;
  color: #64748b;
  font-size: 13px;
  font-weight: 650;
}

.ad-phone-preview.is-feed .ad-preview-media,
.ad-phone-preview.is-fullscreen .ad-preview-media {
  position: absolute;
  inset: 0;
  min-height: 100%;
}

.ad-phone-preview.has-media .ad-preview-screen::after,
.ad-phone-preview.is-fullscreen .ad-preview-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.04), rgba(15, 23, 42, 0.72));
}

.ad-preview-content {
  position: absolute;
  left: 14px;
  right: 48px;
  bottom: 14px;
  z-index: 2;
  color: #fff;
}

.ad-preview-content h3,
.preview-account-card h3,
.preview-waiting-card h3 {
  margin: 6px 0 5px;
  font-size: 17px;
  line-height: 1.25;
}

.ad-preview-content p,
.preview-account-card p,
.preview-waiting-card p {
  margin: 0;
  color: inherit;
  font-size: 12px;
  line-height: 1.45;
}

.ad-preview-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: inherit;
  font-size: 11px;
  font-weight: 720;
  backdrop-filter: blur(8px);
}

.ad-preview-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  margin-top: 10px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff;
  color: #0f172a;
  font-size: 12px;
  font-weight: 760;
}

.preview-highlight-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.preview-highlight-row span {
  min-height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: inherit;
  font-size: 11px;
}

.preview-feed-actions {
  position: absolute;
  right: 10px;
  bottom: 68px;
  z-index: 2;
  display: grid;
  gap: 8px;
}

.preview-feed-actions span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.34);
  color: #fff;
  font-size: 11px;
  font-weight: 740;
  backdrop-filter: blur(6px);
}

.ad-phone-preview.is-fullscreen button {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 3;
  width: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.46);
  color: #fff;
}

.preview-waiting-top {
  display: grid;
  gap: 8px;
  padding: 18px 14px 10px;
}

.preview-waiting-top strong {
  font-size: 17px;
}

.preview-waiting-top span {
  color: #64748b;
  font-size: 12px;
}

.preview-waiting-top i {
  overflow: hidden;
  height: 7px;
  border-radius: 999px;
  background: #dbe6f3;
}

.preview-waiting-top i::after {
  content: "";
  display: block;
  width: 66%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #55a7ff, #14b8a6);
}

.preview-waiting-card,
.preview-account-card {
  display: grid;
  gap: 10px;
  margin: 12px;
  padding: 10px;
  border: 1px solid #dbe6f3;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: #0f172a;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.10);
}

.preview-waiting-card {
  grid-template-columns: 92px minmax(0, 1fr);
}

.preview-waiting-card .ad-preview-media {
  width: 92px;
  height: 116px;
  min-height: 116px;
  border-radius: 7px;
}

.preview-account-card .ad-preview-media {
  height: 150px;
  min-height: 150px;
  border-radius: 7px;
}

.preview-waiting-card .ad-preview-badge,
.preview-account-card .ad-preview-badge {
  background: #eff6ff;
  color: #55a7ff;
}

.preview-waiting-card .ad-preview-cta,
.preview-account-card .ad-preview-cta {
  background: #55a7ff;
  color: #fff;
}

.preview-waiting-card .preview-highlight-row span,
.preview-account-card .preview-highlight-row span {
  background: #f1f5f9;
  color: #475569;
}

.ad-preview-side {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 12px;
  border: 1px solid #dbe6f3;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.ad-preview-side strong {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
}

.ad-preview-side p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.preview-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preview-audit-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px 10px;
  align-items: center;
  margin: 8px 0 10px;
  padding: 10px;
  border: 1px solid #dbe6f3;
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fbff, #ffffff);
}

.preview-audit-summary strong {
  color: #348fff;
  font-size: 18px;
  font-weight: 860;
}

.preview-audit-summary span {
  min-width: 0;
  color: #475569;
  font-size: 12px;
  font-weight: 740;
}

.preview-audit-summary > i {
  grid-column: 1 / -1;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef7;
}

.preview-audit-summary > i b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ad-console-blue), #6d55f2);
}

.preview-audit-summary.ok {
  border-color: rgba(22, 128, 95, 0.26);
  background: linear-gradient(180deg, #f2fbf7, #ffffff);
}

.preview-audit-summary.ok strong {
  color: #0f6249;
}

.preview-check {
  min-width: min(100%, 150px);
  min-height: 42px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 2px 6px;
  align-items: center;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid #dbe6f3;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 650;
}

.preview-check i {
  width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-style: normal;
  font-size: 10px;
}

.preview-check b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #334155;
  font-size: 12px;
  font-weight: 780;
}

.preview-check small {
  grid-column: 2;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #7b8798;
  font-size: 11px;
}

.preview-check.ok {
  border-color: #bbf7d0;
  color: #15803d;
}

.preview-check.ok i {
  background: #dcfce7;
}

.preview-check.warn {
  border-color: #fed7aa;
  color: #b45309;
}

.preview-check.warn i {
  background: #ffedd5;
}

.preview-check.ok b {
  color: #11664e;
}

.preview-check.warn b {
  color: #9a3412;
}

.preview-note {
  padding: 9px;
  border-radius: 8px;
  background: #f8fafc;
}

.form-actions {
  display: flex;
  gap: 8px;
  padding-bottom: 16px;
}

/* Shared visual standard for admin and merchant ad consoles. */
:root {
  --ad-console-bg: #f3f6fa;
  --ad-console-head: #0f172a;
  --ad-console-blue: #55a7ff;
  --ad-console-green: #16805f;
  --ad-console-text: #102033;
  --ad-console-muted: #667085;
  --ad-console-line: #dbe5f0;
  --ad-console-shadow: 0 14px 34px rgba(15, 23, 42, 0.075);
}

body:not(.auth-locked) {
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.045) 0, rgba(85, 167, 255, 0.035) 250px, transparent 520px),
    var(--ad-console-bg);
  color: var(--ad-console-text);
}

.panel,
.editor-card,
.merchant-action-panel,
.merchant-audit-timeline {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--ad-console-shadow);
}

.panel-title {
  min-height: 68px;
  border-bottom-color: rgba(219, 229, 240, 0.94);
  background:
    linear-gradient(135deg, rgba(85, 167, 255, 0.12), rgba(22, 128, 95, 0.06) 48%, rgba(255, 255, 255, 0)),
    #fff;
}

.panel-title h2 {
  color: var(--ad-console-head);
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: 0;
}

.panel-title h2::before {
  content: "";
  width: 7px;
  height: 18px;
  display: inline-block;
  margin-right: 9px;
  border-radius: 999px;
  vertical-align: -3px;
  background: linear-gradient(180deg, var(--ad-console-blue), var(--ad-console-green));
}

.panel-title p,
.ops-section-head span,
.report-main span,
.merchant-main span,
.campaign-title span,
.account-item span {
  color: var(--ad-console-muted);
}

.ops-panel,
.report-panel,
.account-panel,
.review-panel,
.reward-rules-panel,
.merchant-finance-panel,
.merchant-ledger-panel {
  overflow: hidden;
}

.ops-panel,
.report-panel {
  border-color: rgba(85, 167, 255, 0.20);
}

.ops-panel > .panel-title h2,
.report-panel > .panel-title h2 {
  color: #123f91;
}

.account-panel > .panel-title h2,
.review-panel > .panel-title h2 {
  color: #173153;
}

.merchant-finance-panel > .panel-title h2,
.merchant-ledger-panel > .panel-title h2,
body[data-portal="merchant"] .report-panel > .panel-title h2,
body[data-portal="merchant"] .review-panel > .panel-title h2 {
  color: #12664e;
}

.metric,
.ops-item,
.ops-report-card,
.report-card,
.report-row,
.merchant-insight-grid div,
.merchant-campaign-mini article,
.account-item,
.merchant-campaign-card,
.merchant-finance-card,
.merchant-ledger-item,
.reward-report-card {
  border-color: rgba(219, 229, 240, 0.92);
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.045);
}

.metric {
  min-height: 108px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 252, 0.96)),
    #fff;
}

.metric strong,
.report-card strong,
.ops-report-card strong,
.reward-report-card strong,
.merchant-finance-card strong,
.merchant-insight-grid strong {
  color: var(--ad-console-head);
  letter-spacing: 0;
}

.metric span,
.report-card span,
.ops-report-card span,
.reward-report-card span,
.merchant-finance-card span,
.report-metric span,
.merchant-insight-grid span {
  color: #667085;
  font-weight: 690;
}

.status-filter {
  padding: 4px;
  border: 1px solid rgba(219, 229, 240, 0.86);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.84);
}

.status-filter button {
  border-color: transparent;
  background: transparent;
  color: #516173;
  box-shadow: none;
}

.status-filter button:hover {
  background: #fff;
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.055);
}

.status-filter button.active {
  border-color: rgba(85, 167, 255, 0.18);
  background: #fff;
  color: var(--ad-console-blue);
  box-shadow: 0 8px 18px rgba(85, 167, 255, 0.12);
}

.ops-board > section,
.report-tables > section {
  border-color: rgba(219, 229, 240, 0.88);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(247, 250, 252, 0.96)),
    #fff;
}

.ops-section-head {
  min-height: 34px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(219, 229, 240, 0.86);
}

.ops-section-head strong {
  color: var(--ad-console-head);
  font-size: 14px;
  font-weight: 800;
}

.ops-report-card,
.report-card,
.reward-report-card,
.merchant-finance-card,
.merchant-insight-grid div {
  position: relative;
  overflow: hidden;
}

.ops-report-card::before,
.report-card::before,
.reward-report-card::before,
.merchant-finance-card::before,
.merchant-insight-grid div::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--ad-console-blue), var(--ad-console-green));
}

.report-card-grid {
  border-bottom-color: rgba(219, 229, 240, 0.92);
  background:
    linear-gradient(180deg, rgba(244, 248, 255, 0.96), rgba(248, 251, 255, 0.98));
}

.report-card {
  min-height: 94px;
  border-color: rgba(191, 219, 254, 0.72);
  background:
    linear-gradient(180deg, #fff, #f8fbff);
}

.report-card strong {
  font-size: 24px;
  font-weight: 860;
}

.report-row {
  min-height: 76px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.report-row:hover,
.ops-item:hover,
.account-item:hover,
.merchant-campaign-card:hover {
  border-color: rgba(85, 167, 255, 0.28);
  box-shadow: 0 12px 26px rgba(85, 167, 255, 0.085);
}

.report-row:hover {
  transform: translateY(-1px);
  background: #fff;
}

.report-main strong,
.report-metric strong,
.merchant-insight h3,
.merchant-main strong,
.account-item strong,
.campaign-title strong {
  color: #173153;
  font-weight: 800;
}

.account-form {
  background:
    linear-gradient(180deg, rgba(247, 250, 252, 0.96), rgba(255, 255, 255, 0.98));
}

.merchant-insight {
  border-bottom-color: rgba(219, 229, 240, 0.92);
  background:
    linear-gradient(135deg, rgba(85, 167, 255, 0.095), rgba(22, 128, 95, 0.055)),
    #f8fbff;
}

.merchant-item.active {
  border-color: rgba(85, 167, 255, 0.54);
  background:
    linear-gradient(135deg, rgba(85, 167, 255, 0.12), rgba(22, 128, 95, 0.045)),
    #fff;
  box-shadow: 0 0 0 3px rgba(85, 167, 255, 0.10), 0 14px 30px rgba(85, 167, 255, 0.12);
}

.merchant-stats span,
.pill,
.delivery-pill,
.status-pill {
  border-color: rgba(219, 229, 240, 0.94);
  background: #f8fafc;
  color: #3f5063;
  font-weight: 700;
}

th {
  height: 44px;
  color: #667085;
  font-weight: 760;
  background:
    linear-gradient(180deg, #f8fafc, #f1f5f9);
}

td {
  color: #233143;
}

tbody tr:hover {
  background: #f8fbff;
}

.row-actions button,
.merchant-actions button,
.ops-meta button {
  border-color: rgba(219, 229, 240, 0.94);
  background: #fff;
  color: #46576a;
  font-weight: 680;
}

.row-actions button.primary,
.ops-meta button.primary,
button.primary,
.primary {
  border-color: var(--ad-console-blue);
  background: linear-gradient(135deg, var(--ad-console-blue), #348fff);
  color: #fff;
}

.row-actions button.success,
.ops-meta button.success,
button.success {
  border-color: rgba(22, 128, 95, 0.24);
  background: linear-gradient(135deg, #16805f, #0f6249);
  color: #fff;
}

body.auth-locked {
  background:
    radial-gradient(circle at 16% 18%, rgba(85, 167, 255, 0.14), transparent 30%),
    radial-gradient(circle at 84% 78%, rgba(22, 128, 95, 0.12), transparent 28%),
    linear-gradient(90deg, rgba(15, 23, 42, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    #f5f8fc;
  background-size: auto, auto, 44px 44px, 44px 44px, auto;
}

body.auth-locked .portal-header h1 {
  color: #fff;
  font-weight: 860;
}

body.auth-locked .portal-header p:not(.eyebrow) {
  color: rgba(255, 255, 255, 0.72);
}

body.auth-locked .eyebrow {
  border-color: rgba(219, 234, 254, 0.94);
  background: rgba(255, 255, 255, 0.96);
  color: #348fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
}

body.auth-locked[data-portal="merchant"] .eyebrow {
  border-color: rgba(209, 250, 229, 0.94);
  color: #0f6249;
}

body.auth-locked .login-panel {
  border-color: rgba(203, 213, 225, 0.76);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.16);
}

body.auth-locked .login-card-head strong {
  color: #0f172a;
}

body.auth-locked .login-panel label > span {
  color: #344054;
  font-weight: 720;
}

body.auth-locked .showcase-data div {
  border-color: rgba(219, 229, 240, 0.88);
  background: rgba(255, 255, 255, 0.9);
}

body.auth-locked .showcase-data strong {
  color: #102033;
}

body[data-portal="merchant"] .panel-title h2::before,
body[data-portal="merchant"] .ops-report-card::before,
body[data-portal="merchant"] .report-card::before,
body[data-portal="merchant"] .reward-report-card::before,
body[data-portal="merchant"] .merchant-finance-card::before,
body[data-portal="merchant"] .merchant-insight-grid div::before {
  background: linear-gradient(90deg, var(--ad-console-green), var(--ad-console-blue));
}

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

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

  .portal-shell {
    width: calc(100vw - 28px);
  }

  .portal-header,
  .admin-grid,
  .merchant-command,
  .merchant-workbench,
  .merchant-action-panel,
  .merchant-campaign-cards,
  .merchant-campaign-card,
  .login-panel,
  .metric-grid,
  .reward-rules-form,
  .ops-board,
  .report-tables,
  .ad-preview-body,
  .form-row,
  .form-row.three {
    grid-template-columns: 1fr;
  }

  .status-filter {
    justify-content: flex-start;
  }

  .campaign-scope-bar {
    grid-template-columns: 1fr;
  }

  .campaign-scope-stats,
  .campaign-scope-actions {
    justify-content: flex-start;
  }

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

  .ops-report-grid,
  .report-card-grid,
  .merchant-finance-grid,
  .merchant-insight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-row,
  .report-row.merchant {
    grid-template-columns: minmax(150px, 1fr) repeat(2, minmax(70px, 0.4fr));
  }

  .report-row .report-metric:nth-last-child(-n+2) {
    display: none;
  }

  .merchant-command {
    display: grid;
  }

  .merchant-finance-grid {
    padding: 14px;
  }

  .portal-header {
    display: grid;
  }

  .metric-grid {
    display: grid;
  }

  .header-actions {
    flex-wrap: wrap;
  }

  .panel-actions {
    justify-content: flex-start;
  }

  .ad-phone-preview {
    min-height: 320px;
  }

  .ad-preview-screen {
    min-height: 300px;
  }

  body.auth-locked .portal-shell {
    width: min(460px, calc(100vw - 28px));
    min-height: 100vh;
    grid-template-columns: 1fr;
    gap: 22px;
    align-content: center;
    padding: 28px 0;
  }

  body.auth-locked .portal-header h1 {
    font-size: 31px;
  }

  body.auth-locked .portal-header p:not(.eyebrow) {
    font-size: 14px;
    line-height: 1.65;
  }

  body.auth-locked .login-showcase {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 18px;
  }

  body.auth-locked .showcase-phone {
    display: none;
  }

  body.auth-locked .showcase-data {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 0;
  }

  body.auth-locked .showcase-data div {
    min-height: 58px;
    padding: 10px;
  }

  body.auth-locked .showcase-data strong {
    font-size: 18px;
  }

  body.auth-locked .login-panel {
    min-height: auto;
    padding: 22px;
  }

  body.auth-locked .status-line {
    grid-column: auto;
    margin: -10px 0 0;
  }
}

@media (max-width: 640px) {
  .invite-root-grid {
    grid-template-columns: 1fr;
  }
}

/* User data fold v1 */
.user-data-details {
  margin-top: 14px;
  border: 1px solid rgba(82, 103, 132, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.user-data-details summary {
  min-height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  color: #1d2a3a;
  font-weight: 800;
}

.user-data-details summary::-webkit-details-marker {
  display: none;
}

.user-data-details summary::after {
  content: "?";
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(73, 133, 255, 0.1);
  color: #377cff;
  font-size: 20px;
  line-height: 1;
  transition: transform 0.18s ease;
}

.user-data-details[open] summary::after {
  transform: rotate(90deg);
}

.user-data-details summary strong {
  margin-left: auto;
  color: #52667f;
  font-size: 13px;
  font-weight: 760;
}

.user-data-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
  border-top: 1px solid rgba(82, 103, 132, 0.1);
}

.user-data-toolbar label {
  display: grid;
  gap: 5px;
}

.user-data-toolbar span {
  color: #667085;
  font-size: 12px;
  font-weight: 760;
}

.user-data-toolbar input {
  min-height: 38px;
  border: 1px solid #dbe6f3;
  border-radius: 10px;
  padding: 0 12px;
  background: #fff;
  color: #172033;
}

.user-data-toolbar button,
.user-data-pager button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(85, 167, 255, 0.22);
  border-radius: 10px;
  background: #f4f8ff;
  color: #2563eb;
  font-size: 13px;
  font-weight: 800;
}

.user-data-toolbar button:first-of-type {
  background: #2563eb;
  color: #fff;
}

.user-data-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(82, 103, 132, 0.1);
  color: #667085;
  font-size: 13px;
}

.user-data-pager > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-data-pager strong {
  color: #172033;
  font-size: 13px;
  font-weight: 800;
}

.user-data-pager button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.user-data-details .user-data-list {
  margin: 0;
  padding: 0 14px 14px;
  border-top: 1px solid rgba(82, 103, 132, 0.1);
}

/* Placement inventory v1 */
.placement-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.placement-card {
  min-height: 132px;
  padding: 14px;
  display: grid;
  gap: 6px;
  text-align: left;
  border: 1px solid rgba(61, 122, 255, 0.12);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(244, 248, 255, 0.84)),
    radial-gradient(circle at 18% 0%, rgba(71, 151, 255, 0.16), transparent 42%);
  color: #172033;
  box-shadow: 0 14px 34px rgba(36, 62, 98, 0.07);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.placement-card:hover,
.placement-card.active {
  transform: translateY(-1px);
  border-color: rgba(55, 124, 255, 0.46);
  box-shadow: 0 18px 42px rgba(45, 103, 204, 0.13);
}

.placement-card.active {
  background:
    linear-gradient(145deg, rgba(239, 246, 255, 0.98), rgba(255, 255, 255, 0.92)),
    radial-gradient(circle at 18% 0%, rgba(71, 151, 255, 0.24), transparent 44%);
}

.placement-card span {
  color: #52667f;
  font-size: 13px;
  font-weight: 800;
}

.placement-card strong {
  color: #101828;
  font-size: 28px;
  line-height: 1;
}

.placement-card small,
.placement-card em,
.placement-card i {
  color: #61748c;
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.placement-card i {
  color: #2f7cff;
  font-weight: 850;
}

@media (max-width: 980px) {
  .placement-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .placement-overview {
    grid-template-columns: 1fr;
  }
}

/* ad image rich display v50 */
.merchant-avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, #f0f7ff, #fff4ed);
  color: #2266d8;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(61, 122, 255, 0.16);
}

.merchant-avatar.small {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  border-radius: 8px;
  font-size: 12px;
}

.merchant-avatar.aggregate {
  background: linear-gradient(135deg, #2368ff, #20b2aa);
  color: #fff;
}

.merchant-avatar img,
.campaign-row-thumb img,
.campaign-row-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.merchant-item {
  align-items: center;
}

.campaign-title-with-avatar,
.campaign-title-rich {
  display: flex;
  align-items: center;
  gap: 10px;
}

.campaign-title-rich {
  min-width: 220px;
}

.campaign-title-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.campaign-title-copy small {
  color: #64748b;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.campaign-row-thumb {
  width: 58px;
  height: 42px;
  flex: 0 0 58px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  background: #eef3fb;
  box-shadow: inset 0 0 0 1px rgba(84, 103, 132, 0.14);
}

.compact-upload {
  grid-template-columns: 1fr;
}

.compact-upload button {
  width: fit-content;
}

/* bold tech visual layer v51 */
body:not(.auth-locked) {
  --tech-blue: #2f7cff;
  --tech-cyan: #10c7e8;
  --tech-green: #15b886;
  --tech-violet: #7c5cff;
  --tech-pink: #ff4d8d;
  --tech-ink: #0b1220;
  background:
    linear-gradient(90deg, rgba(47, 124, 255, 0.07) 1px, transparent 1px),
    linear-gradient(0deg, rgba(16, 199, 232, 0.06) 1px, transparent 1px),
    linear-gradient(135deg, rgba(47, 124, 255, 0.18), transparent 26%),
    linear-gradient(225deg, rgba(21, 184, 134, 0.12), transparent 34%),
    #eef4fb;
  background-size: 42px 42px, 42px 42px, auto, auto, auto;
}

body:not(.auth-locked) .portal-header {
  position: relative;
  overflow: hidden;
  min-height: 172px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background:
    linear-gradient(115deg, rgba(47, 124, 255, 0.38), rgba(16, 199, 232, 0.18) 36%, rgba(11, 18, 32, 0.96) 72%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    #0b1220;
  background-size: auto, 36px 36px, 36px 36px, auto;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
}

body:not(.auth-locked) .portal-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent, rgba(16, 199, 232, 0.16), transparent),
    linear-gradient(135deg, transparent 0 54%, rgba(255, 255, 255, 0.08) 54% 55%, transparent 55%);
  pointer-events: none;
}

body:not(.auth-locked) .portal-header > * {
  position: relative;
  z-index: 1;
}

body:not(.auth-locked) .eyebrow,
body:not(.auth-locked) .account-badge {
  border-color: rgba(125, 211, 252, 0.5);
  background: rgba(8, 15, 30, 0.42);
  color: #dff7ff;
  box-shadow: 0 0 0 1px rgba(16, 199, 232, 0.12), 0 10px 26px rgba(16, 199, 232, 0.14);
}

body:not(.auth-locked) .portal-header h1 {
  color: #ffffff;
  text-shadow: 0 8px 30px rgba(16, 199, 232, 0.24);
}

body:not(.auth-locked) .portal-header p:not(.eyebrow) {
  color: rgba(226, 241, 255, 0.78);
}

body:not(.auth-locked) button.primary,
body:not(.auth-locked) .primary {
  border-color: rgba(16, 199, 232, 0.54);
  background: linear-gradient(135deg, #2f7cff, #10c7e8 52%, #15b886);
  box-shadow: 0 12px 28px rgba(47, 124, 255, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

body:not(.auth-locked) .panel,
body:not(.auth-locked) .editor-card {
  position: relative;
  border-color: rgba(119, 145, 183, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 252, 255, 0.9)),
    #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.09);
}

body:not(.auth-locked) .panel::before,
body:not(.auth-locked) .editor-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--tech-blue), var(--tech-cyan), var(--tech-green), var(--tech-violet));
  opacity: 0.9;
}

body:not(.auth-locked) .metric {
  min-height: 118px;
  border-color: rgba(147, 197, 253, 0.45);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(239, 248, 255, 0.92)),
    linear-gradient(135deg, rgba(47, 124, 255, 0.14), rgba(21, 184, 134, 0.09));
  box-shadow: 0 14px 34px rgba(47, 124, 255, 0.1);
}

body:not(.auth-locked) .metric::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 54px;
  height: 24px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(47, 124, 255, 0.22), rgba(16, 199, 232, 0.18)),
    repeating-linear-gradient(90deg, transparent 0 6px, rgba(255, 255, 255, 0.48) 6px 8px);
}

body:not(.auth-locked) .metric strong {
  font-size: 28px;
  color: #0f2f66;
}

body:not(.auth-locked) .status-filter {
  border-color: rgba(147, 197, 253, 0.5);
  background: rgba(239, 248, 255, 0.82);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

body:not(.auth-locked) .status-filter button.active {
  background: linear-gradient(135deg, #2f7cff, #10c7e8);
  color: #fff;
  box-shadow: 0 10px 22px rgba(47, 124, 255, 0.22);
}

body:not(.auth-locked) .merchant-campaign-card,
body:not(.auth-locked) .account-item,
body:not(.auth-locked) .ops-item,
body:not(.auth-locked) .report-row {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

body:not(.auth-locked) .merchant-campaign-card:hover,
body:not(.auth-locked) .account-item:hover,
body:not(.auth-locked) .ops-item:hover,
body:not(.auth-locked) .report-row:hover {
  transform: translateY(-2px);
  border-color: rgba(47, 124, 255, 0.38);
  box-shadow: 0 18px 42px rgba(47, 124, 255, 0.14);
  background:
    linear-gradient(135deg, rgba(47, 124, 255, 0.08), rgba(16, 199, 232, 0.05)),
    #fff;
}

body:not(.auth-locked) .merchant-campaign-card > img,
body:not(.auth-locked) .merchant-campaign-card > video,
body:not(.auth-locked) .campaign-row-thumb {
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.15);
}

body:not(.auth-locked) .merchant-avatar {
  background: linear-gradient(135deg, #2f7cff, #10c7e8 55%, #15b886);
  color: #fff;
  box-shadow: 0 10px 24px rgba(47, 124, 255, 0.2);
}

body:not(.auth-locked) .table-wrap {
  border-color: rgba(147, 197, 253, 0.32);
  background: rgba(255, 255, 255, 0.82);
}

body:not(.auth-locked) th {
  color: #244167;
  background:
    linear-gradient(180deg, rgba(229, 244, 255, 0.96), rgba(241, 247, 255, 0.94));
}

body:not(.auth-locked) tbody tr {
  border-bottom-color: rgba(203, 213, 225, 0.58);
}

body:not(.auth-locked) .ad-preview {
  border-color: rgba(47, 124, 255, 0.26);
  background:
    linear-gradient(135deg, rgba(47, 124, 255, 0.08), rgba(16, 199, 232, 0.06)),
    #f8fbff;
}

body:not(.auth-locked) .ad-preview-screen {
  transform: perspective(900px) rotateY(-4deg);
  transform-origin: center;
  box-shadow: 0 24px 56px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(16, 199, 232, 0.16);
}

body:not(.auth-locked) .ad-preview-tabs button.active,
body:not(.auth-locked) .ad-preview-cta {
  background: linear-gradient(135deg, #2f7cff, #10c7e8);
  border-color: rgba(16, 199, 232, 0.54);
}

body:not(.auth-locked) .preview-check.ok {
  border-color: rgba(21, 184, 134, 0.28);
  background: linear-gradient(135deg, rgba(21, 184, 134, 0.12), rgba(255, 255, 255, 0.94));
}

body:not(.auth-locked) .preview-check.warn {
  border-color: rgba(255, 77, 141, 0.24);
  background: linear-gradient(135deg, rgba(255, 77, 141, 0.1), rgba(255, 255, 255, 0.94));
}

/* module color zoning v52 */
body:not(.auth-locked) .user-data-panel {
  --module-a: #2f7cff;
  --module-b: #10c7e8;
  border-color: rgba(47, 124, 255, 0.28);
  background:
    linear-gradient(135deg, rgba(47, 124, 255, 0.14), rgba(16, 199, 232, 0.06)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(243, 248, 255, 0.92));
}

body:not(.auth-locked) .invite-tree-panel {
  --module-a: #7c5cff;
  --module-b: #ff4d8d;
  border-color: rgba(124, 92, 255, 0.26);
  background:
    linear-gradient(135deg, rgba(124, 92, 255, 0.13), rgba(255, 77, 141, 0.06)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 246, 255, 0.92));
}

body:not(.auth-locked) .reward-rules-panel {
  --module-a: #f59e0b;
  --module-b: #ff4d8d;
  border-color: rgba(245, 158, 11, 0.28);
  background:
    linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(255, 77, 141, 0.055)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 250, 239, 0.92));
}

body:not(.auth-locked) .ops-panel {
  --module-a: #10c7e8;
  --module-b: #2f7cff;
  border-color: rgba(16, 199, 232, 0.3);
  background:
    linear-gradient(135deg, rgba(16, 199, 232, 0.14), rgba(47, 124, 255, 0.07)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(240, 251, 255, 0.92));
}

body:not(.auth-locked) .report-panel {
  --module-a: #15b886;
  --module-b: #10c7e8;
  border-color: rgba(21, 184, 134, 0.3);
  background:
    linear-gradient(135deg, rgba(21, 184, 134, 0.14), rgba(16, 199, 232, 0.06)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(239, 253, 248, 0.92));
}

body:not(.auth-locked) .account-panel {
  --module-a: #6366f1;
  --module-b: #2f7cff;
  border-color: rgba(99, 102, 241, 0.28);
  background:
    linear-gradient(135deg, rgba(99, 102, 241, 0.13), rgba(47, 124, 255, 0.06)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(246, 247, 255, 0.92));
}

body:not(.auth-locked) .review-panel {
  --module-a: #ff4d8d;
  --module-b: #7c5cff;
  border-color: rgba(255, 77, 141, 0.25);
  background:
    linear-gradient(135deg, rgba(255, 77, 141, 0.1), rgba(124, 92, 255, 0.065)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 246, 251, 0.92));
}

body:not(.auth-locked) .merchant-finance-panel {
  --module-a: #15b886;
  --module-b: #2dd4bf;
  border-color: rgba(21, 184, 134, 0.34);
  background:
    linear-gradient(135deg, rgba(21, 184, 134, 0.15), rgba(45, 212, 191, 0.06)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(239, 253, 248, 0.92));
}

body:not(.auth-locked) .merchant-ledger-panel {
  --module-a: #2f7cff;
  --module-b: #15b886;
  border-color: rgba(47, 124, 255, 0.26);
  background:
    linear-gradient(135deg, rgba(47, 124, 255, 0.12), rgba(21, 184, 134, 0.06)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(244, 250, 255, 0.92));
}

body:not(.auth-locked) .panel::before,
body:not(.auth-locked) .editor-card::before {
  background: linear-gradient(90deg, var(--module-a, var(--tech-blue)), var(--module-b, var(--tech-cyan)));
  height: 4px;
}

body:not(.auth-locked) .panel-title {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--module-a, #2f7cff) 10%, transparent), transparent 72%);
}

body:not(.auth-locked) .panel-title h2::before {
  background: linear-gradient(180deg, var(--module-a, var(--tech-blue)), var(--module-b, var(--tech-cyan)));
  box-shadow: 0 0 18px color-mix(in srgb, var(--module-a, #2f7cff) 34%, transparent);
}

body:not(.auth-locked) .ops-board > section,
body:not(.auth-locked) .report-tables > section,
body:not(.auth-locked) .account-form,
body:not(.auth-locked) .merchant-insight,
body:not(.auth-locked) .report-card-grid {
  border-color: color-mix(in srgb, var(--module-a, #2f7cff) 18%, rgba(219, 229, 240, 0.88));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--module-a, #2f7cff) 8%, transparent), rgba(255, 255, 255, 0.82)),
    rgba(255, 255, 255, 0.78);
}

body:not(.auth-locked) .metric:nth-child(1),
body:not(.auth-locked) .metric:nth-child(5) {
  --module-a: #2f7cff;
  --module-b: #10c7e8;
}

body:not(.auth-locked) .metric:nth-child(2),
body:not(.auth-locked) .metric:nth-child(6) {
  --module-a: #15b886;
  --module-b: #10c7e8;
}

body:not(.auth-locked) .metric:nth-child(3),
body:not(.auth-locked) .metric:nth-child(7) {
  --module-a: #f59e0b;
  --module-b: #ff4d8d;
}

body:not(.auth-locked) .metric:nth-child(4),
body:not(.auth-locked) .metric:nth-child(8) {
  --module-a: #7c5cff;
  --module-b: #2f7cff;
}

body:not(.auth-locked) .metric::before {
  background: linear-gradient(180deg, var(--module-a), var(--module-b)) !important;
}

/* unified delivery operation palette v53 */
body:not(.auth-locked) .user-data-panel,
body:not(.auth-locked) .invite-tree-panel,
body:not(.auth-locked) .reward-rules-panel,
body:not(.auth-locked) .ops-panel,
body:not(.auth-locked) .report-panel,
body:not(.auth-locked) .account-panel,
body:not(.auth-locked) .review-panel,
body:not(.auth-locked) .merchant-finance-panel,
body:not(.auth-locked) .merchant-ledger-panel,
body:not(.auth-locked) .merchant-report-panel,
body:not(.auth-locked) .merchant-review-panel {
  --module-a: #10c7e8;
  --module-b: #2f7cff;
  border-color: rgba(16, 199, 232, 0.28);
  background:
    linear-gradient(135deg, rgba(16, 199, 232, 0.13), rgba(47, 124, 255, 0.07)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(240, 251, 255, 0.92));
}

body:not(.auth-locked) .panel::before,
body:not(.auth-locked) .editor-card::before {
  background: linear-gradient(90deg, #10c7e8, #2f7cff);
}

body:not(.auth-locked) .panel-title {
  background: linear-gradient(90deg, rgba(16, 199, 232, 0.1), transparent 72%);
}

body:not(.auth-locked) .panel-title h2,
body:not(.auth-locked) .ops-panel > .panel-title h2,
body:not(.auth-locked) .report-panel > .panel-title h2,
body:not(.auth-locked) .account-panel > .panel-title h2,
body:not(.auth-locked) .review-panel > .panel-title h2,
body:not(.auth-locked) .merchant-finance-panel > .panel-title h2,
body:not(.auth-locked) .merchant-ledger-panel > .panel-title h2,
body[data-portal="merchant"]:not(.auth-locked) .report-panel > .panel-title h2,
body[data-portal="merchant"]:not(.auth-locked) .review-panel > .panel-title h2 {
  color: #123f91;
}

body:not(.auth-locked) .panel-title h2::before {
  background: linear-gradient(180deg, #10c7e8, #2f7cff);
  box-shadow: 0 0 18px rgba(16, 199, 232, 0.28);
}

body:not(.auth-locked) .ops-board > section,
body:not(.auth-locked) .report-tables > section,
body:not(.auth-locked) .account-form,
body:not(.auth-locked) .merchant-insight,
body:not(.auth-locked) .report-card-grid {
  border-color: rgba(16, 199, 232, 0.18);
  background:
    linear-gradient(135deg, rgba(16, 199, 232, 0.08), rgba(255, 255, 255, 0.86)),
    rgba(255, 255, 255, 0.78);
}

body:not(.auth-locked) .metric:nth-child(n) {
  --module-a: #10c7e8;
  --module-b: #2f7cff;
}

body:not(.auth-locked) .metric {
  border-color: rgba(16, 199, 232, 0.26);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(240, 251, 255, 0.92)),
    linear-gradient(135deg, rgba(16, 199, 232, 0.11), rgba(47, 124, 255, 0.08));
  box-shadow: 0 14px 34px rgba(47, 124, 255, 0.09);
}

body:not(.auth-locked) .metric::before {
  background: linear-gradient(180deg, #10c7e8, #2f7cff) !important;
}

/* placement inventory active color v54 */
body:not(.auth-locked) .placement-card {
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, color 0.16s ease;
}

body:not(.auth-locked) .placement-card.active {
  border-color: rgba(16, 199, 232, 0.78);
  background:
    linear-gradient(135deg, rgba(16, 199, 232, 0.96), rgba(47, 124, 255, 0.94)),
    #2f7cff;
  color: #fff;
  box-shadow: 0 18px 44px rgba(47, 124, 255, 0.28), 0 0 0 3px rgba(16, 199, 232, 0.16);
  transform: translateY(-2px);
}

body:not(.auth-locked) .placement-card:hover {
  border-color: rgba(16, 199, 232, 0.72);
  background:
    linear-gradient(135deg, rgba(16, 199, 232, 0.92), rgba(47, 124, 255, 0.88)),
    #2f7cff;
  color: #fff;
  box-shadow: 0 18px 42px rgba(47, 124, 255, 0.24), 0 0 0 3px rgba(16, 199, 232, 0.12);
  transform: translateY(-2px);
}

body:not(.auth-locked) .placement-card.active span,
body:not(.auth-locked) .placement-card.active strong,
body:not(.auth-locked) .placement-card.active small,
body:not(.auth-locked) .placement-card.active em,
body:not(.auth-locked) .placement-card.active i,
body:not(.auth-locked) .placement-card:hover span,
body:not(.auth-locked) .placement-card:hover strong,
body:not(.auth-locked) .placement-card:hover small,
body:not(.auth-locked) .placement-card:hover em,
body:not(.auth-locked) .placement-card:hover i {
  color: #fff;
}

body:not(.auth-locked) .placement-card.active small,
body:not(.auth-locked) .placement-card.active em,
body:not(.auth-locked) .placement-card:hover small,
body:not(.auth-locked) .placement-card:hover em {
  opacity: 0.86;
}

/* floating invite root cards v56 */
body:not(.auth-locked) .invite-root-grid {
  align-items: stretch;
  perspective: 1200px;
}

body:not(.auth-locked) .invite-root-card {
  isolation: isolate;
  min-height: 184px;
  border-color: rgba(16, 199, 232, 0.28);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(240, 251, 255, 0.9)),
    linear-gradient(135deg, rgba(16, 199, 232, 0.14), rgba(47, 124, 255, 0.08));
  box-shadow:
    0 24px 46px rgba(15, 23, 42, 0.13),
    0 8px 20px rgba(47, 124, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
  transform: translateY(-4px);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

body:not(.auth-locked) .invite-root-card::before {
  height: 4px;
  background: linear-gradient(90deg, #10c7e8, #2f7cff);
  box-shadow: 0 0 24px rgba(16, 199, 232, 0.35);
}

body:not(.auth-locked) .invite-root-card::after {
  content: "";
  position: absolute;
  inset: 12px 12px auto auto;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 199, 232, 0.22), transparent 68%);
  pointer-events: none;
  z-index: -1;
}

body:not(.auth-locked) .invite-root-card:hover {
  transform: translateY(-10px) rotateX(2deg);
  border-color: rgba(16, 199, 232, 0.46);
  box-shadow:
    0 34px 70px rgba(15, 23, 42, 0.18),
    0 14px 30px rgba(47, 124, 255, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body:not(.auth-locked) .invite-root-head code {
  border-color: rgba(16, 199, 232, 0.24);
  background: linear-gradient(135deg, rgba(16, 199, 232, 0.14), rgba(47, 124, 255, 0.08));
  color: #0f5fd0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

body:not(.auth-locked) .invite-root-metrics span,
body:not(.auth-locked) .invite-root-levels span {
  border-color: rgba(16, 199, 232, 0.16);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

/* floating report range buttons v57 */
body:not(.auth-locked) .report-panel #reportRangeFilters {
  position: relative;
  padding: 6px;
  border-color: rgba(16, 199, 232, 0.24);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(240, 251, 255, 0.76)),
    rgba(255, 255, 255, 0.72);
  box-shadow: 0 16px 34px rgba(47, 124, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.88);
  transform: translateY(-2px);
}

body:not(.auth-locked) .report-panel #reportRangeFilters button {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(16, 199, 232, 0.16);
  background: rgba(255, 255, 255, 0.88);
  color: #245074;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, color 0.16s ease;
}

body:not(.auth-locked) .report-panel #reportRangeFilters button:hover {
  transform: translateY(-3px);
  border-color: rgba(16, 199, 232, 0.46);
  background: linear-gradient(135deg, rgba(16, 199, 232, 0.92), rgba(47, 124, 255, 0.88));
  color: #fff;
  box-shadow: 0 14px 28px rgba(47, 124, 255, 0.22);
}

body:not(.auth-locked) .report-panel #reportRangeFilters button.active {
  transform: translateY(-3px);
  border-color: rgba(16, 199, 232, 0.72);
  background: linear-gradient(135deg, #10c7e8, #2f7cff);
  color: #fff;
  box-shadow: 0 16px 32px rgba(47, 124, 255, 0.26), 0 0 0 3px rgba(16, 199, 232, 0.12);
}

/* floating report metric cards v58 */
body:not(.auth-locked) .report-panel .report-card-grid {
  align-items: stretch;
  gap: 16px;
  padding: 18px 18px 22px;
}

body:not(.auth-locked) .report-panel .report-card {
  isolation: isolate;
  min-height: 116px;
  border-color: rgba(16, 199, 232, 0.28);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(240, 251, 255, 0.9)),
    linear-gradient(135deg, rgba(16, 199, 232, 0.13), rgba(47, 124, 255, 0.08));
  box-shadow:
    0 22px 42px rgba(15, 23, 42, 0.11),
    0 8px 18px rgba(47, 124, 255, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
  transform: translateY(-4px);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

body:not(.auth-locked) .report-panel .report-card::before {
  height: 4px;
  background: linear-gradient(90deg, #10c7e8, #2f7cff);
  box-shadow: 0 0 22px rgba(16, 199, 232, 0.34);
}

body:not(.auth-locked) .report-panel .report-card::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 60px;
  height: 28px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(16, 199, 232, 0.18), rgba(47, 124, 255, 0.12)),
    repeating-linear-gradient(90deg, transparent 0 6px, rgba(255, 255, 255, 0.5) 6px 8px);
  pointer-events: none;
  z-index: -1;
}

body:not(.auth-locked) .report-panel .report-card:hover {
  transform: translateY(-10px);
  border-color: rgba(16, 199, 232, 0.46);
  box-shadow:
    0 32px 64px rgba(15, 23, 42, 0.16),
    0 14px 30px rgba(47, 124, 255, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

/* merchant detail drilldown v59 */
body:not(.auth-locked) .merchant-profile-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(16, 199, 232, 0.22);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(16, 199, 232, 0.12), rgba(47, 124, 255, 0.06)),
    rgba(255, 255, 255, 0.84);
  box-shadow: 0 16px 34px rgba(47, 124, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

body:not(.auth-locked) .merchant-profile-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, #10c7e8, #2f7cff);
}

body:not(.auth-locked) .merchant-profile-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

body:not(.auth-locked) .merchant-avatar.profile {
  width: 54px;
  height: 54px;
  flex-basis: 54px;
  border-radius: 16px;
}

body:not(.auth-locked) .merchant-profile-main strong {
  display: block;
  color: #123f91;
  font-size: 16px;
  font-weight: 850;
}

body:not(.auth-locked) .merchant-profile-main span {
  display: block;
  margin-top: 3px;
  color: #55708e;
  font-size: 12px;
}

body:not(.auth-locked) .merchant-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

body:not(.auth-locked) .merchant-profile-grid span {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid rgba(16, 199, 232, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.76);
}

body:not(.auth-locked) .merchant-profile-grid em {
  color: #68809a;
  font-size: 11px;
  font-style: normal;
}

body:not(.auth-locked) .merchant-profile-grid strong {
  overflow: hidden;
  color: #173153;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body:not(.auth-locked) .merchant-profile-grid a {
  color: #0f5fd0;
  font-weight: 850;
  text-decoration: none;
}

/* merchant self profile form v61 */
.merchant-profile-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(16, 199, 232, 0.2);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(16, 199, 232, 0.08), rgba(47, 124, 255, 0.04)),
    rgba(255, 255, 255, 0.86);
}

/* calmer grey platform background v64 */
body:not(.auth-locked) {
  background:
    radial-gradient(circle at 18% 0%, rgba(85, 167, 255, 0.10), transparent 30%),
    linear-gradient(180deg, #d9e0ea 0, #e9edf3 240px, #e1e7ee 100%);
}

body:not(.auth-locked) .portal-shell {
  background: transparent;
}

body:not(.auth-locked) .portal-header {
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
}

body[data-portal="admin"]:not(.auth-locked) .portal-header {
  background:
    linear-gradient(135deg, rgba(85, 167, 255, 0.20), rgba(15, 23, 42, 0.90) 58%, rgba(17, 24, 39, 0.96) 100%),
    #111827;
}

body[data-portal="merchant"]:not(.auth-locked) .portal-header {
  background:
    linear-gradient(135deg, rgba(22, 128, 95, 0.22), rgba(85, 167, 255, 0.11) 48%, rgba(17, 24, 39, 0.94) 100%),
    #111827;
}

body:not(.auth-locked) .metric-card,
body:not(.auth-locked) .review-panel,
body:not(.auth-locked) .reward-rules-panel,
body:not(.auth-locked) .ops-panel,
body:not(.auth-locked) .report-panel,
body:not(.auth-locked) .merchant-command,
body:not(.auth-locked) .editor-drawer,
body:not(.auth-locked) .login-panel,
body:not(.auth-locked) .merchant-action-panel,
body:not(.auth-locked) .merchant-audit-timeline {
  background-color: rgba(247, 249, 252, 0.96);
  border-color: rgba(191, 201, 214, 0.86);
}

body:not(.auth-locked) .campaign-card,
body:not(.auth-locked) .merchant-campaign-card,
body:not(.auth-locked) .merchant-action-card,
body:not(.auth-locked) .reward-report-card,
body:not(.auth-locked) .delivery-control-card,
body:not(.auth-locked) .merchant-ledger-item,
body:not(.auth-locked) .device-targeting {
  background-color: #f7f9fc;
  border-color: rgba(199, 209, 222, 0.88);
}

body:not(.auth-locked) input,
body:not(.auth-locked) textarea,
body:not(.auth-locked) select {
  background: #fbfcfe;
}

body:not(.auth-locked) .metric-card:hover,
body:not(.auth-locked) .campaign-card:hover,
body:not(.auth-locked) .merchant-campaign-card:hover {
  background-color: #f1f6fd;
}

.merchant-profile-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.merchant-profile-form-head strong {
  color: #123f91;
  font-size: 15px;
  font-weight: 850;
}

.merchant-profile-form-head span {
  color: #667085;
  font-size: 12px;
}

.merchant-profile-form label {
  display: grid;
  gap: 6px;
}

.merchant-profile-form label span {
  color: #516173;
  font-size: 12px;
  font-weight: 760;
}

.merchant-profile-form input,
.merchant-profile-form textarea {
  width: 100%;
  border-color: rgba(16, 199, 232, 0.18);
  background: rgba(255, 255, 255, 0.92);
}

.merchant-profile-form button.primary {
  justify-self: start;
}

body:not(.auth-locked) .merchant-detail-chip {
  min-height: 28px;
  width: fit-content;
  padding: 0 10px;
  border-color: rgba(16, 199, 232, 0.22);
  border-radius: 999px;
  background: rgba(240, 251, 255, 0.92);
  color: #0f5fd0;
  font-size: 12px;
  font-weight: 800;
  box-shadow: none;
}

body:not(.auth-locked) .merchant-item:hover .merchant-detail-chip,
body:not(.auth-locked) .merchant-item.active .merchant-detail-chip {
  border-color: rgba(16, 199, 232, 0.44);
  background: linear-gradient(135deg, #10c7e8, #2f7cff);
  color: #fff;
}

/* rational floating visual frames v65 */
body:not(.auth-locked) .metric,
body:not(.auth-locked) .merchant-finance-card,
body:not(.auth-locked) .merchant-insight-grid div,
body:not(.auth-locked) .ops-report-card,
body:not(.auth-locked) .reward-report-card {
  transform: translateY(-2px);
  box-shadow:
    0 18px 34px rgba(15, 23, 42, 0.10),
    0 6px 16px rgba(47, 124, 255, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

body:not(.auth-locked) .metric:hover,
body:not(.auth-locked) .merchant-finance-card:hover,
body:not(.auth-locked) .merchant-insight-grid div:hover,
body:not(.auth-locked) .ops-report-card:hover,
body:not(.auth-locked) .reward-report-card:hover {
  transform: translateY(-6px);
  box-shadow:
    0 28px 58px rgba(15, 23, 42, 0.15),
    0 10px 24px rgba(47, 124, 255, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

body:not(.auth-locked) .account-item,
body:not(.auth-locked) .merchant-item,
body:not(.auth-locked) .merchant-campaign-card,
body:not(.auth-locked) .merchant-action-card,
body:not(.auth-locked) .campaign-row-thumb,
body:not(.auth-locked) .merchant-avatar,
body:not(.auth-locked) .ad-preview,
body:not(.auth-locked) .ad-preview-side,
body:not(.auth-locked) .preview-check,
body:not(.auth-locked) .preview-audit-summary {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

body:not(.auth-locked) .account-item,
body:not(.auth-locked) .merchant-item,
body:not(.auth-locked) .merchant-campaign-card,
body:not(.auth-locked) .merchant-action-card,
body:not(.auth-locked) .ad-preview,
body:not(.auth-locked) .ad-preview-side,
body:not(.auth-locked) .preview-check,
body:not(.auth-locked) .preview-audit-summary {
  box-shadow:
    0 16px 34px rgba(15, 23, 42, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

body:not(.auth-locked) .account-item:hover,
body:not(.auth-locked) .merchant-item:hover,
body:not(.auth-locked) .merchant-campaign-card:hover,
body:not(.auth-locked) .merchant-action-card:hover,
body:not(.auth-locked) .preview-check:hover,
body:not(.auth-locked) .preview-audit-summary:hover {
  transform: translateY(-4px);
  border-color: rgba(47, 124, 255, 0.38);
  box-shadow:
    0 26px 54px rgba(15, 23, 42, 0.15),
    0 10px 24px rgba(47, 124, 255, 0.12);
}

body:not(.auth-locked) .campaign-row-thumb,
body:not(.auth-locked) .merchant-avatar,
body:not(.auth-locked) .merchant-campaign-card > img,
body:not(.auth-locked) .merchant-campaign-card > video,
body:not(.auth-locked) .ad-preview-media {
  box-shadow:
    0 14px 28px rgba(15, 23, 42, 0.16),
    0 0 0 1px rgba(255, 255, 255, 0.72);
}

body:not(.auth-locked) .campaign-row-thumb:hover,
body:not(.auth-locked) .merchant-avatar:hover,
body:not(.auth-locked) .merchant-campaign-card:hover > img,
body:not(.auth-locked) .merchant-campaign-card:hover > video {
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 22px 44px rgba(15, 23, 42, 0.20),
    0 8px 20px rgba(47, 124, 255, 0.12);
}

body:not(.auth-locked) .ad-phone-preview {
  transform: translateY(-3px);
  box-shadow:
    0 28px 66px rgba(15, 23, 42, 0.24),
    0 10px 26px rgba(47, 124, 255, 0.12);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

body:not(.auth-locked) .ad-preview:hover .ad-phone-preview {
  transform: translateY(-7px);
  box-shadow:
    0 38px 82px rgba(15, 23, 42, 0.30),
    0 14px 34px rgba(47, 124, 255, 0.17);
}

body:not(.auth-locked) .panel,
body:not(.auth-locked) .editor-card {
  box-shadow:
    0 22px 52px rgba(15, 23, 42, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

body:not(.auth-locked) .login-panel,
body:not(.auth-locked) .editor-drawer,
body:not(.auth-locked) .merchant-profile-form,
body:not(.auth-locked) .report-tables > section,
body:not(.auth-locked) .ops-board > section,
body:not(.auth-locked) .table-wrap {
  transform: none;
}
