*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Header */
header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
}
header h1 { font-size: 20px; }
header nav a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
header nav a:hover { color: var(--primary-dark); }

/* Container */
.container { max-width: 1100px; margin: 24px auto; padding: 0 24px; }

/* Card */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  padding: 28px;
  margin-bottom: 20px;
}
.card h2 { font-size: 18px; margin-bottom: 20px; }

/* Channel Section */
.channel-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.channel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.channel-header h3 { font-size: 16px; }

/* Toggle Switch */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.switch input { display: none; }
.slider {
  width: 48px; height: 26px;
  background: #cbd5e1;
  border-radius: 13px;
  position: relative;
  transition: background .25s;
}
.slider::after {
  content: '';
  position: absolute;
  width: 22px; height: 22px;
  background: #fff;
  border-radius: 50%;
  top: 2px; left: 2px;
  transition: transform .25s;
}
.switch input:checked + .slider { background: var(--success); }
.switch input:checked + .slider::after { transform: translateX(22px); }
.switch-label { font-size: 13px; color: var(--text-muted); min-width: 40px; }

/* Form */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.form-group input, .form-group textarea {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  transition: border-color .2s, box-shadow .2s;
}
.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.form-group textarea { min-height: 80px; resize: vertical; font-family: monospace; font-size: 12px; }

.hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 12px;
}
.hint a { color: var(--primary); }

.btn-save {
  display: block;
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .1s;
  margin-top: 12px;
}
.btn-save:hover { background: var(--primary-dark); }
.btn-save:active { transform: scale(.98); }

/* Info Grid */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.info-item label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.info-item code {
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 14px;
}

/* Table */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { font-weight: 600; color: var(--text-muted); font-size: 13px; }
td code { background: #f1f5f9; padding: 2px 8px; border-radius: 4px; font-size: 13px; }

/* Status Badge */
.status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.status-pending { background: #fef3c7; color: #92400e; }
.status-paid { background: #d1fae5; color: #065f46; }
.status-cancelled { background: #fee2e2; color: #991b1b; }

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

/* Login Page */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 12% 8%, rgba(37,99,235,0.26), transparent 32rem),
    radial-gradient(circle at 86% 4%, rgba(15,118,110,0.18), transparent 30rem),
    linear-gradient(135deg, #eef6ff 0%, #f8fbff 54%, #eef7f3 100%);
}
.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  width: min(1040px, 100%);
  min-height: 640px;
  border: 1px solid rgba(219,228,238,0.85);
  border-radius: 34px;
  overflow: hidden;
  background: rgba(255,255,255,0.74);
  box-shadow: 0 30px 80px rgba(15,23,42,0.14);
}
.login-brand {
  position: relative;
  overflow: hidden;
  padding: 54px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(15,23,42,0.96), rgba(30,64,175,0.92)),
    repeating-linear-gradient(90deg, transparent 0 18px, rgba(255,255,255,0.06) 18px 19px);
}
.login-brand::after {
  content: '';
  position: absolute;
  right: -100px;
  bottom: -100px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(45,212,191,0.18);
}
.login-brand .brand-mark {
  margin-bottom: 28px;
}
.login-brand h1 {
  max-width: 520px;
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.04;
}
.login-brand p {
  max-width: 520px;
  margin-top: 18px;
  color: rgba(255,255,255,0.72);
  line-height: 1.8;
  font-weight: 650;
}
.login-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}
.login-points span {
  padding: 9px 12px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  color: rgba(255,255,255,0.82);
  background: rgba(255,255,255,0.08);
  font-size: 13px;
  font-weight: 900;
}
.login-box {
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 44px;
  width: 100%;
  text-align: left;
}
.login-box h1 { font-size: 22px; margin-bottom: 8px; }
.login-box .sub { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }
.login-label {
  display: block;
  margin: 14px 0 7px;
  color: #475569;
  font-size: 13px;
  font-weight: 900;
}
.login-box input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  font-size: 14px;
  margin-bottom: 0;
}
.login-box input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.login-box button {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 18px;
}
.login-box button:hover { background: var(--primary-dark); }
.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 126px;
  gap: 10px;
}
.code-row button {
  margin-top: 0;
  padding: 0 12px;
  white-space: nowrap;
  font-size: 13px;
}
.code-row button:disabled {
  opacity: 0.68;
  cursor: not-allowed;
}
.login-help {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
}
.error { background: #fee2e2; color: #991b1b; padding: 10px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }

/* Login Switch */
.login-switch { text-align: right; margin-bottom: 16px; font-size: 13px; }
.login-switch-label { color: var(--text-muted); cursor: pointer; user-select: none; }
.login-switch-label.active { color: var(--primary); font-weight: 700; }
.login-switch-divider { color: var(--border); margin: 0 6px; }

/* Pay Page */
.pay-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
.pay-header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
}
.pay-header h1 { font-size: 18px; }
.pay-body {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
}
.pay-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
  padding: 36px;
  width: 420px;
  max-width: 100%;
  text-align: center;
}
.pay-card .amount {
  font-size: 40px;
  font-weight: 700;
  color: var(--primary);
  margin: 8px 0 24px;
}
.pay-card .order-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
}
.pay-card .order-meta code {
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}
.pay-buttons { display: flex; flex-direction: column; gap: 12px; }
.pay-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform .1s, box-shadow .2s;
}
.pay-btn:active { transform: scale(.98); }
.pay-btn-wechat {
  background: #07c160;
  color: #fff;
}
.pay-btn-wechat:hover { box-shadow: 0 4px 16px rgba(7,193,96,.35); }
.pay-btn-alipay {
  background: #1677ff;
  color: #fff;
}
.pay-btn-alipay:hover { box-shadow: 0 4px 16px rgba(22,119,255,.35); }
.pay-btn-usdt {
  background: #f7931a;
  color: #fff;
}
.pay-btn-usdt:hover { box-shadow: 0 4px 16px rgba(247,147,26,.35); }
.pay-btn-disabled {
  background: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
  pointer-events: none;
}
.pay-paid {
  color: var(--success);
  font-size: 18px;
  font-weight: 600;
  margin-top: 20px;
}
.pay-qr { margin: 20px 0; }
.pay-qr img { max-width: 220px; border-radius: 8px; }

