/* ==========================================================================
   集合健身 · BetterOPC-inspired light theme
   Loaded after style.css / workspace.css / fitgo.css so it can re-skin the app
   without touching page behaviour. Delete the <link> to roll back.
   ========================================================================== */

/* ---------- 1. Design tokens ---------- */
:root {
  color-scheme: light;

  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: rgba(37, 99, 235, 0.08);
  --primary-softer: rgba(37, 99, 235, 0.04);
  --primary-line: rgba(37, 99, 235, 0.18);

  --bg: #f5f5f5;
  --bg-top: #fafafa;
  --card: #ffffff;
  --card-soft: #fcfcfd;
  --card-glass: rgba(255, 255, 255, 0.72);
  --side: #fbfbfc;
  --side-soft: rgba(37, 99, 235, 0.07);
  --text: #172235;
  --muted: #5b6b80;
  --muted-2: #667085;
  --line: rgba(48, 77, 118, 0.12);
  --line-strong: rgba(48, 77, 118, 0.22);
  --danger: #d92d20;
  --danger-dark: #b42318;
  --danger-soft: #fef3f2;
  --ok: #067647;
  --ok-soft: #ecfdf3;
  --warn: #b54708;
  --warn-soft: #fffaeb;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.05), 0 1px 2px rgba(16, 24, 40, 0.03);
  --shadow-md: 0 12px 32px -12px rgba(16, 24, 40, 0.16), 0 4px 12px -4px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 24px 64px -24px rgba(16, 24, 40, 0.32), 0 8px 24px -8px rgba(16, 24, 40, 0.08);
  --ring: 0 0 0 3px rgba(37, 99, 235, 0.14);

  --font-ui: "IBM Plex Sans", "SF Pro Text", -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", "Songti SC", "STSong",
    "Noto Serif SC", "Source Han Serif SC", Georgia, serif;

  --ease: cubic-bezier(0.16, 0.7, 0.2, 1);
}

/* fitgo.css paints the business pages red; re-point every token at the new palette. */
body.fitgo-business {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --bg: #f5f5f5;
  --side: #fbfbfc;
  --side-soft: rgba(37, 99, 235, 0.07);
  --text: #172235;
  --muted: #5b6b80;
  --line: rgba(48, 77, 118, 0.12);
  --danger: #d92d20;
  --ok: #067647;
}

#app {
  --side: #fbfbfc;
  --side-soft: rgba(37, 99, 235, 0.07);
  --bg: #f5f5f5;
  --line: rgba(48, 77, 118, 0.12);
  background: transparent;
}

/* ---------- 2. Base ---------- */
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 480px at 50% -12%, rgba(37, 99, 235, 0.055), transparent 70%),
    radial-gradient(900px 420px at 100% 0%, rgba(37, 99, 235, 0.03), transparent 60%);
  background-attachment: fixed;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(37, 99, 235, 0.18);
  color: var(--text);
}

:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.55);
  outline-offset: 2px;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(48, 77, 118, 0.24) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: rgba(48, 77, 118, 0.22);
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(48, 77, 118, 0.36);
  background-clip: content-box;
}

/* ---------- 3. Buttons ---------- */
.btn,
#app .btn,
#modal .btn,
#confirm .btn,
#login .btn,
#memberDetails .btn,
#workspaceSearch .btn,
.ledger-detail .btn {
  min-height: 34px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease),
    color 0.16s var(--ease), box-shadow 0.16s var(--ease), transform 0.16s var(--ease);
}

.btn:hover,
#app .btn:hover,
#modal .btn:hover,
#confirm .btn:hover,
#login .btn:hover,
#memberDetails .btn:hover,
#workspaceSearch .btn:hover,
.ledger-detail .btn:hover {
  border-color: var(--line-strong);
  background: #fafbfc;
  color: var(--text);
}

.btn:active,
#app .btn:active,
#modal .btn:active,
#confirm .btn:active,
#login .btn:active,
#memberDetails .btn:active,
#workspaceSearch .btn:active,
.ledger-detail .btn:active {
  transform: translateY(1px);
  box-shadow: none;
}

.btn.primary,
#app .btn.primary,
#modal .btn.primary,
#confirm .btn.primary,
#login .btn.primary,
#memberDetails .btn.primary,
#workspaceSearch .btn.primary,
.ledger-detail .btn.primary {
  border-color: var(--primary);
  background: linear-gradient(180deg, #3572ef 0%, #2563eb 55%, #2460dd 100%);
  color: #fff;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn.primary:hover,
#app .btn.primary:hover,
#modal .btn.primary:hover,
#confirm .btn.primary:hover,
#login .btn.primary:hover,
#memberDetails .btn.primary:hover,
#workspaceSearch .btn.primary:hover,
.ledger-detail .btn.primary:hover {
  border-color: var(--primary-dark);
  background: linear-gradient(180deg, #2c68e6 0%, #1d4ed8 100%);
  color: #fff;
}

.btn.ghost,
#app .btn.ghost {
  background: transparent;
  box-shadow: none;
}

.btn.ghost:hover,
#app .btn.ghost:hover {
  background: rgba(23, 34, 53, 0.045);
}

.btn.link,
#app .btn.link,
#modal .btn.link,
#memberDetails .btn.link {
  min-height: 28px;
  padding: 4px 7px;
  border-color: transparent;
  background: transparent;
  color: var(--primary);
  font-size: 12.5px;
  box-shadow: none;
}

