/* AuraDesk Design System v1.0 — 12 Standard Component Families (/assets/aura-ui.css) */

.aui-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--radius-ctrl); border: 1px solid transparent;
  font-family: var(--font-sans); font-weight: 600; cursor: pointer; text-decoration: none;
  white-space: nowrap;
  transition: background var(--motion-fast) var(--motion-ease),
              border-color var(--motion-fast) var(--motion-ease),
              color var(--motion-fast) var(--motion-ease),
              transform var(--motion-fast) var(--motion-spring);
}
.aui-btn:active:not(:disabled) { transform: scale(0.97); }
.aui-btn:disabled { opacity: 0.48; cursor: not-allowed; }
.aui-btn-sm { height: 28px; padding: 0 10px; font-size: var(--fs-sm); border-radius: var(--radius-sm); }
.aui-btn-md { height: 34px; padding: 0 14px; font-size: var(--fs-md); }
.aui-btn-lg { height: 42px; padding: 0 20px; font-size: var(--fs-base); }
.aui-btn-primary { background: var(--brand); color: #fff; }
.aui-btn-primary:hover:not(:disabled) { background: var(--brand-hover); }
.aui-btn-secondary { background: var(--surface); color: var(--text-primary); border-color: var(--border-strong); }
.aui-btn-secondary:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.aui-btn-ghost { background: transparent; color: var(--text-secondary); }
.aui-btn-ghost:hover:not(:disabled) { background: var(--surface-subtle); color: var(--text-primary); }
.aui-btn-soft { background: var(--brand-soft); color: var(--brand); }
.aui-btn-soft:hover:not(:disabled) { background: #F3DCE3; }
.aui-btn-danger { background: var(--danger); color: #fff; }
.aui-btn-danger:hover:not(:disabled) { background: #A52C34; }

.aui-switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: var(--fs-md); color: var(--text-primary); }
.aui-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.aui-switch-track { width: 38px; height: 22px; border-radius: var(--radius-pill); background: var(--border-strong); position: relative; transition: background var(--motion-fast) var(--motion-ease); }
.aui-switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.18); transition: transform var(--motion-base) var(--motion-spring); }
.aui-switch input:checked + .aui-switch-track { background: var(--brand); }
.aui-switch input:checked + .aui-switch-track::after { transform: translateX(16px); }
.aui-switch input:disabled + .aui-switch-track { opacity: 0.45; }
.aui-checkbox { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-md); color: var(--text-primary); cursor: pointer; }
.aui-checkbox input { accent-color: var(--brand); width: 15px; height: 15px; cursor: pointer; }
.aui-seg { display: inline-flex; align-items: center; gap: 2px; padding: 3px; background: var(--brand-soft); border-radius: var(--radius-pill); }
.aui-seg-btn { border: none; background: transparent; color: var(--text-secondary); font-size: var(--fs-sm); font-weight: 600; padding: 5px 12px; border-radius: var(--radius-pill); cursor: pointer; font-family: inherit; transition: all var(--motion-fast) var(--motion-ease); }
.aui-seg-btn.is-active { background: var(--brand); color: #fff; box-shadow: 0 1px 4px rgba(154,74,91,0.22); }

.aui-breadcrumb { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-base); white-space: nowrap; }
.aui-breadcrumb-root { color: var(--text-muted); font-weight: 500; }
.aui-breadcrumb-sep { color: var(--border-strong); }
.aui-breadcrumb-cur { color: var(--text-primary); font-weight: 700; }
.aui-tabs { display: flex; gap: 4px; border-bottom: 1.5px solid var(--border); overflow-x: auto; }
.aui-tab { border: none; background: transparent; padding: 9px 14px; font-size: var(--fs-md); font-weight: 600; color: var(--text-secondary); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1.5px; transition: color var(--motion-fast) var(--motion-ease), border-color var(--motion-fast) var(--motion-ease); }
.aui-tab:hover { color: var(--text-primary); }
.aui-tab.is-active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 700; }

@keyframes aui-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }
.aui-input { height: 36px; padding: 0 12px; border-radius: var(--radius-ctrl); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-primary); font-family: var(--font-sans); font-size: var(--fs-md); outline: none; transition: border-color var(--motion-fast) var(--motion-ease), box-shadow var(--motion-fast) var(--motion-ease); }
.aui-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.aui-input:disabled { background: var(--surface-subtle); color: var(--text-muted); cursor: not-allowed; }
.aui-input.is-error { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); animation: aui-shake 260ms var(--motion-ease); }
.aui-field-error { color: var(--danger); font-size: var(--fs-sm); margin-top: 4px; font-weight: 600; }

