:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --card: #ffffff;
  --card-soft: #f8faff;
  --text: #17233c;
  --text-strong: #0f1b34;
  --muted: #718096;
  --border: #e4eaf2;
  --border-strong: #d6dfeb;
  --primary: #1677ff;
  --primary-dark: #075dd1;
  --primary-soft: #edf5ff;
  --danger: #dc3545;
  --danger-dark: #bd2233;
  --danger-soft: #fff0f2;
  --success: #149c68;
  --success-soft: #eaf9f2;
  --warning: #d5810b;
  --warning-soft: #fff7e8;
  --sidebar: #0b1735;
  --sidebar-soft: #132349;
  --shadow-sm: 0 5px 18px rgba(30, 58, 108, .06);
  --shadow-md: 0 14px 36px rgba(30, 58, 108, .10);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
button, input, textarea, select { font: inherit; }
button { line-height: 1.2; }

/* Admin application shell */
.admin-layout { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  display: flex;
  width: 244px;
  flex-direction: column;
  overflow: hidden;
  color: #dce7fb;
  background:
    radial-gradient(circle at 10% 0%, rgba(45, 116, 255, .22), transparent 28%),
    linear-gradient(180deg, var(--sidebar) 0%, #0a1530 100%);
  box-shadow: 14px 0 38px rgba(11, 23, 53, .12);
}
.sidebar::after {
  content: "";
  position: absolute;
  right: -96px;
  bottom: 8%;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(255, 255, 255, .04);
  border-radius: 50%;
  pointer-events: none;
}
.sidebar-brand {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 82px;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.sidebar-brand:hover { color: #fff; }
.sidebar-brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #2288ff, #596af2);
  box-shadow: 0 10px 22px rgba(17, 111, 255, .30);
}
.sidebar-brand-mark svg { width: 27px; height: 27px; }
.sidebar-brand > span:last-child { display: grid; gap: 1px; }
.sidebar-brand strong { font-size: 18px; letter-spacing: .03em; }
.sidebar-brand small { color: #9eb1d4; font-size: 11px; letter-spacing: .1em; }
.sidebar-nav {
  position: relative;
  z-index: 1;
  flex: 1;
  overflow-y: auto;
  padding: 18px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}
.nav-group + .nav-group { margin-top: 18px; }
.nav-label {
  display: block;
  padding: 0 12px 8px;
  color: #7086ae;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .12em;
}
.nav-item {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  margin: 3px 0;
  padding: 10px 12px;
  border-radius: 12px;
  color: #b8c7e2;
  font-weight: 600;
  transition: color .18s, background .18s, transform .18s;
}
.nav-item svg { width: 20px; height: 20px; flex: 0 0 20px; fill: currentColor; opacity: .88; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.07); transform: translateX(2px); }
.nav-item.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(35, 126, 255, .95), rgba(78, 100, 238, .88));
  box-shadow: 0 10px 22px rgba(8, 81, 198, .25);
}
.sidebar-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 16px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  background: rgba(5, 14, 35, .38);
}
.admin-profile { display: flex; min-width: 0; align-items: center; gap: 10px; }
.admin-avatar, .mobile-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #3b8cff, #6965ef);
  font-weight: 800;
}
.admin-profile-text { display: grid; min-width: 0; }
.admin-profile-text strong { overflow: hidden; color: #fff; font-size: 13px; text-overflow: ellipsis; }
.admin-profile-text small { color: #758bb2; font-size: 11px; }
.sidebar-footer form { margin: 0; }
.logout-button {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 10px;
  color: #8ea2c5;
  background: transparent;
  cursor: pointer;
}
.logout-button:hover { color: #fff; background: rgba(255,255,255,.08); }
.logout-button svg { width: 20px; height: 20px; fill: currentColor; }
.admin-workspace { min-height: 100vh; margin-left: 244px; }
.mobile-header { display: none; }
.sidebar-overlay { display: none; }
.container {
  width: min(1480px, calc(100% - 48px));
  margin: 0 auto;
}
.admin-container { padding: 30px 0 64px; }
.global-alert { box-shadow: var(--shadow-sm); }

/* Public/login shell */
.public-body {
  background:
    radial-gradient(circle at 5% 4%, rgba(22, 119, 255, .13), transparent 28%),
    radial-gradient(circle at 95% 20%, rgba(94, 86, 239, .10), transparent 26%),
    var(--bg);
}
.container-narrow { width: min(500px, calc(100% - 32px)); margin: 9vh auto 50px; }
.public-container > .login-card:first-child { margin-top: 0; }
.public-hero { text-align: center; }
.public-hero .eyebrow { justify-content: center; }
.claim-code-actions { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(150px, .75fr); gap: 10px; }
.claim-code-actions button { width: 100%; min-height: 44px; }
.claim-success-phone {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(32, 125, 82, .20);
  border-radius: 12px;
  background: rgba(32, 125, 82, .06);
  color: var(--muted);
}
.claim-success-phone strong { color: var(--text-strong); letter-spacing: .04em; }
.benefit-change-phone { margin-top: 16px; }
.benefit-change-phone summary { cursor: pointer; color: var(--primary); font-weight: 700; }

/* Typography and page headers */
h1, h2, h3 { color: var(--text-strong); }
h1 { margin: 0 0 8px; font-size: clamp(26px, 2.4vw, 34px); line-height: 1.25; letter-spacing: -.025em; }
h2 { margin: 0 0 18px; font-size: 20px; line-height: 1.35; }
h3 { margin: 22px 0 12px; }
p { margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px !important; }
.page-head, .section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}
.page-head { margin-bottom: 24px; }
.page-head p { max-width: 760px; margin: 0; font-size: 14px; }
.section-head { margin-bottom: 18px; }
.section-head h2 { margin: 0; }

/* Cards and dashboard metrics */
.card {
  margin-bottom: 20px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.card:hover { border-color: #dce4ef; }
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}
.stat {
  position: relative;
  min-height: 112px;
  overflow: hidden;
  padding: 18px 19px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: linear-gradient(145deg, #fff, #fbfdff);
  box-shadow: var(--shadow-sm);
}
.stat::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #2c8dff, #6573f2);
}
.stat::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -34px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: rgba(22, 119, 255, .045);
}
.stat:nth-child(4n+2)::before { background: linear-gradient(90deg, #17a779, #54c69e); }
.stat:nth-child(4n+3)::before { background: linear-gradient(90deg, #8a63ef, #b174ee); }
.stat:nth-child(4n+4)::before { background: linear-gradient(90deg, #f29b32, #f1c252); }
.stat span { position: relative; z-index: 1; display: block; color: var(--muted); font-size: 13px; }
.stat strong { position: relative; z-index: 1; display: block; margin-top: 10px; color: var(--text-strong); font-size: 26px; line-height: 1.25; overflow-wrap: anywhere; }
.stat strong.small { font-size: 14px !important; line-height: 1.6; }
.asset-stat small { position: relative; z-index: 1; display: block; margin-top: 7px; color: var(--muted); font-size: 12px; }
.asset-warning {
  display: inline-flex;
  margin-left: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  color: #985b05;
  background: var(--warning-soft);
  font-size: 11px;
  font-weight: 750;
}
.two-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

/* Forms and buttons */
.form-grid { display: grid; gap: 16px; }
.form-grid.two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
label { display: grid; gap: 7px; color: #34445e; font-size: 13px; font-weight: 700; }
input, textarea, select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  outline: none;
  background: #fff;
  color: var(--text);
  transition: border-color .18s, box-shadow .18s, background .18s;
}
input, select { min-height: 43px; }
textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; line-height: 1.6; }
input:hover, textarea:hover, select:hover { border-color: #bdc9d9; }
input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(22, 119, 255, .10);
  background: #fff;
}
button, .button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  color: #34445e;
  background: #fff;
  cursor: pointer;
  font-weight: 650;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s, border-color .15s, background .15s;
}
button:hover, .button:hover {
  border-color: #b8c5d7;
  color: var(--text-strong);
  background: #f8faff;
  box-shadow: 0 6px 14px rgba(30, 58, 108, .07);
}
button:active, .button:active { transform: translateY(1px); box-shadow: none; }
.primary {
  border-color: var(--primary);
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #496cf0);
  box-shadow: 0 8px 18px rgba(22, 119, 255, .18);
}
.primary:hover { border-color: var(--primary-dark); color: #fff; background: linear-gradient(135deg, var(--primary-dark), #3f5ed7); }
.danger { border-color: var(--danger); color: #fff; background: linear-gradient(135deg, var(--danger), #ef5c68); }
.danger:hover { border-color: var(--danger-dark); color: #fff; background: var(--danger-dark); }
.large { min-height: 50px; padding: 13px 24px; font-size: 17px; }
.small, button.small, .button.small { min-height: 32px; padding: 6px 10px; font-size: 12px !important; }
.actions, .button-stack, .button-row { display: flex; gap: 10px; flex-wrap: wrap; }
.button-stack form, .actions form, .button-row form { margin: 0; }
.check-row { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.check-row input { width: 17px; min-height: auto; height: 17px; accent-color: var(--primary); }
.batch-form { margin: 0; }
.selection-toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--card-soft);
}
.selection-column { width: 40px; text-align: center; }

/* Tables */
.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  scrollbar-width: thin;
  scrollbar-color: #c8d2df transparent;
}
.card > .table-wrap:last-child { margin-bottom: 0; }
table { width: 100%; border-spacing: 0; border-collapse: separate; font-size: 13px; }
th, td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}
thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: #5f718b;
  background: #f7f9fc;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .02em;
}
tbody tr { transition: background .15s; }
tbody tr:hover { background: #f8fbff; }
tbody tr:last-child td { border-bottom: 0; }
.accounts-table { min-width: 1160px; }
.accounts-table .account-actions-column {
  position: sticky;
  right: 0;
  z-index: 3;
  min-width: 78px;
  background: #fff;
  box-shadow: -8px 0 14px rgba(30, 58, 108, .07);
}
.accounts-table tbody tr:hover .account-actions-column { background: #f8fbff; }
.accounts-table thead .account-actions-column { z-index: 4; background: #f7f9fc; }
.account-note { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.empty { padding: 36px !important; color: var(--muted); text-align: center; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 22px 0 10px; color: var(--muted); }

/* Status, messages and details */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  color: #52637b;
  background: #eef1f5;
  font-size: 11px;
  font-weight: 750;
}
.badge::before { content: ""; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: currentColor; opacity: .7; }
.status-active, .status-payment_ready, .status-paid, .status-claimed, .status-ready { color: #13744f; background: #e7f8f0; }
.status-payment_pending, .status-sms_sent, .status-login_sms_sent, .status-prize_sms_sent, .status-pending { color: #9a6208; background: #fff6df; }
.status-risk_required, .status-risk_initialized, .status-h5_risk_required, .status-needs_const_id, .status-fallback_required { color: #9a6208; background: #fff4dd; }
.status-failed, .status-error, .status-invalid, .status-order_failed, .status-payment_failed, .status-payment_expired, .status-payment_closed, .status-risk_failed, .status-claim_failed, .status-failed_mismatch, .status-disabled { color: #aa2d3b; background: #ffeaed; }
.status-category-success { color: #13744f; background: #e7f8f0; }
.status-category-pending { color: #28639f; background: #e8f2ff; }
.status-category-warning { color: #956108; background: #fff4d8; }
.status-category-error { color: #aa2d3b; background: #ffeaed; }
.status-category-neutral { color: #596a82; background: #eef1f5; }
.alert {
  margin-bottom: 18px;
  padding: 13px 15px;
  border: 1px solid #d6eaff;
  border-radius: 13px;
  color: #28639f;
  background: var(--primary-soft);
  line-height: 1.65;
}
.alert.success { border-color: #cdeedd; color: #16744f; background: var(--success-soft); }
.alert.danger { border-color: #ffd6dc; color: #a52c3a; background: var(--danger-soft); }
.details {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  overflow: hidden;
  margin: 18px 0 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}
.details dt, .details dd { min-height: 44px; margin: 0; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.details dt { color: #63748d; background: #f8fafc; font-weight: 650; }
.details dd { min-width: 0; overflow-wrap: anywhere; }
.details dt:nth-last-of-type(1), .details dd:nth-last-of-type(1) { border-bottom: 0; }
.break { word-break: break-all; white-space: pre-wrap; }
.account-login-material-column { min-width: 210px; max-width: 300px; }
.account-login-material-column code { font-size: 12px; line-height: 1.45; }
pre {
  overflow: auto;
  max-height: 480px;
  margin: 14px 0 0;
  padding: 16px;
  border-radius: 13px;
  color: #dbe8ff;
  background: #0c1730;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
  font-size: 12px;
  line-height: 1.65;
}
details.card { padding: 18px 22px; }
summary { cursor: pointer; color: #31435f; font-weight: 750; }
details[open] summary { margin-bottom: 16px; }
.danger-zone { border-color: #ffd5da; background: linear-gradient(145deg, #fff, #fff9fa); }

/* Benefit catalog, link generator and claim-order pages */
.generator-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); gap: 20px; margin-bottom: 20px; }
.generator-card, .generator-help { min-height: 320px; }
.generator-card { position: relative; overflow: hidden; background: linear-gradient(145deg, #fff, #f7fbff); }
.generator-card::after { content: ""; position: absolute; right: -70px; bottom: -90px; width: 220px; height: 220px; border-radius: 50%; background: rgba(22,119,255,.07); }
.generator-icon { display: grid; width: 46px; height: 46px; margin-bottom: 18px; place-items: center; border-radius: 14px; color: #fff; background: linear-gradient(135deg, #1677ff, #6573f2); box-shadow: 0 10px 22px rgba(22,119,255,.2); font-size: 25px; font-weight: 800; }
.generator-card h2, .generator-help h2 { margin-bottom: 8px; }
.generator-form { max-width: 560px; margin-top: 24px; }
.field-hint { color: var(--muted); font-size: 12px; font-weight: 500; }
.generator-help { background: #fbfcff; }
.eyebrow { display: inline-flex; margin-bottom: 9px; color: #5571a0; font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.product-summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 24px; padding: 15px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.product-summary strong, .product-summary small, td strong, td small { display: block; }
.product-summary small, td small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.workflow-steps { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 24px; color: #52637b; font-size: 12px; font-weight: 700; }
.workflow-steps span { padding: 8px 10px; border-radius: 9px; background: #eef5ff; }
.workflow-steps i { color: #7d91b2; font-style: normal; }
.created-links-card { border-color: #cfe5ff; background: linear-gradient(145deg, #fff, #f6fbff); }
.created-links-textarea { min-height: 130px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.order-filter-grid { display: grid; grid-template-columns: minmax(150px, .7fr) minmax(190px, 1fr) minmax(220px, 1.2fr) auto; align-items: end; gap: 14px; }
.filter-actions { display: flex; gap: 9px; }
.orders-table { min-width: 1040px; }
.orders-table td { white-space: normal; }
.phone-value { font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.order-status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 750; white-space: nowrap; }
.order-status-badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.order-status-badge.success { color: #13744f; background: #e7f8f0; }
.order-status-badge.failed { color: #aa2d3b; background: #ffeaed; }
.order-status-badge.pending { color: #956108; background: #fff4d8; }
.result-success { color: #16744f; }
.result-failed { color: #aa2d3b; }
.result-success, .result-failed { display: block; max-width: 330px; overflow: hidden; text-overflow: ellipsis; }
.inline-form { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(140px, 1fr) auto; gap: 7px; align-items: center; min-width: 390px; }
.inline-form input { min-height: 36px; padding: 7px 9px; font-size: 12px; }
.copy-row { display: flex; align-items: center; gap: 7px; min-width: 340px; }
.copy-row input { min-width: 260px; min-height: 36px; padding: 7px 9px; font-size: 11px; }
.copy-row .button { min-height: 36px; padding: 7px 10px; font-size: 12px; }
.benefit-links-table { min-width: 1120px; }
.filter-bar { display: grid; grid-template-columns: minmax(170px, .9fr) minmax(160px, .8fr) minmax(220px, 1.2fr) auto auto; align-items: end; gap: 12px; }
.badge-success { color: #13744f; background: #e7f8f0; }
.badge-active { color: #28639f; background: #e8f2ff; }
.badge-failed { color: #aa2d3b; background: #ffeaed; }
.product-catalog-grid { display: grid; gap: 20px; }
.activity-picker { display: grid; gap: 8px; margin: 0; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: #fbfcff; }
.activity-picker legend { padding: 0 6px; color: var(--text-strong); font-size: 13px; font-weight: 800; }
.activity-option { display: flex; align-items: flex-start; gap: 10px; min-width: 0; padding: 10px 11px; border: 1px solid #e6ebf3; border-radius: 8px; background: #fff; }
.activity-option:hover { border-color: #b9d2ff; background: #f8fbff; }
.activity-option input { flex: 0 0 auto; margin-top: 3px; }
.activity-option span { display: grid; gap: 3px; min-width: 0; }
.activity-option strong { font-size: 13px; }
.activity-option small { overflow-wrap: anywhere; color: var(--muted); font-size: 11px; line-height: 1.4; }
.activity-option em { margin-left: auto; color: var(--muted); font-size: 11px; font-style: normal; white-space: nowrap; }
.activity-inline-form { display: grid; grid-template-columns: minmax(120px, .45fr) minmax(220px, 1fr) auto auto; gap: 7px; align-items: center; margin-bottom: 8px; }
.activity-inline-form input { min-width: 0; }
.product-catalog-card { overflow: hidden; padding: 0; }
.product-card-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 22px; border-bottom: 1px solid var(--border); background: linear-gradient(135deg, #f8fbff, #fff); }
.product-card-top h2 { margin: 0 0 5px; font-size: 21px; }
.product-card-top code { color: #74849c; font-size: 12px; }
.product-card-icon { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 16px; color: #fff; background: linear-gradient(135deg, #1677ff, #656dea); box-shadow: 0 10px 22px rgba(22,119,255,.2); font-size: 17px; font-weight: 850; }
.product-meta-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; padding: 0 22px; }
.product-meta-grid > div { min-height: 104px; padding: 20px 18px; border-right: 1px solid var(--border); }
.product-meta-grid > div:first-child { padding-left: 0; }
.product-meta-grid > div:last-child { border-right: 0; }
.product-meta-grid span, .product-meta-grid small { display: block; color: var(--muted); font-size: 12px; }
.product-meta-grid strong { display: block; margin: 8px 0 4px; color: var(--text-strong); font-size: 14px; }
.product-card-settings { padding: 16px 22px; border-top: 1px solid var(--border); background: #f7faff; }
.product-redirect-form { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.product-redirect-option { display: flex; align-items: flex-start; gap: 11px; margin: 0; cursor: pointer; }
.product-redirect-option input { flex: 0 0 auto; width: 18px; min-height: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); }
.product-redirect-option strong, .product-redirect-option small { display: block; }
.product-redirect-option strong { color: var(--text-strong); font-size: 14px; }
.product-redirect-option small { max-width: 680px; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.product-redirect-form button { flex: 0 0 auto; }
.product-card-actions { display: flex; align-items: end; justify-content: space-between; gap: 18px; padding: 18px 22px; border-top: 1px solid var(--border); background: #fbfcfe; }
.product-name-form { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(190px, 1fr) auto; align-items: end; gap: 10px; flex: 1; }
.product-name-form input { min-height: 39px; }
.link-management-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.link-management-tab { display: flex; align-items: center; gap: 13px; padding: 15px 17px; border: 1px solid var(--border); border-radius: 15px; color: var(--text-strong); background: #fff; box-shadow: var(--shadow-sm); transition: border-color .18s, box-shadow .18s, transform .18s; }
.link-management-tab:hover { border-color: #b9d2ff; box-shadow: 0 10px 26px rgba(22,119,255,.1); transform: translateY(-1px); }
.link-management-tab.active { border-color: #8eb7ff; background: linear-gradient(135deg, #f2f7ff, #fff); box-shadow: 0 10px 25px rgba(22,119,255,.1); }
.link-management-tab .tab-index { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 11px; color: #fff; background: linear-gradient(135deg, #1677ff, #6573f2); font-size: 12px; font-weight: 850; }
.link-management-tab strong, .link-management-tab small { display: block; }
.link-management-tab small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.product-link-generator-section, .link-list-section { scroll-margin-top: 24px; }
.link-filter-card { margin: 0 0 18px; padding: 15px; background: #fbfcff; box-shadow: none; }

@media (max-width: 980px) {
  .generator-layout { grid-template-columns: 1fr; }
  .order-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-actions { grid-column: 1 / -1; }
  .product-meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-meta-grid > div:nth-child(2) { border-right: 0; }
  .product-card-actions { align-items: stretch; flex-direction: column; }
  .activity-inline-form { grid-template-columns: 1fr; }
}

/* Payment, account and specialized layouts */
.payment-ready { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.qr { width: 180px; height: 180px; object-fit: contain; border: 10px solid #fff; border-radius: 15px; background: #fff; box-shadow: var(--shadow-md); }
.qr-large { display: block; width: 260px; height: 260px; margin: 15px auto 24px; }
.payment-page { max-width: 640px; margin: 7vh auto; text-align: center; }
.payment-title { margin-bottom: 18px; }
.captcha-box { min-height: 170px; margin: 12px 0; }
.login-card {
  position: relative;
  overflow: hidden;
  padding: 34px;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 23px;
  box-shadow: var(--shadow-md);
}
.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 5px;
  background: linear-gradient(90deg, #1684ff, #6267ed);
}
.login-card h1 { font-size: 30px; }
.login-card .form-grid { margin-top: 22px; }
.login-card button.primary { width: 100%; min-height: 46px; margin-top: 4px; }
.account-page-head, .account-auth-shell { width: min(660px, 100%); margin-right: auto; margin-left: auto; }
.account-page-head { margin-bottom: 16px; }
.account-page-head p { margin: 0; }
.account-auth-card { padding: 30px; border-radius: 18px; }
.account-auth-heading { margin-bottom: 24px; }
.account-auth-heading h2 { margin: 8px 0 0; font-size: 23px; }
.account-auth-kicker { display: inline-flex; color: var(--primary); font-size: 12px; font-weight: 800; letter-spacing: .06em; }
.account-auth-form { display: grid; gap: 18px; }
.account-auth-form input { min-height: 46px; font-size: 16px; }
.account-submit { width: 100%; min-height: 46px; font-weight: 750; }
.account-phone-status { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; padding: 14px 16px; border: 1px solid #d7e8ff; border-radius: 13px; background: #f6faff; }
.account-phone-status div { display: grid; gap: 4px; }
.account-phone-status div span { color: var(--muted); font-size: 12px; }
.account-phone-status strong { font-size: 17px; }
.account-auto-refresh { color: #54667e; font-size: 13px; }
.account-secondary-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.account-secondary-actions form { margin: 0; }

/* Authenticator and sensitive-operation verification */
.sensitive-auth-inline {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 5px 7px 5px 11px;
  border: 1px solid #cfdfff;
  border-radius: 11px;
  background: #f5f9ff;
  color: #315783;
  font-size: 12px;
  white-space: nowrap;
}
.sensitive-auth-inline input {
  width: 116px;
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 13px;
  letter-spacing: .12em;
}
.security-summary-card { background: linear-gradient(145deg, #fff, #f7faff); }
.security-protection-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.security-protection-grid > div {
  display: grid;
  gap: 5px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #fff;
}
.security-protection-grid strong { color: var(--text-strong); font-size: 13px; }
.security-protection-grid span { color: var(--muted); font-size: 12px; line-height: 1.55; }
.security-state-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
}
.security-state-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.security-state-dot.enabled { color: #13744f; background: #e7f8f0; }
.security-state-dot.pending { color: #956108; background: #fff5dd; }
.security-state-dot.disabled { color: #8b5360; background: #f7edf0; }
.totp-enrollment {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.totp-qr-wrap {
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.totp-qr { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.totp-enrollment-detail { display: grid; gap: 18px; }
.security-steps { display: grid; gap: 8px; margin: 0; padding-left: 22px; color: #4b5d76; line-height: 1.6; }
.totp-secret-box {
  display: grid;
  gap: 7px;
  padding: 13px 15px;
  border: 1px dashed #b7cae8;
  border-radius: 12px;
  background: #f6f9ff;
}
.totp-secret-box span { color: var(--muted); font-size: 12px; font-weight: 700; }
.totp-secret-box code { overflow-wrap: anywhere; color: #183c68; font-size: 15px; letter-spacing: .1em; }
.security-reset-details { padding-top: 2px; border-top: 1px solid var(--border); }
.security-reset-details summary { padding-top: 15px; font-size: 13px; }
.compact-form { grid-template-columns: minmax(220px, 420px) auto; align-items: end; margin-top: 14px; }
.form-action-align { align-self: end; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 13, 31, .58);
  backdrop-filter: blur(4px);
}
.modal-backdrop[hidden] { display: none; }
[data-batch-totp-wrap][hidden] { display: none !important; }
.modal-card {
  width: min(480px, 100%);
  padding: 24px;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(5, 13, 31, .28);
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.modal-head h2 { margin: 0 0 6px; }
.modal-head p { margin: 0; }
.modal-close { min-width: 38px; min-height: 38px; padding: 4px; border: 0; background: #f1f4f8; font-size: 24px; }
.modal-open { overflow: hidden; }
.exception-reason { display: grid; gap: 4px; max-width: 340px; white-space: normal; }
.exception-reason small { color: var(--muted); }
.task-progress { min-width: 120px; }
.task-progress progress { width: 100%; accent-color: var(--primary); }
.reason-list, .exception-summary-list { display: grid; gap: 10px; }
.reason-row, .exception-summary-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: #fafcff; }
.reason-row strong { min-width: 34px; color: var(--danger); font-size: 18px; text-align: right; }
.exception-summary-row > div { display: grid; flex: 1; gap: 3px; min-width: 0; }
.exception-summary-row small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.exception-summary-row > span:last-child { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* Responsive */
@media (max-width: 1180px) {
  .sidebar { width: 224px; }
  .admin-workspace { margin-left: 224px; }
  .container { width: min(1480px, calc(100% - 36px)); }
  .stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
}

@media (max-width: 900px) {
  .sidebar {
    width: 250px;
    transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: 18px 0 46px rgba(11, 23, 53, .24);
  }
  .sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: block;
    visibility: hidden;
    background: rgba(5, 13, 31, .45);
    opacity: 0;
    transition: opacity .22s, visibility .22s;
    backdrop-filter: blur(2px);
  }
  .sidebar-open .sidebar-overlay { visibility: visible; opacity: 1; }
  .admin-workspace { margin-left: 0; }
  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    min-height: 60px;
    align-items: center;
    justify-content: space-between;
    padding: 10px 17px;
    border-bottom: 1px solid rgba(216, 225, 237, .85);
    background: rgba(255,255,255,.9);
    box-shadow: 0 8px 24px rgba(30,58,108,.06);
    backdrop-filter: blur(14px);
  }
  .menu-button { display: grid; width: 38px; height: 38px; min-height: 38px; padding: 9px; place-content: center; gap: 4px; border: 0; background: var(--primary-soft); box-shadow: none; }
  .menu-button span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--primary); }
  .mobile-brand { color: var(--text-strong); font-size: 16px; font-weight: 800; }
  .mobile-avatar { width: 36px; height: 36px; }
  .admin-container { padding-top: 22px; }
  .two-columns, .form-grid.two-up { grid-template-columns: 1fr; }
  .security-protection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .totp-enrollment { grid-template-columns: 220px minmax(0, 1fr); }
  .form-grid .full { grid-column: auto; }
  .page-head, .payment-ready { align-items: flex-start; flex-direction: column; }
  .page-head .actions, .page-head .button-row { width: 100%; }
  .page-head .actions .button, .page-head .button-row .button { flex: 1 1 auto; }
}

@media (max-width: 620px) {
  .container { width: min(100% - 24px, 1480px); }
  .admin-container { padding-bottom: 40px; }
  .page-head { margin-bottom: 18px; }
  h1 { font-size: 27px; }
  .card { padding: 17px; border-radius: 16px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .stat { min-height: 100px; padding: 15px; }
  .stat strong { font-size: 22px; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .section-head .actions { width: 100%; }
  .selection-toolbar { align-items: stretch; }
  .selection-toolbar button { flex: 1 1 auto; }
  .sensitive-auth-inline { width: 100%; margin-left: 0; justify-content: space-between; }
  .sensitive-auth-inline input { width: min(180px, 55%); }
  .security-protection-grid, .totp-enrollment, .compact-form { grid-template-columns: 1fr; }
  .totp-qr-wrap { width: min(260px, 100%); margin: 0 auto; }
  .details { grid-template-columns: 1fr; }
  .details dt, .details dd { min-height: auto; }
  .details dt { padding-bottom: 5px; border-bottom: 0; }
  .details dd { padding-top: 0; }
  .details dd:last-child { border-bottom: 0; }
  .account-auth-card, .login-card { padding: 23px; }
  .account-phone-status { align-items: flex-start; flex-direction: column; }
  .account-secondary-actions { align-items: stretch; flex-direction: column; }
  .account-secondary-actions form, .account-secondary-actions button, .account-secondary-actions .button { width: 100%; }
  .payment-page { margin-top: 4vh; }
  .qr-large { width: min(240px, 100%); height: auto; }
  .link-management-tabs { grid-template-columns: 1fr; gap: 9px; }
  .link-management-tab { padding: 13px 14px; }
  .link-filter-card { padding: 12px; }
  .claim-code-actions { grid-template-columns: 1fr; }
  .order-filter-grid, .filter-bar, .product-name-form { grid-template-columns: 1fr; }
  .filter-bar > button, .filter-bar > .button, .filter-actions, .filter-actions > * { width: 100%; }
  .filter-actions { grid-column: auto; }
  .product-card-top { grid-template-columns: auto minmax(0, 1fr); padding: 18px; }
  .product-card-top .order-status-badge { grid-column: 1 / -1; justify-self: start; }
  .product-meta-grid { grid-template-columns: 1fr; padding: 0 18px; }
  .product-meta-grid > div { min-height: auto; padding: 15px 0; border-right: 0; border-bottom: 1px solid var(--border); }
  .product-meta-grid > div:last-child { border-bottom: 0; }
  .product-card-actions { padding: 17px 18px; }
  .product-card-settings { padding: 15px 18px; }
  .product-redirect-form { align-items: stretch; flex-direction: column; }
  .product-redirect-form button { width: 100%; }
  .product-card-actions > .actions, .product-card-actions > .actions form, .product-card-actions > .actions button { width: 100%; }
  .product-card-actions > .actions { display: grid; grid-template-columns: 1fr 1fr; }
  .mobile-card-table-wrap { overflow: visible; border: 0; }
  .mobile-card-table { display: block; min-width: 0; border: 0; background: transparent; }
  .mobile-card-table thead { display: none; }
  .mobile-card-table tbody { display: grid; gap: 12px; }
  .mobile-card-table tbody tr { display: block; overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); }
  .mobile-card-table tbody td { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; align-items: start; min-width: 0; padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: normal; }
  .mobile-card-table tbody td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 750; }
  .mobile-card-table tbody td:last-child { border-bottom: 0; }
  .mobile-card-table tbody td.empty, .mobile-card-table tbody td[colspan] { display: block; padding: 28px 16px; text-align: center; }
  .mobile-card-table tbody td.empty::before, .mobile-card-table tbody td[colspan]::before { content: none; }
  .mobile-card-table .copy-row { min-width: 0; align-items: stretch; flex-direction: column; }
  .mobile-card-table .copy-row input { width: 100%; min-width: 0; }
  .mobile-card-table code, .mobile-card-table small, .mobile-card-table a, .mobile-card-table span { overflow-wrap: anywhere; }
}

@media (max-width: 390px) {
  .page-head .actions, .page-head .button-row { flex-direction: column; }
  .page-head .actions .button, .page-head .button-row .button { width: 100%; }
}

/* New product setup workspace */
.new-product-head { margin-bottom: 22px; }
.new-product-layout { display: grid; gap: 16px; max-width: 980px; }
.setup-section { margin: 0; padding: 24px 26px; }
.setup-section-head { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 21px; }
.setup-section-head h2 { margin: 0; font-size: 18px; }
.setup-section-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; font-weight: 500; }
.setup-step { display: grid; flex: 0 0 auto; width: 34px; height: 34px; place-items: center; border-radius: 10px; color: #2868b0; background: #eaf3ff; font-size: 11px; font-weight: 850; letter-spacing: .04em; }
.field-label { display: block; }
.required-mark { margin-left: 3px; color: #d14758; font-weight: 850; }
.setup-section label small, .advanced-setup-section label small { color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.5; }
.activity-setup-section { padding-bottom: 20px; }
.activity-setup-section .setup-section-head { align-items: center; }
.selected-counter { margin-left: auto; padding: 7px 11px; border-radius: 999px; color: #2e6baa; background: #edf5ff; font-size: 12px; white-space: nowrap; }
.selected-counter b { font-size: 15px; }
.activity-setup-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.activity-search { display: flex; flex: 1; align-items: center; gap: 8px; min-height: 40px; margin: 0; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; color: #7890ac; background: #fff; }
.activity-search span { font-size: 21px; line-height: 1; }
.activity-search input { min-height: 36px; padding: 4px 0; border: 0; background: transparent; box-shadow: none; }
.activity-search input:focus { box-shadow: none; }
.activity-selection-shell { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(220px, .75fr); gap: 13px; }
.activity-selection-list { display: grid; gap: 7px; max-height: 330px; overflow: auto; padding: 8px; border: 1px solid #e2eaf3; border-radius: 12px; background: #f8fafd; }
.activity-select-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-width: 0; margin: 0; padding: 11px 10px; border: 1px solid #e3eaf3; border-radius: 9px; background: #fff; cursor: pointer; transition: border-color .15s, background .15s; }
.activity-select-row:hover { border-color: #9fc2f6; background: #fbfdff; }
.activity-select-row input { position: absolute; opacity: 0; pointer-events: none; }
.activity-select-check { width: 10px; height: 10px; border: 2px solid #bcc9d8; border-radius: 3px; }
.activity-select-row:has(input:checked) { border-color: #8db9f4; background: #f3f8ff; }
.activity-select-row:has(input:checked) .activity-select-check { border-color: var(--primary); background: var(--primary); box-shadow: inset 0 0 0 2px #fff; }
.activity-select-copy { display: grid; min-width: 0; gap: 3px; }
.activity-select-copy strong, .activity-select-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-select-copy strong { color: var(--text-strong); font-size: 13px; }
.activity-select-copy small { color: var(--muted); font-size: 11px; font-weight: 500; }
.activity-select-type { justify-self: end; padding: 4px 7px; border-radius: 6px; color: #52749b; background: #eff5fb; font-size: 10px; font-weight: 750; white-space: nowrap; }
.activity-select-row em { color: var(--muted); font-size: 10px; font-style: normal; white-space: nowrap; }
.activity-selected-preview { min-height: 120px; padding: 14px; border: 1px solid #dce8f6; border-radius: 12px; background: #f5f9ff; }
.selected-preview-head strong, .selected-preview-head small { display: block; }
.selected-preview-head strong { color: var(--text-strong); font-size: 13px; }
.selected-preview-head small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.activity-selected-preview ol { display: grid; gap: 7px; margin: 13px 0 0; padding: 0; list-style: none; }
.activity-selected-preview li { display: grid; grid-template-columns: 21px minmax(0, 1fr); align-items: center; gap: 7px; min-width: 0; color: #3f5f80; font-size: 12px; }
.activity-selected-preview li span { display: grid; width: 21px; height: 21px; place-items: center; border-radius: 6px; color: #2868b0; background: #deecff; font-size: 10px; font-weight: 800; }
.activity-selected-preview li strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-selected-preview li.selected-empty { display: block; color: var(--muted); font-size: 12px; }
.activity-selection-empty { padding: 28px 12px; color: var(--muted); text-align: center; font-size: 12px; }
.setup-note { margin: 13px 0 0; color: var(--muted); font-size: 11px; }
.advanced-setup-section { margin: 0; padding: 0; overflow: hidden; }
.advanced-setup-section > summary { display: flex; align-items: center; gap: 13px; padding: 18px 26px; cursor: pointer; list-style: none; }
.advanced-setup-section > summary::-webkit-details-marker { display: none; }
.advanced-setup-section > summary strong, .advanced-setup-section > summary small { display: block; }
.advanced-setup-section > summary strong { color: var(--text-strong); font-size: 14px; }
.advanced-setup-section > summary small { margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 500; }
.advanced-setup-section[open] > summary { border-bottom: 1px solid var(--border); }
.advanced-setup-body { padding: 20px 26px 24px; background: #fbfdff; }
.advanced-setup-body textarea { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.new-product-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 3px 0 20px; }
.new-product-actions .button { min-width: 100px; }
@media (max-width: 760px) {
  .setup-section { padding: 20px 17px; }
  .setup-section-head { margin-bottom: 17px; }
  .activity-setup-section .setup-section-head { align-items: flex-start; }
  .selected-counter { margin-top: 1px; }
  .activity-selection-shell { grid-template-columns: 1fr; }
  .activity-selected-preview { order: -1; }
  .activity-selection-list { max-height: 290px; }
  .advanced-setup-section > summary { padding: 17px; }
  .advanced-setup-body { padding: 17px; }
  .new-product-actions { padding-bottom: 12px; }
  .new-product-actions .button { flex: 1; }
}

/* Compact activity and product catalog screens */
.catalog-page-head { margin-bottom: 18px; }
.catalog-list-section { margin-top: 24px; }
.compact-section-head { margin-bottom: 13px; }
.compact-section-head h2 { font-size: 18px; }
.compact-create-panel { overflow: hidden; margin-bottom: 0; padding: 0; border-color: #dbe7f6; box-shadow: 0 8px 24px rgba(26, 65, 120, .055); }
.compact-create-panel > summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 16px 20px; cursor: pointer; list-style: none; }
.compact-create-panel > summary::-webkit-details-marker, .catalog-editor > summary::-webkit-details-marker, .advanced-config > summary::-webkit-details-marker { display: none; }
.compact-create-panel > summary:hover { background: #f8fbff; }
.compact-create-panel > summary strong, .compact-create-panel > summary small { display: block; }
.compact-create-panel > summary strong { color: var(--text-strong); font-size: 15px; }
.compact-create-panel > summary small { margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 500; }
.compact-create-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 11px; color: var(--primary); background: #eaf3ff; font-size: 23px; font-weight: 500; }
.summary-hint { color: var(--primary); font-size: 12px; font-weight: 800; }
.compact-create-panel[open] > summary { border-bottom: 1px solid var(--border); }
.compact-create-panel[open] .summary-hint { font-size: 0; }
.compact-create-panel[open] .summary-hint::after { content: "收起"; font-size: 12px; }
.compact-create-body { padding: 20px; background: #fbfdff; }
.compact-create-body .form-grid { max-width: 920px; }
.advanced-config { padding: 12px 14px; border: 1px solid #e2eaf4; border-radius: 11px; background: #fff; }
.advanced-config > summary { cursor: pointer; color: #47617e; font-size: 13px; font-weight: 750; }
.advanced-config[open] > summary { margin-bottom: 12px; }

.activity-link-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.activity-link-card { min-width: 0; margin: 0; padding: 0; overflow: hidden; border-radius: 15px; }
.activity-link-card-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 16px 17px 13px; }
.activity-link-id { display: grid; min-width: 34px; height: 28px; place-items: center; border-radius: 8px; color: #4773a5; background: #eef5ff; font-size: 12px; font-weight: 800; }
.activity-link-title { min-width: 0; }
.activity-link-title strong, .activity-link-title small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-link-title strong { color: var(--text-strong); font-size: 14px; }
.activity-link-title small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.activity-link-meta { display: grid; gap: 7px; padding: 0 17px 15px; }
.activity-link-meta > span { color: #66809d; font-size: 12px; font-weight: 700; }
.activity-url { display: block; overflow: hidden; padding: 8px 10px; border: 1px solid #e8eef5; border-radius: 8px; color: #60738a; background: #f8fafd; font-size: 11px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.catalog-editor { border-top: 1px solid var(--border); }
.catalog-editor > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 17px; cursor: pointer; color: #405b79; list-style: none; font-size: 13px; font-weight: 800; }
.catalog-editor > summary:hover { background: #f8fbff; }
.catalog-editor > summary small { color: var(--muted); font-size: 11px; font-weight: 500; }
.catalog-editor[open] > summary { border-bottom: 1px solid var(--border); color: var(--primary); }
.activity-editor form { padding: 16px 17px 17px; background: #fbfdff; }
.check-field { display: flex; align-items: center; gap: 9px; min-height: 42px; margin-top: 25px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; color: #405470; background: #fff; cursor: pointer; }
.check-field input { width: 16px; min-height: 16px; height: 16px; margin: 0; accent-color: var(--primary); }

.compact-product-grid { gap: 14px; }
.compact-product-card { min-width: 0; margin: 0; padding: 0; overflow: hidden; border-radius: 15px; }
.compact-product-top { min-height: 78px; padding: 16px 18px; }
.compact-product-top h2 { margin-bottom: 3px; font-size: 17px; }
.compact-product-top small { display: block; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.compact-product-top .product-card-icon { width: 44px; height: 44px; border-radius: 13px; font-size: 14px; }
.compact-product-summary { display: grid; grid-template-columns: minmax(170px, .9fr) minmax(120px, .6fr) minmax(260px, 1.5fr); gap: 16px; align-items: start; padding: 13px 18px 16px; border-top: 1px solid #eef2f7; background: #fff; }
.compact-product-summary > div { min-width: 0; }
.compact-product-summary span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 700; }
.compact-product-summary code, .compact-product-summary strong { display: block; overflow: hidden; color: var(--text-strong); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.compact-product-activities > div { display: flex; flex-wrap: wrap; gap: 6px; }
.compact-product-activities em { max-width: 190px; overflow: hidden; padding: 4px 8px; border-radius: 999px; color: #356795; background: #edf5ff; font-size: 11px; font-style: normal; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.compact-product-activities small { color: var(--muted); font-size: 12px; }
.product-editor-body { display: grid; gap: 16px; padding: 17px 18px 18px; background: #fbfdff; }
.compact-activity-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 270px; overflow: auto; padding: 10px; background: #fff; }
.compact-activity-picker .activity-option { min-height: 54px; padding: 8px 9px; }
.compact-activity-picker .activity-option small { white-space: nowrap; text-overflow: ellipsis; }
.product-editor-actions { display: grid; gap: 12px; padding-top: 15px; border-top: 1px dashed #dce6f1; }
.product-secondary-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.product-secondary-actions form { display: flex; align-items: center; gap: 8px; }
.product-secondary-actions .check-row { display: inline-flex; align-items: center; gap: 6px; color: #536a84; font-size: 12px; font-weight: 650; white-space: nowrap; }
.catalog-empty { margin: 0; }

@media (max-width: 1050px) {
  .compact-product-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compact-product-activities { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .activity-link-grid { grid-template-columns: 1fr; }
  .compact-create-panel > summary { padding: 15px 16px; }
  .compact-create-body { padding: 16px; }
  .activity-link-card-head, .activity-link-meta { padding-right: 14px; padding-left: 14px; }
  .activity-editor form, .product-editor-body { padding-right: 14px; padding-left: 14px; }
  .catalog-editor > summary { padding-right: 14px; padding-left: 14px; }
  .compact-product-top { padding: 15px 16px; }
  .compact-product-summary { grid-template-columns: 1fr; gap: 12px; padding: 14px 16px; }
  .compact-product-activities { grid-column: auto; }
  .compact-activity-picker { grid-template-columns: 1fr; max-height: 250px; }
  .product-name-form { grid-template-columns: 1fr; }
  .product-secondary-actions, .product-secondary-actions form { align-items: stretch; flex-direction: column; width: 100%; }
  .product-secondary-actions .button { width: 100%; }
}

/* Product catalog rows: keep information and actions in one stable grid. */
.product-catalog-head { align-items: flex-end; }
.product-catalog-head-actions { justify-content: flex-end; }
.product-list-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 13px; }
.product-list-toolbar h2 { margin: 0; font-size: 18px; }
.product-list-toolbar p { margin: 5px 0 0; }
.product-list-count { display: inline-flex; align-items: center; min-height: 30px; padding: 6px 10px; border: 1px solid #dce7f3; border-radius: 8px; color: #52749b; background: #f5f9ff; font-size: 12px; font-weight: 750; white-space: nowrap; }
.product-list { display: grid; gap: 10px; }
.product-row { display: grid; grid-template-columns: minmax(235px, 1.55fr) minmax(170px, 1fr) minmax(110px, .65fr) minmax(240px, 1.7fr) auto; align-items: center; gap: 0; min-width: 0; padding: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); }
.product-row:hover { border-color: #c9daf0; box-shadow: 0 8px 22px rgba(30, 58, 108, .08); }
.product-row-main, .product-row-detail, .product-row-activities, .product-row-actions { min-width: 0; padding: 16px 15px; }
.product-row-main { display: flex; align-items: center; gap: 11px; min-height: 92px; padding-left: 17px; }
.product-row-icon { display: grid; width: 43px; height: 43px; flex: 0 0 43px; place-items: center; border-radius: 12px; color: #fff; background: linear-gradient(135deg, #2b87ff, #6573f2); box-shadow: 0 7px 15px rgba(40, 110, 228, .17); font-size: 13px; font-weight: 850; }
.product-row-title { min-width: 0; }
.product-row-title-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.product-row-title h2 { min-width: 0; margin: 0; overflow: hidden; color: var(--text-strong); font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.product-row-title p, .product-row-title small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-row-title p { margin: 4px 0 2px; color: #4e6682; font-size: 12px; }
.product-row-title small { color: var(--muted); font-size: 11px; }
.product-row-detail, .product-row-activities { align-self: stretch; border-left: 1px solid #edf1f6; }
.product-row-detail { display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.product-row-detail span, .product-row-activities > span { color: var(--muted); font-size: 11px; font-weight: 700; }
.product-row-detail code { overflow: hidden; color: var(--text-strong); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.product-row-detail small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.product-row-policy strong { color: var(--text-strong); font-size: 13px; }
.product-row-activities { display: flex; flex-direction: column; justify-content: center; gap: 7px; }
.product-row-activities > div { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.product-row-activities em { max-width: 170px; overflow: hidden; padding: 4px 7px; border-radius: 6px; color: #356795; background: #edf5ff; font-size: 10px; font-style: normal; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.product-row-activities small { color: var(--muted); font-size: 11px; }
.product-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; border-left: 1px solid #edf1f6; }
.product-row-actions form { margin: 0; }
.product-row-actions .button { min-height: 34px; padding: 7px 10px; font-size: 11px; white-space: nowrap; }
.product-row-actions .danger { background: #fff1f3; color: #b52d3c; border-color: #efb6bd; box-shadow: none; }
.product-row-actions .danger:hover { background: #dc3545; color: #fff; border-color: #dc3545; }
@media (max-width: 1250px) {
  .product-row { grid-template-columns: minmax(220px, 1.4fr) minmax(155px, .95fr) minmax(100px, .65fr) minmax(190px, 1.3fr); }
  .product-row-actions { grid-column: 1 / -1; justify-content: flex-end; padding: 10px 15px; border-top: 1px solid #edf1f6; border-left: 0; }
}
@media (max-width: 760px) {
  .product-catalog-head { align-items: stretch; }
  .product-catalog-head-actions { justify-content: stretch; }
  .product-catalog-head-actions .button { flex: 1; }
  .product-list-toolbar { align-items: flex-start; }
  .product-list-count { display: none; }
  .product-row { display: block; }
  .product-row-main, .product-row-detail, .product-row-activities { min-height: 0; padding: 13px 14px; border-left: 0; border-bottom: 1px solid #edf1f6; }
  .product-row-main { padding-top: 15px; padding-bottom: 13px; }
  .product-row-detail { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 5px 10px; align-items: center; }
  .product-row-detail span { grid-row: 1 / span 2; }
  .product-row-detail small { grid-column: 2; }
  .product-row-activities > span { margin-bottom: 1px; }
  .product-row-activities em { max-width: 100%; }
  .product-row-actions { justify-content: stretch; padding: 12px 14px; border: 0; }
  .product-row-actions .button, .product-row-actions form { flex: 1; width: 100%; }
}

/* Standalone product editor */
.edit-product-head { align-items: flex-end; }
.edit-product-head-actions { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; justify-content: flex-end; }
.product-state-summary { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 7px 11px; border: 1px solid #dce7f3; border-radius: 9px; color: #5b7089; background: #f8fafd; font-size: 12px; font-weight: 750; white-space: nowrap; }
.product-state-summary i { width: 7px; height: 7px; border-radius: 50%; background: #9baabd; }
.product-state-summary.is-enabled { border-color: #c9eadb; color: #167850; background: #f0fbf5; }
.product-state-summary.is-enabled i { background: var(--success); }
.product-edit-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 26px; padding: 16px 22px; border-color: #dbe7f5; background: linear-gradient(110deg, #fff, #f8fbff); }
.product-edit-summary-main { display: flex; min-width: 0; align-items: center; gap: 12px; }
.product-summary-icon { display: grid; width: 43px; height: 43px; flex: 0 0 43px; place-items: center; border-radius: 13px; color: #fff; background: linear-gradient(135deg, #2c8dff, #6573f2); font-size: 16px; font-weight: 800; box-shadow: 0 7px 15px rgba(40, 110, 228, .18); }
.product-edit-summary-main strong, .product-edit-summary-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-edit-summary-main strong { color: var(--text-strong); font-size: 15px; }
.product-edit-summary-main small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.product-edit-summary-meta { min-width: 78px; padding-left: 24px; border-left: 1px solid #e7edf5; }
.product-edit-summary-meta span, .product-edit-summary-meta strong { display: block; }
.product-edit-summary-meta span { color: var(--muted); font-size: 11px; font-weight: 700; }
.product-edit-summary-meta strong { margin-top: 4px; color: var(--text-strong); font-size: 19px; }
.readonly-field input { color: #65758b; background: #f5f7fa; cursor: not-allowed; }
.readonly-field input:focus { border-color: var(--border-strong); box-shadow: none; }
.edit-product-layout { gap: 14px; }
.edit-product-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 4px 0 5px; }
.edit-product-actions .new-product-actions { padding: 0; }
.edit-product-secondary { display: flex; align-items: center; gap: 8px; }
.edit-product-secondary .button { min-height: 36px; font-size: 12px; }
.danger-outline { border-color: #efb6bd; color: #b52d3c; background: #fff8f8; }
.danger-outline:hover { border-color: #dc7380; color: #9e1e2d; background: #fff1f3; }
.product-danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 12px; padding: 16px 20px; border-color: #f0d7da; background: #fffafb; }
.product-danger-zone strong, .product-danger-zone small { display: block; }
.product-danger-zone strong { color: #8e2d39; font-size: 13px; }
.product-danger-zone small { margin-top: 3px; color: #9a7479; font-size: 11px; }
.product-danger-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.product-danger-actions form { margin: 0; }
.product-danger-actions .button { min-height: 35px; font-size: 12px; }
@media (max-width: 760px) {
  .edit-product-head { align-items: stretch; }
  .edit-product-head-actions { justify-content: flex-start; }
  .product-edit-summary { grid-template-columns: 1fr 1fr; gap: 15px; padding: 15px 16px; }
  .product-edit-summary-main { grid-column: 1 / -1; }
  .product-edit-summary-meta { padding-left: 0; border-left: 0; }
  .edit-product-actions, .product-danger-zone { align-items: stretch; flex-direction: column; }
  .edit-product-secondary, .edit-product-actions .new-product-actions, .product-danger-actions, .product-danger-actions form { width: 100%; }
  .edit-product-secondary .button, .edit-product-actions .new-product-actions .button, .product-danger-actions .button { flex: 1; }
}
