/* SECRETVAULT — 财务会计 · vibe-coding-cn (t99) */
:root {
  /* Airtable-aligned tokens (visual only; not an official brand claim) */
  --primary: #181d26;
  --primary-active: #0d1218;
  --ink: #181d26;
  --body: #333840;
  --muted: #41454d;
  --hairline: #dddddd;
  --border-strong: #9297a0;
  --canvas: #ffffff;
  --surface-soft: #f8fafc;
  --surface-strong: #e0e2e6;
  --surface-dark: #181d26;
  --surface-dark-elevated: #1d1f25;
  --on-primary: #ffffff;
  --on-dark: #ffffff;
  --link: #1b61c9;
  --link-active: #1a3866;
  --info: #254fad;
  --info-border: #458fff;
  --success: #006400;
  --success-border: #39bf45;
  --signature-coral: #aa2d00;
  --signature-forest: #0a2e0e;
  --signature-cream: #f5e9d4;
  --signature-peach: #fcab79;
  --signature-mint: #a8d8c4;
  --signature-yellow: #f4d35e;
  --signature-mustard: #d9a441;

  /* Compat aliases used by existing classes/JS */
  --lime: var(--primary);
  --lime-soft: #41454d;
  --lime-dim: rgba(24, 29, 38, 0.08);
  --lime-glow: rgba(24, 29, 38, 0.18);
  --accent: var(--primary);
  --accent-2: var(--primary-active);
  --accent-gold: var(--signature-mustard);
  --accent-gold-soft: var(--signature-coral);
  --accent-pink: var(--signature-coral);
  --accent-grad: var(--primary);
  --bg-deep: var(--canvas);
  --bg-mid: var(--surface-soft);
  --surface: var(--canvas);
  --text: var(--ink);
  --text-secondary: var(--body);
  --text-muted: var(--muted);
  --glass-bg: var(--canvas);
  --glass-bg-strong: var(--canvas);
  --glass-bg-soft: var(--surface-soft);
  --glass-border: var(--hairline);
  --glass-border-bright: var(--border-strong);
  --glass-highlight: rgba(255, 255, 255, 0.9);
  --glass-blur: 0px;
  --radius-card: 10px;
  --radius-lg: 12px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --radius-pill: 9999px;
  --sidebar-w: 220px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue",
    Arial, sans-serif;
  --shadow-glass: none;
  --shadow-btn: 0 1px 2px rgba(24, 29, 38, 0.08);
  --status-orange: #d97706;
  --status-yellow: #f4d35e;
  --status-green: #39bf45;
  --status-red: #aa2d00;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-deep);
  min-width: 1280px;
  overflow-x: auto;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font-family: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

/* —— Ambient background orbs —— */
.app-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 88% 8%, rgba(243, 232, 255, 0.9), transparent 58%),
    radial-gradient(ellipse 55% 50% at 6% 88%, rgba(252, 231, 243, 0.78), transparent 58%),
    radial-gradient(ellipse 48% 42% at 48% 42%, rgba(224, 231, 255, 0.38), transparent 62%),
    radial-gradient(ellipse 40% 35% at 70% 70%, rgba(255, 228, 240, 0.28), transparent 60%),
    linear-gradient(135deg, #f3eefc 0%, #f8f1fa 45%, #fce8f3 100%);
  overflow: hidden;
}

.app-bg::before,
.app-bg::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
}

.app-bg::before {
  width: 560px;
  height: 560px;
  top: -100px;
  left: 32%;
  background: radial-gradient(circle, rgba(186, 210, 255, 0.28), transparent 70%);
}

.app-bg::after {
  width: 480px;
  height: 480px;
  bottom: -8%;
  right: -60px;
  background: radial-gradient(circle, rgba(255, 200, 220, 0.22), transparent 70%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(59, 130, 246, 0.18);
  opacity: 0.7;
}

.orb-1 {
  width: 380px;
  height: 380px;
  top: 8%;
  right: 12%;
  border-color: rgba(255, 255, 255, 0.06);
}

.orb-2 {
  width: 260px;
  height: 260px;
  bottom: 18%;
  left: 22%;
  border-color: rgba(120, 160, 255, 0.15);
}

.orb-3 {
  width: 180px;
  height: 180px;
  top: 55%;
  right: 35%;
  border-color: rgba(59, 130, 246, 0.1);
}

/* —— Glass primitives —— */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.35);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.35);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass);
  border-radius: var(--radius-card);
  position: relative;
}

.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.55) 0%,
    transparent 42%,
    transparent 100%
  );
  opacity: 0.55;
}

.glass-strong {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(28px) saturate(1.4);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  border: 1px solid var(--glass-border-bright);
  box-shadow: var(--shadow-glass);
  border-radius: var(--radius-lg);
  position: relative;
}

.glass-strong::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.55) 0%,
    transparent 40%
  );
}

.glass-input {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(148, 163, 200, 0.35);
  border-radius: var(--radius-md);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.glass-input:focus {
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.glass-input::placeholder {
  color: var(--text-muted);
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s, opacity 0.2s;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
.btn-primary:disabled:hover,
.btn-primary[disabled]:hover {
  background: var(--accent-grad);
  box-shadow: none;
}

.btn-primary {
  background: var(--accent-grad);
  color: #ffffff;
  box-shadow: var(--shadow-btn);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  box-shadow: 0 8px 28px rgba(59, 130, 246, 0.36);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.65);
  color: var(--text);
  border: 1px solid rgba(148, 163, 200, 0.35);
  backdrop-filter: blur(10px);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(59, 130, 246, 0.35);
}

.btn-outline-lime {
  background: transparent;
  color: var(--lime);
  border: 1px solid rgba(59, 130, 246, 0.55);
}

.btn-outline-lime:hover {
  background: var(--lime-dim);
}

.btn-danger-text {
  background: transparent;
  color: #ff6b7a;
  border: 1px solid rgba(255, 107, 122, 0.25);
  padding: 6px 14px;
  font-size: 13px;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

.btn-xs {
  padding: 4px 12px;
  font-size: 12px;
}

/* —— Views —— */
.view {
  display: none;
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.view.active {
  display: block;
}

/* ===================== LOGIN ===================== */
#view-login {
  position: relative;
  display: none;
  min-height: 100vh;
  flex-direction: column;
}

#view-login.active {
  display: flex;
}

.login-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 40px;
  position: relative;
  z-index: 2;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-grad);
  color: #ffffff;
  font-weight: 800;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.35);
}

.brand-text strong {
  display: block;
  font-size: 15px;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.brand-text span {
  display: block;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.login-topbar-meta {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.login-hero {
  text-align: center;
  margin-top: 56px;
  margin-bottom: 32px;
  position: relative;
  z-index: 2;
}

.login-hero .eyebrow {
  color: var(--lime);
  font-size: 12px;
  letter-spacing: 0.28em;
  font-weight: 700;
  margin-bottom: 10px;
}

.login-hero h1 {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.login-hero p {
  color: var(--text-secondary);
  font-size: 14px;
}

.login-card-wrap {
  display: flex;
  justify-content: center;
  padding: 0 24px 60px;
  position: relative;
  z-index: 2;
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 460px;
  padding: 28px 32px 30px;
  overflow: hidden;
  border-radius: 22px;
}

.login-card-ring {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 1px solid rgba(59, 130, 246, 0.18);
  top: -70px;
  right: -60px;
  pointer-events: none;
}

.login-card-ring::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  border: 1px solid rgba(59, 130, 246, 0.08);
}

.login-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  position: relative;
  z-index: 1;
}

.portal-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  font-weight: 500;
}

.login-badge {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(59, 130, 246, 0.55);
  color: var(--lime);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(59, 130, 246, 0.06);
  white-space: nowrap;
}

.portal-tag .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 8px var(--lime-glow);
}

.login-card h2 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}

.login-card .sub {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.field {
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}

.field .req,
.field label .req {
  color: #ff4d4f;
  font-weight: 700;
}

.input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: 48px;
}

.input-wrap .icon {
  color: var(--text-muted);
  flex-shrink: 0;
  display: flex;
}

.input-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 14px;
  height: 100%;
}

.input-wrap .show-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 6px;
}

.input-wrap .show-btn:hover {
  color: var(--lime);
}

.login-actions {
  margin-top: 10px;
  position: relative;
  z-index: 1;
}

.login-actions .btn-primary,
.login-actions .btn-login {
  width: 100%;
  height: 50px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(59, 130, 246, 0.35), 0 0 0 1px rgba(59, 130, 246, 0.12);
}

.login-actions .btn-login:hover {
  box-shadow: 0 12px 32px rgba(59, 130, 246, 0.42), 0 0 0 1px rgba(59, 130, 246, 0.18);
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 16px;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.12em;
  position: relative;
  z-index: 1;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(148, 163, 200, 0.35);
}

.login-actions .btn-ghost {
  width: 100%;
  height: 44px;
}

.login-secure {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
}

.login-secure .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
}

/* ===================== APP SHELL ===================== */
#view-app {
  display: none;
  min-height: 100vh;
}

#view-app.active {
  display: flex;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  margin: 16px 0 16px 16px;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 32px);
  position: sticky;
  top: 16px;
  z-index: 3;
  overflow: hidden;
}

.sidebar-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  position: relative;
  z-index: 1;
}

.sidebar-scroll::-webkit-scrollbar {
  width: 4px;
}
.sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.25);
  border-radius: 4px;
}

.placeholder-panel {
  padding: 28px 32px;
  position: relative;
  z-index: 1;
}
.placeholder-panel h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}
.placeholder-panel p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.erp-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  background: var(--accent-grad);
  color: #ffffff;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--shadow-btn);
  position: relative;
  z-index: 1;
}

.sidebar-brand {
  text-align: center;
  margin: 12px 0 22px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  position: relative;
  z-index: 1;
}

.nav-group {
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}

.nav-group-title {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  padding: 0 12px 8px;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  background: transparent;
  width: 100%;
  text-align: left;
}

.nav-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-item:hover {
  background: rgba(59, 130, 246, 0.06);
  color: var(--text);
}

.nav-item.active {
  background: rgba(59, 130, 246, 0.12);
  border-color: transparent;
  color: var(--lime);
  box-shadow: none;
}

.nav-item.active svg {
  opacity: 1;
  color: var(--lime);
}

.sidebar-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(148, 163, 200, 0.28);
  position: relative;
  z-index: 1;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  border: 1px solid rgba(59, 130, 246, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #ffffff;
  flex-shrink: 0;
}

.avatar.sm {
  width: 32px;
  height: 32px;
  font-size: 13px;
}

.user-meta strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.user-meta span {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 16px 20px 20px 16px;
  position: relative;
  z-index: 2;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px 16px;
}

.breadcrumb {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 200, 0.35);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-btn:hover {
  border-color: rgba(59, 130, 246, 0.4);
  color: var(--lime);
}

.page {
  display: none;
  flex: 1;
  flex-direction: column;
  gap: 18px;
  position: relative;
}

.page.active {
  display: flex;
}

.page-head .eng {
  color: var(--lime);
  font-size: 11px;
  letter-spacing: 0.22em;
  font-weight: 700;
  margin-bottom: 6px;
}

.page-head h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-head .desc {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 6px;
}

.greeting .date {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.greeting h1 {
  font-size: 28px;
  font-weight: 700;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.stat-card {
  padding: 20px 20px 18px;
  overflow: hidden;
  min-height: 118px;
}

.stat-card .stat-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  z-index: 1;
}

.stat-card .label {
  font-size: 13px;
  color: var(--text-secondary);
}

.stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--lime-dim);
  border: 1px solid rgba(59, 130, 246, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--lime);
}

.stat-card .value {
  font-size: 36px;
  font-weight: 700;
  margin-top: 14px;
  letter-spacing: -0.03em;
  position: relative;
  z-index: 1;
}

.stat-card .deco {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.05);
  right: -20px;
  bottom: -40px;
  pointer-events: none;
}

.stat-card .deco::after {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  border: 1px solid rgba(59, 130, 246, 0.06);
}

/* Chart panel */
.chart-panel {
  padding: 20px 22px 24px;
  flex: 1;
  min-height: 280px;
}

.chart-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}

.chart-toolbar h3 {
  font-size: 16px;
  font-weight: 600;
  margin-right: 8px;
}

.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: rgba(240, 242, 248, 0.9);
  border: 1px solid rgba(148, 163, 200, 0.3);
  gap: 2px;
}

.seg button {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-weight: 500;
}

.seg button.active {
  background: var(--accent-grad);
  color: #ffffff;
  font-weight: 700;
}

.date-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.date-field input {
  height: 34px;
  padding: 0 12px;
  width: 140px;
  font-size: 12px;
}

.chart-area {
  position: relative;
  z-index: 1;
  height: 200px;
  margin-top: 8px;
  cursor: crosshair;
}

.chart-area svg {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-empty-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  pointer-events: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  line-height: 1.5;
  white-space: nowrap;
  z-index: 2;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 12px;
}

.chart-empty-hint[hidden] {
  display: none !important;
}

.chart-tooltip {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  min-width: 96px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(28, 32, 48, 0.92);
  color: #fff;
  font-size: 12px;
  line-height: 1.45;
  box-shadow: 0 8px 24px rgba(20, 24, 40, 0.22);
  transform: translate(-50%, calc(-100% - 10px));
  white-space: nowrap;
}

.chart-tooltip[hidden] {
  display: none !important;
}

.chart-tooltip .tip-date {
  opacity: 0.78;
  font-size: 11px;
  margin-bottom: 2px;
}

.chart-tooltip .tip-value {
  font-weight: 700;
  font-size: 13px;
}

.chart-tooltip .tip-value em {
  font-style: normal;
  color: #c4b5fd;
  margin-left: 4px;
}

/* Table / filter panels */
.panel {
  padding: 18px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.panel-toolbar h3 {
  font-size: 16px;
  font-weight: 600;
  margin-right: auto;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  min-width: 260px;
  flex: 1;
  max-width: 360px;
}

.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13px;
}

.search-box svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.table-wrap {
  position: relative;
  z-index: 1;
  overflow: auto;
  flex: 1;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 200, 0.22);
  background: rgba(255, 255, 255, 0.55);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.data th {
  text-align: left;
  padding: 12px 14px;
  color: var(--text-muted);
  font-weight: 500;
  border-bottom: 1px solid rgba(148, 163, 200, 0.22);
  white-space: nowrap;
  background: rgba(248, 249, 253, 0.85);
}

table.data td {
  padding: 14px;
  border-bottom: 1px solid rgba(148, 163, 200, 0.14);
  color: var(--text-secondary);
  vertical-align: middle;
}

table.data tr:last-child td {
  border-bottom: none;
}

table.data tr:hover td {
  background: rgba(59, 130, 246, 0.04);
}

