/* Soybean Admin visual adapter. Upstream MIT notice: ./LICENSE.soybean */
:root {
  --soy-primary: #646cff;
  --soy-soft: #eff0ff;
  --soy-layout: #f7fafc;
  --soy-line: #efeff5;
  --soy-text: #1f1f1f;
  --bg: var(--soy-layout); --panel: #fff; --line: var(--soy-line);
  --text: var(--soy-text); --sub: #767c82; --accent: var(--soy-primary);
  --accent-soft: var(--soy-soft); --blue: var(--soy-primary);
  --provider-bg: var(--soy-layout); --provider-line: var(--soy-line);
  --provider-blue: var(--soy-primary); --provider-teal: var(--soy-primary);
  --records-bg: var(--soy-layout); --records-line: var(--soy-line);
  --records-blue: var(--soy-primary); --records-teal: var(--soy-primary);
  font-family: v-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color-scheme: light;
}
body { font-family: inherit; background: var(--soy-layout); color: var(--soy-text); }
button, input, select, textarea { font-family: inherit; }
button { transition: background-color .18s, border-color .18s, color .18s; }
:where(button, a, input, select, textarea, summary):focus-visible { outline: 2px solid var(--soy-primary); outline-offset: 3px; }
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), select, textarea { border-radius: 6px; }
input:not([type=checkbox]):not([type=radio]):focus, select:focus, textarea:focus { border-color: var(--soy-primary); }
input[type=checkbox], input[type=radio] { accent-color: var(--soy-primary); }