.btn.link:hover,
#app .btn.link:hover,
#modal .btn.link:hover,
#memberDetails .btn.link:hover {
  border-color: transparent;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.btn.danger,
#app .btn.danger,
#modal .btn.danger,
#memberDetails .btn.danger {
  border-color: transparent;
  background: transparent;
  color: var(--danger);
  box-shadow: none;
}

.btn.danger:hover,
#app .btn.danger:hover,
#modal .btn.danger:hover,
#memberDetails .btn.danger:hover {
  background: var(--danger-soft);
  color: var(--danger-dark);
}

.btn.danger-solid,
#app .btn.danger-solid,
#confirm .btn.danger-solid {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
  box-shadow: 0 1px 2px rgba(217, 45, 32, 0.25);
}

.btn.danger-solid:hover,
#app .btn.danger-solid:hover,
#confirm .btn.danger-solid:hover {
  border-color: var(--danger-dark);
  background: var(--danger-dark);
  color: #fff;
}

.btn.block,
#login .btn.block {
  width: 100%;
  min-height: 44px;
  padding: 10px;
  border-radius: 10px;
  font-size: 14px;
}

.btn:disabled,
#app .btn:disabled,
#modal .btn:disabled,
#memberDetails .btn:disabled,
.ledger-detail .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.icon-btn,
#app .icon-btn,
#modal .icon-btn,
#confirm .icon-btn,
#workspaceSearch .icon-btn,
#memberDetails .icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}

.icon-btn:hover,
#app .icon-btn:hover,
#modal .icon-btn:hover,
#confirm .icon-btn:hover,
#workspaceSearch .icon-btn:hover,
#memberDetails .icon-btn:hover {
  background: rgba(23, 34, 53, 0.05);
  color: var(--text);
}

/* ---------- 4. Login ---------- */
#login.login-mask {
  padding: 24px;
  background:
    radial-gradient(900px 520px at 18% 8%, rgba(37, 99, 235, 0.10), transparent 62%),
    radial-gradient(760px 480px at 88% 92%, rgba(37, 99, 235, 0.07), transparent 60%),
    linear-gradient(180deg, #fafafa 0%, #f2f3f5 100%);
  overflow: hidden;
}

#login::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(48, 77, 118, 0.10) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 78%);
  pointer-events: none;
}

#login::after {
  content: "";
  position: absolute;
  top: -180px;
  right: -140px;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.14), transparent 66%);
  filter: blur(8px);
  pointer-events: none;
}

#login .login-card {
  position: relative;
  z-index: 1;
  width: min(408px, 100%);
  padding: 42px 38px 32px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.78);
  text-align: center;
  box-shadow: 0 28px 70px -30px rgba(16, 24, 40, 0.34), 0 2px 8px rgba(16, 24, 40, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  backdrop-filter: blur(24px) saturate(1.4);
  animation: theme-card-in 0.45s var(--ease) both;
}

#login .login-logo {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 auto;
  border-radius: 15px;
  background: linear-gradient(140deg, #3b82f6 0%, #2563eb 52%, #1d4ed8 100%);
  color: #fff;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  box-shadow: 0 10px 24px -10px rgba(37, 99, 235, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

#login .login-card h1 {
  margin: 20px 0 6px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

#login .login-sub {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: 0.04em;
}

#login .login-card label {
  margin-bottom: 15px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-align: left;
}

#login .login-card input {
  display: block;
  width: 100%;
  height: 44px;
  margin-top: 7px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease),
    background 0.16s var(--ease);
}

#login .login-card input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: var(--ring);
}

#login .login-error {
  margin: 0 0 12px;
  padding: 8px 11px;
  border: 1px solid rgba(217, 45, 32, 0.16);
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger-dark);
  font-size: 12px;
  text-align: left;
}

#login .login-tip {
  margin-top: 16px;
  color: var(--muted-2);
  font-size: 11px;
}

@keyframes theme-card-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 5. App shell ---------- */
#app .sidebar {
  width: 232px;
  flex: 0 0 232px;
  border-right: 1px solid var(--line);
  background: rgba(252, 252, 253, 0.78);
  color: var(--muted);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
}

#app .brand {
  min-height: 76px;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