.empty-cell {
  text-align: center !important;
  padding: 64px 20px !important;
  color: var(--text-muted) !important;
  font-size: 14px;
}

.panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
  gap: 10px;
}

.pager {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pager .page-num {
  min-width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--lime-dim);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--lime);
  font-weight: 600;
  font-size: 12px;
}

.thumb {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 11px;
}

.ops {
  display: flex;
  gap: 6px;
}

.ops-order {
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  max-width: 280px;
}
/* 订单管理 / 已发订单：列表显示方式与客户昵称列一致（整表居中） */
#page-orders table.data th,
#page-orders table.data td,
#orders-table th,
#orders-table td,
#page-fulfillment table.data th,
#page-fulfillment table.data td,
#fulfillment-table th,
#fulfillment-table td {
  text-align: center !important;
  vertical-align: middle;
}
#page-orders table.data td .ops,
#page-orders table.data td .ops-order,
#page-fulfillment table.data td .ops,
#page-fulfillment table.data td .ops-order {
  justify-content: center;
  margin-inline: auto;
}


.ops-order .btn-xs {
  border-radius: 999px;
  padding: 0 10px;
  min-height: 28px;
}
.ops-danger,
.btn-danger-outline {
  color: #e5484d !important;
  border-color: rgba(229, 72, 77, 0.4) !important;
  background: rgba(229, 72, 77, 0.06) !important;
}
.ops-danger:hover,
.btn-danger-outline:hover {
  background: rgba(255, 80, 80, 0.18) !important;
  border-color: rgba(255, 140, 140, 0.55) !important;
  color: #d9363e !important;
}

.price {
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.select-glass {
  height: 38px;
  padding: 0 32px 0 14px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='rgba(92,101,120,0.7)' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  font-size: 13px;
  min-width: 160px;
  cursor: pointer;
}

.select-glass option {
  background: #ffffff;
  color: var(--text);
}

/* Utility */
.ml-auto {
  margin-left: auto;
}

.gap-sm {
  gap: 8px;
}

.hide {
  display: none !important;
}

@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}
.blob-a {
  width: 420px;
  height: 420px;
  top: 12%;
  left: 18%;
  background: rgba(90, 140, 255, 0.35);
}
.blob-b {
  width: 360px;
  height: 360px;
  top: 28%;
  right: 10%;
  background: rgba(59, 130, 246, 0.18);
}
.blob-c {
  width: 480px;
  height: 480px;
  bottom: -80px;
  left: 40%;
  background: rgba(99, 140, 250, 0.22);
}

/* —— Order detail —— */
.order-link {
  color: var(--lime);
  font-weight: 600;
  border-bottom: 1px solid rgba(59, 130, 246, 0.35);
  transition: opacity 0.15s;
}
.order-link:hover {
  opacity: 0.85;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.detail-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.detail-head-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}

.status-pending {
  color: var(--lime);
  background: var(--lime-dim);
  border-color: rgba(59, 130, 246, 0.35);
}

.status-done {
  color: #2f6fed;
  background: rgba(91, 141, 239, 0.12);
  border-color: rgba(91, 141, 239, 0.35);
}

.lime-text {
  color: var(--lime) !important;
}

.mono {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.detail-info-card,
.detail-summary-card {
  padding: 20px 22px;
}

.detail-section-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 20px;
  position: relative;
  z-index: 1;
}

.info-grid .span-2 {
  grid-column: 1 / -1;
}

.info-grid dt {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.info-grid dd {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

.amount-list {
  list-style: none;
  position: relative;
  z-index: 1;
}

.amount-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
  color: var(--text-secondary);
}

.amount-list li.total {
  border-bottom: none;
  padding-top: 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.detail-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
}

.detail-note .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 8px var(--lime-glow);
}

.product-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-foot-actions {
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  width: 100%;
}
#page-order-detail .panel-foot.detail-foot-actions {
  justify-content: flex-start;
  text-align: left;
}

@media (max-width: 1200px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

/* 订单详情：基本信息平铺（无金额摘要） */
.detail-grid-flat {
  grid-template-columns: 1fr;
}
/* 首行：订单号 + 创建者 + 创建时间；标题下不再重复订单号 */
.detail-info-card > .detail-section-title {
  margin: 0 0 16px;
}
.detail-info-card .info-row-first {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px 28px;
  align-items: start;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}
.detail-info-card .info-row-first dt {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.detail-info-card .info-row-first dd {
  font-size: 15px;
  font-weight: 600;
  min-height: 28px;
  color: var(--text);
}
.detail-info-card .info-row-first dd.mono {
  font-weight: 700;
  letter-spacing: 0.02em;
}
.detail-info-card .info-grid-flat {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 28px;
  /* 行2: 昵称|收件人；行3: 地址独占；行4: 地区|金额 */
}
.detail-info-card .info-grid-flat > .span-all,
.detail-info-card .info-grid-flat > .span-2 {
  grid-column: 1 / -1;
}
.info-grid-flat dt {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.info-grid-flat dd {
  font-size: 15px;
  font-weight: 600;
  min-height: 28px;
}
.info-grid-flat dd.mono {
  font-weight: 700;
  letter-spacing: 0.02em;
}
.info-grid-flat .info-total dd.price {
  color: var(--lime);
  font-size: 18px;
  font-weight: 700;
}
#page-order-detail.order-edit-mode .info-grid-flat .detail-edit-input {
  min-height: 42px;
  border-radius: 14px;
}
#page-order-detail.order-edit-mode .info-total .detail-edit-input {
  color: var(--lime);
  font-weight: 700;
  font-size: 16px;
}
.detail-order-remark {
  margin: 14px 18px 6px;
  max-width: 520px;
  text-align: left;
}
.detail-remark-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.detail-remark-input {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  line-height: 1.45;
  padding: 10px 12px;
  font-size: 13px;
}
#page-order-detail:not(.order-edit-mode) .detail-remark-input {
  background: rgba(255,255,255,0.03);
  cursor: default;
}



/* Scoped toast：挂在当前页或打开的弹窗内 */
.app-toast {
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
  max-width: min(420px, calc(100% - 24px));
  text-align: center;
  backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: 0 12px 40px rgba(90, 110, 170, 0.18);
  pointer-events: none;
  white-space: pre-wrap;
  word-break: break-word;
}
.app-toast[hidden] {
  display: none !important;
}
.app-toast.is-in-page {
  position: absolute;
  left: 50%;
  top: 10px;
  transform: translateX(-50%);
  z-index: 40;
}
.app-toast.is-in-login {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 40;
}
.app-toast.is-in-modal {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 60;
}
.voucher-preview-stage > .app-toast.is-in-modal {
  bottom: 18px;
  z-index: 80;
}


/* Product modals */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-root[hidden] { display: none !important; }
.modal-nested { z-index: 1300; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 36, 51, 0.35);
  backdrop-filter: blur(6px);
}
.modal {
  position: relative;
  width: min(560px, 100%);
  max-height: min(90vh, 820px);
  overflow: auto;
  border-radius: 22px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.95);
  padding: 18px 18px 16px;
  box-shadow: 0 24px 64px rgba(80, 100, 160, 0.18);
}
.modal-sm { width: min(420px, 100%); }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.modal-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}
.modal-close {
  font-size: 22px;
  line-height: 1;
  width: 32px;
  height: 32px;
}
.modal-body .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.modal-body .field > span {
  font-size: 12px;
  color: var(--text-secondary);
}
.modal-body .glass-input,
.modal-body .select-glass {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: rgba(248, 249, 253, 0.92);
  color: var(--text);
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.currency-block { margin: 4px 0 14px; }
.currency-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.currency-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: rgba(248, 249, 253, 0.85);
  font-size: 13px;
}
.image-block {
  margin-top: 4px;
  padding-top: 4px;
}
.image-block-title {
  font-size: 13px;
  margin-bottom: 10px;
}
.image-block-title .muted {
  color: var(--text-muted);
  font-size: 12px;
}
.image-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px dashed rgba(148, 163, 200, 0.45);
  border-radius: 12px;
}
.image-add {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  border: 1px dashed rgba(59,130,246,0.5);
  display: grid;
  place-items: center;
  color: var(--lime);
  font-size: 28px;
  background: rgba(59,130,246,0.06);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}
.image-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.image-note {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 200, 0.28);
}
.col-check { width: 36px; text-align: center; }
.col-check input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  cursor: pointer;
  vertical-align: middle;
}
.page-jump {
  width: 42px;
  height: 28px;
  text-align: center;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(248, 249, 253, 0.9);
  color: var(--text);
}
.thumb-img {
  background: radial-gradient(circle at 30% 30%, #a78bfa, #2563eb 70%);
}

.cat-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
  margin-bottom: 4px;
}
.btn-danger-outline {
  background: transparent;
  color: #ff6b6b;
  border: 1px solid rgba(255, 107, 107, 0.65);
}
.btn-danger-outline:hover {
  background: rgba(255, 107, 107, 0.12);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

button.image-add {
  cursor: pointer;
  font: inherit;
}
.thumb.has-photo {
  background-color: transparent;
}

.batch-hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}
#cf-custom-country-wrap[hidden] { display: none !important; }

.price-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  text-align: center;
  width: 100%;
}
.price-line {
  white-space: nowrap;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}
a.btn {
  text-decoration: none;
  box-sizing: border-box;
}

.price-stack-vertical {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: center;
  gap: 4px;
  text-align: center;
  width: 100%;
}
.price-stack-vertical .price-line {
  display: block;
  width: 100%;
  text-align: center;
}
#products-table td.price,
#display-table td.price {
  text-align: center;
  vertical-align: middle;
}

/* 商品管理 / 商品展示：列表 th/td 全部居中（覆盖全局 table.data th left） */
#page-products table.data th,
#page-products table.data td,
#page-display table.data th,
#page-display table.data td,
#products-table th,
#products-table td,
#display-table th,
#display-table td {
  text-align: center !important;
  vertical-align: middle;
}
#page-products table.data .price-stack,
#page-products table.data .price-stack-vertical,
#page-products table.data .price-line,
#page-display table.data .price-stack,
#page-display table.data .price-stack-vertical,
#page-display table.data .price-line {
  text-align: center !important;
  align-items: center !important;
}
#page-products table.data td .thumb-wrap,
#page-display table.data td .thumb-wrap,
#products-table td .thumb-wrap,
#display-table td .thumb-wrap {
  margin: 0 auto;
  display: flex;
  justify-content: center;
}
#page-products table.data td .ops,
#page-products table.data td .row-actions,
#products-table td .ops,
#products-table td .row-actions {
  justify-content: center;
}
.thumb-wrap {
  position: relative;
  width: 50px;
  height: 50px;
}
.thumb.thumb-product {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}
.thumb.thumb-product[data-preview-image] {
  cursor: zoom-in;
}
.thumb-zoom {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.thumb-zoom::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 1.5px solid #fff;
  border-radius: 50%;
  box-shadow: 5px 5px 0 -7px #fff;
  transform: translate(-1px, -1px);
}
.thumb.thumb-product:hover .thumb-zoom,
.thumb.thumb-product:focus .thumb-zoom {
  opacity: 1;
}
.image-lightbox {
  position: relative;
  z-index: 2;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-lightbox-frame {
  position: relative;
  width: 500px;
  height: 500px;
  max-width: min(500px, 90vw);
  max-height: min(500px, 90vw);
}
.image-lightbox img {
  width: 100%;
  height: 100%;
  max-width: 500px;
  max-height: 500px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.image-lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  backdrop-filter: blur(4px);
}
.image-lightbox-close:hover {
  background: rgba(0, 0, 0, 0.55);
}
.currency-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
}
.currency-meta {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  min-width: 0;
  flex: 1;
  text-align: left;
}
.currency-meta strong {
  text-align: left;
  white-space: nowrap;
}
.currency-prices {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap;
  align-items: center !important;
  gap: 8px 16px !important;
  text-align: left !important;
  width: auto !important;
}
.currency-prices .price-line {
  width: auto !important;
  text-align: left !important;
  display: inline-block;
}
.currency-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
#pf-currency-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#pf-currency-list > li {
  list-style: none;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}

.module-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
}
.check-pill input {
  accent-color: var(--lime);
}
.mf-shop-item,
.mf-cat-item {
  padding-right: 6px;
  gap: 4px;
}
.mf-shop-label,
.mf-cat-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.mf-shop-remove,
.mf-cat-remove {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  padding: 0;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.55;
}
.mf-shop-remove:hover,
.mf-cat-remove:hover {
  opacity: 1;
  color: #ff7b7b;
  border-color: rgba(255, 107, 122, 0.35);
  background: rgba(255, 80, 80, 0.12);
}
.modules-cell {
  max-width: 220px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.pass-cell {
  white-space: nowrap;
  color: var(--text);
  font-size: 13px;
  letter-spacing: 0.02em;
}
.pass-cell .pass-text {
  margin-right: 4px;
}

.user-menu {
  position: relative;
}
.user-menu-trigger {
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 0;
  color: inherit;
}
.sidebar-foot-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border-radius: 12px;
  padding: 6px;
}
.sidebar-foot-btn:hover {
  background: rgba(59, 130, 246, 0.08);
}
.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 140px;
  padding: 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(148, 163, 200, 0.35);
  box-shadow: 0 12px 30px rgba(90, 110, 170, 0.16);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.user-menu-dropdown[hidden] {
  display: none !important;
}
.user-menu-dropdown.side {
  top: auto;
  bottom: calc(100% + 8px);
  left: 0;
  right: auto;
}
.user-menu-item {
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.user-menu-item:hover {
  background: rgba(59, 130, 246, 0.12);
}
.user-menu-item.danger {
  color: #e5484d;
}
#topbar-avatar {
  display: inline-flex;
}


.category-mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.mf-cat-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}
.mf-cat-add-row .glass-input {
  flex: 1;
  min-width: 0;
}
.categories-cell,
.shops-cell {
  max-width: 180px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}


.scope-banner {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.08);
  color: var(--lime);
  font-size: 12px;
  font-weight: 600;
}


