@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/be-vietnam-pro-400.woff2") format("woff2"); }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/be-vietnam-pro-500.woff2") format("woff2"); }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/be-vietnam-pro-600.woff2") format("woff2"); }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/be-vietnam-pro-700.woff2") format("woff2"); }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/be-vietnam-pro-800.woff2") format("woff2"); }

:root {
  --primary: #f97316;
  --primary-dark: #ea3f1f;
  --primary-soft: #fff1e7;
  --cyan: #0f9fb0;
  --orange: #ff8b3d;
  --pink: #d94682;
  --ink: #172033;
  --muted: #667085;
  --bg: #f4f6fa;
  --surface: #fff;
  --line: #e4e7ee;
  --success: #12976b;
  --danger: #df4655;
  --warning: #b77912;
  --shadow: 0 10px 28px rgba(23, 32, 51, .08);
}

.partner-brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.partner-brand-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
}
.partner-brand-preview {
  width: 64px;
  height: 64px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.partner-brand-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.partner-brand-item label,
.partner-brand-item small {
  display: block;
  min-width: 0;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Be Vietnam Pro", Inter, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
}
button, input, select, textarea { font: inherit; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* Authentication */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    linear-gradient(90deg, rgba(249, 115, 22, .08) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, #f7f8fb 0%, #eef2f7 100%);
  background-size: 42px 100%, auto;
}
.auth-page::before, .auth-page::after {
  content: "";
  display: none;
}
.auth-card {
  width: min(460px, 100%);
  background: rgba(255,255,255,.98);
  border: 1px solid rgba(199, 206, 220, .9);
  border-left: 6px solid var(--primary);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(23, 32, 51, .14);
  padding: 34px;
  position: relative;
  z-index: 1;
  backdrop-filter: blur(12px);
}
.auth-card h1 { margin: 24px 0 8px; font-size: 27px; letter-spacing: 0; }
.auth-card form { margin-top: 24px; }
.auth-card > p { text-align: center; margin: 22px 0 0; }
.auth-state-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 22px 0 -6px;
  border-radius: 12px;
  background: #fff7ed;
  color: var(--primary);
}
.auth-state-icon .verify-icon {
  width: 22px;
  height: 22px;
}
.register-page { place-items: center; }
.register-page .auth-card { width: min(460px, 100%); }
.register-page .auth-card form { margin-top: 20px; }
.register-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 13px;
}
.form-field { min-width: 0; }
.register-full { grid-column: 1 / -1; }
.referral-option {
  margin-top: 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
}
.referral-option summary {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  min-height: 32px;
  padding: 0;
  color: #556174;
  font-size: 12px;
  font-weight: 700;
  list-style: none;
}
.referral-option summary::-webkit-details-marker { display: none; }
.referral-option summary::before {
  content: "+";
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 7px;
  border: 1px solid #d8deea;
  border-radius: 6px;
  color: var(--primary);
  line-height: 16px;
  text-align: center;
  transition: transform .18s ease;
}
.referral-option[open] summary::before { content: "-"; }
.referral-option .form-field { padding: 8px 0 0; }
.referral-option input {
  min-height: 38px;
  border-radius: 9px;
  background: #fff;
}
.captcha-panel {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid #eceff6;
  border-radius: 14px;
  background: #fbfcff;
}
.captcha-head,
.captcha-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.captcha-head { justify-content: space-between; margin-bottom: 10px; }
.captcha-head label { margin: 0; }
.captcha-head button { min-height: 36px; padding: 0 12px; }
.captcha-row img {
  width: 150px;
  height: 54px;
  flex: 0 0 150px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
}
.captcha-row input { text-transform: uppercase; letter-spacing: 3px; }
.register-page .terms-label { display: flex; align-items: flex-start; gap: 7px; line-height: 1.45; margin: 16px 0; }
.register-page .terms-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  margin: 3px 0 0;
  flex: 0 0 16px;
  transition: none;
  transform: none;
  box-shadow: none;
}