/* ========== 移动端响应式 ========== */
@media (max-width: 768px) {
  .container { padding: 0 12px; margin: 16px auto; }
  .card { padding: 18px; margin-bottom: 14px; }
  .card h2 { font-size: 16px; margin-bottom: 14px; }
  header { padding: 0 12px; }
  .header-inner { height: 50px; }
  header h1 { font-size: 17px; }
  .channel-section { padding: 14px; }
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  .info-grid { grid-template-columns: 1fr 1fr; gap: 12px; }

  /* 登录页 */
  .login-box { padding: 28px 20px; }
  .login-box h1 { font-size: 20px; }
  .login-box input { padding: 14px; font-size: 16px; }
  .login-box button { padding: 14px; font-size: 16px; }
  .login-switch { font-size: 14px; }

  /* 订单卡片视图 - 移动端 */
  .desktop-table { display: none; }
  .mobile-orders { display: block; }
  .order-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
  }
  .order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
  }
  .order-card-header .order-no {
    font-size: 12px;
    color: var(--text-muted);
    font-family: monospace;
    word-break: break-all;
  }
  .order-card-header .order-amount {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
  }
  .order-card-header .order-arrow {
    font-size: 14px;
    color: var(--text-muted);
    transition: transform 0.25s ease;
    min-width: 20px;
    text-align: center;
  }
  .order-card.expanded .order-card-header .order-arrow {
    transform: rotate(180deg);
  }
  .order-card-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
  }
  .order-card-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    border-top: 0 solid var(--border);
  }
  .order-card.expanded .order-card-body {
    max-height: 300px;
    border-top-width: 1px;
    margin-top: 12px;
    padding-top: 12px;
  }
  .order-card-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
    gap: 8px;
  }
  .order-card-detail .label { color: var(--text-muted); white-space: nowrap; }
  .order-card-detail .value { text-align: right; word-break: break-all; }
  .order-card-detail code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
  }
  .order-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    justify-content: flex-end;
  }
  .order-card-actions button {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    border: none;
    cursor: pointer;
  }
}

@media (min-width: 769px) {
  .desktop-table { display: table; }
  .mobile-orders { display: none; }
}

/* 表格横向滚动 */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrapper table { min-width: 1100px; }

/* 支付页移动端 */
@media (max-width: 480px) {
  .pay-card { padding: 24px 18px; }
  .pay-card .amount { font-size: 32px; }
  .pay-btn { padding: 12px; font-size: 15px; }
}

/* 兑换码表格优化 */
.table-wrapper td code { white-space: nowrap; font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace; font-size: 11px; letter-spacing: 0.5px; display: inline-block; max-width: none; }
.table-wrapper table td { white-space: nowrap; padding: 8px 10px; }