/* Native dialog — 新建订单：视口居中 + 圆角玻璃 */
.order-dialog {
  border: none;
  padding: 0;
  background: transparent;
  max-width: calc(100vw - 32px);
  width: fit-content;
  height: fit-content;
  max-height: calc(100vh - 32px);
  margin: 0;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1400;
}
.order-dialog:modal {
  margin: 0;
}
.order-dialog::backdrop {
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgba(59, 130, 246, 0.12), transparent 65%),
    rgba(30, 36, 51, 0.32);
  backdrop-filter: blur(10px) saturate(1.15);
  -webkit-backdrop-filter: blur(10px) saturate(1.15);
}
.order-dialog .order-dialog-panel.modal,
.order-dialog .order-dialog-panel {
  position: relative;
  margin: 0;
  width: min(400px, calc(100vw - 32px));
  max-height: min(90vh, 820px);
  overflow: hidden;
  padding: 24px 24px 20px;
  border-radius: 28px;
  border: 1px solid rgba(148, 163, 200, 0.35);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  box-shadow:
    0 24px 64px rgba(80, 100, 160, 0.18),
    0 0 0 1px rgba(59, 130, 246, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.order-dialog .order-dialog-panel::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.2) 0%,
    transparent 40%,
    transparent 100%
  );
  opacity: 0.85;
}
.order-dialog .modal-head {
  position: relative;
  z-index: 1;
  margin-bottom: 18px;
}
.order-dialog .modal-head h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.order-dialog .modal-close {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(248, 249, 253, 0.95);
  border: 1px solid rgba(148, 163, 200, 0.35);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.order-dialog .modal-close:hover {
  background: rgba(59, 130, 246, 0.08);
  color: var(--lime);
  border-color: rgba(59, 130, 246, 0.35);
}
.order-dialog .modal-body {
  position: relative;
  z-index: 1;
}
.order-dialog .modal-body .field {
  position: relative;
  gap: 8px;
  margin-bottom: 14px;
}
.order-dialog .modal-body .field > span {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}
.order-dialog .modal-body .glass-input {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 200, 0.35);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.order-dialog .modal-body .glass-input:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow:
    0 0 0 3px rgba(59, 130, 246, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.order-dialog .modal-body .glass-input[readonly] {
  color: var(--text-secondary);
  background: rgba(248, 249, 253, 0.95);
  border-style: dashed;
  cursor: default;
}
.order-dialog .modal-foot {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 200, 0.28);
}
.order-dialog .modal-foot .btn {
  min-height: 38px;
  min-width: 96px;
  padding: 0 18px;
  border-radius: 999px;
}
.order-dialog[hidden] {
  display: none !important;
}


/* 操作列居中（与客户昵称列同显示方式，见上方订单/已发整表居中） */
.ops-order {
  justify-content: center;
  margin: 0 auto;
}
#page-order-detail.order-edit-mode .detail-title-row h1::after {
  content: " · 编辑";
  color: var(--lime);
  font-size: 0.85em;
  font-weight: 600;
}
#page-order-detail .detail-edit-input {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 200, 0.35);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text);
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
#page-order-detail.order-edit-mode .amount-list .detail-edit-input {
  width: 160px;
  text-align: right;
}
#page-order-detail.order-edit-mode .info-grid dd {
  min-width: 0;
}

/* 编辑：隐藏金额摘要，基本信息单栏平铺 */
#page-order-detail.order-edit-mode .detail-summary-card {
  display: none;
}
#page-order-detail.order-edit-mode .detail-grid {
  grid-template-columns: 1fr;
}
#page-order-detail .info-grid-flat {
  gap: 18px 28px;
}
#page-order-detail .info-grid-flat dt {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
#page-order-detail.order-edit-mode .detail-edit-input.price,
#page-order-detail.order-edit-mode .detail-edit-input.lime-text {
  color: var(--lime, #3b82f6);
  font-weight: 600;
}

#page-order-detail .detail-edit-input:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

/* 编辑订单：详情同构大弹层（盖过通用 panel 400px） */
.order-dialog .order-edit-panel {
  width: min(1100px, calc(100vw - 48px));
  max-height: min(94vh, 960px);
  overflow: hidden;
  padding: 22px 24px 18px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
#modal-edit-order.order-dialog,
#modal-edit-order {
  width: min(1100px, calc(100vw - 48px)) !important;
  max-width: calc(100vw - 48px) !important;
}
#modal-edit-order .order-edit-panel.order-dialog-panel,
#modal-edit-order .order-edit-panel.modal,
#modal-edit-order .order-edit-panel {
  width: min(1100px, calc(100vw - 48px)) !important;
  max-width: calc(100vw - 48px) !important;
  max-height: min(94vh, 960px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
#modal-edit-order .modal-head {
  flex-shrink: 0;
}
#modal-edit-order .modal-body.edit-sections {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
#modal-edit-order .edit-items-wrap {
  overflow-x: visible;
  overflow-y: auto;
  /* 压低明细高度，保证弹窗默认可见下方备注 */
  max-height: min(22vh, 200px);
}
#modal-edit-order .edit-items-wrap table.data {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}
#modal-edit-order .edit-items-wrap table.data th:nth-child(1),
#modal-edit-order .edit-items-wrap table.data td:nth-child(1) { width: 14%; }
#modal-edit-order .edit-items-wrap table.data th:nth-child(2),
#modal-edit-order .edit-items-wrap table.data td:nth-child(2) { width: 10%; }
#modal-edit-order .edit-items-wrap table.data th:nth-child(3),
#modal-edit-order .edit-items-wrap table.data td:nth-child(3) { width: 30%; }
#modal-edit-order .edit-items-wrap table.data th:nth-child(4),
#modal-edit-order .edit-items-wrap table.data td:nth-child(4) { width: 16%; }
#modal-edit-order .edit-items-wrap table.data th:nth-child(5),
#modal-edit-order .edit-items-wrap table.data td:nth-child(5) { width: 12%; }
#modal-edit-order .edit-items-wrap table.data th:nth-child(6),
#modal-edit-order .edit-items-wrap table.data td:nth-child(6) { width: 18%; }
#modal-edit-order .edit-order-remark {
  margin: 12px 0 0;
  flex-shrink: 0;
}
#modal-edit-order .modal-foot {
  flex-shrink: 0;
  margin-top: 12px;
}
#modal-edit-order #eof-region-hint {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.4;
}
.order-edit-panel .edit-sections {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  z-index: 1;
}
.order-edit-panel .edit-section {
  border: 1px solid rgba(148, 163, 200, 0.28);
  border-radius: 18px;
  background: rgba(248, 249, 253, 0.85);
  padding: 14px 16px 8px;
}
.order-edit-panel .edit-section-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}
.order-edit-panel .edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}
.order-edit-panel .edit-grid .field.span-2 {
  grid-column: 1 / -1;
}
.order-edit-panel .edit-amount-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.order-edit-panel .edit-amount-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}
.order-edit-panel .edit-amount-list li.total {
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 200, 0.28);
  font-weight: 600;
}
.order-edit-panel .edit-amount-list .glass-input {
  width: 160px;
  min-height: 36px;
  text-align: right;
}
.order-edit-panel .edit-items-wrap {
  overflow-x: visible;
  overflow-y: auto;
  border-radius: 12px;
}
.order-edit-panel .edit-items-wrap table.data {
  margin: 0;
  width: 100%;
  table-layout: fixed;
}
.order-edit-panel .edit-items-wrap .glass-input {
  min-height: 34px;
  width: 100%;
}

/* 添加商品弹窗固定 1100×600 */
#modal-add-order-item .order-edit-panel {
  width: min(1100px, calc(100vw - 32px));
  height: 600px;
  max-height: min(600px, 92vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}
#modal-add-order-item .order-edit-panel .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#modal-add-order-item .add-item-list-wrap {
  flex: 1 1 auto;
  max-height: none;
  min-height: 0;
}

/* 订单详情：添加商品选择器 */
.add-item-toolbar {
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.add-item-toolbar .search-box {
  flex: 1 1 220px;
  min-width: 180px;
}
#modal-add-order-item [data-add-product-id].is-added,
#modal-add-order-item [data-add-product-id]:disabled {
  opacity: 0.7;
  cursor: default;
}
.add-item-list-wrap {
  max-height: min(52vh, 420px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
}
#page-order-detail .panel-toolbar #btn-add-order-item {
  margin-left: auto;
}
#page-order-detail.order-edit-mode .detail-items-table .qty-edit {
  width: 72px;
  min-height: 34px;
  text-align: center;
  border-radius: 10px;
}


/* 其它头栏按钮的 [hidden] 仍需压过 .btn 的 display */
.detail-head-actions > [hidden] {
  display: none !important;
}

#page-order-detail.order-edit-mode .detail-items-table .line-edit {
  width: 8.5rem;
  text-align: center;
  margin: 0 auto;
  display: block;
}
#page-order-detail .detail-items-table td .thumb-wrap {
  display: inline-flex;
}
#page-order-detail .detail-items-table .thumb-product {
  width: 40px;
  height: 40px;
}

#page-order-detail .detail-items-table th,
#page-order-detail .detail-items-table td {
  text-align: center;
  vertical-align: middle;
}
#page-order-detail .detail-items-table td .thumb-wrap {
  margin: 0 auto;
  display: flex;
  justify-content: center;
}

#modal-currency .modal-foot-currency {
  justify-content: flex-end;
  gap: 10px;
}

#page-order-detail .detail-region-select {
  width: 100%;
  max-width: 240px;
  min-height: 36px;
}
#page-order-detail .detail-region-price {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.4;
}




.order-edit-panel .edit-grid-detail {
  display: grid;
  /* 6 列锁死四行：避免 3 列时行2空第三格把地址挤乱 */
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px 14px;
}
/* 行1：订单号 | 创建者 | 创建时间 — 各占 2 列 */
.order-edit-panel .edit-grid-detail > .field:nth-child(1),
.order-edit-panel .edit-grid-detail > .field:nth-child(2),
.order-edit-panel .edit-grid-detail > .field:nth-child(3) {
  grid-column: span 2;
}
/* 行2：客户昵称 | 收件人 — 各占 3 列 */
.order-edit-panel .edit-grid-detail > .field:nth-child(4),
.order-edit-panel .edit-grid-detail > .field:nth-child(5) {
  grid-column: span 3;
}
/* 行3：收件地址 — 整行 */
.order-edit-panel .edit-grid-detail > .field.span-all,
.order-edit-panel .edit-grid-detail > .field.span-2,
.order-edit-panel .edit-grid-detail > .field:nth-child(6) {
  grid-column: 1 / -1;
}
/* 行4：选择地区 | 订单金额 — 各占 3 列 */
.order-edit-panel .edit-grid-detail > .field:nth-child(7),
.order-edit-panel .edit-grid-detail > .field:nth-child(8) {
  grid-column: span 3;
}
.order-edit-panel .edit-items-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.order-edit-panel .edit-items-toolbar .edit-section-title {
  margin: 0;
}
.order-edit-panel .edit-order-remark {
  margin-top: 12px;
  margin-bottom: 0;
}
.order-edit-panel .edit-items-wrap .qty-edit,
.order-edit-panel .edit-items-wrap .line-edit {
  width: 100%;
  min-width: 0;
}
@media (max-width: 900px) {
  .order-edit-panel .edit-grid-detail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .order-edit-panel .edit-grid-detail > .field:nth-child(1),
  .order-edit-panel .edit-grid-detail > .field:nth-child(2),
  .order-edit-panel .edit-grid-detail > .field:nth-child(3),
  .order-edit-panel .edit-grid-detail > .field:nth-child(4),
  .order-edit-panel .edit-grid-detail > .field:nth-child(5),
  .order-edit-panel .edit-grid-detail > .field:nth-child(7),
  .order-edit-panel .edit-grid-detail > .field:nth-child(8) {
    grid-column: span 1;
  }
  .order-edit-panel .edit-grid-detail > .field.span-all,
  .order-edit-panel .edit-grid-detail > .field.span-2,
  .order-edit-panel .edit-grid-detail > .field:nth-child(6) {
    grid-column: 1 / -1;
  }
}

.order-edit-panel .edit-items-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.order-edit-panel .edit-items-foot {
  margin-top: 10px;
  padding-top: 8px;
}
#modal-edit-order .detail-items-table td .thumb-wrap {
  display: flex;
  justify-content: center;
}
#modal-edit-order .detail-items-table .thumb-product {
  width: 40px;
  height: 40px;
}
#modal-edit-order .edit-items-wrap .qty-edit {
  max-width: 88px;
}
#modal-edit-order .edit-items-wrap .line-edit {
  max-width: 140px;
}

/* ===================== BER DESIGN TAKEOVER (Airtable editorial · t91) ===================== */
:root {
  --lime: #181d26;
  --lime-soft: #41454d;
  --lime-dim: rgba(24, 29, 38, 0.08);
  --lime-glow: rgba(24, 29, 38, 0.16);
  --accent: #181d26;
  --accent-2: #0d1218;
  --accent-grad: #181d26;
  --bg-deep: #ffffff;
  --bg-mid: #f8fafc;
  --surface: #ffffff;
  --text: #181d26;
  --text-secondary: #333840;
  --text-muted: #41454d;
  --glass-bg: #ffffff;
  --glass-bg-strong: #ffffff;
  --glass-bg-soft: #f8fafc;
  --glass-border: #dddddd;
  --glass-border-bright: #9297a0;
  --glass-highlight: #ffffff;
  --glass-blur: 0px;
  --radius-card: 10px;
  --radius-lg: 12px;
  --radius-md: 10px;
  --sidebar-w: 220px;
  --shadow-glass: none;
  --shadow-btn: 0 1px 2px rgba(24, 29, 38, 0.08);
}


body {
  min-width: 0;
  overflow-x: hidden;
  background: var(--bg-deep);
  color: var(--text);
}

.app-bg {
  background: #ffffff;
}

.app-bg::before,
.app-bg::after,
.app-bg .orb,
.app-bg .blob {
  opacity: 0.32;
}

#view-app.active {
  min-height: 100vh;
  align-items: stretch;
}

.sidebar {
  width: var(--sidebar-w);
  height: calc(100vh - 28px);
  margin: 14px 0 14px 14px;
  padding: 18px 12px 14px;
  top: 14px;
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-glass);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.15);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.15);
}

.sidebar.glass::before {
  opacity: 0.35;
}

.erp-badge {
  height: 40px;
  border-radius: 12px;
  font-size: 12px;
  background: var(--accent-grad);
  color: #fff;
  box-shadow: var(--shadow-btn);
}

.sidebar-brand {
  margin: 10px 0 20px;
  color: var(--text-secondary);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.nav-group-title {
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 0.14em;
}

.nav-item {
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

.nav-item.active {
  background: rgba(59, 130, 246, 0.12);
  border-color: transparent;
  color: var(--lime);
  box-shadow: none;
}

.nav-item.active svg {
  color: var(--lime);
}

.sidebar-foot {
  border-radius: 14px;
  background: rgba(248, 249, 253, 0.9);
  border-color: rgba(148, 163, 200, 0.28);
}

.main {
  min-width: 0;
  padding: 14px 16px 16px 12px;
}

.topbar {
  min-height: 56px;
  padding: 4px 8px 12px;
  border-bottom: none;
  background: transparent;
  backdrop-filter: none;
}

.breadcrumb {
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.page {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 8px 8px 28px;
  gap: 16px;
}

.greeting .date {
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.greeting h1,
.page-head h1 {
  color: var(--text);
  font-size: 26px;
  letter-spacing: -0.03em;
}

.page-head .eng {
  color: var(--lime);
}

.stats-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.stat-card,
.chart-panel,
.panel,
.glass {
  border-color: var(--glass-border);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-glass);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.12);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.12);
}

.glass-strong {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--glass-border-bright);
  box-shadow: var(--shadow-glass);
}