#app .brand-mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 11px;
  background: linear-gradient(140deg, #3b82f6 0%, #2563eb 60%, #1d4ed8 100%);
  color: #fff;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  box-shadow: 0 6px 16px -8px rgba(37, 99, 235, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

#app .brand small {
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

#app .menu {
  padding: 14px 12px 24px;
}

#app .workspace-nav-link {
  grid-template-columns: 20px 1fr auto;
  gap: 10px;
  min-height: 42px;
  margin: 0 0 3px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #4b5b70;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.16s var(--ease), color 0.16s var(--ease),
    border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}

#app .workspace-nav-link:hover {
  background: rgba(23, 34, 53, 0.045);
  color: var(--text);
}

#app .workspace-nav-link.active {
  border-color: rgba(37, 99, 235, 0.12);
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.13), rgba(37, 99, 235, 0.055));
  color: var(--primary-dark);
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

#app .workspace-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: currentColor;
  opacity: 0.82;
  font-size: 0;
}

#app .workspace-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

#app .workspace-nav-link.active .workspace-icon {
  opacity: 1;
}

#app .workspace-nav-arrow {
  color: currentColor;
  font-size: 16px;
  opacity: 0.4;
  transition: transform 0.18s var(--ease);
}

#app .workspace-nav-group[open] .workspace-nav-arrow {
  transform: rotate(90deg);
}

#app .workspace-nav-group.active > summary {
  border-color: rgba(37, 99, 235, 0.1);
  background: rgba(37, 99, 235, 0.055);
  color: var(--primary-dark);
  font-weight: 600;
}

#app .workspace-submenu {
  display: grid;
  gap: 1px;
  margin: 4px 0 10px 20px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
  background: transparent;
}

#app .workspace-submenu a {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 8px;
  color: #5b6b80;
  font-size: 12.5px;
  line-height: 1.5;
  text-decoration: none;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}

#app .workspace-submenu a:hover {
  background: rgba(23, 34, 53, 0.045);
  color: var(--text);
}

#app .workspace-submenu a[aria-current],
#app .workspace-submenu a[aria-current="page"] {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary-dark);
  font-weight: 600;
}

/* Collapsed rail */
@media (min-width: 781px) {
  #app.sidebar-collapsed .sidebar {
    width: 76px;
    flex-basis: 76px;
  }

  #app.sidebar-collapsed .brand {
    justify-content: center;
    padding-inline: 0;
  }

  #app.sidebar-collapsed .brand-mark {
    width: 36px;
    height: 36px;
  }

  #app.sidebar-collapsed .workspace-nav-link {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0;
  }

  #app.sidebar-collapsed .workspace-submenu {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }

  #app.sidebar-collapsed .workspace-submenu a {
    padding: 9px 4px;
    font-size: 10.5px;
  }
}

/* Top bar */
#app .topbar {
  height: 64px;
  flex-basis: 64px;
  gap: 12px;
  padding: 0 clamp(18px, 2.6vw, 38px);
  border-bottom: 1px solid var(--line);
  background: rgba(245, 245, 245, 0.8);
  -webkit-backdrop-filter: blur(16px) saturate(1.35);
  backdrop-filter: blur(16px) saturate(1.35);
}

/* 顶栏统一用面包屑显示当前页面，欢迎语不再重复占位 */
#app .fitgo-welcome {
  display: none;
}

#app .crumb {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

#app .crumb span::after {
  margin: 0 8px;
  color: var(--muted-2);
  opacity: 0.6;
}

#app .crumb b {
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

#app .topbar-right {
  gap: 10px;
}

#app .who,
#app .topbar .who {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
}

#app .workspace-find {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: none;
}

#app .workspace-find {
  padding-left: 30px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235b6b80' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
  background-size: 14px 14px;
}

#app .workspace-find::before {
  content: none;
}

#app .workspace-find:hover {
  border-color: var(--line-strong);
  background-color: #fff;
  color: var(--text);
}

#app #workspaceMenuToggle {
  color: var(--muted);
}

/* Page tabs */
#fitgoPageTabs {
  min-height: 52px;
  padding: 8px clamp(18px, 2.6vw, 38px) 0;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  scrollbar-width: none;
}

#fitgoPageTabs::-webkit-scrollbar {
  display: none;
}

#fitgoPageTabs a {
  margin-bottom: 8px;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-bottom: 1px solid transparent;
  border-radius: 9px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.5;
  transition: background 0.16s var(--ease), color 0.16s var(--ease),
    border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}

#fitgoPageTabs a:hover {
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
}

#fitgoPageTabs a[aria-current] {
  border-color: var(--line);
  background: #fff;
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

/* Content */
#app .content,
body.fitgo-business #app .content {
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
  padding: 28px clamp(18px, 3vw, 40px) 48px;
  background: transparent;
}

/* ---------- 6. Page head, cards, stats ---------- */
.page-head {
  align-items: flex-end;
  gap: 16px;
  margin: 2px 0 22px;
}