/* SaaS dashboard refresh */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #0f766e;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --bg: #f4f7fb;
  --card-bg: rgba(255, 255, 255, 0.92);
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #dbe4ee;
  --radius: 16px;
  --shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 20px 50px rgba(15, 23, 42, 0.10);
}

body {
  background:
    radial-gradient(circle at 8% 0%, rgba(37, 99, 235, 0.12), transparent 32rem),
    radial-gradient(circle at 92% 10%, rgba(15, 118, 110, 0.10), transparent 30rem),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 45%, #eef4f8 100%);
  color: var(--text);
}

header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(248, 251, 255, 0.88);
  border-bottom: 1px solid rgba(219, 228, 238, 0.82);
  backdrop-filter: blur(18px);
}

.header-inner {
  max-width: 1280px;
  height: 72px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  font-weight: 900;
  box-shadow: 0 14px 32px rgba(37, 99, 235, 0.24);
}

header h1 {
  font-size: 18px;
  line-height: 1.1;
}

.brand-subtitle {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

header nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

header nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 800;
}

header nav a:hover {
  color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
}

/* Header right */
.header-nav-right { display: flex; align-items: center; gap: 12px; position: relative; }
.avatar-wrap { cursor: pointer; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
  transition: box-shadow .2s;
}
.avatar-wrap:hover .avatar { box-shadow: 0 0 0 4px rgba(99,102,241,.2); }
.avatar-menu {
  display: none; position: absolute; top: 44px; right: 0;
  background: #fff; border-radius: 10px; box-shadow: 0 8px 32px rgba(0,0,0,.12);
  min-width: 140px; z-index: 999; overflow: hidden;
}
.avatar-menu.show { display: block; }
.avatar-menu-item {
  display: block; padding: 12px 16px; font-size: 14px; color: var(--text);
  text-decoration: none; cursor: pointer; transition: background .15s;
  border: none; background: none; width: 100%; text-align: left;
}
.avatar-menu-item:hover { background: #f1f5f9; }

.nav-primary {
  color: #fff !important;
  background: var(--text);
}

.container {
  max-width: 1280px;
  margin: 28px auto 48px;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 22px;
  width: min(1480px, calc(100% - 32px));
  margin: 24px auto 52px;
}

.sidebar {
  position: sticky;
  top: 92px;
  align-self: start;
  min-height: calc(100vh - 116px);
  padding: 18px;
  border: 1px solid rgba(219, 228, 238, 0.85);
  border-radius: 26px;
  background: rgba(255,255,255,0.86);
  box-shadow: var(--shadow-sm);
}

.sidebar-title {
  padding: 8px 10px 16px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 900;
}

.sidebar-nav {
  display: grid;
  gap: 6px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 14px;
  color: #334155;
  text-decoration: none;
  font-size: 14px;
  font-weight: 850;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: var(--primary);
  background: rgba(37, 99, 235, 0.09);
}

.sidebar-foot {
  margin-top: 18px;
  padding: 14px;
  border-radius: 18px;
  color: var(--text-muted);
  background: #f8fafc;
  font-size: 12px;
  line-height: 1.6;
  font-weight: 750;
}

.content {
  min-width: 0;
}

.content .container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.72fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 20px;
}

.page-section {
  display: none;
}

.page-section.active {
  display: block;
}

.dashboard-hero.page-section.active {
  display: grid;
}

.tab-panel.page-section {
  display: none;
}

.tab-panel.page-section.active {
  display: block;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  padding: 32px;
  border: 1px solid rgba(219, 228, 238, 0.75);
  border-radius: 28px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 64, 175, 0.92)),
    repeating-linear-gradient(90deg, transparent 0 18px, rgba(255,255,255,0.06) 18px 19px);
  box-shadow: var(--shadow-md);
}

.hero-panel::after {
  content: '';
  position: absolute;
  right: -80px;
  top: -80px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: rgba(45, 212, 191, 0.18);
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 7px 11px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  color: rgba(255,255,255,0.78);
  font-size: 12px;
  font-weight: 900;
}

.hero-panel h2 {
  max-width: 720px;
  margin: 0;
  color: #fff;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.06;
}

.hero-panel p {
  max-width: 720px;
  margin: 16px 0 0;
  color: rgba(255,255,255,0.72);
  font-size: 15px;
  line-height: 1.8;
  font-weight: 650;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.hero-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  color: #0f172a;
  background: #fff;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.hero-action.secondary {
  color: #fff;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.1);
}

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

.metric-card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(255,255,255,0.9);
  box-shadow: var(--shadow-sm);
}

.metric-card span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 900;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 30px;
  line-height: 1;
}