.stat-card {
  min-width: 0;
  min-height: 118px;
  padding: 18px 18px 16px;
  border-radius: var(--radius-card);
}

.stat-card .label {
  color: var(--text-secondary);
  font-size: 12px;
}

.stat-card .value {
  margin-top: 12px;
  font-size: 30px;
  letter-spacing: -0.04em;
  color: var(--text);
}

.stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--lime-dim);
  border: 1px solid rgba(59, 130, 246, 0.22);
  color: var(--lime);
}

.stat-card .deco {
  width: 100px;
  height: 100px;
  right: -18px;
  bottom: -36px;
  border-color: rgba(59, 130, 246, 0.1);
}

.chart-panel {
  min-height: 280px;
  padding: 18px 20px 20px;
  border-radius: var(--radius-card);
}

.chart-toolbar h3 {
  font-size: 15px;
  color: var(--text);
}

.seg {
  border-color: rgba(148, 163, 200, 0.3);
  background: rgba(244, 246, 251, 0.95);
}

.seg button.active {
  background: var(--accent-grad);
  color: #fff;
}

.btn-primary {
  background: var(--accent-grad);
  border-color: transparent;
  color: #ffffff;
  box-shadow: var(--shadow-btn);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  border-color: transparent;
  color: #ffffff;
}

.panel {
  border-radius: var(--radius-card);
}

.panel-toolbar h3 {
  color: var(--text);
}

.table-wrap {
  border-color: rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 16px;
}

.table-wrap table.data th {
  color: var(--text-muted);
  background: rgba(248, 249, 253, 0.9);
}

.table-wrap table.data td {
  border-bottom-color: rgba(148, 163, 200, 0.14);
  color: var(--text-secondary);
}

.search-box,
.panel-toolbar .glass-input,
.date-field input {
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(148, 163, 200, 0.32);
}

.select-glass {
  border-radius: var(--radius-pill);
  background-color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(148, 163, 200, 0.32);
  color: var(--text);
}

.login-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--glass-border-bright);
  box-shadow: 0 20px 60px rgba(100, 120, 160, 0.10);
}

.login-hero .eyebrow,
.login-badge,
.portal-tag .dot,
.login-secure .dot {
  color: var(--lime);
}

.login-badge {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.08);
}

.modal {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 22px;
  box-shadow: 0 24px 64px rgba(80, 100, 160, 0.18);
}

.modal-head h2 {
  color: var(--text);
}

.pager .page-num {
  background: var(--lime-dim);
  border: 1px solid rgba(59, 130, 246, 0.28);
  color: var(--lime);
}

.ops-danger,
.btn-danger-outline {
  color: #e5484d !important;
  border-color: rgba(229, 72, 77, 0.4) !important;
  background: rgba(229, 72, 77, 0.06) !important;
}

.ops-danger:hover,
.btn-danger-outline:hover {
  background: rgba(229, 72, 77, 0.12) !important;
  border-color: rgba(229, 72, 77, 0.55) !important;
  color: #c23030 !important;
}

/* legacy dark-compat helpers (unused by default) */
.theme-dark-legacy {
  --lime: #d4ff5e;
  --bg-deep: #050608;
  --text: #f4f6fa;
}

@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sidebar {
    width: 200px;
  }

  .page {
    padding-right: 4px;
    padding-left: 4px;
  }
}

@media (max-width: 900px) {
  #view-app.active {
    flex-direction: column;
  }

  .sidebar {
    width: calc(100% - 24px);
    height: auto;
    min-height: 0;
    position: sticky;
    top: 0;
    margin: 10px 12px 0;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    overflow-x: auto;
    border-radius: 18px;
  }

  .erp-badge {
    flex: 0 0 auto;
    width: 62px;
    height: 34px;
    font-size: 10px;
  }

  .sidebar-brand {
    display: none;
  }

  .nav-group {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    white-space: nowrap;
  }

  .nav-group-title {
    display: none;
  }

  .nav-item {
    width: auto;
    min-height: 36px;
    padding: 8px 10px;
    gap: 7px;
    font-size: 12px;
  }

  .sidebar-foot {
    display: none;
  }

  .main {
    width: 100%;
    padding: 10px 12px 16px;
  }

  .topbar {
    min-height: 48px;
    padding: 0 4px 10px;
  }
}

@media (max-width: 640px) {
  .sidebar {
    gap: 8px;
    padding: 8px 10px;
  }

  .erp-badge {
    width: 42px;
    font-size: 9px;
  }

  .nav-item {
    padding: 8px;
    font-size: 0;
  }

  .nav-item svg {
    width: 19px;
    height: 19px;
  }

  .page {
    padding: 8px 2px 24px;
    gap: 12px;
  }

  .greeting h1,
  .page-head h1 {
    font-size: 22px;
  }

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

  .stat-card {
    min-height: 100px;
    padding: 14px;
  }

  .stat-card .value {
    font-size: 24px;
  }

  .chart-panel {
    min-height: 0;
    padding: 14px;
  }

  .chart-area {
    height: 170px;
  }

  .panel {
    padding: 14px;
  }
}


/* Overview spacing and hidden-state correction */
#overview-scope[hidden] {
  display: none !important;
}

#page-overview .chart-panel {
  flex: 0 0 auto;
}


/* —— unified list pager —— */
.pager .pager-info {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.pager .page-jump {
  width: 48px;
  height: 28px;
  text-align: center;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(248, 249, 253, 0.95);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}
.pager .page-jump:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.pager [data-pager-prev]:disabled,
.pager [data-pager-next]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* —— binge3: 登录者类目/店铺 + 首字外圈 —— */
.topbar-scope {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  max-width: min(420px, 46vw);
  text-align: right;
  line-height: 1.35;
}
.user-scope-line {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.user-scope-side {
  display: block;
  margin-top: 4px;
  line-height: 1.35;
}
.user-scope-side .user-scope-line {
  font-size: 10px;
  color: var(--text-muted);
  white-space: normal;
  word-break: break-all;
}
.avatar.avatar-ring,
#topbar-avatar.avatar-ring,
#topbar-avatar {
  position: relative;
  border-radius: 50%;
  border: 2px solid rgba(59, 130, 246, 0.55);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.92),
    0 0 0 4px rgba(59, 130, 246, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mf-cat-item.is-fixed {
  border-style: dashed;
  opacity: 0.95;
}
.mf-cat-fixed-hint {
  font-style: normal;
  font-size: 10px;
  margin-left: 4px;
  color: var(--text-muted);
}
.mf-cat-locked {
  flex: 0 0 auto;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.28);
  background: rgba(59, 130, 246, 0.08);
  color: var(--text-secondary);
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  opacity: 0.85;
  cursor: default;
  user-select: none;
}


/* —— 我要报销 —— */
.reimburse-panel,
.reimburse-list-panel {
  margin-top: 16px;
  padding: 20px 22px 22px;
}
.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.panel-title-row h2 {
  font-size: 16px;
  font-weight: 650;
  color: var(--text);
}
.panel-title-row .muted {
  font-size: 13px;
  color: var(--text-muted);
}
.reimburse-form .field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.reimburse-form .field > span {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 550;
}
.reimburse-form .glass-input {
  width: 100%;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg-soft);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  color: var(--text);
  outline: none;
  font-size: 14px;
  resize: vertical;
}
.reimburse-form .glass-input:focus {
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.reimburse-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 0;
}
.reimburse-grid .field {
  margin-bottom: 14px;
}
.reimburse-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.reimburse-list-panel .table-wrap {
  overflow-x: auto;
}
#reimburse-table th.num,
#reimburse-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
#reimburse-table .empty-row td {
  text-align: center;
  color: var(--text-muted);
  padding: 28px 12px;
}
#reimburse-table td .ops {
  display: flex;
  gap: 8px;
}
@media (max-width: 900px) {
  .reimburse-grid {
    grid-template-columns: 1fr;
  }
}


.page-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.page-head-row .btn {
  flex-shrink: 0;
  margin-top: 8px;
}
#modal-reimburse .modal-body .glass-input[type="date"],
#modal-reimburse .modal-body .glass-input[type="number"] {
  font-variant-numeric: tabular-nums;
}


.reimburse-inline-panel {
  margin-top: 16px;
  padding: 22px;
  max-width: 480px;
}
.reimburse-inline-card {
  position: relative;
}
.reimburse-inline-head {
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.reimburse-inline-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}
.reimburse-head-project {
  margin-left: auto;
  flex-shrink: 0;
}
.reimburse-head-project .select-glass,
.reimburse-head-project .glass-input {
  min-width: 140px;
  max-width: 220px;
}
.modal-head-with-project {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.modal-head-aside {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.modal-head-aside .reimburse-head-project .select-glass {
  min-width: 120px;
  max-width: 160px;
  height: 34px;
  min-height: 34px;
  font-size: 12px;
}
.ledger-project-filter-wrap {
  margin-right: auto;
}
.reimburse-inline-body .field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.reimburse-inline-body .field > span {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}
.reimburse-inline-body .glass-input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 200, 0.35);
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.reimburse-inline-body .glass-input:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow:
    0 0 0 3px rgba(59, 130, 246, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.reimburse-inline-foot {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 200, 0.28);
}
.reimburse-inline-foot .btn {
  min-height: 38px;
  min-width: 96px;
  padding: 0 18px;
  border-radius: 999px;
}

.reimburse-inline-body .glass-input[readonly] {
  color: var(--text-secondary);
  background: rgba(248, 249, 253, 0.95);
  border-style: dashed;
  cursor: default;
}

.reimburse-voucher-field > span {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.reimburse-voucher-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.reimburse-voucher-preview {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  border: 1px dashed rgba(148, 163, 200, 0.55);
  background: rgba(248, 249, 253, 0.95) center/cover no-repeat;
  color: var(--text-muted);
  font-size: 28px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.reimburse-voucher-preview:hover {
  border-color: rgba(59, 130, 246, 0.55);
  color: var(--lime);
}
.reimburse-voucher-preview.has-file {
  border-style: solid;
  color: transparent;
}
.reimburse-voucher-preview.is-pdf {
  color: var(--lime);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.reimburse-voucher-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  min-width: 0;
  flex: 1;
}
.reimburse-voucher-btns {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.reimburse-voucher-actions .btn {
  min-width: 0;
}
.reimburse-voucher-name {
  font-size: 12px;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

.writeoff-panel {
  margin-top: 16px;
  padding: 18px 20px 16px;
}
/* 一页最多 50 条；可视约 20 行，超出上下滚动 */
.writeoff-panel .table-wrap {
  max-height: calc(20 * 52px + 48px);
  overflow-x: auto;
  overflow-y: auto;
}
.writeoff-panel .table-wrap table.data thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(248, 249, 253, 0.98);
  box-shadow: 0 1px 0 rgba(148, 163, 200, 0.22);
}
.writeoff-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.writeoff-toolbar-left,
.writeoff-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.writeoff-person-filter {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
}
.writeoff-person-filter > span {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}
.writeoff-person-filter .glass-input {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 200, 0.35);
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
}
.writeoff-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 200, 0.22);
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-secondary);
}
.writeoff-footer .muted,
#expense-writeoff-count,
#income-writeoff-count {
  font-size: 12px;
  line-height: 1.4;
}
.writeoff-pager {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}
.writeoff-page-info {
  font-size: 12px;
  color: var(--text-secondary);
  min-width: 48px;
  text-align: center;
}
.writeoff-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}
.writeoff-jump .glass-input {
  width: 64px;
  min-height: 30px;
  padding: 0 8px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 200, 0.35);
  text-align: center;
}
#expense-writeoff-table th,
#expense-writeoff-table td,
#income-writeoff-table th,
#income-writeoff-table td {
  text-align: center;
  vertical-align: middle;
}
#expense-writeoff-table th.num,
#expense-writeoff-table td.num,
#income-writeoff-table th.num,
#income-writeoff-table td.num {
  text-align: center;
  font-variant-numeric: tabular-nums;
}
#expense-writeoff-table .col-check,
#income-writeoff-table .col-check {
  width: 42px;
  text-align: center;
}
#expense-writeoff-table .col-actions,
#income-writeoff-table .col-actions {
  white-space: nowrap;
  min-width: 120px;
}
#expense-writeoff-table .empty-row td,
#income-writeoff-table .empty-row td {
  text-align: center;
  color: var(--text-muted);
  padding: 28px 12px;
}
.writeoff-ops {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.writeoff-ops .btn-xs {
  border-radius: 999px;
  padding: 0 10px;
  min-height: 28px;
}

#expense-writeoff-table .col-voucher,
#income-writeoff-table .col-voucher {
  text-align: center;
  vertical-align: middle;
  width: 64px;
}
.writeoff-voucher-thumb {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0 auto;
  border: 1px solid rgba(148, 163, 200, 0.35);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  vertical-align: middle;
}
.writeoff-voucher-thumb:hover {
  transform: scale(1.06);
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.22);
}
.writeoff-voucher-thumb:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.7);
  outline-offset: 2px;
}
.writeoff-voucher-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
  pointer-events: none;
}
.writeoff-voucher-thumb.is-pdf {
  background: linear-gradient(145deg, rgba(248, 113, 113, 0.18), rgba(239, 68, 68, 0.12));
  border-color: rgba(239, 68, 68, 0.35);
}
.writeoff-voucher-pdf-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #dc2626;
  pointer-events: none;
  user-select: none;
}