#app .page-head h2,
.page-head h2 {
  position: relative;
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(24px, 2.2vw, 30px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

#app .page-head h2::after,
.page-head h2::after {
  content: "";
  display: block;
  width: 34px;
  height: 2px;
  margin-top: 10px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--primary), rgba(37, 99, 235, 0.15));
}

.page-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.card {
  padding: 20px 22px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-xs);
}

.card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.card h3::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.stat-grid {
  gap: 16px;
  margin-bottom: 18px;
}

.stat {
  position: relative;
  overflow: hidden;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #fff 0%, #fcfdff 100%);
  box-shadow: var(--shadow-xs);
}

.stat::after {
  content: "";
  position: absolute;
  top: -34px;
  right: -34px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.08), transparent 70%);
  pointer-events: none;
}

.stat .label {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.stat .value {
  margin-top: 8px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.two-col {
  gap: 18px;
}

.workspace-shortcuts {
  gap: 16px;
  margin-bottom: 26px;
}

.workspace-shortcuts a {
  min-height: 96px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease),
    transform 0.18s var(--ease);
}

.workspace-shortcuts a:hover {
  border-color: var(--primary-line);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.shortcut-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 18px;
}

.workspace-shortcuts strong {
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
}

.workspace-shortcuts small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.shortcut-arrow {
  color: var(--muted-2);
  font-size: 18px;
  opacity: 0.6;
}

.workspace-section-title {
  margin: 0 0 12px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.workspace-card-head a {
  color: var(--primary);
  font-size: 12px;
  font-weight: 500;
}

/* ---------- 7. Tables ---------- */
.toolbar {
  gap: 10px;
  margin-bottom: 16px;
}

.toolbar input {
  width: 260px;
  height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  outline: none;
  box-shadow: var(--shadow-xs);
}

.toolbar input:focus {
  border-color: var(--primary);
  box-shadow: var(--ring);
}

#app .table-wrap,
.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-xs);
}

#app table {
  font-size: 13px;
  color: var(--text);
}

#app th {
  padding: 12px 14px;
  border-right: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 251, 253, 0.94);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: left;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

#app td {
  padding: 13px 14px;
  border-right: 0;
  border-bottom: 1px solid rgba(48, 77, 118, 0.08);
  color: #344054;
  font-size: 13px;
  text-align: left;
  vertical-align: middle;
}

#app tbody tr {
  transition: background 0.14s var(--ease);
}

#app tbody tr:hover {
  background: rgba(37, 99, 235, 0.035);
}

#app tbody tr:last-child td {
  border-bottom: 0;
}

#app td.ops {
  background: var(--card);
  white-space: nowrap;
}

#app td.ops .btn + .btn {
  margin-left: 2px;
}

#app td.ops .btn.danger {
  min-height: 28px;
  padding: 4px 7px;
  font-size: 12.5px;
}

#app tbody tr:hover td.ops {
  background: #f7f9ff;
}

#app .member-admin-table td:first-child {
  font-weight: 600;
  color: var(--text);
}

#app .member-admin-table th:last-child,
#app .member-admin-table td.ops {
  position: sticky;
  right: 0;
  box-shadow: -8px 0 12px -12px rgba(16, 24, 40, 0.28);
}

#app .member-admin-table td.row-check {
  position: sticky;
  left: 0;
  background: var(--card);
}

#app .member-admin-table tbody tr:hover td.row-check {
  background: #f7f9ff;
}

#app .head-check,
#app .row-check {
  width: 44px;
  text-align: center;
}

#app .row-check input[type="checkbox"],
#app .head-check input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
  cursor: pointer;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border: 1px solid rgba(37, 99, 235, 0.1);
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
  white-space: nowrap;
}

.pill.off {
  border-color: rgba(48, 77, 118, 0.08);
  background: rgba(48, 77, 118, 0.06);
  color: var(--muted);
}

#app .empty,
.empty {
  padding: 56px 24px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

#app .pager,
.pager {
  gap: 8px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 12.5px;
}

#app .pager .btn,
#modal .pager .btn {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 12.5px;
}

.pager select,
#app .pager select {
  height: 32px;
  padding: 4px 28px 4px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-color: #fff;
  color: var(--text);
  font-size: 12.5px;
}

#app .fitgo-page-number,
.fitgo-page-number {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--primary-line);
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 12.5px;
  font-weight: 600;
}

/* ---------- 8. Forms ---------- */
#app :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea),
#modal :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea),
#login :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea),
#memberDetails :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea),
#workspaceSearch :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea),
.ledger-detail :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea) {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background-color: #fff;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.5;
  outline: none;
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease),
    background 0.16s var(--ease);
}

#app :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea):focus,
#modal :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea):focus,
#login :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea):focus,
#memberDetails :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea):focus,
#workspaceSearch :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea):focus,
.ledger-detail :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea):focus {
  border-color: var(--primary);
  background-color: #fff;
  box-shadow: var(--ring);
}