.metric-card small {
  display: block;
  margin-top: 9px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.card {
  border: 1px solid rgba(219, 228, 238, 0.78);
  border-radius: 24px;
  box-shadow: var(--shadow-sm);
}

.card h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  font-size: 20px;
}

.card-subtitle {
  margin: -10px 0 20px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
  font-weight: 650;
}

.channel-section {
  border-color: rgba(219, 228, 238, 0.9);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(248,251,255,0.88), rgba(255,255,255,0.88));
}

.channel-header h3,
.channel-section h3 {
  color: var(--text);
  font-size: 16px;
}

.form-group label {
  color: #475569;
  font-weight: 800;
}

.form-group input,
.form-group textarea,
select {
  border-color: #d7e0ea !important;
  border-radius: 12px !important;
  background: #fff;
}

.btn-save,
.btn-load-more {
  border-radius: 14px !important;
  background: linear-gradient(135deg, var(--primary), var(--accent)) !important;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.20);
}

.user-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

.tab-nav {
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(226, 232, 240, 0.72);
}

.tab-btn {
  border-radius: 14px;
  background: transparent;
}

.tab-btn.active {
  background: #fff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

th {
  color: #64748b;
  background: #f8fafc;
  text-transform: none;
}

td code,
.info-item code {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.qr-panel {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}

.qr-frame {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: #fff;
  text-align: center;
}

.qr-frame img {
  width: 200px;
  height: 200px;
  border: 0 !important;
  border-radius: 16px !important;
}

.qr-frame img.qr-card-preview {
  width: 224px;
  height: auto;
  max-width: 100%;
  border-radius: 18px !important;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.merchant-mini-card {
  display: grid;
  gap: 5px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #dbeafe;
  border-radius: 16px;
  color: #475569;
  background: linear-gradient(135deg, #eff6ff, #ffffff);
  font-size: 13px;
}

.merchant-mini-card strong {
  color: #0f172a;
  font-size: 16px;
}

.merchant-edit-form {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid #dbeafe;
  border-radius: 22px;
  background: linear-gradient(135deg, #f8fbff, #ffffff);
}

.merchant-edit-form h3 {
  margin: 0 0 6px;
  color: #0f172a;
  font-size: 18px;
  font-weight: 900;
}

.form-group-wide {
  grid-column: 1 / -1;
}

.merchant-save-btn {
  width: auto;
  min-width: 150px;
}

.qr-copy code {
  display: inline-block;
  max-width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  word-break: break-all;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  margin-top: 14px;
  padding: 0 14px;
  border-radius: 999px;
  color: #fff;
  background: var(--primary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
}

.account-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.admin-permission-box {
  display: grid;
  gap: 14px;
  margin: -2px 0 18px;
  padding: 16px;
  border: 1px solid #dbeafe;
  border-radius: 18px;
  background: linear-gradient(135deg, #eff6ff, #ffffff);
}

.admin-permission-box strong,
.admin-permission-box span {
  display: block;
}

.admin-permission-box strong {
  color: #0f172a;
  font-size: 15px;
  font-weight: 900;
}

.admin-permission-box > div > span {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.permission-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #dbe4ee;
  border-radius: 12px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
}

.permission-chip input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.permission-chip:has(input:not(:checked)) {
  color: #94a3b8;
  background: #f8fafc;
}

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

.account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
}

.account-row strong,
.account-row span {
  display: block;
}

.account-row span {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 750;
}

.danger-text-btn {
  border: 1px solid rgba(220, 38, 38, 0.18);
  border-radius: 999px;
  color: var(--danger);
  background: #fff;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.danger-text-btn:disabled {
  color: var(--text-muted);
  border-color: var(--border);
  cursor: not-allowed;
}

.admin-permission-note {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #fde68a;
  border-radius: 16px;
  color: #92400e;
  background: #fffbeb;
  font-size: 13px;
  font-weight: 750;
}

.admin-readonly-tag {
  justify-self: end;
  padding: 6px 10px;
  border-radius: 999px;
  color: #64748b;
  background: #f1f5f9;
  font-size: 12px;
  font-weight: 850;
}

@media (max-width: 900px) {
  .header-inner {
    height: auto;
    padding: 14px 0;
    gap: 12px;
  }
  .dashboard-hero,
  .metric-grid,
  .qr-panel {
    grid-template-columns: 1fr;
  }
  .dashboard-layout {
    grid-template-columns: 1fr;
    width: min(100% - 24px, 1280px);
  }
  .sidebar {
    position: static;
    min-height: auto;
  }
  .sidebar-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .account-form {
    grid-template-columns: 1fr;
  }
}