.channel-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  line-height: 1.35;
  text-align: center;
}
.channel-stack-item {
  display: block;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.treasury-channel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.1);
  color: var(--lime);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.treasury-channel-btn:hover {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.65);
}
.treasury-channel-btn.has-value {
  background: rgba(59, 130, 246, 0.16);
  color: var(--text);
  border-color: rgba(59, 130, 246, 0.55);
}
.treasury-channel-btn #treasury-channel-label,
.treasury-channel-btn #edit-income-channel-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
#modal-edit-income .modal-body .field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
#modal-edit-income .modal-body .field > span {
  font-size: 13px;
  color: var(--muted);
}
#modal-edit-income .modal-body .glass-input[readonly] {
  opacity: 0.92;
}
.treasury-channel-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.treasury-channel-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 200, 0.35);
  background: rgba(255, 255, 255, 0.9);
}
.treasury-channel-name {
  flex: 0 0 72px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.treasury-channel-amount,
.edit-income-channel-amount,
.expense-writeoff-channel-amount {
  flex: 1;
  min-width: 0;
}


/* —— 核销确认弹窗（支出/收入共用 · 一行一单表单） —— */
#modal-expense-writeoff-channel .writeoff-confirm-panel,
#modal-income-writeoff-confirm .writeoff-confirm-panel {
  width: min(1280px, calc(100vw - 32px));
  height: min(720px, calc(100vh - 32px));
  max-height: min(720px, calc(100vh - 32px));
  display: flex;
  flex-direction: column;
}
#modal-expense-writeoff-channel .modal-body,
#modal-income-writeoff-confirm .modal-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#modal-expense-writeoff-channel .modal-head h2,
#modal-income-writeoff-confirm .modal-head h2 {
  flex: 1;
  min-width: 0;
  margin-right: 8px;
}
.writeoff-confirm-hint {
  margin: 0;
  flex: 0 0 auto;
  font-size: 13px;
}
.writeoff-confirm-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1 1 auto;
  min-height: 0;
  /* 约 20 笔订单可视高度，超出纵向滚动，不撑破弹窗 */
  max-height: min(560px, calc(20 * 72px));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 4px 4px 0;
}
.writeoff-confirm-empty {
  text-align: center;
  padding: 28px 12px;
}
.writeoff-confirm-item {
  display: block;
  padding: 10px 4px 12px;
  border-bottom: 1px solid rgba(148, 163, 200, 0.36);
  background: transparent;
  box-shadow: none;
}
.writeoff-confirm-item:last-child {
  border-bottom: 0;
}
.writeoff-confirm-form {
  display: flex;
  flex-wrap: nowrap;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px 10px;
  width: 100%;
  min-width: 0;
}
.writeoff-confirm-form-index {
  flex: 0 0 36px;
  align-self: flex-start;
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  margin-bottom: 0;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 200, 0.35);
  background: rgba(59, 130, 246, 0.08);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.writeoff-confirm-form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  min-width: 0;
  box-sizing: border-box;
}
.writeoff-confirm-form-field > span {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary, var(--muted));
  line-height: 1.2;
  white-space: nowrap;
}
/* 一行一单：按比例压缩，不换行 */
.writeoff-confirm-form-field-xs {
  flex: 0 1 88px;
  width: 88px;
  max-width: 100px;
}
.writeoff-confirm-form-field-sm {
  flex: 0 1 120px;
  width: 120px;
  max-width: 140px;
}
.writeoff-confirm-form-field-md {
  flex: 1 1 140px;
  min-width: 110px;
  max-width: 200px;
}
.writeoff-confirm-form-field-channel {
  flex: 2 1 260px;
  min-width: 220px;
  max-width: 420px;
}
.writeoff-confirm-form-field-lg {
  flex: 1.2 1 160px;
  min-width: 120px;
}
.writeoff-confirm-form-field-voucher {
  flex: 0 0 64px;
  width: 64px;
  max-width: 72px;
}
.writeoff-confirm-form-field .glass-input {
  width: 100%;
  min-height: 40px;
  height: 40px;
  padding: 0 10px;
  border-radius: 10px;
  cursor: default;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.writeoff-confirm-amount-input {
  font-weight: 700 !important;
  font-size: 14px !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  color: var(--text) !important;
}
.writeoff-confirm-form-box {
  display: flex;
  align-items: center;
  min-height: 40px;
  height: 40px;
  padding: 4px 8px;
  border-radius: 10px;
  border: 1px dashed rgba(148, 163, 200, 0.55);
  background: rgba(248, 249, 253, 0.95);
  color: var(--text);
  box-sizing: border-box;
  width: 100%;
  overflow: hidden;
}
.writeoff-confirm-form-box-status {
  justify-content: center;
  padding: 4px 6px;
}
.writeoff-confirm-form-box-voucher {
  justify-content: center;
  padding: 2px;
  height: 40px;
  min-height: 40px;
}
.writeoff-confirm-form-box-voucher .writeoff-voucher-thumb {
  width: 34px;
  height: 34px;
  margin: 0;
}
.writeoff-confirm-form-box-channel {
  align-items: center;
  height: auto;
  min-height: 40px;
  max-height: none;
  overflow: visible;
  padding: 6px 10px;
}
.writeoff-confirm-form-box-channel .channel-stack {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 6px 12px;
  text-align: left;
  overflow: visible;
  width: 100%;
}
.writeoff-confirm-form-box-channel .channel-stack-item {
  display: inline-block;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}
.writeoff-confirm-voucher-empty {
  color: var(--text-muted, var(--muted));
  font-size: 13px;
}

/* 支出弹窗底部有报销渠道，列表可视区略收；仍约按行高滚动 */
#modal-expense-writeoff-channel .writeoff-confirm-list {
  max-height: min(420px, calc(20 * 72px));
}
#modal-income-writeoff-confirm .writeoff-confirm-list {
  max-height: min(560px, calc(20 * 72px));
}

.writeoff-confirm-channel-block {
  flex: 0 0 auto;
  padding-top: 10px;
  border-top: 1px dashed rgba(148, 163, 200, 0.45);
}
.writeoff-confirm-channel-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}
#modal-expense-writeoff-channel .treasury-channel-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
#modal-expense-writeoff-channel .treasury-channel-row {
  min-height: 40px;
  padding: 6px 10px;
}

#treasury-amount-display {
  opacity: 0.95;
  cursor: default;
}

/* 凭证预览 lightbox（支出/收入核销）
   Stage wraps only the visible media (img intrinsic size capped by vw/vh).
   Author display rules must not override [hidden] — otherwise the PDF iframe
   (fixed vw×vh + white bg) still lays out and letterboxes image previews. */
.voucher-preview-dialog {
  border: 0;
  outline: none;
  padding: 0;
  background: transparent;
  background-color: transparent;
  color: inherit;
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  margin: 0;
  position: fixed;
  inset: 0;
  overflow: visible;
  z-index: 1600;
  box-shadow: none;
}
.voucher-preview-dialog:modal {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  background-color: transparent;
  border: 0;
  padding: 0;
}
.voucher-preview-dialog[open] {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  background-color: transparent;
  border: 0;
  padding: 0;
}
.voucher-preview-dialog[hidden] {
  display: none !important;
}
.voucher-preview-dialog::backdrop {
  background: rgba(12, 14, 20, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.voucher-preview-stage {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  height: fit-content;
  max-width: min(92vw, 960px);
  max-height: min(86vh, 920px);
  border-radius: 18px;
  overflow: hidden;
  background: transparent;
  background-color: transparent;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}
.voucher-preview-toolbar {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}
.voucher-preview-pill,
.voucher-preview-x {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(28, 30, 36, 0.45);
  color: #fff;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
.voucher-preview-pill:hover,
.voucher-preview-x:hover {
  background: rgba(40, 42, 50, 0.62);
  border-color: rgba(255, 255, 255, 0.55);
}
.voucher-preview-pill {
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.voucher-preview-x {
  border-radius: 999px;
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 20px;
  font-weight: 400;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.voucher-preview-img {
  display: block;
  max-width: min(92vw, 960px);
  max-height: min(86vh, 920px);
  width: auto;
  height: auto;
  object-fit: contain;
  border: none;
  border-radius: 18px;
  box-shadow: none;
  background: transparent;
  vertical-align: top;
}
.voucher-preview-pdf {
  display: block;
  width: min(92vw, 900px);
  height: min(86vh, 860px);
  border: none;
  border-radius: 18px;
  background: #fff;
  box-shadow: none;
}
.voucher-preview-fallback {
  min-width: min(72vw, 360px);
  padding: 36px 28px;
  border-radius: 18px;
  background: rgba(28, 30, 36, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.18);
  text-align: center;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
/* Critical: author display:block/flex beats UA [hidden]{display:none} */
.voucher-preview-img[hidden],
.voucher-preview-pdf[hidden],
.voucher-preview-fallback[hidden] {
  display: none !important;
}
.voucher-preview-fallback-text {
  margin: 0;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.88);
}


/* —— 公司总账：双栏核销入账 —— */
.ledger-view-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin: 8px 0 14px;
  flex-wrap: wrap;
}
.ledger-tabs {
  display: inline-flex;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(148, 163, 200, 0.28);
  gap: 4px;
}
.ledger-tab {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.ledger-tab:hover {
  color: var(--text);
  background: rgba(59, 130, 246, 0.06);
}
.ledger-tab.active {
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.28);
}
.ledger-mode-toggle {
  display: inline-flex;
  padding: 3px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(148, 163, 200, 0.28);
  gap: 2px;
}
.ledger-mode-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 9px;
  cursor: pointer;
}
.ledger-mode-btn.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 8px rgba(90, 110, 170, 0.12);
}
.ledger-dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
  min-height: 0;
}
.ledger-dual[data-mode="switch"] {
  grid-template-columns: 1fr;
}
.ledger-dual[data-mode="switch"] .ledger-pane {
  display: none;
}
.ledger-dual[data-mode="switch"][data-active="expense"] .ledger-pane[data-pane="expense"],
.ledger-dual[data-mode="switch"][data-active="income"] .ledger-pane[data-pane="income"] {
  display: flex;
}
.ledger-pane {
  margin-top: 0;
  min-height: 280px;
  max-height: calc(100vh - 220px);
}
.ledger-pane-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}
.ledger-pane-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
}

.ledger-pane-footer {
  flex-shrink: 0;
  margin-top: auto;
  align-items: center;
}
.ledger-pane-footer.writeoff-footer {
  margin-top: auto;
}
.ledger-pane .table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
#ledger-expense-count,
#ledger-income-count {
  font-size: 12px;
  line-height: 1.4;
}
@media (max-width: 640px) {
  .ledger-pane-footer.writeoff-footer {
    flex-direction: column;
    align-items: flex-start;
  }
  .ledger-pane-footer .writeoff-pager {
    width: 100%;
  }
}

#ledger-expense-table th,
#ledger-expense-table td,
#ledger-income-table th,
#ledger-income-table td {
  text-align: center;
  vertical-align: middle;
}
#ledger-expense-table th.col-writeoff-day,
#ledger-expense-table td.col-writeoff-day,
#ledger-income-table th.col-writeoff-day,
#ledger-income-table td.col-writeoff-day {
  text-align: center;
}
#ledger-expense-table th.num,
#ledger-expense-table td.num,
#ledger-income-table th.num,
#ledger-income-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
#ledger-expense-table .col-check,
#ledger-income-table .col-check {
  width: 36px;
  text-align: center;
}
.ledger-day-ops {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
#ledger-expense-table .col-actions,
#ledger-income-table .col-actions {
  white-space: nowrap;
  min-width: 140px;
}
#ledger-expense-table .empty-row td,
#ledger-income-table .empty-row td {
  text-align: center;
  color: var(--text-muted, var(--muted));
}

/* —— 公司总账 · 日明细弹窗 —— */
#modal-ledger-day-detail .ledger-day-detail-panel {
  width: min(1200px, calc(100vw - 32px));
  height: min(860px, calc(100vh - 24px));
  max-height: min(860px, calc(100vh - 24px));
  display: flex;
  flex-direction: column;
}
#modal-ledger-day-detail .modal-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
#modal-ledger-day-detail .modal-head h2 {
  flex: 1;
  min-width: 0;
  margin-right: 8px;
}
.ledger-day-summary {
  flex: 0 0 auto;
}
.ledger-day-total-module {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.18) 0%, rgba(96, 165, 250, 0.12) 100%);
  box-shadow: 0 8px 22px rgba(59, 130, 246, 0.12);
}
.ledger-day-total-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #1d4ed8;
}
.ledger-day-total-amount,
.ledger-day-total {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: #1e3a8a;
}
.ledger-day-summary-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
}
.ledger-day-person-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-height: 140px;
  overflow: auto;
}
.ledger-day-person-empty {
  padding: 8px 0;
}
.ledger-day-person-card {
  flex: 1 1 160px;
  min-width: 140px;
  max-width: 220px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 200, 0.35);
  background: rgba(255, 255, 255, 0.9);
}
.ledger-day-person-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.ledger-day-person-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted, var(--muted));
}
.ledger-day-person-amount {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.ledger-day-detail-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ledger-day-detail-title {
  font-size: 13px;
  font-weight: 600;
}
.ledger-day-detail-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  /* 表头 + 约 20 行可见，超出表内上下滚动 */
  max-height: calc(44px + 20 * 47px);
  overflow-y: auto;
  overflow-x: auto;
  border: 1px solid rgba(148, 163, 200, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
}
#ledger-day-detail-table {
  border-collapse: separate;
  border-spacing: 0;
}
#ledger-day-detail-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(248, 249, 253, 0.98);
  box-shadow: 0 1px 0 rgba(148, 163, 200, 0.22);
}
#ledger-day-detail-table th,
#ledger-day-detail-table td {
  text-align: center;
  vertical-align: middle;
}
#ledger-day-detail-table th.num,
#ledger-day-detail-table td.num {
  font-variant-numeric: tabular-nums;
}
#ledger-day-detail-table td:nth-child(3) {
  text-align: left;
  max-width: 220px;
  word-break: break-word;
}
#ledger-day-detail-table .col-voucher {
  width: 64px;
}
#ledger-day-detail-table .channel-stack {
  align-items: flex-start;
  text-align: left;
}

@media (max-width: 1100px) {
  .ledger-dual[data-mode="split"] {
    grid-template-columns: 1fr;
  }
  .ledger-dual[data-mode="split"] .ledger-pane {
    max-height: none;
  }
  /* 窄屏默认用切换更省空间：若仍为并排则纵向堆叠 */
}

/* 切换模式：单栏展示，页签在左上 */
.ledger-dual[data-mode="switch"] .ledger-pane {
  flex-direction: column;
  max-height: none;
}
.ledger-view-bar {
  justify-content: flex-start;
}
.ledger-mode-toggle {
  margin-left: auto;
}

.ledger-mode-toggle { display: none !important; }


.writeoff-confirm-total {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(59, 130, 246, 0.28);
  background: rgba(59, 130, 246, 0.08);
  flex-shrink: 0;
}
.writeoff-confirm-total-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary, var(--muted));
}
.writeoff-confirm-total-value {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  letter-spacing: 0.02em;
}


/* —— 股东有限写权限：仅 ap/ar 的 write-only 控件可见 —— */
body.role-shareholder [data-write-only]:not([data-write-scope="ap"]):not([data-write-scope="ar"]) {
  display: none !important;
}
.team-member-cell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.team-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.16);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}
#team-table .modules-cell {
  max-width: 280px;
  text-align: left;
  font-size: 12px;
  word-break: break-word;
}

#team-table .projects-cell {
  max-width: 200px;
  text-align: left;
  font-size: 12px;
  word-break: break-word;
}