.aui-select { height: 34px; padding: 0 11px; border-radius: var(--radius-ctrl); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-primary); font-size: var(--fs-md); font-weight: 600; font-family: var(--font-sans); cursor: pointer; }
.aui-select:focus { outline: none; border-color: var(--brand); }
.aui-search-wrap { position: relative; display: inline-flex; align-items: center; }
.aui-search-wrap .aui-input { padding-left: 32px; }
.aui-search-icon { position: absolute; left: 10px; color: var(--text-muted); font-size: 13px; pointer-events: none; }

.aui-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; }
.aui-badge-ok { background: var(--ok-soft); color: var(--ok); }
.aui-badge-warn { background: var(--warn-soft); color: var(--warn); }
.aui-badge-danger { background: var(--danger-soft); color: var(--danger); }
.aui-badge-brand { background: var(--brand-soft); color: var(--brand); }
.aui-badge-muted { background: var(--surface-subtle); color: var(--text-secondary); border: 1px solid var(--border); }
.aui-tier-l1 { background: var(--tier-l1-soft); color: var(--tier-l1); }
.aui-tier-l2 { background: var(--tier-l2-soft); color: var(--tier-l2); }
.aui-tier-l3 { background: var(--tier-l3-soft); color: var(--tier-l3); }
.aui-tier-l4 { background: var(--tier-l4-soft); color: var(--tier-l4); }
.aui-tier-l5 { background: var(--tier-l5-soft); color: var(--tier-l5); }
.aui-tier-churn { background: var(--tier-churn-soft); color: var(--tier-churn); }

.aui-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 14px 16px; box-shadow: var(--shadow-card); }
.aui-kpi-label { font-size: var(--fs-sm); color: var(--text-secondary); }
.aui-kpi-val { font-size: var(--fs-2xl); font-weight: 800; color: var(--text-primary); margin-top: 4px; font-variant-numeric: tabular-nums; }
.aui-progress { height: 8px; border-radius: var(--radius-pill); background: var(--border); overflow: hidden; }
.aui-progress-bar { height: 100%; border-radius: var(--radius-pill); background: var(--brand); transition: width var(--motion-slow) var(--motion-ease); }
.aui-stepper { display: inline-flex; align-items: center; gap: 6px; }
.aui-stepper-btn { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-primary); font-weight: 700; cursor: pointer; }
.aui-stepper-btn:hover { border-color: var(--brand); color: var(--brand); }

.aui-help-wrap { position: relative; display: inline-flex; align-items: center; }
.aui-help-btn { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface-subtle); color: var(--text-secondary); font-size: 11px; font-weight: 700; cursor: pointer; }
.aui-popover { position: absolute; top: calc(100% + 6px); left: 0; z-index: var(--z-popover); min-width: 210px; padding: 10px 12px; border-radius: var(--radius-ctrl); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-popover); font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.5; }
.aui-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }

.aui-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.aui-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.aui-table th { text-align: left; padding: 9px 10px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-secondary); background: var(--surface-subtle); border-bottom: 1.5px solid var(--border); white-space: nowrap; }
.aui-table td { padding: 10px; border-bottom: 1px solid var(--border); color: var(--text-primary); white-space: nowrap; }
.aui-table tbody tr:hover td { background: var(--surface-subtle); }

.aui-modal-backdrop { position: fixed; inset: 0; z-index: var(--z-modal); background: rgba(42, 31, 35, 0.44); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 16px; }
.aui-modal { width: 100%; max-width: 480px; background: var(--surface); border-radius: var(--radius-card); border: 1px solid var(--border); box-shadow: var(--shadow-modal); padding: var(--space-card); animation: aui-pop var(--motion-base) var(--motion-ease); }
@keyframes aui-pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.aui-drawer-backdrop { position: fixed; inset: 0; z-index: var(--z-drawer); background: rgba(42, 31, 35, 0.38); display: flex; justify-content: flex-end; }
.aui-drawer { width: min(420px, 92vw); height: 100%; background: var(--surface); border-left: 1px solid var(--border); padding: var(--space-card); overflow-y: auto; box-shadow: -10px 0 32px rgba(42,31,35,0.14); }