#app select,
#modal select,
#memberDetails select,
.ledger-detail select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235b6b80' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

#app textarea,
#modal textarea,
#memberDetails textarea {
  min-height: 76px;
  resize: vertical;
}

#app input::placeholder,
#modal input::placeholder,
#login input::placeholder,
#memberDetails input::placeholder,
#workspaceSearch input::placeholder {
  color: var(--muted-2);
}

#app input[type="checkbox"],
#app input[type="radio"],
#modal input[type="checkbox"],
#modal input[type="radio"],
#memberDetails input[type="checkbox"],
#memberDetails input[type="radio"] {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Member list filter card */
.member-admin-filters {
  padding: 16px 18px;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-xs);
}

.member-admin-filters label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

#app .member-admin-filters :is(input, select) {
  min-height: 38px;
  min-width: 170px;
}

/* Modal forms */
#modal .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 18px;
  padding: 22px 24px;
}

#modal .form-grid > .fitgo-form {
  grid-column: 1 / -1;
}

.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.field label .req {
  color: var(--danger);
}

#modal .field :is(input, select, textarea) {
  width: 100%;
  min-height: 38px;
}

.field.wide {
  grid-column: 1 / -1;
}

.card-form-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  grid-column: 1 / -1;
  margin: 6px 0 0;
  padding: 12px 0 8px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.card-form-heading::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
}

/* Fitgo modal form (label / control rows) */
#modal .fitgo-form {
  display: block;
  width: 100%;
}

#modal .fitgo-form-field {
  grid-template-columns: 128px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  margin-bottom: 13px;
  line-height: 1.6;
}

#modal .fitgo-form-field > span:first-child {
  padding-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
}

#modal .fitgo-form-field em {
  margin-right: 3px;
  color: var(--danger);
  font-style: normal;
}

#modal .fitgo-form-field textarea {
  width: 100%;
  min-height: 92px;
  line-height: 1.65;
}

#modal .fitgo-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  min-height: 38px;
}

#modal .fitgo-radios label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}

#modal .fitgo-permission-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 14px;
  padding-top: 8px;
}

#modal .fitgo-permission-options label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 400;
}

#modal .fitgo-image-field {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

#modal .fitgo-image-field img {
  width: 96px;
  height: 86px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafbfc;
  object-fit: contain;
}

#modal .fitgo-image-field input {
  flex: 1;
  min-width: 160px;
}

/* Dashboard / list search bars */
#app .fitgo-search-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafbfc;
}

#app .fitgo-search-form .fitgo-form-field {
  display: flex;
  flex: 0 1 280px;
  align-items: center;
  gap: 8px;
  margin: 0;
  line-height: 1.5;
}

#app .fitgo-search-form .fitgo-form-field > span {
  width: auto;
  padding-top: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

#app .fitgo-search-form .fitgo-form-field :is(input, select) {
  flex: 1;
  min-width: 90px;
  max-width: 220px;
}

#app .fitgo-search-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

#app .fitgo-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}

#app .fitgo-toolbar .fitgo-batch-delete {
  margin-left: auto;
}

#app .fitgo-toolbar .fitgo-batch-delete[hidden] {
  display: none;
}

#app .fitgo-shop-picker {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

#app .fitgo-shop-picker select {
  max-width: 290px;
}

/* ---------- 9. Modals, drawer, command palette, toast ---------- */
#modal.modal-mask {
  padding: 24px;
  background: rgba(15, 23, 42, 0.44);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: theme-fade-in 0.18s var(--ease);
}

#modal .modal {
  width: min(760px, 100%);
  max-height: 88vh;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-xl);
  background: #fff;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: theme-modal-in 0.24s var(--ease);
}

#modal .modal-head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff 0%, #fcfcfd 100%);
}

#modal .modal-head h2 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

#modal .modal-foot {
  gap: 10px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  background: #fafbfc;
}

#confirm.modal-mask {
  background: rgba(15, 23, 42, 0.44);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: theme-fade-in 0.18s var(--ease);
}

#confirm .confirm-card {
  width: min(420px, 100%);
  padding: 26px 26px 20px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-xl);
  background: #fff;
  box-shadow: var(--shadow-lg);
  animation: theme-modal-in 0.24s var(--ease);
}

#confirm .confirm-card h2 {
  margin: 0 0 10px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

#confirm .confirm-card p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

#confirm .confirm-foot {
  gap: 10px;
}

#workspaceSearch {
  width: min(95vw, 560px);
  max-height: 72vh;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-xl);
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

#workspaceSearch::backdrop {
  background: rgba(15, 23, 42, 0.42);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

#workspaceSearch .modal-head {
  padding: 16px 22px 0;
  border: 0;
}

#workspaceSearch .modal-head h2 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
}