#team-table .mono {
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}
#team-table .ops {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
#modal-member .modal-member-panel {
  width: min(560px, 100%);
  max-height: min(90vh, 720px);
  display: flex;
  flex-direction: column;
}
#modal-member .modal-body {
  overflow: auto;
}
#modal-member .modal-foot {
  justify-content: flex-start;
}
#page-audit .action-row {
  margin-bottom: 12px;
}
#page-audit .panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
#page-audit .search-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 220px;
  flex: 1;
  padding: 0 12px;
  min-height: 40px;
}
#page-audit .search-box input {
  border: 0;
  outline: none;
  background: transparent;
  width: 100%;
  color: inherit;
}


/* —— 项目分类弹窗 —— */
#modal-projects .modal-projects-panel {
  width: min(480px, 100%);
  max-height: min(90vh, 640px);
  display: flex;
  flex-direction: column;
}
#modal-projects .modal-body {
  overflow: auto;
}
#modal-projects .modal-foot {
  justify-content: flex-start;
}
.project-add-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}
.project-add-row .glass-input {
  flex: 1;
  min-width: 0;
}
.project-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.project-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.project-row.is-editing {
  flex-wrap: wrap;
}
.project-row-name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  color: var(--text);
  word-break: break-word;
}
.project-row-ops {
  display: inline-flex;
  gap: 6px;
  flex-shrink: 0;
  align-items: center;
}
.project-row-edit-input {
  flex: 1;
  min-width: 0;
}
.project-list-empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--muted, rgba(150, 160, 180, 0.85));
  font-size: 13px;
}


/* —— 各页项目分类筛选 —— */
.page-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0 0 14px;
  position: relative;
  z-index: 1;
}
.project-page-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted, rgba(150, 160, 180, 0.9));
}
.project-page-filter > span {
  white-space: nowrap;
}
.project-page-filter .select-glass,
.project-page-filter .glass-input {
  min-width: 160px;
}
.writeoff-toolbar-left .project-page-filter {
  margin-right: 4px;
}
#page-audit .panel-toolbar .project-page-filter {
  margin-right: 2px;
}


.writeoff-channel-match-hint {
  margin-top: 10px;
  font-size: 12px;
}
.writeoff-channel-match-hint.is-mismatch {
  color: #e85d5d;
}
.writeoff-channel-match-hint.is-match {
  color: #3d9a6a;
}
.ledger-day-person-channels {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted, rgba(150, 160, 180, 0.9));
  line-height: 1.45;
  word-break: break-word;
}



/* 实时财报 · 合计总余额（单焦点大数字） */
.live-channel-sum {
  margin: 0 0 14px;
  padding: 20px 22px 18px;
  border: 1px solid var(--hairline, #dddddd);
  border-radius: 10px;
  background: var(--canvas, #ffffff);
  box-shadow: 0 1px 2px rgba(24, 29, 38, 0.04);
}
.live-channel-sum-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted, #41454d);
}
.live-channel-sum-value {
  margin-top: 8px;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--ink, #181d26);
}
.live-channel-sum-value.is-negative {
  color: #aa2d00;
}
@media (max-width: 700px) {
  .live-channel-sum {
    padding: 16px 16px 14px;
  }
  .live-channel-sum-value {
    font-size: 30px;
  }
}

/* 实时财报 · 三渠道余额 */
.live-channel-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.live-channel-card {
  min-height: 148px;
  position: relative;
}
.live-channel-card .value.is-negative {
  color: #ff6b7a;
}
.live-channel-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-secondary, rgba(160, 170, 190, 0.9));
  position: relative;
  z-index: 1;
}
@media (max-width: 900px) {
  .live-channel-grid {
    grid-template-columns: 1fr;
  }
}



/* 月度财报 · 本年合计 + 月度表（t98） */
.monthly-year-sum {
  margin-bottom: 14px;
}
.monthly-year-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted, #41454d);
}
.monthly-year-sub .muted {
  opacity: 0.85;
}
.monthly-table-panel {
  margin-top: 4px;
  padding: 16px 18px 18px;
}
.monthly-table-panel .ledger-pane-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.monthly-table-panel .ledger-pane-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
#monthly-report-table .amt-plus {
  color: #0f6d3b;
}
#monthly-report-table .amt-minus {
  color: #aa2d00;
}
#monthly-report-table .empty-row td {
  text-align: center;
  color: var(--muted, #41454d);
  padding: 28px 12px;
}
@media (max-width: 700px) {
  .monthly-year-sub {
    font-size: 12px;
  }
}

/* 实时财报 · 实时记录 */
.live-log-panel {
  margin-top: 16px;
  padding: 16px 18px 18px;
}
.live-log-panel .ledger-pane-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.live-log-panel .ledger-pane-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.live-log-table-wrap {
  max-height: 420px;
  overflow: auto;
}
#live-log-table .amt-plus {
  color: #3ecf8e;
  font-variant-numeric: tabular-nums;
}
#live-log-table .amt-minus {
  color: #ff6b7a;
  font-variant-numeric: tabular-nums;
}
#live-log-table .type-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
#live-log-table .type-pill.is-income {
  color: #3ecf8e;
  background: rgba(62, 207, 142, 0.12);
}
#live-log-table .type-pill.is-expense {
  color: #ff6b7a;
  background: rgba(255, 107, 122, 0.12);
}
#live-log-table td {
  vertical-align: top;
}
#live-log-table .col-detail,
#live-log-table .col-remark {
  max-width: 220px;
  word-break: break-word;
}


/* 财务概览 · 核销走势图例 / tooltip 双色 */
.finance-chart-legend {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
  font-size: 12px;
  color: var(--text-secondary);
}
.finance-chart-legend .leg::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 3px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}
.finance-chart-legend .leg-income::before {
  background: #3ecf8e;
}
.finance-chart-legend .leg-expense::before {
  background: #3b82f6;
}
.chart-tooltip .tip-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.chart-tooltip .tip-row + .tip-row {
  margin-top: 2px;
}
.chart-tooltip .tip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.chart-tooltip .tip-dot.income { background: #3ecf8e; }
.chart-tooltip .tip-dot.expense { background: #3b82f6; }
.chart-tooltip .tip-row em {
  font-style: normal;
  font-weight: 700;
  margin-left: 2px;
}


/* ============================================================
   AIRTABLE t91 color lift — editorial white canvas (login + shell)
   Final token authority. Clears PRYON lavender glass + AWARDS
   dark/lilac login isolation. Visual tokens only — not official Airtable.
   ============================================================ */

:root {
  --primary: #181d26;
  --primary-active: #0d1218;
  --ink: #181d26;
  --body: #333840;
  --muted: #41454d;
  --hairline: #dddddd;
  --border-strong: #9297a0;
  --canvas: #ffffff;
  --surface-soft: #f8fafc;
  --surface-strong: #e0e2e6;
  --surface-dark: #181d26;
  --surface-dark-elevated: #1d1f25;
  --on-primary: #ffffff;
  --on-dark: #ffffff;
  --link: #1b61c9;
  --link-active: #1a3866;
  --info: #254fad;
  --info-border: #458fff;
  --success: #006400;
  --success-border: #39bf45;
  --signature-coral: #aa2d00;
  --signature-forest: #0a2e0e;
  --signature-cream: #f5e9d4;
  --signature-peach: #fcab79;
  --signature-mint: #a8d8c4;
  --signature-yellow: #f4d35e;
  --signature-mustard: #d9a441;

  --lime: #181d26;
  --lime-soft: #41454d;
  --lime-dim: rgba(24, 29, 38, 0.08);
  --lime-glow: rgba(24, 29, 38, 0.16);
  --accent: #181d26;
  --accent-2: #0d1218;
  --accent-gold: #d9a441;
  --accent-gold-soft: #aa2d00;
  --accent-pink: #aa2d00;
  --accent-grad: #181d26;
  --bg-deep: #ffffff;
  --bg-mid: #f8fafc;
  --surface: #ffffff;
  --text: #181d26;
  --text-secondary: #333840;
  --text-muted: #41454d;
  --glass-bg: #ffffff;
  --glass-bg-strong: #ffffff;
  --glass-bg-soft: #f8fafc;
  --glass-border: #dddddd;
  --glass-border-bright: #9297a0;
  --glass-highlight: #ffffff;
  --glass-blur: 0px;
  --radius-card: 10px;
  --radius-lg: 12px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --radius-pill: 9999px;
  --shadow-glass: none;
  --shadow-btn: 0 1px 2px rgba(24, 29, 38, 0.08);
  --status-yellow: #f4d35e;
  --status-red: #aa2d00;
  --font: Inter, system-ui, -apple-system, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue",
    Arial, sans-serif;
}

body {
  background: var(--canvas);
  color: var(--body);
  font-family: var(--font);
  font-weight: 400;
}

a {
  color: var(--link);
}
a:active {
  color: var(--link-active);
}

/* Flat white canvas — no purple/pink gradient orbs */
.app-bg {
  background: var(--canvas) !important;
  opacity: 1 !important;
}
.app-bg::before,
.app-bg::after,
.app-bg .orb,
.app-bg .blob {
  display: none !important;
  opacity: 0 !important;
}

/* Glass primitives → flat editorial surfaces */
.glass,
.glass-strong {
  background: var(--canvas) !important;
  border: 1px solid var(--hairline) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.glass::before,
.glass-strong::before {
  opacity: 0 !important;
  background: none !important;
}
.glass-input {
  background: var(--canvas) !important;
  border: 1px solid var(--hairline) !important;
  color: var(--ink) !important;
  border-radius: var(--radius-sm) !important;
}
.glass-input:focus,
.input-wrap.glass-input:focus-within {
  border-color: var(--info-border) !important;
  box-shadow: 0 0 0 2px rgba(69, 143, 255, 0.22) !important;
}
.glass-input::placeholder,
.input-wrap input::placeholder {
  color: var(--muted) !important;
}

/* Buttons — near-black primary / white secondary */
.btn {
  border-radius: var(--radius-lg);
  font-weight: 500;
}
.btn-primary,
.btn-login {
  background: var(--primary) !important;
  color: var(--on-primary) !important;
  border: 1px solid var(--primary) !important;
  box-shadow: var(--shadow-btn) !important;
  border-radius: var(--radius-lg) !important;
}
.btn-primary:hover,
.btn-login:hover,
.btn-primary:active,
.btn-login:active {
  background: var(--primary-active) !important;
  border-color: var(--primary-active) !important;
  color: var(--on-primary) !important;
  box-shadow: var(--shadow-btn) !important;
}
.btn-primary:disabled:hover,
.btn-primary[disabled]:hover {
  background: var(--primary) !important;
}
.btn-ghost,
.btn-secondary {
  background: var(--canvas) !important;
  color: var(--ink) !important;
  border: 1px solid var(--hairline) !important;
  box-shadow: none !important;
  border-radius: var(--radius-lg) !important;
}
.btn-ghost:hover,
.btn-secondary:hover {
  background: var(--surface-soft) !important;
  border-color: var(--border-strong) !important;
  color: var(--ink) !important;
}
.btn-outline-lime {
  color: var(--ink) !important;
  border: 1px solid var(--hairline) !important;
  background: var(--canvas) !important;
}
.btn-outline-lime:hover {
  background: var(--surface-soft) !important;
}
.btn-danger-text {
  color: var(--signature-coral) !important;
  border-color: rgba(170, 45, 0, 0.35) !important;
}

/* ===================== LOGIN: white editorial canvas ===================== */
#view-login {
  /* Clear AWARDS dark isolation tokens */
  --lime: #181d26;
  --lime-soft: #41454d;
  --lime-dim: rgba(24, 29, 38, 0.08);
  --lime-glow: rgba(24, 29, 38, 0.16);
  --accent: #181d26;
  --accent-2: #0d1218;
  --accent-gold: #d9a441;
  --accent-gold-soft: #aa2d00;
  --accent-pink: #aa2d00;
  --accent-grad: #181d26;
  --bg-deep: #ffffff;
  --bg-mid: #f8fafc;
  --surface: #ffffff;
  --text: #181d26;
  --text-secondary: #333840;
  --text-muted: #41454d;
  --glass-bg: #ffffff;
  --glass-bg-strong: #ffffff;
  --glass-bg-soft: #f8fafc;
  --glass-border: #dddddd;
  --glass-border-bright: #9297a0;
  --shadow-btn: 0 1px 2px rgba(24, 29, 38, 0.08);
  background: var(--canvas) !important;
  overflow: auto;
  display: none;
  min-height: 100vh;
  position: relative;
  color: var(--body);
}
#view-login.active {
  display: flex;
}
#view-login::before,
#view-login::after {
  content: none !important;
  display: none !important;
}

.login-layout {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  padding: 48px 24px;
  position: relative;
  z-index: 1;
  background: var(--canvas);
  grid-template-columns: none !important;
  grid-template-rows: none !important;
}

/* Remove awards racing art dependency */
.login-art,
.login-art-veil,
.login-art-caption {
  display: none !important;
}