/* Shell dimensions and colors follow upstream src/theme/settings.ts. */
.soy-shell { height: 100vh; overflow: hidden; }
.soy-shell .app-shell { grid-template-columns: 220px minmax(0, 1fr); height: 100vh; min-height: 0; }
.soy-shell .sidebar { min-height: 0; background: #fff; color: var(--soy-text); box-shadow: 2px 0 8px rgb(29 35 41 / 5%); z-index: 60; }
.soy-shell .sidebar-head { height: 56px; flex-shrink: 0; background: #fff; border: 0; }
.soy-brand { display: flex; gap: 10px; align-items: center; color: var(--soy-primary); font-size: 20px; font-weight: 650; white-space: nowrap; }
.soy-brand-mark { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px 4px 10px 4px; background: var(--soy-primary); color: white; font-size: 21px; }
.soy-shell .sidebar-nav { padding: 12px 10px; flex: 1; overflow: auto; }
.soy-shell .menu { gap: 6px; }
.soy-shell .menu-btn, .soy-shell .nav-summary, .soy-shell .nav-child-btn { min-height: 42px; height: auto; border-radius: 6px; color: #4b4b52; font-size: 14px; background: transparent; padding: 11px 14px; gap: 10px; border: 0; }
.soy-shell .menu-icon { width: 22px; color: inherit; font-size: 20px; flex-shrink: 0; }
.soy-shell .menu-btn:hover, .soy-shell .nav-summary:hover, .soy-shell .nav-child-btn:hover { background: #f6f6f9; color: var(--soy-primary); }
.soy-shell .menu-btn.active, .soy-shell .nav-child-btn.active, .soy-shell .nav-summary.active { background: var(--soy-soft); color: var(--soy-primary); font-weight: 500; }
.soy-shell .nav-section { border: 0; background: transparent; }
.soy-shell .nav-children { padding: 4px 0 0; background: transparent; gap: 4px; }
.soy-shell .nav-child-btn { padding-left: 46px; }
.soy-shell .nav-child-btn::before { display: none; }
.soy-shell .nav-arrow { border-color: #92929a; }
.soy-shell .main { display: flex; flex-direction: column; min-width: 0; height: 100vh; overflow: hidden; }
.soy-shell .topbar { height: 56px; min-height: 56px; padding: 0 20px; background: #fff; border: 0; border-radius: 0; box-shadow: 0 1px 2px rgb(0 21 41 / 8%); z-index: 10; }
.soy-shell .topbar-main { gap: 16px; min-width: 0; }
.soy-shell .toolbar-title { font-size: 14px; font-weight: 400; white-space: nowrap; }
.soy-shell .toolbar-icon-btn { color: #555; border-radius: 6px; }
.soy-shell .toolbar-avatar { border-radius: 50%; background-color: var(--soy-soft); color: var(--soy-primary); }
.soy-shell .toolbar-user-name { font-size: 14px; }
.soy-shell .content-frame { display: block; flex: 1; width: 100%; height: 0; min-height: 0; background: var(--soy-layout); }
.soy-tabbar { height: 44px; min-height: 44px; background: white; box-shadow: 0 1px 2px rgb(0 21 41 / 8%); display: flex; align-items: flex-end; padding: 0 16px; gap: 6px; }
.soy-current-tab { height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 20px; border-radius: 8px 8px 0 0; color: var(--soy-primary); background: var(--soy-soft); font-size: 13px; }
.soy-current-tab::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.soy-menu-toggle { border: 0; background: transparent; cursor: pointer; width: 32px; height: 32px; padding: 6px; color: #555; border-radius: 6px; }
.soy-menu-toggle svg { width: 20px; height: 20px; }
.soy-shell.soy-collapsed .app-shell { grid-template-columns: 64px minmax(0, 1fr); }
.soy-collapsed .soy-brand-name, .soy-collapsed .menu-label, .soy-collapsed .nav-arrow { display: none; }
.soy-shell.soy-collapsed .sidebar-nav { padding-inline: 6px; }
.soy-shell.soy-collapsed .menu-btn, .soy-shell.soy-collapsed .nav-summary { padding-inline: 14px; }
.soy-shell.soy-collapsed .nav-children { display: none; }
.soy-mobile-shade { display: none; }

/* Existing page DOM, table sizing, visibility and business states are retained. */
.soy-page .wrap { padding-top: 16px; padding-inline: 20px; }
.soy-page :is(.provider-page, .records-page, .permission-page) { padding: 16px 20px 20px; }
.soy-page :is(.card, .panel, .section, .table-wrap, .daily-trend-panel, .product-pie-panel, .top-merchant-panel, .region-map-panel) { border-radius: 8px; border-color: var(--soy-line); box-shadow: 0 1px 3px rgb(0 21 41 / 3%); }
.soy-page :is(.tabs, .merchant-tabs, .provider-tabs, .overview-product-tabs, .detail-tabs) { background: #fff; border-bottom: 1px solid var(--soy-line); border-radius: 8px 8px 0 0; padding-inline: 12px; gap: 8px; }
.soy-page :is(.tab, .merchant-tab, .provider-tab, .overview-product-tab, .detail-tab) { background: transparent; font-size: 14px; font-weight: 400; min-width: auto; padding-inline: 20px; border-radius: 0; color: #555; }
.soy-page :is(.tab, .merchant-tab, .provider-tab, .overview-product-tab, .detail-tab).active { color: var(--soy-primary); background: #fff; border-radius: 0; box-shadow: inset 0 -2px var(--soy-primary); font-weight: 500; }
.soy-page :is(.merchant-tab, .overview-product-tab).active::before, .soy-page :is(.merchant-tab, .overview-product-tab).active::after { display: none; }
.soy-page :is(.btn, .provider-btn, .records-apply, .filter-confirm-btn) { border-radius: 6px; }
.soy-page .primary-btn { background: var(--soy-primary); border-color: var(--soy-primary); border-radius: 6px; }
.soy-page .primary-btn:hover { background: #8288ff; }
.soy-page :is(.table-card, .control-bar, .level-card) { border-radius: 8px; border-color: var(--soy-line); }
.soy-page .btn:not(.ghost):not(.danger) { background: var(--soy-primary); }
.soy-page th { background: #fafafc; color: #555; font-weight: 600; }
.soy-page td { border-bottom-color: var(--soy-line); }
.soy-page tbody tr:hover { background-color: #f7f7ff; }
.soy-page .summary-card { border-radius: 8px; background: linear-gradient(120deg, #8e9dff, #646cff); }
.soy-page .summary-card.balance { background: linear-gradient(120deg, #70d5c9, #39b5a6); }
.soy-page .summary-card.business { background: linear-gradient(120deg, #edb783, #df9666); }

/* Keep all existing scan, password, registration and error controls. */
.soy-login { background: radial-gradient(ellipse at 10% 10%, #e2e5ff, transparent 55%), radial-gradient(ellipse at 95% 95%, #e6e9ff, transparent 55%), #f4f7fc; }
.soy-login .bg-noise { opacity: 1; background: none; border: 1px solid #646cff12; width: 70vw; height: 70vw; border-radius: 50%; inset: auto auto -50vw -10vw; }
.soy-login .qr-card { width: min(440px, 100%); padding: 32px; border: 1px solid #fff; border-radius: 16px; background: #fff; box-shadow: 0 16px 70px #646cff14; backdrop-filter: none; }
.soy-login .page-title { color: var(--soy-primary); font-size: 24px; margin: 4px 0 28px; text-shadow: none; }
.soy-login .tabs { background: #fff; border-radius: 0; border-bottom: 1px solid var(--soy-line); margin-bottom: 16px; }
.soy-login .tab-btn { background: #fff; color: #767c82; font-weight: 400; }
.soy-login .tab-btn.active { background: #fff; color: var(--soy-primary); box-shadow: inset 0 -2px var(--soy-primary); }
.soy-login .login-submit { background: var(--soy-primary); border-radius: 6px; box-shadow: none; }
.soy-login .field input { border-radius: 6px; }
.soy-login .login-tip, .soy-login .wechat-desc { color: #767c82; }
.soy-login .env-badge { box-shadow: none; backdrop-filter: none; border-radius: 6px; }
.soy-login .error-banner { background: #fff0f0; border-color: #ffd5d5; color: #d03050; box-shadow: none; }
@media (max-width: 760px) {
  .soy-shell .app-shell, .soy-shell.soy-collapsed .app-shell { grid-template-columns: minmax(0, 1fr); }
  .soy-shell .sidebar { position: fixed; inset: 0 auto 0 0; width: 220px; transform: translateX(-100%); transition: transform .2s; }
  .soy-shell.soy-mobile-open .sidebar { transform: translateX(0); }
  .soy-mobile-open .soy-mobile-shade { display: block; position: fixed; inset: 0; background: #0005; z-index: 55; border: 0; }
  .soy-shell .topbar { padding-inline: 12px; }
  .soy-shell .topbar-main { gap: 6px; }
  .soy-shell .toolbar-title { overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
  .soy-shell .toolbar-user-name { max-width: 80px; overflow: hidden; text-overflow: ellipsis; }
  .soy-page .wrap { padding-inline: 12px; }
  .soy-login .qr-card { padding: 24px 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