#workspaceSearchInput {
  width: calc(100% - 44px);
  height: 46px;
  margin: 14px 22px 8px;
  padding: 8px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  outline: none;
  box-shadow: none;
}

#workspaceSearchInput:focus {
  border-bottom-color: var(--primary);
  box-shadow: none;
}

#workspaceSearchResults {
  display: grid;
  gap: 2px;
  padding: 8px 14px 16px;
  max-height: calc(72vh - 132px);
  overflow: auto;
}

#workspaceSearchResults a {
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.14s var(--ease), color 0.14s var(--ease);
}

#workspaceSearchResults a:hover,
#workspaceSearchResults a:focus-visible {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

#workspaceSearchResults small {
  color: var(--muted);
}

#memberDetails.member-details {
  inset: 0;
  margin: auto;
  width: min(760px, calc(100vw - 48px));
  max-width: calc(100vw - 32px);
  height: fit-content;
  max-height: 88vh;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-xl);
  background: #fff;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

#memberDetails[open] {
  animation: theme-modal-in 0.24s var(--ease);
}

#memberDetails::backdrop {
  background: rgba(15, 23, 42, 0.44);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: theme-fade-in 0.18s var(--ease);
}

#memberDetails .modal-head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff 0%, #fcfcfd 100%);
}

#memberDetails .modal-head h2 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

#memberDetails .member-details-body {
  padding: 0 24px 24px;
}

#memberDetails .member-details-summary {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
}

#memberDetails .member-details-tabs {
  gap: 2px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

#memberDetails .member-details-tabs button {
  padding: 10px 12px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease);
}

#memberDetails .member-details-tabs button:hover {
  color: var(--text);
}

#memberDetails .member-details-tabs button[aria-pressed="true"] {
  border-bottom-color: var(--primary);
  color: var(--primary-dark);
  font-weight: 600;
}

#memberDetails .member-details-fields div {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(48, 77, 118, 0.08);
}

#memberDetails .member-details-fields dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

#memberDetails .member-details-fields dd {
  margin-top: 5px;
  color: var(--text);
  font-size: 13px;
}

.toast {
  top: 22px;
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: #172235;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: theme-toast-in 0.22s var(--ease);
  z-index: 50;
}

.toast.error {
  border-color: rgba(255, 255, 255, 0.16);
  background: var(--danger-dark);
}

@keyframes theme-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes theme-modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes theme-drawer-in {
  from {
    transform: translateX(24px);
    opacity: 0.6;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

@keyframes theme-toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, -6px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* ---------- 10. Fitgo pages ---------- */
#app .fitgo-panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-xs);
  min-height: 330px;
  font-size: 13px;
}

#app .fitgo-inner-tabs {
  display: flex;
  gap: 4px;
  margin: -22px -22px 0;
  border-radius: 16px 16px 0 0;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fcfcfd 0%, #fff 100%);
  overflow-x: auto;
  scrollbar-width: none;
}

#app .fitgo-inner-tabs::-webkit-scrollbar {
  display: none;
}

#app .fitgo-inner-tabs button {
  padding: 15px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease);
}

#app .fitgo-inner-tabs button:hover {
  color: var(--text);
}

#app .fitgo-inner-tabs button.active {
  border-bottom-color: var(--primary);
  color: var(--primary-dark);
  font-weight: 600;
}

#app .fitgo-period {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 16px 4px;
}

#app .fitgo-period > div {
  display: flex;
  gap: 2px;
  margin-right: 10px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafbfc;
}

#app .fitgo-period button:not(.btn) {
  padding: 5px 10px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.14s var(--ease), color 0.14s var(--ease),
    box-shadow 0.14s var(--ease);
}

#app .fitgo-period button:not(.btn):hover {
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

#app .fitgo-period :is(input[type="date"]) {
  height: 34px;
  min-height: 34px;
  padding: 4px 10px;
  font-size: 12.5px;
}

#app .fitgo-metrics {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  margin: 6px 0 22px;
}

#app .fitgo-metric {
  position: relative;
  overflow: hidden;
  padding: 15px 15px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff 0%, #fcfdff 100%);
  color: var(--text);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  user-select: none;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

#app .fitgo-metric:hover {
  transform: translateY(-2px);
  border-color: var(--metric, var(--primary));
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

#app .fitgo-metric.is-active {
  border-color: var(--metric, var(--primary));
  background: #fff;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--metric, var(--primary)) 25%, transparent);
}

#app .fitgo-detail-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8faff;
}

#app .fitgo-detail-bar strong {
  font-size: 14px;
}

#app .fitgo-metric::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: var(--metric, var(--primary));
  opacity: 0.85;
}

#app .fitgo-metric-0 {
  --metric: #2563eb;
}

#app .fitgo-metric-1 {
  --metric: #d97706;
}

#app .fitgo-metric-2 {
  --metric: #dc2626;
}