.login-panel {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 0 !important;
  background: transparent !important;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-panel-inner {
  width: 100%;
  position: relative;
}
.login-panel-brand {
  margin-bottom: 28px;
  justify-content: flex-start;
}
.login-panel .brand-mark {
  background: var(--primary) !important;
  color: var(--on-primary) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: none !important;
  font-weight: 500 !important;
}
.login-panel .brand-text strong {
  color: var(--ink) !important;
  font-weight: 500 !important;
  letter-spacing: 0.02em;
}
.login-panel .brand-text span {
  color: var(--muted) !important;
  letter-spacing: 0.08em;
  text-transform: none;
  font-weight: 400;
}

.login-panel .login-card,
.login-card {
  background: var(--canvas) !important;
  border: 1px solid var(--hairline) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  padding: 32px !important;
  max-width: 440px;
  width: 100%;
  overflow: visible;
}
.login-panel .login-card-head {
  margin-bottom: 20px;
}
.login-panel .login-card h2,
.login-card h2 {
  color: var(--ink) !important;
  font-size: 24px !important;
  font-weight: 400 !important;
  letter-spacing: 0.12px;
  margin-bottom: 8px;
}
.login-panel .login-card .sub,
.login-card .sub {
  color: var(--body) !important;
  font-size: 14px !important;
  font-weight: 400;
  margin-bottom: 24px;
}
.login-panel .login-badge,
.login-badge {
  background: var(--surface-soft) !important;
  border: 1px solid var(--hairline) !important;
  color: var(--ink) !important;
  border-radius: var(--radius-sm) !important;
  font-weight: 500 !important;
  font-size: 12px;
  padding: 4px 10px;
  height: auto;
}
.login-panel .portal-tag,
.portal-tag {
  color: var(--muted) !important;
  font-size: 13px;
  font-weight: 500;
}
.login-panel .portal-tag .dot,
.login-panel .login-secure .dot,
.portal-tag .dot {
  background: var(--signature-coral) !important;
  box-shadow: none !important;
}
.login-panel .field label,
.field label {
  color: var(--body) !important;
  font-weight: 500;
}
.login-panel .field .req,
.field .req {
  color: var(--signature-coral) !important;
  font-weight: 500;
}
.login-panel .input-wrap.glass-input,
.input-wrap.glass-input {
  background: var(--canvas) !important;
  border: 1px solid var(--hairline) !important;
  color: var(--ink) !important;
  border-radius: var(--radius-sm) !important;
  min-height: 44px;
}
.login-panel .input-wrap.glass-input:focus-within {
  border-color: var(--info-border) !important;
  box-shadow: 0 0 0 2px rgba(69, 143, 255, 0.22) !important;
}
.login-panel .input-wrap input,
.input-wrap input {
  color: var(--ink) !important;
}
.login-panel .input-wrap .icon,
.login-panel .input-wrap .show-btn {
  color: var(--muted) !important;
}
.login-panel .input-wrap .show-btn:hover {
  color: var(--ink) !important;
}
.login-panel .login-actions .btn-primary,
.login-panel .login-actions .btn-login,
.login-actions .btn-primary,
.login-actions .btn-login {
  background: var(--primary) !important;
  color: var(--on-primary) !important;
  border: 1px solid var(--primary) !important;
  box-shadow: var(--shadow-btn) !important;
  border-radius: var(--radius-lg) !important;
  letter-spacing: 0 !important;
  width: 100%;
  font-weight: 500;
  padding: 14px 24px;
}
.login-panel .login-actions .btn-login:hover,
.login-actions .btn-login:hover {
  background: var(--primary-active) !important;
  border-color: var(--primary-active) !important;
  box-shadow: var(--shadow-btn) !important;
}
.login-panel .login-secure,
.login-secure {
  color: var(--muted) !important;
  margin-top: 16px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.login-topbar,
.login-hero,
.login-card-wrap,
.login-card-ring {
  display: none !important;
}

@media (max-width: 1099px) {
  .login-layout {
    display: flex !important;
    padding: 32px 16px;
  }
  .login-panel {
    padding: 0 !important;
  }
}

/* ===================== APP SHELL (editorial) ===================== */
.sidebar,
.sidebar.glass {
  background: var(--surface-soft) !important;
  border: 1px solid var(--hairline) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-radius: var(--radius-lg) !important;
}
.sidebar.glass::before {
  opacity: 0 !important;
}
.erp-badge {
  background: var(--primary) !important;
  color: var(--on-primary) !important;
  box-shadow: none !important;
  border-radius: var(--radius-md) !important;
  font-weight: 500 !important;
}
.sidebar-brand {
  color: var(--muted) !important;
  letter-spacing: 0.06em;
  font-weight: 500 !important;
}
.nav-group-title {
  color: var(--muted) !important;
  font-weight: 500;
}
.nav-item {
  color: var(--body) !important;
  border-radius: var(--radius-sm);
  font-weight: 400;
}
.nav-item:hover {
  background: rgba(24, 29, 38, 0.05) !important;
  color: var(--ink) !important;
}
.nav-item.active {
  background: rgba(24, 29, 38, 0.08) !important;
  border-color: transparent !important;
  color: var(--ink) !important;
  box-shadow: inset 3px 0 0 var(--primary) !important;
  font-weight: 500 !important;
}
.nav-item.active svg {
  color: var(--ink) !important;
}
.sidebar-foot {
  background: var(--canvas) !important;
  border-color: var(--hairline) !important;
}
.sidebar-foot-btn:hover {
  background: rgba(24, 29, 38, 0.05) !important;
}
.breadcrumb {
  color: var(--muted) !important;
}
.greeting h1,
.page-head h1 {
  color: var(--ink) !important;
  font-weight: 400 !important;
}
.page-head .eng {
  color: var(--muted) !important;
}
.greeting .date {
  color: var(--muted) !important;
}

/* Cards / panels / tables */
.stat-card,
.chart-panel,
.panel,
.glass {
  border-color: var(--hairline) !important;
  background: var(--canvas) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-radius: var(--radius-md) !important;
}
.glass-strong {
  background: var(--canvas) !important;
  border-color: var(--hairline) !important;
}
.stat-card .label {
  color: var(--muted) !important;
  font-weight: 500;
}
.stat-card .value {
  color: var(--ink) !important;
  font-weight: 500;
}
.stat-icon {
  background: var(--surface-soft) !important;
  border: 1px solid var(--hairline) !important;
  color: var(--ink) !important;
}
.stat-card .deco {
  border-color: var(--hairline) !important;
}
/* KPI signature accents — large blocks only */
.stat-card:nth-child(1) {
  border-top: 3px solid var(--signature-coral);
}
.stat-card:nth-child(2) {
  border-top: 3px solid var(--signature-forest);
}
.stat-card:nth-child(3) {
  border-top: 3px solid var(--signature-mustard);
}
.stat-card:nth-child(4) {
  border-top: 3px solid var(--signature-mint);
}
.chart-toolbar h3,
.panel-toolbar h3 {
  color: var(--ink) !important;
  font-weight: 500 !important;
}
.seg {
  border-color: var(--hairline) !important;
  background: var(--surface-soft) !important;
  border-radius: var(--radius-sm);
}
.seg button {
  color: var(--body) !important;
  font-weight: 500;
}
.seg button.active {
  background: var(--primary) !important;
  color: var(--on-primary) !important;
  border-radius: var(--radius-sm);
}
.table-wrap {
  border-color: var(--hairline) !important;
  background: var(--canvas) !important;
  border-radius: var(--radius-md);
}
.table-wrap table.data th {
  color: var(--muted) !important;
  background: var(--surface-soft) !important;
  border-bottom: 1px solid var(--hairline) !important;
  font-weight: 500;
}
.table-wrap table.data td {
  border-bottom-color: var(--hairline) !important;
  color: var(--body) !important;
}
.table-wrap table.data tr:hover td {
  background: var(--surface-soft) !important;
  color: var(--ink) !important;
}
.search-box,
.panel-toolbar .glass-input,
.date-field input,
.select-glass {
  background: var(--canvas) !important;
  background-color: var(--canvas) !important;
  border: 1px solid var(--hairline) !important;
  color: var(--ink) !important;
  border-radius: var(--radius-sm) !important;
}
.select-glass option {
  background: #ffffff;
  color: #181d26;
}

/* Modal / toast / dialog */
.app-toast {
  background: var(--canvas) !important;
  border: 1px solid var(--hairline) !important;
  color: var(--ink) !important;
  box-shadow: 0 8px 24px rgba(24, 29, 38, 0.08) !important;
  border-radius: var(--radius-md);
}
.modal,
.modal.glass,
.modal.glass-strong {
  background: var(--canvas) !important;
  border: 1px solid var(--hairline) !important;
  box-shadow: 0 16px 48px rgba(24, 29, 38, 0.12) !important;
  color: var(--ink) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-radius: var(--radius-lg) !important;
}
.modal-head h2 {
  color: var(--ink) !important;
  font-weight: 500 !important;
}
.modal-close {
  color: var(--muted) !important;
}
.modal-backdrop {
  background: rgba(24, 29, 38, 0.35);
}
.order-dialog .order-dialog-panel.modal,
.order-dialog .order-dialog-panel {
  background: var(--canvas) !important;
  border: 1px solid var(--hairline) !important;
  color: var(--ink) !important;
}
.order-dialog::backdrop {
  background: rgba(24, 29, 38, 0.35);
}
.pager .page-num {
  background: var(--surface-soft) !important;
  border: 1px solid var(--hairline) !important;
  color: var(--ink) !important;
}
.ops-danger,
.btn-danger-outline {
  color: var(--signature-coral) !important;
  border-color: rgba(170, 45, 0, 0.35) !important;
  background: rgba(170, 45, 0, 0.06) !important;
}
.ops-danger:hover,
.btn-danger-outline:hover {
  background: rgba(170, 45, 0, 0.12) !important;
  border-color: rgba(170, 45, 0, 0.5) !important;
  color: #7a2000 !important;
}

/* User menu / avatar / misc */
.user-menu-dropdown {
  background: var(--canvas) !important;
  border: 1px solid var(--hairline) !important;
  box-shadow: 0 12px 32px rgba(24, 29, 38, 0.1) !important;
  color: var(--ink) !important;
  border-radius: var(--radius-md);
}
.user-menu-item {
  color: var(--body) !important;
}
.user-menu-item:hover {
  background: var(--surface-soft) !important;
  color: var(--ink) !important;
}
.user-menu-item.danger {
  color: var(--signature-coral) !important;
}
.avatar,
.avatar.sm,
.brand-mark {
  background: var(--primary) !important;
  color: var(--on-primary) !important;
  box-shadow: none !important;
}
.topbar-scope,
.user-scope-line {
  color: var(--body) !important;
}
.page-filter-bar,
.project-page-filter span {
  color: var(--body) !important;
}
.chart-tooltip {
  background: var(--canvas) !important;
  border: 1px solid var(--hairline) !important;
  color: var(--ink) !important;
}
.finance-chart-legend .leg-expense::before {
  background: var(--signature-coral) !important;
}
.chart-tooltip .tip-dot.expense {
  background: var(--signature-coral) !important;
}
.finance-chart-legend .leg-income::before,
.chart-tooltip .tip-dot.income {
  background: var(--signature-forest) !important;
}
.brand-mark,
.erp-badge {
  color: #fff !important;
}

/* Main content area sits on white canvas */
#view-app,
#view-app.active,
.main {
  background: var(--canvas);
}

/* Hardcoded blue/purple residue overrides */
.btn-primary:hover,
.btn-login:hover {
  background: var(--primary-active) !important;
  background-image: none !important;
}
.ledger-tab:hover {
  background: rgba(24, 29, 38, 0.05) !important;
  color: var(--ink) !important;
}
.ledger-tab.active {
  background: var(--primary) !important;
  background-image: none !important;
  color: var(--on-primary) !important;
  box-shadow: none !important;
}
.ledger-mode-toggle {
  background: var(--surface-soft) !important;
  border: 1px solid var(--hairline) !important;
  border-radius: var(--radius-sm) !important;
}
.ledger-mode-btn.active {
  background: var(--primary) !important;
  color: var(--on-primary) !important;
}
.finance-chart-legend .leg-income::before {
  background: var(--signature-forest) !important;
}
.finance-chart-legend .leg-expense::before {
  background: var(--signature-coral) !important;
}
.chart-tooltip .tip-dot.income {
  background: var(--signature-forest) !important;
}
.chart-tooltip .tip-dot.expense {
  background: var(--signature-coral) !important;
}

/* ============================================================
   vibe-coding-cn t99 — 中文业务软件审美（财务后台）
   Final visual authority over Airtable t91 near-black / magazine
   signature stripes. Tokens + shell/login/table/button only.
   ============================================================ */

:root {
  /* Surfaces */
  --canvas: #ffffff;
  --bg-deep: #f5f7fa;
  --bg-mid: #f5f7fa;
  --surface: #ffffff;
  --surface-soft: #f5f7fa;
  --surface-strong: #e8edf3;
  --surface-dark: #1e3a5f;
  --surface-dark-elevated: #16304f;

  /* Brand / primary — 稳重蓝 / 墨青 */
  --primary: #1e3a5f;
  --primary-active: #16304f;
  --primary-soft: #2563a8;
  --on-primary: #ffffff;
  --on-dark: #ffffff;

  /* Text */
  --ink: #1f2937;
  --body: #1f2937;
  --muted: #6b7280;
  --text: #1f2937;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;

  /* Borders */
  --hairline: #e5e7eb;
  --border-strong: #d1d5db;

  /* Links / info */
  --link: #2563a8;
  --link-active: #1e3a5f;
  --info: #2563a8;
  --info-border: #2563a8;

  /* Semantic (克制) */
  --success: #15803d;
  --success-border: #22c55e;
  --status-orange: #d97706;
  --status-yellow: #f59e0b;
  --status-green: #16a34a;
  --status-red: #dc2626;

  /* Income / expense accents only — not magazine stripes */
  --signature-coral: #c2410c;
  --signature-forest: #166534;
  --signature-cream: #f5f7fa;
  --signature-peach: #f5f7fa;
  --signature-mint: #ecfdf5;
  --signature-yellow: #fef3c7;
  --signature-mustard: #d97706;

  /* Compat aliases */
  --lime: #2563a8;
  --lime-soft: #6b7280;
  --lime-dim: rgba(37, 99, 168, 0.10);
  --lime-glow: rgba(37, 99, 168, 0.18);
  --accent: #1e3a5f;
  --accent-2: #16304f;
  --accent-gold: #d97706;
  --accent-gold-soft: #c2410c;
  --accent-pink: #c2410c;
  --accent-grad: #2563a8;

  --glass-bg: #ffffff;
  --glass-bg-strong: #ffffff;
  --glass-bg-soft: #f5f7fa;
  --glass-border: #e5e7eb;
  --glass-border-bright: #d1d5db;
  --glass-highlight: #ffffff;
  --glass-blur: 0px;
  --radius-card: 8px;
  --radius-lg: 10px;
  --radius-md: 8px;
  --radius-sm: 6px;
  --radius-pill: 9999px;
  --sidebar-w: 220px;
  --shadow-glass: none;
  --shadow-btn: 0 1px 2px rgba(30, 58, 95, 0.12);
  --shadow-card: 0 1px 3px rgba(31, 41, 55, 0.06);
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system,
    "Segoe UI", "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
}

body {
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); }
a:active { color: var(--link-active); }

/* Flat cool gray canvas — no purple/pink orbs */
.app-bg {
  background: var(--bg-deep) !important;
  opacity: 1 !important;
}
.app-bg::before,
.app-bg::after,
.app-bg .orb,
.app-bg .blob {
  display: none !important;
  opacity: 0 !important;
}

.glass,
.glass-strong {
  background: var(--canvas) !important;
  border: 1px solid var(--hairline) !important;
  box-shadow: var(--shadow-card) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.glass::before,
.glass-strong::before {
  opacity: 0 !important;
  background: none !important;
}
.glass-input {
  background: var(--canvas) !important;
  border: 1px solid var(--hairline) !important;
  color: var(--ink) !important;
  border-radius: var(--radius-sm) !important;
}
.glass-input:focus,
.input-wrap.glass-input:focus-within {
  border-color: var(--primary-soft) !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 168, 0.18) !important;
}

/* Buttons — solid blue primary (not near-black) */
.btn {
  border-radius: var(--radius-md);
  font-weight: 500;
}
.btn-primary,
.btn-login {
  background: var(--primary-soft) !important;
  color: var(--on-primary) !important;
  border: 1px solid var(--primary-soft) !important;
  box-shadow: var(--shadow-btn) !important;
  border-radius: var(--radius-md) !important;
  background-image: none !important;
}
.btn-primary:hover,
.btn-login:hover,
.btn-primary:active,
.btn-login:active {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: var(--on-primary) !important;
  box-shadow: var(--shadow-btn) !important;
  background-image: none !important;
}
.btn-primary:disabled:hover,
.btn-primary[disabled]:hover {
  background: var(--primary-soft) !important;
}
.btn-ghost,
.btn-secondary {
  background: var(--canvas) !important;
  color: var(--ink) !important;
  border: 1px solid var(--hairline) !important;
  box-shadow: none !important;
  border-radius: var(--radius-md) !important;
}
.btn-ghost:hover,
.btn-secondary:hover {
  background: var(--surface-soft) !important;
  border-color: var(--border-strong) !important;
  color: var(--ink) !important;
}
.btn-outline-lime {
  color: var(--primary-soft) !important;
  border: 1px solid rgba(37, 99, 168, 0.45) !important;
  background: var(--canvas) !important;
}
.btn-outline-lime:hover {
  background: rgba(37, 99, 168, 0.06) !important;
}
.btn-danger-text {
  color: var(--status-red) !important;
  border-color: rgba(220, 38, 38, 0.35) !important;
}

/* ===================== LOGIN: 简洁居中白卡 ===================== */
#view-login {
  --lime: #2563a8;
  --lime-soft: #6b7280;
  --lime-dim: rgba(37, 99, 168, 0.10);
  --lime-glow: rgba(37, 99, 168, 0.18);
  --accent: #1e3a5f;
  --accent-2: #16304f;
  --accent-grad: #2563a8;
  --bg-deep: #f5f7fa;
  --bg-mid: #f5f7fa;
  --surface: #ffffff;
  --text: #1f2937;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --glass-bg: #ffffff;
  --glass-bg-strong: #ffffff;
  --glass-bg-soft: #f5f7fa;
  --glass-border: #e5e7eb;
  --glass-border-bright: #d1d5db;
  background: var(--bg-deep) !important;
  overflow: auto;
  display: none;
  min-height: 100vh;
  position: relative;
  color: var(--body);
}
#view-login.active { display: flex; }
#view-login::before,
#view-login::after {
  content: none !important;
  display: none !important;
}

