:root {
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #182230;
  background: #f4f6f9;
  --navy: #0f1d32;
  --navy-2: #172a45;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --teal: #0f8f83;
  --orange: #b86618;
  --text: #182230;
  --muted: #667085;
  --line: #e4e7ec;
  --surface: #fff;
  --soft: #f8fafc;
  --sidebar: 260px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 92px; }
body { margin: 0; min-width: 320px; background: #f4f6f9; }
button, input, select, textarea { font: inherit; }
button { border: 0; border-radius: 8px; background: var(--blue); color: #fff; padding: 10px 16px; font-weight: 650; cursor: pointer; transition: .18s ease; }
button:hover { background: var(--blue-dark); transform: translateY(-1px); }
button.secondary { background: #fff; color: #344054; border: 1px solid #d0d5dd; }
button.secondary:hover { background: #f8fafc; color: #101828; }
button.danger, .danger { background: #fff1f1; color: #b42318; }
button.danger:hover { background: #fee4e2; }
.small { padding: 7px 10px; font-size: 12px; }
h1, h2, h3 { color: var(--text); margin: 0; letter-spacing: -.025em; }
h1 { font-size: 22px; }
h2 { font-size: 26px; }
h3 { font-size: 18px; }
p { color: var(--muted); margin: 6px 0; line-height: 1.65; }
small { font-size: 10px; font-weight: 700; letter-spacing: .16em; }
.adminShell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: var(--navy); color: #fff; padding: 28px 18px; display: flex; flex-direction: column; z-index: 30; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 28px; border-bottom: 1px solid #ffffff16; }
.brandMark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: linear-gradient(145deg, #3b82f6, #2563eb); font-size: 13px; font-weight: 800; box-shadow: 0 8px 24px #2563eb55; }
.brand div { display: grid; gap: 3px; }
.brand small { color: #91a4be; }
.brand strong { font-size: 16px; }
.sideNav { display: grid; gap: 6px; margin-top: 24px; }
.sideNav a { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: center; min-height: 62px; padding: 10px 12px; border-radius: 10px; color: #aebdd1; text-decoration: none; transition: .18s ease; }
.sideNav a:hover, .sideNav a.active { background: #ffffff10; color: #fff; }
.sideNav a.active { box-shadow: inset 3px 0 #4f8cff; }
.sideNav a > span { color: #66809e; font-size: 11px; font-weight: 700; }
.sideNav a div { display: grid; gap: 3px; }
.sideNav a strong { font-size: 14px; }
.sideNav a small { color: #7187a2; font-size: 10px; letter-spacing: .04em; font-weight: 500; }
.scopeLegend { margin-top: auto; border: 1px solid #ffffff12; border-radius: 12px; padding: 14px; background: #ffffff08; }
.scopeLegend strong { font-size: 12px; color: #dbe5f2; }
.scopeLegend p { display: flex; align-items: center; gap: 8px; color: #8fa2ba; font-size: 11px; margin: 9px 0 0; line-height: 1.3; }
.scopeDot { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; }
.scopeDot.global { background: #5d8df6; }
.scopeDot.product { background: #2eb5a8; }
.workspace { margin-left: var(--sidebar); min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; min-height: 78px; padding: 13px 30px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: #ffffffed; border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.pageIdentity { display: grid; gap: 3px; }
.pageIdentity small { color: #98a2b3; }
.headerActions { display: flex; align-items: end; gap: 10px; }
.productSelector { min-width: 230px; margin: 0; }
.productSelector span { display: block; color: #667085; font-size: 11px; margin-bottom: 4px; }
.productSelector select { margin: 0; padding: 8px 34px 8px 10px; }
.refreshButton { height: 38px; }
main { max-width: 1500px; margin: 0 auto; padding: 28px 30px 70px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 3px #1018280a, 0 8px 24px #10182805; }
.login { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(260px, 440px) auto auto; gap: 16px; padding: 24px; align-items: end; }
.login small { color: var(--blue); }
.login label { margin: 0; }
.login > span, #aiStatus, #homeBannerStatus, #featureStatus, #appCreateStatus, #appSettingsStatus, #popupStatus, #taskCreateStatus, #promptStatus { color: var(--blue-dark); font-size: 13px; }
.pageSection { padding-top: 12px; margin-top: 0; }
.pageSection + .pageSection { border-top: 0; margin-top: 0; padding-top: 12px; }
.pageSectionHeader { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.pageSectionHeader > div { position: relative; padding-left: 54px; }
.pageSectionHeader small { color: #7c8da5; }
.pageSectionHeader p { max-width: 720px; }
.sectionIndex { position: absolute; left: 0; top: 2px; width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid #cbd5e1; border-radius: 9px; color: #64748b; font-size: 11px; font-weight: 750; }
.scopeBadge { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; border-radius: 999px; padding: 7px 11px; font-size: 12px; font-weight: 700; }
.scopeBadge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.scopeBadge.global { color: #1d4ed8; background: #eff6ff; border: 1px solid #bfdbfe; }
.scopeBadge.global::before { background: #3b82f6; }
.scopeBadge.product { color: #08796e; background: #ecfdf9; border: 1px solid #a7f3d0; }
.scopeBadge.product::before { background: #14b8a6; }
.scopeBadge.neutral { color: #475467; background: #f2f4f7; border: 1px solid #e4e7ec; }
.scopeBadge.neutral::before { background: #98a2b3; }
.scopeNotice { display: flex; align-items: center; gap: 14px; margin: 0 0 16px; padding: 12px 16px; border-radius: 9px; font-size: 13px; }
.scopeNotice strong { white-space: nowrap; }
.scopeNotice.global { background: #eff6ff; border-left: 3px solid #3b82f6; color: #344054; }
.scopeNotice.global strong { color: #1d4ed8; }
.scopeNotice.product { background: #effcf9; border-left: 3px solid #14b8a6; color: #344054; }
.scopeNotice.product strong { color: #08796e; }
.filterPanel, .configCard, .analyticsCard, .tableCard, .guidanceCard { padding: 22px; }
.filterPanel { margin-top: 0; }
.sectionHeading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.sectionHeading small, .tableTitle small, .guidanceCard > small { color: var(--blue); }
.sectionHeading h3, .tableTitle h3, .guidanceCard h3 { margin-top: 4px; }
.filterGrid { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 0 14px; margin-top: 18px; }
.stats { display: grid; grid-template-columns: repeat(6, minmax(130px, 1fr)); gap: 12px; margin: 16px 0; }
.stats article { padding: 18px; min-height: 96px; position: relative; overflow: hidden; }
.stats article::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: #dbeafe; }
.stats strong { display: block; margin-bottom: 7px; color: #1d4ed8; font-size: 23px; letter-spacing: -.03em; }
.stats span { color: var(--muted); font-size: 12px; }
.analyticsGrid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.analyticsCard { min-height: 220px; }
.trendChart { margin-top: 16px; display: grid; gap: 10px; }
.trendRow { display: grid; grid-template-columns: 90px minmax(120px, 1fr) 64px 92px; align-items: center; gap: 10px; font-size: 13px; }
.trendRow span, .trendRow small { color: var(--muted); }
.barTrack { height: 9px; background: #eef2f6; border-radius: 999px; overflow: hidden; }
.barTrack i { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: linear-gradient(90deg, #2563eb, #2e90fa); }
.errorList { display: grid; gap: 9px; margin-top: 16px; }
.errorRow { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 8px; background: #f8fafc; border: 1px solid #eef2f6; }
.errorRow strong { color: #b42318; }
.emptyBlock { padding: 42px 12px; text-align: center; color: #98a2b3; }
.twoColumn { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; }
.foundationGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.foundationCard { margin-top: 0; }
.overviewScopeBar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 18px; margin-bottom: 16px; }
.overviewScopeBar > div:first-child { display: grid; gap: 3px; }
.overviewScopeBar small { color: var(--blue); }
.overviewScopeBar strong { font-size: 16px; color: var(--text); }
.overviewScopeBar span { color: var(--muted); font-size: 12px; }
.overviewScopeTabs { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.overviewScopeTabs button { padding: 8px 12px; background: #f2f4f7; border: 1px solid #e4e7ec; color: #475467; font-size: 12px; }
.overviewScopeTabs button:hover { background: #eaf1ff; color: #1d4ed8; transform: none; }
.overviewScopeTabs button.active { background: #1d4ed8; border-color: #1d4ed8; color: #fff; box-shadow: 0 4px 12px #2563eb25; }
.productConfigWorkspace { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.productListPanel { padding: 16px; position: sticky; top: 96px; }
.productListHeader { padding: 3px 4px 14px; border-bottom: 1px solid var(--line); }
.productListHeader small { color: var(--teal); }
.productListHeader h3 { margin-top: 4px; }
.productListHeader p { font-size: 12px; }
.productAppList { display: grid; gap: 7px; padding-top: 12px; }
.productListItem { width: 100%; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px; text-align: left; background: #fff; color: var(--text); border: 1px solid transparent; }
.productListItem:hover { background: #f8fafc; border-color: #dbe3ee; transform: none; }
.productListItem.selected { background: #eff6ff; border-color: #8ab4ff; box-shadow: inset 3px 0 #2563eb; }
.productListIdentity { min-width: 0; display: grid; gap: 3px; }
.productListIdentity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.productListIdentity code { width: fit-content; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.productListIdentity small { color: var(--muted); font-size: 10px; letter-spacing: 0; font-weight: 500; }
.productListState { padding: 4px 6px; border-radius: 999px; font-size: 10px; }
.productListState.active { color: #027a48; background: #ecfdf3; }
.productListState.disabled { color: #b42318; background: #fef3f2; }
.productConfigDetail { min-width: 0; }
.productConfigDetail > .configCard:first-of-type { margin-top: 0; }
.appSettingsEmpty { min-height: 330px; display: grid; place-items: center; align-content: center; padding: 40px; text-align: center; }
.appSettingsEmpty > span { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 14px; border-radius: 50%; background: #eff6ff; color: #2563eb; font-size: 24px; }
.productForms { grid-template-columns: 1fr 1fr; margin-top: 16px; }
.operationsGrid { grid-template-columns: minmax(0, 1fr) minmax(300px, .7fr); }
.guidanceCard { background: #101f35; border-color: #101f35; color: #fff; }
.guidanceCard h3 { color: #fff; }
.guidanceCard p, .guidanceCard span, .guidanceCard li { color: #aebdd1; }
.guidanceCard ol, .guidanceCard ul { display: grid; gap: 14px; margin: 18px 0 0; padding-left: 20px; }
.guidanceCard ol li { padding-left: 6px; }
.guidanceCard ol li::marker { color: #6ca2ff; font-weight: 800; }
.guidanceCard li b, .guidanceCard li span { display: block; }
.guidanceCard li b { color: #fff; margin-bottom: 3px; }
.appConfigCards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin-bottom: 16px; }
.appConfigCard { background: #fff; border: 1px solid #dfe4ec; border-radius: 12px; padding: 18px; box-shadow: 0 1px 3px #1018280a; }
.appConfigCard.selected { border-color: #5b8def; box-shadow: 0 0 0 3px #2563eb12; }
.appCardTop { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.appInitial { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: #eff6ff; color: #1d4ed8; font-weight: 800; }
.appConfigCard h3 { margin-bottom: 5px; }
.appConfigCard dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 17px 0; }
.appConfigCard dl div { padding: 9px; border-radius: 8px; background: #f8fafc; }
.appConfigCard dt { color: #667085; font-size: 10px; }
.appConfigCard dd { margin: 4px 0 0; color: #101828; font-size: 14px; font-weight: 750; }
.appConfigCard button { width: 100%; }
.rowActions { display: flex; gap: 7px; }
label { display: block; color: #344054; font-size: 13px; font-weight: 650; margin-bottom: 13px; }
input, select, textarea { width: 100%; margin-top: 6px; padding: 10px 11px; border: 1px solid #d0d5dd; border-radius: 8px; color: #101828; background: #fff; outline: none; transition: .15s ease; }
input:hover, select:hover, textarea:hover { border-color: #98a2b3; }
input:focus, select:focus, textarea:focus { border-color: #5285ed; box-shadow: 0 0 0 3px #2563eb14; }
input[type=checkbox] { width: auto; margin: 0 7px 0 0; accent-color: var(--blue); }
textarea { min-height: 88px; resize: vertical; }
.formGrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; margin-top: 18px; }
.formGrid.compact { grid-template-columns: repeat(2, 1fr); }
.formGrid .wide { grid-column: 1 / -1; }
.priceGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.switchLabel { display: flex; align-items: center; margin: 0; padding: 8px 11px; border-radius: 999px; background: #f2f4f7; border: 1px solid #e4e7ec; white-space: nowrap; font-size: 12px; }
.scopeToken { display: grid; justify-items: end; gap: 5px; }
.scopeToken span { color: var(--muted); font-size: 11px; }
.actions { display: flex; align-items: center; gap: 12px; margin-top: 2px; }
.configCard { margin-top: 16px; }
.twoColumn > .configCard, .twoColumn > .guidanceCard { margin-top: 0; }
.tableCard { margin-top: 16px; }
.tableTitle { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.tableTitle select { width: 150px; margin: 0; }
.tableWrap { overflow: auto; margin: 14px -22px -22px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 720px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid #eaecf0; white-space: nowrap; }
th { position: sticky; top: 0; z-index: 1; background: #f8fafc; color: #667085; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
td { color: #344054; font-size: 13px; }
tbody tr:hover td { background: #fafcff; }
tbody tr:last-child td { border-bottom: 0; }
td input[type=number] { min-width: 78px; margin: 0; padding: 7px 8px; }
.tag { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 650; }
.tag.unused { background: #eff8ff; color: #175cd3; }
.tag.used, .tag.active, .tag.success { background: #ecfdf3; color: #027a48; }
.tag.revoked { background: #f2f4f7; color: #667085; }
.tag.disabled, .tag.failed { background: #fef3f2; color: #b42318; }
.tag.rewarded { background: #fffaeb; color: #b54708; }
.tag.member { background: #f4f3ff; color: #5925dc; }
.tag.free { background: #f2f4f7; color: #475467; }
.empty { text-align: center; color: #98a2b3; padding: 35px; }
code { font-size: 12px; color: #344054; background: #f2f4f7; padding: 4px 6px; border-radius: 5px; }
[hidden] { display: none !important; }

@media (max-width: 1280px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
  .filterGrid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1024px) {
  :root { --sidebar: 220px; }
  .sidebar { padding-inline: 12px; }
  main, .topbar { padding-left: 22px; padding-right: 22px; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .analyticsGrid, .twoColumn, .operationsGrid, .foundationGrid, .productConfigWorkspace { grid-template-columns: 1fr; }
  .productListPanel { position: static; }
  .productAppList { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .formGrid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  :root { --sidebar: 0px; }
  html { scroll-padding-top: 150px; }
  .sidebar { position: sticky; top: 0; width: 100%; height: auto; padding: 10px 14px 8px; flex-direction: row; align-items: center; overflow-x: auto; }
  .brand { flex: 0 0 auto; padding: 0 14px 0 0; border: 0; }
  .brand div, .scopeLegend { display: none; }
  .brandMark { width: 34px; height: 34px; }
  .sideNav { display: flex; gap: 4px; margin: 0; }
  .sideNav a { display: flex; min-height: 38px; padding: 7px 10px; white-space: nowrap; }
  .sideNav a div { display: block; }
  .sideNav a small, .sideNav a > span { display: none; }
  .workspace { margin-left: 0; }
  .topbar { top: 52px; padding: 10px 16px; }
  .pageIdentity small { display: none; }
  .pageIdentity h1 { font-size: 18px; }
  main { padding: 20px 16px 55px; }
  .login { grid-template-columns: 1fr; align-items: stretch; }
  .login button { width: 100%; }
  .pageSection + .pageSection { margin-top: 0; padding-top: 12px; }
  .productForms { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .headerActions { width: 100%; }
  .productSelector { flex: 1; min-width: 0; }
  .pageSectionHeader { align-items: flex-start; flex-direction: column; gap: 12px; }
  .pageSectionHeader > div { padding-left: 0; padding-top: 50px; }
  .sectionIndex { top: 0; }
  .filterGrid, .formGrid, .formGrid.compact, .priceGrid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats strong { font-size: 19px; }
  .sectionHeading, .actions, .tableTitle { align-items: stretch; flex-direction: column; }
  .scopeNotice { align-items: flex-start; flex-direction: column; gap: 4px; }
  .tableTitle select { width: 100%; }
  .scopeToken { justify-items: start; }
  .overviewScopeBar { align-items: stretch; flex-direction: column; }
  .overviewScopeTabs { justify-content: flex-start; }
  .productAppList { grid-template-columns: 1fr; }
  .trendRow { grid-template-columns: 76px 1fr 58px; }
  .trendRow small { display: none; }
}