#app .fitgo-metric-3 {
  --metric: #7c3aed;
}

#app .fitgo-metric-4 {
  --metric: #0d9488;
}

#app .fitgo-metric-5 {
  --metric: #475569;
}

#app .fitgo-metric-6 {
  --metric: #e11d48;
}

#app .fitgo-metric span {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.5;
}

#app .fitgo-metric strong {
  display: block;
  margin: 5px 0 4px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(20px, 1.6vw, 24px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

#app .fitgo-metric small {
  display: block;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.4;
}

#app .btn {
  border-radius: 9px;
}

#app .fitgo-row-more {
  position: relative;
  display: inline-block;
  margin-left: 4px;
  color: var(--muted);
}

#app .fitgo-row-more summary {
  padding: 4px 7px;
  border-radius: 7px;
  color: var(--primary);
  font-size: 12.5px;
  cursor: pointer;
  list-style: none;
}

#app .fitgo-row-more summary:hover {
  background: var(--primary-soft);
}

#app .fitgo-row-more[open] {
  z-index: 6;
}

#app .fitgo-row-more button {
  display: block;
  width: 100%;
  min-width: 108px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font-size: 12.5px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}

#app .fitgo-row-more[open] button {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 7;
  height: auto;
}

#app .fitgo-row-more[open] button:nth-child(3) {
  top: calc(100% + 44px);
}

#app .fitgo-row-more button:hover {
  border-color: rgba(217, 45, 32, 0.2);
  background: var(--danger-soft);
  color: var(--danger-dark);
}

#app .fitgo-calendar {
  border-radius: var(--radius);
}

#app .fitgo-calendar-date {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  color: var(--muted);
}

#app .fitgo-calendar table td {
  height: 172px;
  border-right: 1px solid rgba(48, 77, 118, 0.08);
  vertical-align: top;
  padding: 6px;
}

#app .fitgo-calendar-course {
  width: 100%;
  padding: 8px 9px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s var(--ease), box-shadow 0.14s var(--ease);
}

#app .fitgo-calendar-course:hover {
  background: rgba(37, 99, 235, 0.13);
  box-shadow: var(--shadow-xs);
}

#app .fitgo-calendar-course small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
}

#app .fitgo-config-panel h3 {
  margin: 0 -22px 24px;
  padding: 0 22px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

#app .fitgo-config-footer {
  display: flex;
  gap: 8px;
  padding-left: 140px;
  margin-top: 22px;
}

#app .fitgo-footer {
  padding: 26px 10px 30px;
  background: transparent;
  color: var(--muted-2);
  font-size: 11.5px;
  letter-spacing: 0.04em;
}

/* ---------- 11. Ledger & decoration ---------- */
.ledger-summary {
  gap: 14px;
  margin: 18px 0;
}

.ledger-summary > div {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-xs);
}

.ledger-summary span {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.ledger-summary strong {
  margin-top: 8px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.ledger-note {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}

.ledger-progress {
  padding: 12px 16px;
  border: 1px solid var(--primary-line);
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 12.5px;
  line-height: 1.7;
}

.ledger-pagination {
  gap: 10px;
  margin: 16px 0;
  color: var(--muted);
  font-size: 12.5px;
}

.ledger-detail {
  width: min(720px, 92vw);
  max-height: 86vh;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-xl);
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

.ledger-detail::backdrop {
  background: rgba(15, 23, 42, 0.42);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.diagnostic-json {
  max-height: 52vh;
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  color: #344054;
  font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  overflow: auto;
  overflow-wrap: anywhere;
}

.ledger-loading {
  accent-color: var(--primary);
}

#app .decoration-section {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

#app .decoration-section h4 {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

#app .decoration-phone {
  border: 7px solid #1f2937;
  border-radius: 32px;
  background: #f6f7fa;
  box-shadow: var(--shadow-md);
}

/* ---------- 12. Mini-program settings ---------- */
#app .mini-settings-header h2 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

#app .mini-save-status {
  color: var(--muted);
  font-size: 12.5px;
}

#app .mini-settings-preview,
#app .mini-settings-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-xs);
}

#app .mini-settings-card h3 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

#app .mini-preview-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

#app .mini-image-setting {
  border-top: 1px solid var(--line);
}

#app .mini-shop-field select,
#app .mini-image-setting textarea,
#app .mini-image-setting input[type="text"] {
  border-radius: 9px;
}

/* Douyin cards */
#app .douyin-connect-card,
#app .douyin-query-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-xs);
}

#app .douyin-connect-card h3 {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

#app .douyin-connect-card dt {
  color: var(--muted);
  font-size: 12px;
}

#app .douyin-connect-card dd {
  color: var(--text);
  font-weight: 500;
}

#app .douyin-connect-fields {
  gap: 14px;
}