.aui-toast { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); z-index: var(--z-toast); background: var(--text-primary); color: #fff; padding: 9px 18px; border-radius: var(--radius-pill); font-size: var(--fs-md); font-weight: 600; box-shadow: 0 10px 28px rgba(42, 31, 35, 0.28); }
.aui-alert { padding: 11px 14px; border-radius: var(--radius-ctrl); font-size: var(--fs-md); display: flex; align-items: center; gap: 8px; border: 1px solid transparent; }
.aui-alert-ok { background: var(--ok-soft); color: var(--ok); border-color: #C7E6D8; }
.aui-alert-warn { background: var(--warn-soft); color: var(--warn); border-color: #F6DC97; }
.aui-alert-danger { background: var(--danger-soft); color: var(--danger); border-color: #F4C8CB; }

.aui-empty { text-align: center; padding: 32px 16px; border: 1px dashed var(--border-strong); border-radius: var(--radius-card); background: var(--surface-subtle); color: var(--text-secondary); }
@keyframes aui-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.aui-skeleton { border-radius: var(--radius-sm); height: 14px; background: linear-gradient(90deg, #F3ECEA 25%, #FAF7F6 50%, #F3ECEA 75%); background-size: 200% 100%; animation: aui-shimmer 1.4s infinite linear; }

.aura-store-locked-badge {
  display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 11px;
  border-radius: var(--radius-ctrl); background: var(--surface-subtle); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap;
}

.aura-readonly-badge {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px;
  border-radius: var(--radius-pill); background: var(--brand-soft); border: 1px solid var(--brand-border);
  color: var(--brand); font-size: var(--fs-sm); font-weight: 700; white-space: nowrap; flex-shrink: 0;
}

/* === Standalone React AppShell Skeleton (DS v1.0.1 · Zero aura-console.js dependency) === */
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text-primary); font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif); }
.aura-console-layout { min-height: 100vh; display: block; width: 100%; max-width: 100vw; overflow-x: clip; }
.aura-sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; justify-content: space-between;
  position: fixed; top: 0; left: 0; bottom: 0; width: 232px; height: 100dvh;
  overflow-y: auto; z-index: 95; box-sizing: border-box;
}
.aura-brand { height: 56px; padding: 0 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; box-sizing: border-box; }
.aura-brand-icon { width: 32px; height: 32px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; flex-shrink: 0; }
.aura-brand-name { font-size: 14.5px; font-weight: 800; color: var(--text-primary); line-height: 1.2; }
.aura-brand-sub { font-size: 10.5px; color: var(--text-secondary); margin-top: 1px; }
.aura-nav-list { display: flex; flex-direction: column; gap: 4px; padding: 14px 12px; }
.aura-nav-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: none; border-radius: 12px; background: transparent; color: var(--text-secondary); font-size: 13.5px; font-weight: 700; cursor: pointer; text-align: left; text-decoration: none; box-sizing: border-box; }
.aura-nav-item:hover { background: var(--bg); color: var(--text-primary); }
.aura-nav-item.is-active { background: var(--brand-soft); color: var(--brand); }
.aura-sub-nav { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 8px 18px; padding-left: 10px; border-left: 1.5px solid var(--border); }
.aura-sub-btn { border: none; background: transparent; color: var(--text-secondary); font-size: 12.5px; font-weight: 600; padding: 7px 10px; border-radius: 9px; cursor: pointer; text-align: left; font-family: inherit; }
.aura-sub-btn:hover { background: var(--bg); color: var(--text-primary); }
.aura-sub-btn.is-active { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.aura-sidebar-foot { border-top: 1px solid var(--border); padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.aura-user-chip { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 10px; border-radius: 12px; background: var(--bg); font-size: 12px; color: var(--text-primary); }
.aura-logout-btn { border: none; background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px; cursor: pointer; font-family: inherit; }
.aura-ver-pill { text-align: center; font-size: 11px; color: var(--text-muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; line-height: 1.35; }
.aura-ver-pill.is-mismatch { background: var(--warn-soft); color: var(--warn); border: 1px solid #F6DC97; border-radius: 999px; padding: 3px 8px; cursor: pointer; font-weight: 700; }
.aura-main-stage { margin-left: 232px; width: calc(100% - 232px); max-width: calc(100% - 232px); min-width: 0; box-sizing: border-box; background: var(--bg); min-height: 100vh; overflow-x: clip; }
.aura-top-header { position: sticky; top: 0; z-index: var(--z-header); height: 56px; background: rgba(255,255,255,0.96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); padding: 0 28px; display: flex; align-items: center; justify-content: space-between; gap: 12px; box-sizing: border-box; width: 100%; }
.aura-th-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.aura-th-menu-btn { display: none; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-primary); border-radius: 9px; font-size: 15px; font-weight: 700; cursor: pointer; flex-shrink: 0; }
.aura-breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.aura-bc-root { color: var(--text-muted); font-weight: 500; }
.aura-bc-sep { color: var(--border-strong); }
.aura-bc-cur { color: var(--text-primary); font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; }
.aura-th-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.aura-store-select { height: 32px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-primary); font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit; max-width: 175px; }
.aura-page-container { width: 100%; max-width: min(1280px, 100%); min-width: 0; margin: 0 auto; padding: 20px 32px 40px; box-sizing: border-box; }
.aura-page-container > * { min-width: 0; max-width: 100%; box-sizing: border-box; }
.aui-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 18px 20px; box-shadow: 0 1px 4px rgba(42,31,35,0.03); min-width: 0; max-width: 100%; box-sizing: border-box; }
.aura-drawer-mask { display: none; position: fixed; inset: 0; background: rgba(42,31,35,0.45); z-index: calc(var(--z-drawer) - 10); }
@media (max-width: 899px) {
  .aura-main-stage { margin-left: 0; width: 100%; max-width: 100%; }
  .aura-th-menu-btn { display: inline-flex; }
  .aura-top-header { padding: 0 14px; gap: 8px; }
  .aura-bc-root, .aura-bc-sep { display: none; }
  .aura-page-container { padding: 14px 14px 84px; }
  .aura-sidebar { width: 252px; z-index: var(--z-drawer); transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: 8px 0 28px rgba(42,31,35,0.16); }
  .aura-console-layout.is-drawer-open .aura-sidebar { transform: translateX(0); }
}
/* Overview PC 5-tab native group visibility & topbar alignment (no aura-console.js) */
.aura-main-stage .page-shell { max-width: min(1280px, 100%); width: 100%; min-width: 0; margin: 0 auto; padding: 20px 32px 40px; box-sizing: border-box; gap: 16px; }
.aura-top-header nav[aria-label="主导航"] { display: none !important; }
@media (min-width: 900px) {
  .mobile-dock, .mobile-bottom-dock, .pc-tab-bar { display: none !important; }
  [data-m-group] { display: none !important; }
  :root[data-mobile-tab="overview"] [data-m-group="overview"]:not(.is-hidden),
  :root[data-mobile-tab="breakdown"] [data-m-group="breakdown"]:not(.is-hidden),
  :root[data-mobile-tab="margin"] [data-m-group="margin"]:not(.is-hidden),
  :root[data-mobile-tab="roi"] [data-m-group="roi"]:not(.is-hidden),
  :root[data-mobile-tab="ledger"] [data-m-group="ledger"]:not(.is-hidden) { display: block !important; }
  :root[data-mobile-tab="overview"] #coverageBanner[data-m-group="overview"]:not(.is-hidden) { display: flex !important; }
}
@media (max-width: 899px) {
  .aura-main-stage .page-shell { padding: 14px 14px 84px; }
  .mobile-compact-header { display: none !important; }
}

/* Quick Switch Account Modal (DS v1.0.1 · PC & 390px Mobile) */
.aura-modal-mask { position: fixed; inset: 0; z-index: 1200; background: rgba(42,31,35,0.48); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 14px; box-sizing: border-box; }
.aura-modal-card { width: min(440px, calc(100vw - 28px)); max-width: 100%; max-height: min(84dvh, 620px); overflow-y: auto; background: var(--surface, #FFFFFF); border: 1px solid var(--border, #EAE0DE); border-radius: 16px; box-shadow: 0 20px 50px rgba(42,31,35,0.22); padding: 18px 20px; box-sizing: border-box; display: flex; flex-direction: column; gap: 14px; }
.aura-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.aura-modal-title { margin: 0; font-size: 16px; font-weight: 800; color: var(--text-primary, #2A1F23); }
.aura-modal-sub { margin: 3px 0 0; font-size: 12.5px; color: var(--text-secondary, #6D5B62); }
.aura-modal-close { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--border, #EAE0DE); background: var(--surface-subtle, #FBF6F5); color: var(--text-secondary, #6D5B62); font-size: 16px; line-height: 1; cursor: pointer; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.aura-switch-list { display: flex; flex-direction: column; gap: 8px; }
.aura-switch-item { width: 100%; text-align: left; border: 1px solid var(--border, #EAE0DE); background: var(--surface, #FFFFFF); border-radius: 12px; padding: 11px 13px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; box-sizing: border-box; transition: border-color 0.15s, background 0.15s; font-family: inherit; }
.aura-switch-item:hover:not(:disabled) { border-color: var(--brand, #9A4A5B); background: var(--surface-subtle, #FBF6F5); }
.aura-switch-item.is-current { border-color: var(--brand, #9A4A5B); background: var(--brand-soft, #F7ECEF); cursor: default; }
.aura-switch-item:disabled { opacity: 0.85; }
.aura-switch-meta { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.aura-switch-name { font-size: 14px; font-weight: 700; color: var(--text-primary, #2A1F23); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.aura-switch-scope { font-size: 12px; color: var(--text-secondary, #6D5B62); line-height: 1.35; }
.aura-switch-tag { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--surface-subtle, #F5ECEA); color: var(--text-secondary, #6D5B62); white-space: nowrap; }
.aura-switch-tag.is-current { background: var(--brand, #9A4A5B); color: #FFFFFF; }
.aura-modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px solid var(--border, #EAE0DE); flex-wrap: wrap; }
.aura-modal-logout-link { background: transparent; border: none; padding: 6px 2px; font-size: 12.5px; font-weight: 600; color: var(--text-secondary, #6D5B62); cursor: pointer; text-decoration: underline; font-family: inherit; }
.aura-modal-logout-link:hover { color: var(--danger, #C2410C); }