.login-layout {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  padding: 40px 20px;
  position: relative;
  z-index: 1;
  background: var(--bg-deep);
  grid-template-columns: none !important;
  grid-template-rows: none !important;
}

.login-art,
.login-art-veil,
.login-art-caption,
.login-topbar,
.login-hero,
.login-card-wrap,
.login-card-ring {
  display: none !important;
}

.login-panel {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 0 !important;
  background: transparent !important;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-panel-inner { width: 100%; position: relative; }
.login-panel-brand {
  margin-bottom: 20px;
  justify-content: flex-start;
}
.login-panel .brand-mark,
.brand-mark {
  background: var(--primary) !important;
  color: var(--on-primary) !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  font-weight: 600 !important;
}
.login-panel .brand-text strong {
  color: var(--ink) !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em;
}
.login-panel .brand-text span {
  color: var(--muted) !important;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 400;
  font-size: 12px;
}

.login-panel .login-card,
.login-card {
  background: var(--canvas) !important;
  border: 1px solid var(--hairline) !important;
  border-radius: 10px !important;
  box-shadow: 0 4px 24px rgba(31, 41, 55, 0.06) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  padding: 28px 28px 24px !important;
  max-width: 420px;
  width: 100%;
  overflow: visible;
}
.login-panel .login-card h2,
.login-card h2 {
  color: var(--ink) !important;
  font-size: 22px !important;
  font-weight: 600 !important;
  letter-spacing: 0;
  margin-bottom: 6px;
}
.login-panel .login-card .sub,
.login-card .sub {
  color: var(--muted) !important;
  font-size: 13px !important;
  margin-bottom: 22px;
}
.login-panel .login-badge,
.login-badge {
  background: rgba(37, 99, 168, 0.08) !important;
  border: 1px solid rgba(37, 99, 168, 0.22) !important;
  color: var(--primary-soft) !important;
  border-radius: 6px !important;
  font-weight: 500 !important;
  font-size: 12px;
  padding: 3px 10px;
  height: auto;
}
.login-panel .portal-tag,
.portal-tag {
  color: var(--muted) !important;
  font-size: 13px;
  font-weight: 500;
}
.login-panel .portal-tag .dot,
.login-panel .login-secure .dot,
.portal-tag .dot,
.login-secure .dot {
  background: var(--primary-soft) !important;
  box-shadow: none !important;
}
.login-panel .field label,
.field label {
  color: var(--text-secondary) !important;
  font-weight: 500;
}
.login-panel .field .req,
.field .req {
  color: var(--status-red) !important;
  font-weight: 500;
}
.login-panel .input-wrap.glass-input,
.input-wrap.glass-input {
  background: var(--canvas) !important;
  border: 1px solid var(--hairline) !important;
  color: var(--ink) !important;
  border-radius: 6px !important;
  min-height: 44px;
}
.login-panel .input-wrap.glass-input:focus-within {
  border-color: var(--primary-soft) !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 168, 0.18) !important;
}
.login-panel .input-wrap input,
.input-wrap input { color: var(--ink) !important; }
.login-panel .input-wrap .icon,
.login-panel .input-wrap .show-btn { color: var(--muted) !important; }
.login-panel .input-wrap .show-btn:hover { color: var(--primary-soft) !important; }

.login-panel .login-actions .btn-primary,
.login-panel .login-actions .btn-login,
.login-actions .btn-primary,
.login-actions .btn-login {
  background: var(--primary-soft) !important;
  color: var(--on-primary) !important;
  border: 1px solid var(--primary-soft) !important;
  box-shadow: var(--shadow-btn) !important;
  border-radius: 8px !important;
  letter-spacing: 0 !important;
  width: 100%;
  font-weight: 600;
  padding: 12px 24px;
  height: 44px;
  background-image: none !important;
}
.login-panel .login-actions .btn-login:hover,
.login-actions .btn-login:hover {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  box-shadow: var(--shadow-btn) !important;
}
.login-panel .login-secure,
.login-secure {
  color: var(--muted) !important;
  margin-top: 16px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

/* ===================== APP SHELL ===================== */
#view-app,
#view-app.active,
.main {
  background: var(--bg-deep);
}

.sidebar,
.sidebar.glass {
  background: #ffffff !important;
  border: 1px solid var(--hairline) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-radius: 10px !important;
}
.sidebar.glass::before { opacity: 0 !important; }

.erp-badge {
  background: var(--primary) !important;
  color: var(--on-primary) !important;
  box-shadow: none !important;
  border-radius: 8px !important;
  font-weight: 500 !important;
}
.sidebar-brand {
  color: var(--muted) !important;
  letter-spacing: 0.04em;
  font-weight: 500 !important;
}
.nav-group-title {
  color: var(--muted) !important;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}
.nav-item {
  color: var(--text-secondary) !important;
  border-radius: 6px;
  font-weight: 400;
  border-left: 3px solid transparent;
}
.nav-item:hover {
  background: rgba(37, 99, 168, 0.06) !important;
  color: var(--ink) !important;
}
.nav-item.active {
  background: rgba(37, 99, 168, 0.10) !important;
  border-color: transparent !important;
  color: var(--primary) !important;
  box-shadow: none !important;
  border-left: 3px solid var(--primary-soft) !important;
  font-weight: 600 !important;
}
.nav-item.active svg {
  color: var(--primary-soft) !important;
  opacity: 1;
}
.sidebar-foot {
  background: var(--surface-soft) !important;
  border-color: var(--hairline) !important;
}
.sidebar-foot-btn:hover {
  background: rgba(37, 99, 168, 0.06) !important;
}

.topbar {
  border-bottom: 1px solid var(--hairline);
  background: transparent;
}
.breadcrumb { color: var(--muted) !important; }
.greeting h1,
.page-head h1 {
  color: var(--ink) !important;
  font-weight: 600 !important;
}
.page-head .eng,
.greeting .date { color: var(--muted) !important; }

/* Cards / panels */
.stat-card,
.chart-panel,
.panel,
.glass {
  border-color: var(--hairline) !important;
  background: var(--canvas) !important;
  box-shadow: var(--shadow-card) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-radius: 8px !important;
}
.glass-strong {
  background: var(--canvas) !important;
  border-color: var(--hairline) !important;
}
.stat-card .label {
  color: var(--muted) !important;
  font-weight: 500;
}
.stat-card .value {
  color: var(--ink) !important;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.stat-icon {
  background: rgba(37, 99, 168, 0.08) !important;
  border: 1px solid rgba(37, 99, 168, 0.16) !important;
  color: var(--primary-soft) !important;
}
.stat-card .deco { border-color: var(--hairline) !important; }

/* 去掉营销签名色顶条；合计卡保持冷静边框 */
.stat-card:nth-child(1),
.stat-card:nth-child(2),
.stat-card:nth-child(3),
.stat-card:nth-child(4) {
  border-top: 1px solid var(--hairline) !important;
}

.chart-toolbar h3,
.panel-toolbar h3 {
  color: var(--ink) !important;
  font-weight: 600 !important;
}
.seg {
  border-color: var(--hairline) !important;
  background: var(--surface-soft) !important;
  border-radius: 6px;
}
.seg button {
  color: var(--text-secondary) !important;
  font-weight: 500;
}
.seg button.active {
  background: var(--primary-soft) !important;
  color: var(--on-primary) !important;
  border-radius: 6px;
}

/* Tables — 对账友好行高 + hairline */
.table-wrap {
  border-color: var(--hairline) !important;
  background: var(--canvas) !important;
  border-radius: 8px;
}
.table-wrap table.data th,
table.data th {
  color: var(--muted) !important;
  background: #f0f3f7 !important;
  border-bottom: 1px solid var(--hairline) !important;
  font-weight: 600;
  padding: 11px 14px;
}
.table-wrap table.data td,
table.data td {
  border-bottom: 1px solid var(--hairline) !important;
  color: var(--text-secondary) !important;
  padding: 12px 14px;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
.table-wrap table.data tr:hover td,
table.data tr:hover td {
  background: rgba(37, 99, 168, 0.04) !important;
  color: var(--ink) !important;
}

.search-box,
.panel-toolbar .glass-input,
.date-field input,
.select-glass {
  background: var(--canvas) !important;
  background-color: var(--canvas) !important;
  border: 1px solid var(--hairline) !important;
  color: var(--ink) !important;
  border-radius: 6px !important;
}
.select-glass option {
  background: #ffffff;
  color: #1f2937;
}

/* Modal / toast */
.app-toast {
  background: var(--canvas) !important;
  border: 1px solid var(--hairline) !important;
  color: var(--ink) !important;
  box-shadow: 0 8px 24px rgba(31, 41, 55, 0.10) !important;
  border-radius: 8px;
}
.modal,
.modal.glass,
.modal.glass-strong {
  background: var(--canvas) !important;
  border: 1px solid var(--hairline) !important;
  box-shadow: 0 16px 48px rgba(31, 41, 55, 0.14) !important;
  color: var(--ink) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-radius: 10px !important;
}
.modal-head h2 {
  color: var(--ink) !important;
  font-weight: 600 !important;
}
.modal-close { color: var(--muted) !important; }
.modal-backdrop { background: rgba(31, 41, 55, 0.40); }
.order-dialog .order-dialog-panel.modal,
.order-dialog .order-dialog-panel {
  background: var(--canvas) !important;
  border: 1px solid var(--hairline) !important;
  color: var(--ink) !important;
}
.order-dialog::backdrop { background: rgba(31, 41, 55, 0.40); }

.pager .page-num {
  background: var(--surface-soft) !important;
  border: 1px solid var(--hairline) !important;
  color: var(--ink) !important;
}
.ops-danger,
.btn-danger-outline {
  color: var(--status-red) !important;
  border-color: rgba(220, 38, 38, 0.35) !important;
  background: rgba(220, 38, 38, 0.05) !important;
}
.ops-danger:hover,
.btn-danger-outline:hover {
  background: rgba(220, 38, 38, 0.10) !important;
  border-color: rgba(220, 38, 38, 0.5) !important;
  color: #b91c1c !important;
}

.user-menu-dropdown {
  background: var(--canvas) !important;
  border: 1px solid var(--hairline) !important;
  box-shadow: 0 12px 32px rgba(31, 41, 55, 0.10) !important;
  color: var(--ink) !important;
  border-radius: 8px;
}
.user-menu-item { color: var(--text-secondary) !important; }
.user-menu-item:hover {
  background: var(--surface-soft) !important;
  color: var(--ink) !important;
}
.user-menu-item.danger { color: var(--status-red) !important; }

.avatar,
.avatar.sm {
  background: var(--primary) !important;
  color: var(--on-primary) !important;
  box-shadow: none !important;
  background-image: none !important;
}
.topbar-scope,
.user-scope-line,
.page-filter-bar,
.project-page-filter span {
  color: var(--text-secondary) !important;
}

/* Income / expense semantic dots only */
.finance-chart-legend .leg-income::before,
.chart-tooltip .tip-dot.income {
  background: var(--signature-forest) !important;
}
.finance-chart-legend .leg-expense::before,
.chart-tooltip .tip-dot.expense {
  background: var(--signature-coral) !important;
}
#live-log-table .type-pill.is-income {
  color: var(--signature-forest) !important;
  background: rgba(22, 101, 52, 0.08) !important;
  border-color: rgba(22, 101, 52, 0.22) !important;
}
#live-log-table .type-pill.is-expense {
  color: var(--signature-coral) !important;
  background: rgba(194, 65, 12, 0.08) !important;
  border-color: rgba(194, 65, 12, 0.22) !important;
}

.chart-tooltip {
  background: var(--canvas) !important;
  border: 1px solid var(--hairline) !important;
  color: var(--ink) !important;
}

.ledger-tab:hover {
  background: rgba(37, 99, 168, 0.06) !important;
  color: var(--ink) !important;
}
.ledger-tab.active {
  background: var(--primary-soft) !important;
  background-image: none !important;
  color: var(--on-primary) !important;
  box-shadow: none !important;
}
.ledger-mode-toggle {
  background: var(--surface-soft) !important;
  border: 1px solid var(--hairline) !important;
  border-radius: 6px !important;
}
.ledger-mode-btn.active {
  background: var(--primary-soft) !important;
  color: var(--on-primary) !important;
}

/* 实时/月度合计卡 — 冷静可核对 */
.live-channel-sum,
.monthly-year-sum {
  background: var(--canvas) !important;
  border: 1px solid var(--hairline) !important;
  border-radius: 8px;
  box-shadow: var(--shadow-card);
}
.live-channel-sum-label {
  color: var(--muted) !important;
}
.live-channel-sum-value {
  color: var(--ink) !important;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.brand-mark,
.erp-badge {
  color: #fff !important;
}