.chat-widget {
  bottom: 18px;
  position: fixed;
  right: 18px;
  z-index: 1000;
}
.chat-launcher {
  align-items: center;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, .14);
  border-radius: 50%;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .22);
  color: #172033;
  cursor: pointer;
  display: flex;
  gap: 8px;
  height: 54px;
  justify-content: center;
  min-height: 54px;
  padding: 0;
  transition: box-shadow .18s ease, transform .18s ease;
  width: 54px;
}
.chat-launcher:hover { transform: scale(1.06); }
.chat-launcher:active { transform: scale(.94); }
.chat-launcher span { font-size: 26px; }
.chat-launcher strong { display: none; }
.chat-panel {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, .14);
  border-radius: 18px;
  box-shadow: 0 26px 70px rgba(15, 23, 42, .28);
  display: flex;
  flex-direction: column;
  height: min(560px, calc(100vh - 36px));
  overflow: hidden;
  width: min(380px, calc(100vw - 36px));
  transform-origin: bottom right;
}
.chat-panel.is-opening {
  animation: chatZoomIn .18s ease-out;
}
.chat-panel.is-closing {
  animation: chatZoomOut .16s ease-in forwards;
}
@keyframes chatZoomIn {
  from { opacity: 0; transform: scale(.92) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes chatZoomOut {
  from { opacity: 1; transform: scale(1) translateY(0); }
  to { opacity: 0; transform: scale(.94) translateY(8px); }
}
@media (prefers-reduced-motion: reduce) {
  .chat-launcher { transition: none; }
  .chat-launcher:hover,
  .chat-launcher:active { transform: none; }
  .chat-panel,
  .chat-panel.is-closing { animation: none; }
}
.chat-panel header {
  align-items: center;
  background: #5b4cf0;
  color: #fff;
  display: flex;
  gap: 12px;
  min-height: 64px;
  padding: 0 14px;
}
.chat-panel header span {
  background: #fff;
  border-radius: 12px;
  color: #5b4cf0;
  display: grid;
  font-size: 24px;
  height: 40px;
  place-items: center;
  width: 40px;
}
.chat-panel header div { flex: 1; min-width: 0; }
.chat-panel header small { color: #ddd9ff; display: block; font-size: 12px; }
.chat-panel header button {
  background: transparent;
  border: 0;
  color: #fff;
  cursor: pointer;
  font-size: 28px;
  height: 40px;
  width: 40px;
}
.chat-messages {
  background: #f7f8fc;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
}
.chat-empty {
  color: #64748b;
  display: grid;
  font-weight: 700;
  height: 100%;
  line-height: 1.5;
  place-items: center;
  text-align: center;
}
.chat-row { display: flex; margin-bottom: 10px; }
.chat-row.visitor { justify-content: flex-end; }
.chat-bubble {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, .1);
  border-radius: 14px;
  color: #172033;
  max-width: 85%;
  padding: 9px 11px;
}
.chat-row.visitor .chat-bubble {
  background: #5b4cf0;
  color: #fff;
}
.chat-bubble small {
  color: #64748b;
  display: block;
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 3px;
}
.chat-row.visitor .chat-bubble small { color: #fff; }
.chat-bubble p { margin: 0; white-space: pre-wrap; word-break: break-word; }
.chat-bubble img {
  border-radius: 10px;
  display: block;
  margin-bottom: 6px;
  max-height: 240px;
  max-width: 100%;
}
.chat-compose {
  align-items: flex-end;
  background: #fff;
  border-top: 1px solid rgba(15, 23, 42, .1);
  display: grid;
  gap: 8px;
  grid-template-columns: 42px 1fr 42px;
  padding: 10px;
}
.chat-error {
  color: #dc2626;
  font-size: 12px;
  font-weight: 700;
  grid-column: 1 / -1;
  margin: 0;
}
.chat-image-preview {
  align-items: center;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 12px;
  display: flex;
  gap: 8px;
  grid-column: 1 / -1;
  padding: 7px;
}
.chat-image-preview img {
  border-radius: 9px;
  height: 44px;
  object-fit: cover;
  width: 44px;
}
.chat-image-preview span {
  color: #64748b;
  flex: 1;
  font-size: 12px;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-image-preview button,
.chat-icon-button,
.chat-send {
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  height: 42px;
  width: 42px;
}
.chat-icon-button {
  background: #f1f5f9;
  color: #475569;
  font-size: 20px;
}
.chat-compose textarea {
  border: 1px solid rgba(15, 23, 42, .18);
  border-radius: 12px;
  font: inherit;
  max-height: 110px;
  min-height: 42px;
  padding: 10px 12px;
  resize: none;
}
.chat-send {
  background: #5b4cf0;
  color: #fff;
  font-size: 18px;
}
.chat-send:disabled,
.chat-compose textarea:disabled {
  cursor: not-allowed;
  opacity: .55;
}

@media (max-width: 560px) {
  .chat-widget { bottom: 14px; right: 14px; }
}
.register-page .terms-text { flex: 1; min-width: 0; display: inline; white-space: nowrap; }
.register-page .terms-text label,
.register-page .terms-link { display: inline; }
.register-page .terms-link {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-decoration: underline;
  box-shadow: none;
}
.register-page .terms-label input[type="checkbox"]:hover,
.register-page .terms-label input[type="checkbox"]:focus,
.register-page .terms-label input[type="checkbox"]:active {
  transform: none;
  box-shadow: none;
  background: initial;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.5px;
  color: var(--primary);
}
.brand-logo {
  width: 38px;
  height: 38px;
  display: block;
  flex: 0 0 38px;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: none;
}
.auth-card .brand {
  display: flex;
  justify-content: center;
  font-size: 22px;
}
.auth-card .brand-logo {
  width: 52px;
  height: 52px;
  flex-basis: 52px;
  border-radius: 15px;
}
.auth-card .brand-logo.auth-brand-full {
  width: min(180px, 70vw);
  height: 56px;
  flex-basis: auto;
  border-radius: 0;
}

/* Application shell */
.layout { min-height: 100vh; display: grid; grid-template-columns: 268px 1fr; transition: grid-template-columns .25s ease; }
.sidebar {
  color: #cbd3e1;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  z-index: 20;
  background: #151a24;
  border-right: 1px solid rgba(255,255,255,.08);
  box-shadow: none;
}

.sidebar-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.sidebar .brand {
  color: #fff;
  padding: 2px 0 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.sidebar .brand-logo { width: 46px; height: 46px; flex-basis: 46px; }
.sidebar .brand-main {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.sidebar .brand-logo-full {
  width: 148px;
  height: auto;
  flex: 0 1 auto;
  border-radius: 0;
  box-shadow: none;
}
.sidebar .brand-slogan {
  color: var(--orange);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}
.sidebar .brand-logo-mark { display: block; border-radius: 10px; box-shadow: none; }
.sidebar-toggle {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  margin-top: 8px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 9px;
  background: rgba(255,255,255,.07);
  color: #d9def0;
  font-size: 22px;
  line-height: 1;
  transition: .2s ease;
}
.sidebar-toggle:hover { color: #fff; background: rgba(255,255,255,.13); }
.nav-section { margin: 16px 11px 7px; color: #768093; font-size: 10px; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase; }
.sidebar a:not(.brand) {
  color: #b8c0ce;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin: 3px 0;
  border-radius: 9px;
  font-weight: 600;
  transition: .2s ease;
}
.nav-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
}
.sidebar a:not(.brand) .nav-icon {
  width: 20px;
  height: 20px;
  flex-basis: 20px;
  opacity: .92;
}
.sidebar a:not(.brand):hover { color: #fff; background: rgba(255,255,255,.07); transform: none; }
.sidebar a.active {
  color: #fff;
  background: #f97316;
  box-shadow: none;
}
.sidebar-collapsed .layout { grid-template-columns: 84px 1fr; }
.sidebar-collapsed .sidebar { padding-right: 13px; padding-left: 13px; overflow-x: hidden; }
.sidebar-collapsed .sidebar-header { display: block; }
.sidebar-collapsed .sidebar .brand { justify-content: center; align-items: center; padding-right: 0; padding-left: 0; }
.sidebar-collapsed .sidebar .brand-logo-full,
.sidebar-collapsed .sidebar .brand-slogan { display: none; }
.sidebar-collapsed .sidebar .nav-section,
.sidebar-collapsed .sidebar a:not(.brand) span { display: none; }
.sidebar-collapsed .sidebar-toggle {
  width: 100%;
  height: 24px;
  margin: -15px 0 15px;
}
.sidebar-collapsed .sidebar a:not(.brand) {
  justify-content: center;
  gap: 0;
  padding-right: 0;
  padding-left: 0;
}
.sidebar-collapsed .sidebar a:not(.brand) .nav-icon { flex: 0 0 20px; }
.sidebar-collapsed .content {
  width: 100%;
  max-width: none;
}
.main { min-width: 0; }
.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  position: sticky;
  top: 0;
  z-index: 15;
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid rgba(226,230,239,.95);
  backdrop-filter: blur(10px);
}
.topbar-context { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.topbar-context::before { content: ""; width: 3px; height: 20px; border-radius: 999px; background: var(--primary); box-shadow: none; }
.user-menu { display: flex; align-items: center; gap: 11px; }
.notification-link {
  position: relative;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  padding: 8px;
}
.topbar-balance {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid #dde2ef;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
  transition: transform .18s, border-color .18s, background .18s, color .18s;
}
.topbar-balance:hover { border-color: #c9d0e2; background: #fff; color: var(--primary); transform: none; }
.topbar-balance span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.topbar-balance strong {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.notification-link span {
  position: absolute; top: 0; right: 0; min-width: 17px; height: 17px;
  display: grid; place-items: center; padding: 0 4px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 9px; font-weight: 800;
}
.notification-item { display: flex; justify-content: space-between; gap: 16px; }
.notification-item.unread { border-left: 4px solid var(--primary); }
.notification-item h3 { margin: 0 0 5px; font-size: 15px; }
.notification-item p { margin: 0; color: var(--muted); }
.notification-read-button {
  width: 88px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  flex: 0 0 88px;
  align-self: flex-start;
  white-space: nowrap;
}
.important-inline-label,
.important-notification-label {
  display: inline-block;
  margin-right: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff0d9;
  color: #a85d00;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.important-notification-modal { border-top: 5px solid #f59e0b; }
.important-notification-modal > p {
  margin-top: 14px;
  color: var(--text);
  line-height: 1.65;
  white-space: pre-wrap;
}
.important-notification-modal > small { color: var(--muted); }
.important-notification-modal .actions { margin-top: 22px; }
.get-link-tutorial-modal {
  position: relative;
  width: min(620px, 100%);
  padding: 30px;
  overflow: hidden;
}
.tutorial-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 22px;
  line-height: 1;
}
.tutorial-progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  padding-right: 42px;
  margin-bottom: 26px;
}
.tutorial-progress span {
  height: 5px;
  border-radius: 999px;
  background: var(--line);
  transition: background .2s ease;
}
.tutorial-progress span.active { background: var(--primary); }
.tutorial-step-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 12px;
  color: #fff;
  background: #202736;
  box-shadow: none;
  font-size: 20px;
  font-weight: 800;
}
.tutorial-eyebrow {
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
}
.get-link-tutorial-modal h3 {
  margin: 5px 0 12px;
  font-size: 23px;
}
.tutorial-content { color: var(--muted); }
.tutorial-content > p { margin: 0 0 12px; }
.tutorial-content b,
.tutorial-content strong { color: var(--ink); }
.tutorial-tip,
.tutorial-warning,
.tutorial-preview {
  margin: 10px 0;
  padding: 12px 14px;
  border-radius: 12px;
}
.tutorial-tip { background: #f5f6fa; }
.tutorial-warning {
  color: #8a5707;
  background: #fff6df;
  border: 1px solid #f4dfaa;
}
.tutorial-note { font-size: 12px; }
.tutorial-preview {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 10px;
  background: #f5f3ff;
  border: 1px solid #ded9ff;
}
.tutorial-preview span { grid-column: 1 / -1; color: var(--ink); font-size: 11px; font-weight: 700; }
.tutorial-preview div { min-width: 0; padding: 9px 11px; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); white-space: nowrap; }
.tutorial-preview > b { padding: 9px 13px; border-radius: 9px; background: var(--primary); color: #fff; }
.tutorial-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 22px;
  margin-top: 20px;
  border-top: 1px solid var(--line);
}
.tutorial-navigation { display: flex; gap: 9px; }
.tutorial-navigation button[hidden] { display: none; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: #fff; font-weight: 700; background: #202736; }
.user-meta { line-height: 1.25; }
.user-meta strong { display: block; font-size: 13px; }
.user-meta span { color: var(--muted); font-size: 11px; }
.mobile-toggle { display: none; align-items: center; justify-content: center; padding: 8px 10px; background: var(--primary-soft); color: var(--primary); }

.content { max-width: 1480px; padding: 28px 32px 46px; margin: auto; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin-bottom: 24px; }
.page-title { margin: 0; font-size: 25px; line-height: 1.25; letter-spacing: 0; }
.page-subtitle { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 17px;
  margin-bottom: 24px;
}
.card, .panel {
  background: var(--surface);
  border: 1px solid rgba(216, 221, 233, .95);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
}
.card { position: relative; overflow: hidden; transition: border-color .18s, box-shadow .18s; }
.card:hover { border-color: #cbd2df; box-shadow: 0 14px 34px rgba(23,32,51,.1); }
.card::after { display: none; }
.card:nth-child(4n+1) { --card-color: var(--primary); --card-soft: #ece9ff; }
.card:nth-child(4n+2) { --card-color: var(--cyan); --card-soft: #e2fafa; }
.card:nth-child(4n+3) { --card-color: var(--orange); --card-soft: #fff0e5; }
.card:nth-child(4n+4) { --card-color: var(--pink); --card-soft: #ffe8f2; }
.metric-icon {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 10px; margin-bottom: 15px;
  color: var(--card-color);
  background: var(--card-soft);
}
.metric-svg {
  width: 19px;
  height: 19px;
}
.metric-label { color: var(--muted); font-size: 12px; font-weight: 600; }
.metric-value { font-size: 23px; font-weight: 800; letter-spacing: 0; margin-top: 4px; }
.referral-code-card .metric-value { font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.referral-code-card .referral-copy-btn { min-height: 32px; margin: 10px auto 0; padding: 6px 13px; font-size: 12px; background: #e1f8ef; color: var(--success); }
.metric-note { color: var(--muted); font-size: 11px; margin-top: 8px; }
.panel { margin-bottom: 18px; }

/* Forms and controls */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.section-title { margin: 0 0 5px; font-size: 18px; }
.input-action { display: flex; align-items: stretch; gap: 8px; }
.input-action input { min-width: 0; }
.input-action button { flex: 0 0 auto; white-space: nowrap; }
label { font-size: 12px; font-weight: 700; display: block; margin-bottom: 8px; color: #3b455b; }
input, select, textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #dfe2ec;
  border-radius: 9px;
  padding: 10px 13px;
  color: var(--ink);
  background: #fbfcfe;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input:not([type="checkbox"]):hover, select:hover, textarea:hover { border-color: #bfc5d8; background: #fff; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(249,115,22,.1); background: #fff; }
input[type="checkbox"] { min-height: 0; accent-color: var(--primary); }
.password-field { position: relative; }
.password-field input { padding-right: 48px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  width: 38px;
  min-height: 36px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  transform: translateY(-50%);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.password-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}
.password-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
button, .btn {
  border: 0;
  border-radius: 9px;
  min-height: 40px;
  padding: 9px 15px;
  cursor: pointer;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: background .18s, border-color .18s, box-shadow .18s, opacity .18s;
}
button:hover, .btn:hover { transform: none; }
.register-page button:hover, .register-page .btn:hover { transform: none; }
button:disabled { cursor: not-allowed; opacity: .5; transform: none; }
button.password-toggle,
button.password-toggle:hover,
button.password-toggle:active {
  transform: translateY(-50%);
}
button.password-toggle:hover {
  color: var(--primary);
  background: var(--primary-soft);
}
.btn-primary { background: #f97316; color: #fff; box-shadow: none; }
.btn-primary:hover { background: #ea580c; }
.btn-secondary { background: #eef1f6; color: #45516c; }
.btn-secondary:hover { background: #e4e8f0; }
.btn-danger { background: #ffebee; color: var(--danger); }
.btn-success { background: #e1f8ef; color: var(--success); }
.btn-icon { width: 40px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.inline-action { display: flex; align-items: center; gap: 7px; min-width: 190px; }
.inline-action select { min-height: 38px; padding: 7px 30px 7px 10px; font-size: 12px; }
.inline-action button { min-height: 38px; white-space: nowrap; }
.commission-percent-input { width: 110px; min-height: 38px; }
.commission-create-panel h3, .commission-setting-heading p { margin: 0; }
.commission-setting-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}
.commission-setting-heading h3 { margin-bottom: 5px; }
.commission-split-example {
  min-width: 290px;
  padding: 13px 15px;
  border-radius: 12px;
  background: #f5f3ff;
}
.commission-split-example span, .commission-split-example small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.commission-split-example strong { display: block; margin: 4px 0; font-size: 13px; }
.commission-create-actions { display: flex; align-items: flex-end; justify-content: flex-end; gap: 12px; }
.referral-setting-panel, .referral-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.referral-setting-panel h3, .referral-summary h3 { margin: 0 0 5px; }
.referral-setting-panel p, .referral-summary p { margin: 0; }
.referral-setting-controls { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.referral-setting-controls label { margin: 0; }
.referral-setting-controls input[type="number"] { width: 140px; margin-top: 7px; }
.checkbox-label { display: flex; align-items: center; gap: 7px; min-height: 40px; }
.checkbox-label input { width: auto; }
.referral-metrics { margin: 20px 0; }
.cashflow-panel h3 { margin: 0 0 16px; }
.cashflow-panel.table-panel h3 { margin: 0; padding: 21px 21px 0; }

/* Tables */
.table-panel { padding: 0; overflow: hidden; }
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 19px;
  border-bottom: 1px solid var(--line);
}
.table-toolbar-title { font-size: 14px; font-weight: 700; }
.table-count { color: var(--muted); font-size: 12px; margin-left: 5px; }
.table-search { width: min(280px, 100%); min-height: 39px; background: #f7f8fb; }
.table-wrap { overflow: auto; }
.partner-table-wrap h3 { margin: 0; padding: 18px 18px 0; }
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.table-pagination .disabled { pointer-events: none; opacity: .45; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 13px 12px; border-bottom: 1px solid #eef0f5; text-align: left; white-space: nowrap; vertical-align: middle; }
th { color: #7d8798; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .45px; background: #f8fafc; }
tbody tr { transition: background .18s; }
tbody tr:hover { background: #fff8f3; }
tbody tr:last-child td { border-bottom: 0; }
.original-url-link {
  display: inline-block !important;
  width: 220px !important;
  max-width: 220px !important;
  overflow: hidden !important;
  color: inherit;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  vertical-align: middle;
}
body[data-page="my-links"] #data-table th:nth-child(2),
body[data-page="my-links"] #data-table td:nth-child(2),
body[data-page="admin-links"] #data-table th:nth-child(2),
body[data-page="admin-links"] #data-table td:nth-child(2) {
  width: 244px;
  max-width: 244px;
  overflow: hidden;
}
.original-url-link:hover { color: var(--primary); text-decoration: underline; }
.table-user {
  display: grid;
  gap: 3px;
  min-width: 150px;
  line-height: 1.35;
}
.table-user strong { color: var(--ink); font-size: 12px; }
.table-user small { color: var(--muted); font-size: 11px; }
.order-product {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 240px;
  max-width: 340px;
}
.order-product-image {
  display: grid;
  width: 48px;
  height: 48px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f8fb;
}
.order-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.order-product-image.is-empty::before {
  content: "SP";
  color: #9aa3b8;
  font-size: 11px;
  font-weight: 700;
}
.order-product-info {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.order-product-info strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.order-product-info span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}
.order-timeline {
  display: grid;
  gap: 5px;
  min-width: 190px;
}
.order-timeline span {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 8px;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.35;
}
.order-timeline strong {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}
body[data-page="orders"] #data-table,
body[data-page="admin-orders"] #data-table,
body[data-page="admin-links"] #data-table {
  min-width: 1180px;
}
body[data-page="admin-audit-logs"] #data-table {
  table-layout: fixed;
  min-width: 860px;
}
body[data-page="admin-audit-logs"] #data-table th:nth-child(1) { width: 122px; }
body[data-page="admin-audit-logs"] #data-table th:nth-child(2) { width: 62px; }
body[data-page="admin-audit-logs"] #data-table th:nth-child(3) { width: 185px; }
body[data-page="admin-audit-logs"] #data-table th:nth-child(4) { width: 118px; }
body[data-page="admin-audit-logs"] #data-table th:nth-child(5) { width: 56px; }
body[data-page="admin-audit-logs"] #data-table th:nth-child(6),
body[data-page="admin-audit-logs"] #data-table td:nth-child(6) {
  width: auto;
  min-width: 0;
}
body[data-page="admin-audit-logs"] #data-table th:nth-child(7) { width: 128px; }
.audit-detail-preview {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 7px 9px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #f7f8fb;
  color: var(--ink);
  font: inherit;
  line-height: 1.4;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.audit-detail-preview:hover,
.audit-detail-preview:focus-visible {
  border-color: #d8d3ff;
  background: var(--primary-soft);
  color: var(--primary);
}
.audit-detail-modal {
  width: min(720px, 100%);
}
.audit-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.audit-detail-heading h3,
.audit-detail-heading p {
  margin: 0;
}
.audit-detail-heading p { margin-top: 5px; }
.audit-detail-close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 22px;
  line-height: 1;
}
.audit-detail-modal pre {
  max-height: min(58vh, 520px);
  margin: 0 0 18px;
  overflow: auto;
  overflow-wrap: anywhere;
}
body[data-page="admin-withdrawals"] #data-table {
  table-layout: fixed;
  min-width: 1080px;
}
body[data-page="admin-withdrawals"] #data-table th:nth-child(1) { width: 58px; }
body[data-page="admin-withdrawals"] #data-table th:nth-child(2) { width: 118px; }
body[data-page="admin-withdrawals"] #data-table th:nth-child(3) { width: 112px; }
body[data-page="admin-withdrawals"] #data-table th:nth-child(4) { width: 150px; }
body[data-page="admin-withdrawals"] #data-table th:nth-child(5) { width: 105px; }
body[data-page="admin-withdrawals"] #data-table th:nth-child(6),
body[data-page="admin-withdrawals"] #data-table th:nth-child(7) { width: 112px; }
body[data-page="admin-withdrawals"] #data-table th:nth-child(8) { width: auto; }
body[data-page="admin-withdrawals"] #data-table td:nth-child(8) {
  min-width: 0;
  overflow: hidden;
}
body[data-page="admin-withdrawals"] #data-table th:nth-child(9) { width: 220px; }
.withdrawal-note-preview {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 7px 9px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #f7f8fb;
  color: var(--ink);
  font: inherit;
  line-height: 1.4;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.withdrawal-note-preview:hover,
.withdrawal-note-preview:focus-visible {
  border-color: #d8d3ff;
  background: var(--primary-soft);
  color: var(--primary);
}
.withdrawal-note-modal { width: min(640px, 100%); }
.withdrawal-note-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.withdrawal-note-heading h3,
.withdrawal-note-heading p { margin: 0; }
.withdrawal-note-heading p { margin-top: 5px; }
.withdrawal-note-close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 22px;
  line-height: 1;
}
.withdrawal-note-content {
  max-height: min(50vh, 420px);
  margin-bottom: 18px;
  padding: 16px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f8fb;
  line-height: 1.7;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
body[data-page="wallet"] #data-table {
  table-layout: fixed;
  min-width: 820px;
}
body[data-page="wallet"] #data-table th:nth-child(1) { width: 165px; }
body[data-page="wallet"] #data-table th:nth-child(2),
body[data-page="wallet"] #data-table th:nth-child(3),
body[data-page="wallet"] #data-table th:nth-child(4) { width: 130px; }
body[data-page="wallet"] #data-table th:nth-child(5) { width: auto; }
body[data-page="wallet"] #data-table th:nth-child(6) { width: 125px; }
body[data-page="earnings"] #data-table {
  table-layout: fixed;
  min-width: 650px;
}
body[data-page="earnings"] #data-table th:nth-child(1) { width: 165px; }
body[data-page="earnings"] #data-table th:nth-child(2) { width: 140px; }
body[data-page="earnings"] #data-table th:nth-child(3) { width: auto; }
body[data-page="earnings"] #data-table th:nth-child(4) { width: 125px; }
body[data-page="wallet"] #data-table td:nth-child(5),
body[data-page="earnings"] #data-table td:nth-child(3) {
  min-width: 0;
  overflow: hidden;
}
.transaction-note-preview {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 7px 9px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #f7f8fb;
  color: var(--ink);
  font: inherit;
  line-height: 1.4;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.transaction-note-preview:hover,
.transaction-note-preview:focus-visible {
  border-color: #d8d3ff;
  background: var(--primary-soft);
  color: var(--primary);
}
.transaction-note-modal { width: min(640px, 100%); }
.transaction-note-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.transaction-note-heading h3,
.transaction-note-heading p { margin: 0; }
.transaction-note-heading p { margin-top: 5px; }
.transaction-note-close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 22px;
  line-height: 1;
}
.transaction-note-content {
  max-height: min(50vh, 420px);
  margin-bottom: 18px;
  padding: 16px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f8fb;
  line-height: 1.7;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.empty-state { text-align: center; padding: 42px !important; color: var(--muted); }
.empty-state::before { content: "◇"; display: block; font-size: 34px; color: #bfc4d4; margin-bottom: 7px; }
.loading-row td { height: 96px; color: var(--muted); text-align: center; }
.loading-row .spinner { display: inline-block; margin-right: 8px; vertical-align: middle; }
.skeleton-card { pointer-events: none; }
.skeleton {
  display: block;
  border-radius: 8px;
  background: linear-gradient(90deg, #eef0f5 25%, #f8f9fc 50%, #eef0f5 75%);
  background-size: 200% 100%;
  animation: skeletonPulse 1.2s ease-in-out infinite;
}
.skeleton-icon { width: 40px; height: 40px; margin-bottom: 17px; border-radius: 12px; }
.skeleton-line { width: 48%; height: 11px; }
.skeleton-value { width: 70%; height: 28px; margin-top: 10px; }

.badge { padding: 5px 9px; border-radius: 999px; font-size: 10px; font-weight: 700; background: #edf0f5; color: #5e687d; text-transform: capitalize; }
.badge.pending, .badge.approved { color: #98640a; background: #fff2d4; }
.badge.confirmed, .badge.active, .badge.completed { color: #087757; background: #dcf8ed; }
.badge.rejected, .badge.blacklisted, .badge.deleted { color: #bf3042; background: #ffe5e9; }
.badge.paid { color: #6840c2; background: #eee7ff; }
.badge.disabled, .badge.suspended { color: #687085; background: #e9ecf2; }

/* Feedback and helpers */
.notice { padding: 13px 15px; border-radius: 11px; margin: 0 0 18px; display: none; border: 1px solid transparent; }
.notice.show { display: block; animation: slideDown .25s ease; }
.notice.error { background: #fff0f2; color: #ae293a; border-color: #ffd6dc; }
.notice.success { background: #e9faf4; color: #087557; border-color: #c8f1e2; }
.buyer-payment-alert {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 18px;
  padding: 13px 16px;
  border: 1px solid #f3c46b;
  border-radius: 14px;
  background: #fff7d6;
  color: #7a4a00;
  box-shadow: 0 10px 24px rgba(245, 158, 11, .1);
  font-weight: 700;
}
.buyer-payment-alert-icon {
  width: 26px;
  height: 26px;
  display: grid;
  flex: 0 0 26px;
  place-items: center;
  border-radius: 50%;
  background: #f59e0b;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}
.buyer-payment-alert p {
  margin: 0;
}
.buyer-payment-alert a {
  color: #9a3412;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}
.dashboard-order-notice {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid #c7defe;
  border-radius: 14px;
  background: #eef6ff;
  color: #174b86;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .08);
  font-weight: 600;
}
.dashboard-order-notice-icon {
  width: 24px;
  height: 24px;
  display: grid;
  flex: 0 0 24px;
  place-items: center;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}
.muted { color: var(--muted); }
.money { font-variant-numeric: tabular-nums; font-weight: 700; }
.result-box { margin-top: 20px; padding: 18px; border: 1px dashed #988cff; border-radius: 14px; background: #f8f7ff; }
.link-loading { display: none; align-items: center; gap: 10px; margin-top: 18px; color: var(--muted); font-weight: 600; }
.link-loading.show { display: flex; }
.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid #ddd9ff;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}
.button-spinner {
  width: 16px;
  height: 16px;
  border-width: 2px;
  border-color: rgba(255,255,255,.4);
  border-top-color: #fff;
}
.copy-row { display: flex; gap: 8px; align-items: center; margin: 10px 0; }
.copy-row input { flex: 1; }
.admin-accent { border-left: 4px solid var(--primary); }
.dashboard-support-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .85fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
}
.dashboard-support-grid .panel { margin-bottom: 0; }
.dashboard-guide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 27px 29px;
  color: #fff;
  border: 0;
  background:
    radial-gradient(circle at 82% 20%, rgba(255,255,255,.18), transparent 10rem),
    linear-gradient(125deg, #7c2d12, #f97316 55%, #ffb11a);
}
.guide-copy h2 { margin: 5px 0 5px; font-size: 21px; }
.guide-copy p { margin: 0; color: #dedaff; }
.guide-kicker { color: #bff7ff; font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.guide-actions { display: flex; gap: 9px; flex-shrink: 0; }
.dashboard-guide .btn-primary { background: #fff; color: var(--primary); }
.dashboard-guide .btn-secondary { background: rgba(255,255,255,.13); color: #fff; }
.dashboard-beginner-guide h2 {
  margin: 5px 0 14px;
  font-size: 18px;
}
.dashboard-beginner-guide .guide-kicker { color: var(--primary); }
.dashboard-beginner-guide ol {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.dashboard-beginner-guide li {
  position: relative;
  min-height: 40px;
  padding-left: 48px;
}
.dashboard-beginner-guide li::before {
  content: counter(list-item);
  position: absolute;
  left: 0;
  top: 1px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
}
.dashboard-beginner-guide strong,
.dashboard-beginner-guide span {
  display: block;
}
.dashboard-beginner-guide strong { font-size: 13px; }
.dashboard-beginner-guide span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}
.dashboard-cashback-terms {
  overflow: hidden;
}
.cashback-terms-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 18px;
}
.cashback-terms-heading h2 {
  margin: 5px 0 0;
  font-size: 20px;
  letter-spacing: 0;
}
.cashback-terms-heading .guide-kicker { color: var(--primary); }
.cashback-terms-heading p {
  max-width: 460px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.cashback-timeline-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.cashback-platform-card {
  display: grid;
  gap: 7px;
  padding: 15px;
  border: 1px solid #e4e7f0;
  border-radius: 14px;
  background: #fbfcff;
}
.cashback-platform-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--primary-soft);
  color: var(--primary);
}
.notice-svg {
  width: 15px;
  height: 15px;
}
.cashback-svg {
  width: 18px;
  height: 18px;
}
.cashback-platform-card strong { font-size: 14px; }
.cashback-platform-card p,
.cashback-terms-alerts p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.dashboard-cashback-terms mark {
  padding: 1px 5px;
  border-radius: 999px;
  background: #fff3cf;
  color: #8a5707;
  font-weight: 800;
}
.cashback-terms-alerts {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.cashback-terms-alerts > div {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 13px;
  background: #f7f8fb;
}
.cashback-terms-alerts span {
  display: grid;
  place-items: center;
  color: var(--primary);
}
.cashback-tracking-warning {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 13px;
  align-items: start;
  margin: 0 0 14px;
  padding: 16px;
  border: 1px solid #f3c46b;
  border-left: 5px solid #f59e0b;
  border-radius: 14px;
  background: #fff7e6;
  color: #7a4a00;
  box-shadow: 0 12px 28px rgba(245, 158, 11, .12);
}
.cashback-tracking-warning-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #ffe8b5;
  color: #b77912;
}
.cashback-tracking-warning h3 {
  margin: 0 0 7px;
  font-size: 15px;
}
.cashback-tracking-warning p {
  margin: 0;
  font-size: 12px;
  line-height: 1.65;
}
.cashback-tracking-warning p + p { margin-top: 7px; }
.cashback-terms-accordion {
  display: grid;
  gap: 10px;
}
.cashback-terms-accordion details {
  border: 1px solid #e4e7f0;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}
.cashback-terms-accordion summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 15px;
  cursor: pointer;
  list-style: none;
}
.cashback-terms-accordion summary::-webkit-details-marker { display: none; }
.cashback-terms-accordion summary::after {
  content: "+";
  margin-left: auto;
  color: var(--primary);
  font-size: 18px;
  font-weight: 800;
}
.cashback-terms-accordion details[open] summary::after { content: "-"; }
.cashback-terms-accordion summary span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--primary-soft);
}
.cashback-terms-accordion ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0 17px 16px 54px;
  color: var(--muted);
}
.cashback-terms-accordion li { padding-left: 3px; }
.row-actions { display: flex; gap: 7px; }
.profile-card { display: flex; align-items: center; gap: 15px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.profile-card h2, .profile-card p { margin: 0; }
.profile-avatar {
  width: 58px; height: 58px; display: grid; place-items: center;
  border-radius: 12px; color: #fff; font-size: 18px; font-weight: 800;
  background: #202736;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.profile-identity { min-width: 0; flex: 1; }
.avatar-form { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 12px; }
.avatar-form .muted { font-size: 11px; }
.avatar-form .disabled { pointer-events: none; opacity: .55; }
.profile-grid { display: grid; grid-template-columns: minmax(260px, 1.25fr) repeat(2, minmax(170px, 1fr)); gap: 16px; padding-top: 20px; }
.profile-grid span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.profile-grid strong { font-size: 13px; }
.profile-phone-card {
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fffdf8;
}
.profile-phone-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.profile-phone-status {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  margin: 0 !important;
  padding: 0 9px;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412 !important;
  font-size: 11px !important;
  font-weight: 700;
  white-space: nowrap;
}
.profile-phone-status.verified {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534 !important;
}
.profile-verify-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  width: 100%;
  margin-top: 12px;
  padding: 0 11px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
  font-weight: 700;
}
.profile-verify-button:hover { background: #ffedd5; }
.verify-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}
.verify-title-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-right: 9px;
  border-radius: 10px;
  background: #fff7ed;
  color: var(--primary);
  vertical-align: middle;
}
.verify-title-icon .verify-icon {
  width: 19px;
  height: 19px;
}
.modal-card .btn-primary .verify-icon {
  margin-right: 6px;
}
.profile-security { padding-top: 20px; margin-top: 25px; border-top: 1px solid var(--line); }
.profile-security[open] { display: grid; grid-template-columns: minmax(220px,.8fr) minmax(320px,1.2fr); gap: 30px; }
.profile-security summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
  list-style: none;
}
.profile-security summary::-webkit-details-marker { display: none; }
.profile-security summary > span {
  flex: 0 0 auto;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}
.profile-security[open] summary {
  align-self: start;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: default;
}
.profile-security[open] summary > span { display: none; }
.profile-security h2 { margin: 0 0 5px; font-size: 18px; }
.profile-security p { margin: 0; }
.profile-password-form { display: grid; gap: 14px; }
.profile-password-form label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.profile-password-form button { justify-self: start; }
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 20px;
  background: rgba(17,20,39,.5); backdrop-filter: blur(4px);
}
.modal-overlay[hidden] { display: none; }
.modal-card {
  width: min(460px,100%); padding: 26px;
  border: 1px solid rgba(218, 223, 235, .95);
  border-radius: 16px; background: #fff;
  box-shadow: 0 28px 80px rgba(17,20,39,.24);
  animation: slideDown .2s ease;
}
.modal-card h3 { margin: 0 0 5px; font-size: 19px; }
.auth-verify-dialog h3,
.email-verify-dialog h3 { display: flex; align-items: center; }
.modal-card p { margin: 0 0 17px; }
.modal-card .actions { justify-content: flex-end; }
.auth-verify-dialog .captcha-panel,
.email-verify-dialog form { margin-top: 18px; }
.email-code-input {
  margin-top: 8px;
  text-align: center;
  font-weight: 800;
}
.terms-modal {
  width: min(760px, 100%);
  max-height: min(86dvh, 760px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
}
.terms-modal-content {
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 6px;
  line-height: 1.58;
}
.terms-modal-content h4 { margin: 18px 0 8px; font-size: 15px; }
.terms-modal-content p { margin-bottom: 12px; }
.wallet-adjustment-modal form { display: grid; gap: 14px; }
.wallet-adjustment-modal label { margin: 0; }
.wallet-adjustment-modal input,
.wallet-adjustment-modal select,
.wallet-adjustment-modal textarea { margin-top: 7px; }
pre { white-space: pre-wrap; overflow: auto; padding: 16px; border-radius: 12px; background: #171a2e; color: #dbe1ff; font-size: 12px; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-5px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes skeletonPulse { to { background-position: -200% 0; } }

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

@media (max-width: 1000px) {
  .layout { grid-template-columns: 230px 1fr; }
  .content { padding: 26px 24px 42px; }
}
@media (min-width: 801px) and (max-width: 1180px) {
  body[data-page="dashboard"] .dashboard-support-grid {
    grid-template-columns: 1fr;
  }
  body[data-page="dashboard"] .dashboard-guide-cta .guide-copy {
    min-width: 0;
  }
  body[data-page="dashboard"] .dashboard-guide-cta .guide-actions {
    flex-wrap: wrap;
  }
}
@media (min-width: 801px) and (max-width: 900px) {
  body[data-page="dashboard"] .dashboard-guide-cta {
    align-items: flex-start;
    flex-direction: column;
  }
}
@media (max-width: 800px) {
  .layout { display: block; }
  .sidebar { position: fixed; left: -280px; width: 270px; transition: left .25s ease; }
  .sidebar-collapsed .sidebar { padding: 22px 16px; overflow: auto; }
  .sidebar-collapsed .sidebar-header { display: flex; }
  .sidebar-collapsed .sidebar .brand { justify-content: flex-start; align-items: flex-start; padding: 2px 10px 25px; }
  .sidebar-collapsed .sidebar .nav-section,
  .sidebar-collapsed .sidebar a:not(.brand) span { display: initial; }
  .sidebar-collapsed .sidebar .brand-logo-full,
  .sidebar-collapsed .sidebar .brand-slogan { display: block; }
  .sidebar-toggle,
  .sidebar-collapsed .sidebar-toggle {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    margin: 22px 0 0;
  }
  .sidebar-collapsed .sidebar a:not(.brand) {
    justify-content: flex-start;
    gap: 12px;
    padding: 11px 13px;
  }
  body.nav-open .sidebar { left: 0; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(17,20,39,.45); z-index: 19; }
  .mobile-toggle { display: inline-flex; }
  .topbar { height: 66px; padding: 0 17px; }
  .topbar-context { display: none; }
  .topbar-balance { padding: 8px 10px; }
  .topbar-balance span { display: none; }
  .user-meta { display: none; }
  .content { padding: 22px 16px 40px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-title { font-size: 23px; }
  .get-link-tutorial-modal { padding: 23px 19px 19px; }
  .get-link-tutorial-modal h3 { font-size: 20px; }
  .tutorial-progress { margin-bottom: 20px; }
  .tutorial-footer { align-items: stretch; flex-direction: column-reverse; }
  .tutorial-navigation { display: grid; grid-template-columns: auto 1fr; }
  .tutorial-footer > button,
  .tutorial-navigation button { justify-content: center; }
  .form-grid { grid-template-columns: 1fr; }
  .cards { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .table-toolbar { align-items: stretch; flex-direction: column; }
  .table-search { width: 100%; }
  .table-panel { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .table-panel .table-toolbar,
  .table-panel .table-pagination {
    border: 1px solid rgba(216, 221, 233, .95);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }
  .table-panel .table-toolbar { margin-bottom: 12px; }
  .table-panel .table-pagination {
    justify-content: space-between;
    flex-wrap: wrap;
    margin-top: 12px;
  }
  .responsive-table,
  .responsive-table tbody,
  .responsive-table tr,
  .responsive-table td { display: block; width: 100%; }
  .responsive-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .responsive-table tbody { display: grid; gap: 12px; }
  .responsive-table tbody tr {
    padding: 7px 15px;
    border: 1px solid rgba(216, 221, 233, .95);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 8px 24px rgba(43, 48, 82, .08);
  }
  .responsive-table tbody tr:hover { background: var(--surface); }
  .responsive-table td {
    display: grid;
    width: 100% !important;
    max-width: none !important;
    grid-template-columns: minmax(92px, 34%) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 10px 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .responsive-table td::before {
    content: attr(data-label);
    color: #8992a7;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.55;
    text-transform: uppercase;
    letter-spacing: .55px;
  }
  .responsive-table td:last-child { border-bottom: 0; }
  .responsive-table .empty-state {
    display: block;
    padding: 32px 12px !important;
  }
  .responsive-table .empty-state::before {
    content: "\25C7";
    color: #bfc4d4;
    font-size: 34px;
    font-weight: 400;
    text-transform: none;
  }
  .responsive-table .original-url-link {
    width: auto !important;
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }
  .responsive-table .row-actions,
  .responsive-table .inline-action {
    min-width: 0;
    flex-wrap: wrap;
  }
  .responsive-table .order-product {
    min-width: 0;
    max-width: 100%;
  }
  .responsive-table .order-product-info strong {
    white-space: normal;
  }
  .responsive-table .order-timeline {
    min-width: 0;
  }
  .responsive-table .inline-action select { min-width: 140px; flex: 1; }
  body:is(
    [data-page="orders"],
    [data-page="admin-links"],
    [data-page="admin-orders"]
  ) .content > .table-wrap {
    padding: 0;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  body:is(
    [data-page="orders"],
    [data-page="admin-links"],
    [data-page="admin-orders"]
  ) #data-table {
    min-width: 0;
    table-layout: auto;
  }
  body:is(
    [data-page="orders"],
    [data-page="admin-links"],
    [data-page="admin-orders"]
  ) .responsive-table tbody tr {
    overflow: hidden;
  }
  body:is(
    [data-page="orders"],
    [data-page="admin-links"],
    [data-page="admin-orders"]
  ) .responsive-table td,
  body:is(
    [data-page="orders"],
    [data-page="admin-links"],
    [data-page="admin-orders"]
  ) .responsive-table td > * {
    min-width: 0;
    max-width: 100%;
  }
  body[data-page="admin-links"] .responsive-table td:nth-child(2),
  body[data-page="admin-links"] .responsive-table td:nth-child(4),
  body[data-page="admin-orders"] .responsive-table td:nth-child(3),
  body[data-page="admin-orders"] .responsive-table td:nth-child(4),
  body[data-page="admin-orders"] .responsive-table td:nth-child(10),
  body[data-page="admin-orders"] .responsive-table td:nth-child(11) {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  body:is(
    [data-page="orders"],
    [data-page="admin-links"],
    [data-page="admin-orders"]
  ) .responsive-table .table-user {
    min-width: 0;
  }
  body:is(
    [data-page="orders"],
    [data-page="admin-links"],
    [data-page="admin-orders"]
  ) .responsive-table .table-user small {
    overflow-wrap: anywhere;
  }
  body[data-page="admin-users"] .responsive-table td,
  body[data-page="admin-links"] .responsive-table td,
  body[data-page="admin-orders"] .responsive-table td,
  body[data-page="admin-withdrawals"] .responsive-table td,
  body[data-page="admin-commission-settings"] .responsive-table td,
  body[data-page="admin-audit-logs"] .responsive-table td {
    overflow: visible !important;
  }
  body[data-page="admin-users"] .responsive-table button,
  body[data-page="admin-links"] .responsive-table button,
  body[data-page="admin-orders"] .responsive-table button,
  body[data-page="admin-withdrawals"] .responsive-table button,
  body[data-page="admin-commission-settings"] .responsive-table button,
  body[data-page="admin-audit-logs"] .responsive-table button { max-width: 100%; }
  body[data-page="admin-audit-logs"] .responsive-table td { grid-template-columns: minmax(84px, 28%) minmax(0, 1fr); }
  body[data-page="admin-audit-logs"] .responsive-table td:nth-child(6),
  body[data-page="admin-links"] .responsive-table td:nth-child(2) {
    grid-template-columns: 1fr;
    gap: 5px;
  }
  body[data-page="admin-audit-logs"] #data-table {
    min-width: 0;
    table-layout: auto;
  }
  body[data-page="admin-withdrawals"] #data-table {
    min-width: 0;
    table-layout: auto;
  }
  body[data-page="wallet"] #data-table,
  body[data-page="earnings"] #data-table {
    min-width: 0;
    table-layout: auto;
  }
  body[data-page="wallet"] #data-table td:nth-child(5),
  body[data-page="earnings"] #data-table td:nth-child(3) {
    width: 100%;
    max-width: 100%;
  }
  body[data-page="wallet"] .transaction-note-preview,
  body[data-page="earnings"] .transaction-note-preview {
    width: 100%;
    max-width: 100%;
  }
  body[data-page="admin-withdrawals"] #data-table td:nth-child(8) {
    width: 100%;
    max-width: 100%;
  }
  body[data-page="admin-withdrawals"] .withdrawal-note-preview {
    width: 100%;
    max-width: 100%;
  }
  body[data-page="admin-audit-logs"] #data-table td:nth-child(6) {
    width: 100%;
    max-width: 100%;
  }
  body[data-page="admin-audit-logs"] .audit-detail-preview {
    width: 100%;
    max-width: 100%;
  }
  body[data-page="admin-orders"] .responsive-table .inline-action,
  body[data-page="admin-users"] .responsive-table .inline-action,
  body[data-page="admin-links"] .responsive-table .inline-action {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }
  body[data-page="admin-orders"] .responsive-table .inline-action select,
  body[data-page="admin-users"] .responsive-table .inline-action select,
  body[data-page="admin-links"] .responsive-table .inline-action select,
  body[data-page="admin-orders"] .responsive-table .inline-action button,
  body[data-page="admin-users"] .responsive-table .inline-action button,
  body[data-page="admin-links"] .responsive-table .inline-action button {
    width: 100%;
  }
  .dashboard-support-grid { grid-template-columns: 1fr; }
  .dashboard-guide { align-items: flex-start; flex-direction: column; }
  .cashback-terms-heading { flex-direction: column; }
  .cashback-terms-heading p { max-width: none; }
  .cashback-timeline-grid { grid-template-columns: 1fr; }
  .commission-setting-heading { flex-direction: column; }
  .commission-split-example { min-width: 0; width: 100%; }
  .commission-create-actions { justify-content: flex-start; }
  .referral-setting-panel, .referral-summary { align-items: flex-start; flex-direction: column; }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-security { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .auth-page { padding: 16px; }
  .auth-card { padding: 27px 22px; border-radius: 22px; }
  .register-grid { grid-template-columns: 1fr; }
  .register-page .terms-text { white-space: normal; }
  .captcha-row { align-items: stretch; flex-direction: column; }
  .captcha-row img { width: 100%; max-width: 220px; flex-basis: 54px; }
  .cards { grid-template-columns: 1fr; }
  .copy-row { align-items: stretch; flex-direction: column; }
  .input-action { align-items: stretch; flex-direction: column; }
  .cashback-terms-alerts > div { grid-template-columns: 1fr; }
  .cashback-tracking-warning { grid-template-columns: 1fr; }
  .cashback-terms-accordion ul { padding-left: 34px; }
  .profile-card { align-items: flex-start; }
  .avatar-form { align-items: stretch; flex-direction: column; }
  .avatar-form .btn { text-align: center; }
  body:is(
    [data-page="orders"],
    [data-page="admin-links"],
    [data-page="admin-orders"]
  ) .content {
    padding-right: 12px;
    padding-left: 12px;
  }
  body:is(
    [data-page="orders"],
    [data-page="admin-links"],
    [data-page="admin-orders"]
  ) .page-heading {
    gap: 14px;
    margin-bottom: 18px;
  }
  body:is(
    [data-page="orders"],
    [data-page="admin-orders"]
  ) .page-actions,
  body:is(
    [data-page="orders"],
    [data-page="admin-orders"]
  ) .page-actions > * {
    width: 100%;
  }
  body:is(
    [data-page="orders"],
    [data-page="admin-links"],
    [data-page="admin-orders"]
  ) .responsive-table tbody {
    gap: 10px;
  }
  body:is(
    [data-page="orders"],
    [data-page="admin-links"],
    [data-page="admin-orders"]
  ) .responsive-table tbody tr {
    padding: 5px 13px;
    border-radius: 14px;
  }
  body:is(
    [data-page="orders"],
    [data-page="admin-links"],
    [data-page="admin-orders"]
  ) .responsive-table td {
    grid-template-columns: minmax(78px, 30%) minmax(0, 1fr);
    gap: 9px;
    padding: 9px 0;
    font-size: 12px;
  }
  body:is(
    [data-page="orders"],
    [data-page="admin-links"],
    [data-page="admin-orders"]
  ) .responsive-table td::before {
    font-size: 9px;
    letter-spacing: .45px;
  }
  body:is(
    [data-page="orders"],
    [data-page="admin-links"],
    [data-page="admin-orders"]
  ) .responsive-table .order-product {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 9px;
  }
  body:is(
    [data-page="orders"],
    [data-page="admin-links"],
    [data-page="admin-orders"]
  ) .responsive-table .order-product-image {
    width: 44px;
    height: 44px;
  }
  body:is(
    [data-page="orders"],
    [data-page="admin-links"],
    [data-page="admin-orders"]
  ) .responsive-table .inline-action select,
  body:is(
    [data-page="orders"],
    [data-page="admin-links"],
    [data-page="admin-orders"]
  ) .responsive-table .inline-action button {
    min-height: 44px;
  }
  body[data-page="admin-commission-settings"] .commission-create-actions,
  body[data-page="admin-commission-settings"] .referral-setting-controls {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }
  body[data-page="admin-commission-settings"] .referral-setting-controls label,
  body[data-page="admin-commission-settings"] .referral-setting-controls input[type="number"],
  body[data-page="admin-commission-settings"] .commission-create-actions button,
  body[data-page="admin-commission-settings"] .referral-setting-controls button {
    width: 100%;
  }
  body[data-page="admin-commission-settings"] .commission-percent-input { width: 100%; }
  body:is(
    [data-page="admin-users"],
    [data-page="admin-links"],
    [data-page="admin-orders"],
    [data-page="admin-withdrawals"],
    [data-page="admin-commission-settings"],
    [data-page="admin-audit-logs"]
  ) .table-pagination .btn { flex: 1; }
  body:is(
    [data-page="admin-users"],
    [data-page="admin-links"],
    [data-page="admin-orders"],
    [data-page="admin-withdrawals"],
    [data-page="admin-commission-settings"],
    [data-page="admin-audit-logs"]
  ) .table-pagination span {
    order: -1;
    width: 100%;
    text-align: center;
  }
}