/* ---------- 13. Responsive ---------- */
@media (max-width: 1180px) {
  #app .fitgo-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  #app .sidebar {
    width: 204px;
    flex-basis: 204px;
  }

  #app .topbar {
    height: 58px;
    flex-basis: 58px;
  }

  #app .content,
  body.fitgo-business #app .content {
    padding: 22px 16px 36px;
  }

  #app .fitgo-panel {
    padding: 18px;
  }

  #app .fitgo-inner-tabs {
    margin: -18px -18px 0;
    padding: 0 18px;
    border-radius: 12px 12px 0 0;
  }
}

@media (max-width: 780px) {
  #login .login-card {
    padding: 34px 26px 26px;
  }

  #login .login-card h1 {
    font-size: 23px;
  }

  #app .sidebar {
    width: 280px;
    flex-basis: 280px;
    border-right: 0;
    background: #fff;
    box-shadow: 0 24px 64px -24px rgba(16, 24, 40, 0.4);
  }

  #app.workspace-menu-open .sidebar {
    display: flex;
  }

  #app .topbar {
    height: 56px;
    flex-basis: 56px;
    padding-inline: 12px;
  }

  #app .topbar-right {
    gap: 6px;
  }

  #app .who {
    display: none;
  }

  #app .workspace-find {
    width: 34px;
    padding: 0;
    background-position: center;
    font-size: 0;
  }

  #fitgoPageTabs {
    min-height: 48px;
    padding: 6px 10px 0;
  }

  #fitgoPageTabs a {
    margin-bottom: 6px;
    padding: 6px 10px;
  }

  #app .content,
  body.fitgo-business #app .content {
    padding: 18px 12px 30px;
  }

  .page-head {
    margin-bottom: 18px;
  }

  #app .page-head h2 {
    font-size: 22px;
  }

  .card {
    padding: 16px;
    border-radius: var(--radius);
  }

  .stat {
    padding: 15px 16px;
  }

  .stat .value {
    font-size: 25px;
  }

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

  .workspace-shortcuts a {
    min-height: 84px;
    padding: 12px;
  }

  #app .fitgo-panel {
    padding: 16px;
    border-radius: var(--radius);
  }

  #app .fitgo-inner-tabs {
    margin: -16px -16px 0;
    padding: 0 12px;
    border-radius: 12px 12px 0 0;
  }

  #app .fitgo-period {
    padding: 14px 0;
  }

  #app .fitgo-period > div {
    margin-right: 0;
  }

  #app .fitgo-search-form {
    padding: 12px;
  }

  #app .fitgo-search-form .fitgo-form-field {
    flex-basis: 100%;
  }

  #app .fitgo-search-form .fitgo-form-field :is(input, select) {
    max-width: none;
  }

  #app .fitgo-search-buttons {
    width: 100%;
    margin-left: 0;
  }

  #app .fitgo-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  #app .fitgo-metric strong {
    font-size: 22px;
  }

  #app .fitgo-config-panel h3 {
    margin-inline: -16px;
    padding-inline: 16px;
  }

  #app .fitgo-config-footer {
    padding-left: 0;
  }

  #app .fitgo-calendar-date {
    flex-wrap: wrap;
  }

  #app .member-admin-filters {
    padding: 14px;
  }

  #app .member-admin-filters :is(input, select) {
    min-width: 0;
    width: 100%;
  }

  #modal.modal-mask {
    padding: 12px;
  }

  #modal .modal {
    max-height: 92vh;
    border-radius: var(--radius-lg);
  }

  #modal .form-grid {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  #modal .fitgo-form-field {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  #modal .fitgo-form-field > span:first-child {
    padding-top: 0;
    text-align: left;
    white-space: normal;
  }

  #modal .fitgo-permission-options {
    grid-template-columns: 1fr;
  }

  #modal .modal-head,
  #modal .modal-foot {
    padding-inline: 18px;
  }

  #memberDetails.member-details {
    width: calc(100vw - 24px);
    max-height: 90vh;
    border-radius: var(--radius-lg);
  }

  #memberDetails .member-details-body {
    padding-inline: 18px;
  }

  .ledger-detail {
    width: min(94vw, 720px);
    padding: 18px;
  }

  .ledger-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toast {
    max-width: calc(100vw - 32px);
    text-align: center;
  }
}

@media (max-width: 480px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-shortcuts {
    grid-template-columns: 1fr;
  }

  #app .page-head h2::after,
.page-head h2::after {
    margin-top: 8px;
  }

  #app .fitgo-metrics {
    grid-template-columns: 1fr;
  }

  .ledger-summary {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

.fitgo-sort-btn {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  white-space: nowrap;
}

.fitgo-sort-btn:hover {
  color: var(--primary);
}

.fitgo-sort-icon {
  font-size: 11px;
  color: var(--muted-2);
  line-height: 1;
}

.fitgo-sort-btn.is-active,
.fitgo-sort-btn.is-active .fitgo-sort-icon {
  color: var(--primary);
  font-weight: 600;
}
