/* BER WORKBENCH — Light purple/blue glassmorphism */
:root {
  /* --lime kept as accent alias for existing class/JS compatibility */
  --lime: #7c5cfc;
  --lime-soft: #8b6fff;
  --lime-dim: rgba(124, 92, 252, 0.12);
  --lime-glow: rgba(124, 92, 252, 0.28);
  --accent: #7c5cfc;
  --accent-2: #5b8def;
  --accent-grad: linear-gradient(135deg, #7c5cfc 0%, #5b8def 100%);
  --bg-deep: #eef1f8;
  --bg-mid: #e8ecf6;
  --text: #1e2433;
  --text-secondary: #5c6578;
  --text-muted: #8b93a7;
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-bg-strong: rgba(255, 255, 255, 0.88);
  --glass-bg-soft: rgba(255, 255, 255, 0.5);
  --glass-border: rgba(148, 163, 200, 0.28);
  --glass-border-bright: rgba(148, 163, 200, 0.4);
  --glass-highlight: rgba(255, 255, 255, 0.65);
  --glass-blur: 24px;
  --radius-card: 22px;
  --radius-lg: 26px;
  --radius-md: 14px;
  --radius-pill: 999px;
  --sidebar-w: 220px;
  --font: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  --shadow-glass: 0 10px 36px rgba(90, 110, 170, 0.10),
    0 2px 8px rgba(90, 110, 170, 0.06);
  --shadow-btn: 0 6px 20px rgba(124, 92, 252, 0.32);
  --status-orange: #ff9f43;
  --status-yellow: #f7c948;
  --status-green: #2ecc71;
  --status-red: #ff6b7a;
}

*,
*::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 80% 60% at 70% -10%, rgba(180, 170, 255, 0.45), transparent 55%),
    radial-gradient(ellipse 55% 45% at 10% 20%, rgba(160, 200, 255, 0.35), transparent 55%),
    radial-gradient(ellipse 50% 40% at 90% 80%, rgba(200, 180, 255, 0.28), transparent 55%),
    radial-gradient(ellipse 40% 35% at 40% 90%, rgba(170, 220, 255, 0.22), transparent 60%),
    linear-gradient(165deg, #f4f6fb 0%, #e8ecf7 45%, #eef0f8 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(124, 92, 252, 0.22), transparent 70%);
}

.app-bg::after {
  width: 480px;
  height: 480px;
  bottom: 0%;
  right: -60px;
  background: radial-gradient(circle, rgba(91, 141, 239, 0.28), transparent 70%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(124, 92, 252, 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(124, 92, 252, 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(124, 92, 252, 0.45);
  box-shadow: 0 0 0 3px rgba(124, 92, 252, 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, #8b6fff 0%, #6a9af5 100%);
  box-shadow: 0 8px 28px rgba(124, 92, 252, 0.42);
}

.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(124, 92, 252, 0.35);
}

.btn-outline-lime {
  background: transparent;
  color: var(--lime);
  border: 1px solid rgba(124, 92, 252, 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 {
  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(124, 92, 252, 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(124, 92, 252, 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(124, 92, 252, 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(124, 92, 252, 0.55);
  color: var(--lime);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(124, 92, 252, 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(124, 92, 252, 0.35), 0 0 0 1px rgba(124, 92, 252, 0.12);
}

.login-actions .btn-login:hover {
  box-shadow: 0 12px 32px rgba(124, 92, 252, 0.42), 0 0 0 1px rgba(124, 92, 252, 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;
}

.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(124, 92, 252, 0.06);
  color: var(--text);
}

.nav-item.active {
  background: rgba(124, 92, 252, 0.10);
  border-color: transparent;
  color: var(--lime);
  box-shadow: inset 3px 0 0 var(--lime);
}

.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, #8b6fff, #5b8def);
  border: 1px solid rgba(124, 92, 252, 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(124, 92, 252, 0.4);
  color: var(--lime);
}

.page {
  display: none;
  flex: 1;
  flex-direction: column;
  gap: 18px;
}

.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(124, 92, 252, 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(124, 92, 252, 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(124, 92, 252, 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(124, 92, 252, 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(124, 92, 252, 0.18);
}
.blob-c {
  width: 480px;
  height: 480px;
  bottom: -80px;
  left: 40%;
  background: rgba(160, 90, 255, 0.22);
}

/* —— Order detail —— */
.order-link {
  color: var(--lime);
  font-weight: 600;
  border-bottom: 1px solid rgba(124, 92, 252, 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(124, 92, 252, 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;
}



/* Placeholder toast */
.app-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 1000;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(124, 92, 252, 0.35);
  color: var(--text);
  font-size: 13px;
  backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: 0 12px 40px rgba(90, 110, 170, 0.18);
}
.app-toast[hidden] {
  display: none !important;
}


/* 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(124,92,252,0.5);
  display: grid;
  place-items: center;
  color: var(--lime);
  font-size: 28px;
  background: rgba(124,92,252,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, #5b8def 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(124, 92, 252, 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(124, 92, 252, 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(124, 92, 252, 0.35);
  background: rgba(124, 92, 252, 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(124, 92, 252, 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(124, 92, 252, 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(124, 92, 252, 0.08);
  color: var(--lime);
  border-color: rgba(124, 92, 252, 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(124, 92, 252, 0.55);
  box-shadow:
    0 0 0 3px rgba(124, 92, 252, 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, #7c5cfc);
  font-weight: 600;
}

#page-order-detail .detail-edit-input:focus {
  outline: none;
  border-color: rgba(124, 92, 252, 0.55);
  box-shadow: 0 0 0 3px rgba(124, 92, 252, 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 (light purple glass) ===================== */
:root {
  --lime: #7c5cfc;
  --lime-soft: #8b6fff;
  --lime-dim: rgba(124, 92, 252, 0.12);
  --lime-glow: rgba(124, 92, 252, 0.28);
  --bg-deep: #eef1f8;
  --bg-mid: #e8ecf6;
  --text: #1e2433;
  --text-secondary: #5c6578;
  --text-muted: #8b93a7;
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-bg-strong: rgba(255, 255, 255, 0.9);
  --glass-bg-soft: rgba(255, 255, 255, 0.5);
  --glass-border: rgba(148, 163, 200, 0.28);
  --glass-border-bright: rgba(148, 163, 200, 0.42);
  --glass-highlight: rgba(255, 255, 255, 0.7);
  --glass-blur: 24px;
  --radius-card: 22px;
  --radius-lg: 26px;
  --radius-md: 14px;
  --sidebar-w: 220px;
  --shadow-glass: 0 10px 36px rgba(90, 110, 170, 0.10),
    0 2px 8px rgba(90, 110, 170, 0.06);
  --shadow-btn: 0 6px 20px rgba(124, 92, 252, 0.32);
}

body {
  min-width: 0;
  overflow-x: hidden;
  background: var(--bg-deep);
  color: var(--text);
}

.app-bg {
  background:
    radial-gradient(ellipse 75% 55% at 78% -8%, rgba(186, 176, 255, 0.5), transparent 58%),
    radial-gradient(ellipse 50% 45% at 5% 25%, rgba(160, 205, 255, 0.38), transparent 58%),
    radial-gradient(ellipse 45% 40% at 92% 85%, rgba(200, 185, 255, 0.3), transparent 58%),
    linear-gradient(155deg, #f5f7fc 0%, #e9edf8 55%, #eef1f8 100%);
}

.app-bg::before,
.app-bg::after,
.app-bg .orb,
.app-bg .blob {
  opacity: 0.45;
}

#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.78);
  box-shadow: var(--shadow-glass);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.2);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.2);
}

.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(124, 92, 252, 0.1);
  border-color: transparent;
  color: var(--lime);
  box-shadow: inset 3px 0 0 var(--lime);
}

.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.78);
  box-shadow: var(--shadow-glass);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.15);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.15);
}

.glass-strong {
  background: rgba(255, 255, 255, 0.9);
  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(124, 92, 252, 0.22);
  color: var(--lime);
}

.stat-card .deco {
  width: 100px;
  height: 100px;
  right: -18px;
  bottom: -36px;
  border-color: rgba(124, 92, 252, 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, #8b6fff 0%, #6a9af5 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, 200, 0.22);
  background: rgba(255, 255, 255, 0.55);
  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.88);
  border: 1px solid var(--glass-border-bright);
  box-shadow: 0 20px 60px rgba(90, 110, 170, 0.14);
}

.login-hero .eyebrow,
.login-badge,
.portal-tag .dot,
.login-secure .dot {
  color: var(--lime);
}

.login-badge {
  border-color: rgba(124, 92, 252, 0.4);
  background: rgba(124, 92, 252, 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(124, 92, 252, 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(124, 92, 252, 0.45);
  box-shadow: 0 0 0 3px rgba(124, 92, 252, 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: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 12px;
  max-width: min(520px, 56vw);
  text-align: right;
  line-height: 1.35;
}
.user-scope-line {
  display: inline-block;
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(260px, 40vw);
}
/* 侧栏用户卡：类目/店铺分行对齐，次级字号 */
.user-meta .user-scope-side,
.user-scope-side {
  display: flex !important;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 2px;
  margin-top: 2px;
  line-height: 1.35;
  min-width: 0;
  max-width: 100%;
}
.user-meta .user-scope-side .user-scope-line,
.user-scope-side .user-scope-line {
  display: block;
  flex: 0 1 auto;
  min-width: 0;
  width: 100%;
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  word-break: normal;
}

/* 侧栏底部用户信息卡排版：头像与文字垂直居中，文字块层次清晰 */
.sidebar-foot {
  padding: 10px 12px;
}
.sidebar-foot-btn {
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  min-width: 0;
}
.sidebar-foot .avatar {
  width: 40px;
  height: 40px;
  font-size: 15px;
}
.sidebar-foot .user-meta,
.sidebar-foot .user-meta-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
  flex: 1;
  text-align: left;
  line-height: 1.25;
}
.sidebar-foot .user-meta strong,
.sidebar-foot .user-meta-side strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-foot .user-meta .user-role,
.sidebar-foot .user-meta #sidebar-role,
.sidebar-foot .user-meta-side .user-role {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.3;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.avatar.avatar-ring,
#topbar-avatar.avatar-ring,
#topbar-avatar {
  position: relative;
  border-radius: 50%;
  border: 2px solid rgba(124, 92, 252, 0.55);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.92),
    0 0 0 4px rgba(124, 92, 252, 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(124, 92, 252, 0.28);
  background: rgba(124, 92, 252, 0.08);
  color: var(--text-secondary);
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  opacity: 0.85;
  cursor: default;
  user-select: none;
}

/* TEAM_TABLE_LAYOUT */
/* 团队管理：表头与内容居中、增加间距、垂直居中 */
#page-team table.data th,
#page-team table.data td,
#team-table th,
#team-table td {
  text-align: center !important;
  vertical-align: middle;
  padding: 14px 16px;
}
#page-team table.data th,
#team-table th {
  padding: 12px 16px;
  font-weight: 500;
}
#page-team table.data td .ops,
#team-table td .ops {
  justify-content: center;
  align-items: center;
  margin-inline: auto;
  gap: 8px;
}
#page-team table.data .modules-cell,
#page-team table.data .categories-cell,
#page-team table.data .shops-cell,
#team-table .modules-cell,
#team-table .categories-cell,
#team-table .shops-cell {
  text-align: center !important;
  max-width: none;
  word-break: break-word;
  line-height: 1.5;
  padding-left: 16px;
  padding-right: 16px;
}
/* 列宽：避免挤在一起，长文案列略宽 */
#team-table th:nth-child(1),
#team-table td:nth-child(1) { width: 9%; }   /* 成员 */
#team-table th:nth-child(2),
#team-table td:nth-child(2) { width: 10%; }  /* 账号 */
#team-table th:nth-child(3),
#team-table td:nth-child(3) { width: 10%; }  /* 角色 */
#team-table th:nth-child(4),
#team-table td:nth-child(4) { width: 9%; }   /* 密码 */
#team-table th:nth-child(5),
#team-table td:nth-child(5) { width: 16%; }  /* 板块 */
#team-table th:nth-child(6),
#team-table td:nth-child(6) { width: 12%; }  /* 类目 */
#team-table th:nth-child(7),
#team-table td:nth-child(7) { width: 12%; }  /* 店铺 */
#team-table th:nth-child(8),
#team-table td:nth-child(8) { width: 12%; }  /* 最近登录 */
#team-table th:nth-child(9),
#team-table td:nth-child(9) { width: 10%; }  /* 操作 */


/* —— 订单创建天数着色 —— */
.created-days {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  border: 1px solid transparent;
}
.created-days-d1 {
  color: #3b82f6;
  background: rgba(147, 197, 253, 0.35);
  border-color: rgba(147, 197, 253, 0.65);
}
.created-days-d2 {
  color: #1e3a8a;
  background: rgba(37, 99, 235, 0.22);
  border-color: rgba(37, 99, 235, 0.55);
}
.created-days-d3 {
  color: #fff;
  background: #e5484d;
  border-color: rgba(229, 72, 77, 0.75);
}


/* order detail: required nick + validation */
.detail-info-card dt .req {
  color: #ff4d4f;
  font-weight: 700;
  margin-left: 2px;
}
.detail-edit-input.input-error,
.detail-edit-input.input-error:focus {
  border-color: #ff4d4f !important;
  box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.22);
}


/* fulfill mark */
#fulfillment-table tr.row-marked td {
  background: rgba(250, 204, 21, 0.08);
}
#fulfillment-table .ops-order button.is-marked {
  color: #ca8a04;
  border-color: rgba(202, 138, 4, 0.45);
}


/* —— 店铺业绩 —— */
.shop-perf-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
}
.shop-perf-toolbar .inline-field {
  margin: 0;
  min-width: 140px;
}
.shop-perf-toolbar .inline-field span {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.shop-perf-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 4px 4px 14px;
}
.shop-perf-card {
  border-radius: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(148, 163, 200, 0.28);
  background: rgba(255, 255, 255, 0.55);
}
.shop-perf-card-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.shop-perf-card-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}
#shop-perf-table td:nth-child(3),
#shop-perf-table td:nth-child(4),
#shop-perf-table th:nth-child(3),
#shop-perf-table th:nth-child(4) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 900px) {
  .shop-perf-summary {
    grid-template-columns: 1fr;
  }
}


/* 店铺切换（运营概览 / 订单 / 已发） */
.shop-switch-field {
  margin: 0;
  min-width: 160px;
}
.shop-switch-field > span {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.overview-shop-toolbar {
  margin: 0 0 12px;
  padding: 0;
  justify-content: flex-start;
}
.shop-switch-select {
  min-width: 160px;
}


/* 店铺业绩：突出店铺切换，两卡汇总 */
.shop-perf-shop-field {
  min-width: 200px;
}
.shop-perf-shop-field .shop-switch-select,
#shop-perf-shop {
  min-width: 200px;
  font-weight: 600;
}
.shop-perf-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
#shop-perf-table td:nth-child(2),
#shop-perf-table td:nth-child(3),
#shop-perf-table th:nth-child(2),
#shop-perf-table th:nth-child(3) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}


/* —— 订单管理 / 已发订单：面板标题 + 虚线分隔 + 分区工具栏 —— */
.list-panel > .panel-section-head {
  display: flex;
  align-items: center;
  padding: 2px 2px 12px;
  margin: 0 0 12px;
  border-bottom: 1px dashed rgba(148, 163, 200, 0.5);
}
.list-panel > .panel-section-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
}
.list-panel > .list-toolbar.panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 14px;
  margin: 0 0 16px;
  padding: 0 2px 14px;
  border-bottom: 1px dashed rgba(148, 163, 200, 0.5);
}
.list-toolbar .toolbar-zone {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
}
.list-toolbar .toolbar-zone-actions {
  flex: 0 0 auto;
  min-height: 38px;
}
.list-toolbar .toolbar-zone-actions .btn {
  height: 38px;
  padding-left: 16px;
  padding-right: 16px;
}
.list-toolbar .toolbar-zone-filters {
  flex: 1 1 380px;
  min-width: 0;
}
.list-toolbar .toolbar-zone-ops {
  flex: 0 1 auto;
  margin-left: auto;
}
.list-toolbar .toolbar-zone-ops .btn {
  height: 38px;
}
.list-toolbar .stacked-field {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  min-width: 0;
}
.list-toolbar .stacked-field > span {
  display: block;
  font-size: 11px;
  line-height: 1.2;
  color: var(--text-muted);
  margin: 0;
  white-space: nowrap;
}
.list-toolbar .shop-switch-field {
  min-width: 140px;
  max-width: 180px;
}
.list-toolbar .shop-switch-field .shop-switch-select,
.list-toolbar .shop-switch-field select {
  height: 38px;
  min-width: 140px;
}
.list-toolbar .search-field {
  flex: 1 1 220px;
  min-width: 180px;
  max-width: 360px;
}
.list-toolbar .search-field .search-box {
  width: 100%;
  max-width: none;
  flex: none;
  min-width: 0;
  height: 38px;
}
.list-toolbar .date-range-field {
  flex: 0 1 auto;
}
.list-toolbar .date-range-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
}
.list-toolbar .date-range-inputs input[type="date"] {
  height: 38px;
  padding: 0 12px;
  width: 138px;
  font-size: 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(148, 163, 200, 0.32);
}
.list-toolbar .date-range-sep {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}
@media (max-width: 1100px) {
  .list-toolbar .toolbar-zone-ops {
    margin-left: 0;
    width: 100%;
  }
}


/* —— 商品下架红字 —— */
tr.product-row-offshelf td,
tr.product-row-offshelf td .price {
  color: #e11d48 !important;
}
tr.product-row-offshelf td .muted {
  color: #fb7185 !important;
}
.btn-offshelf {
  color: #e11d48;
  border-color: rgba(225, 29, 72, 0.28);
}
.btn-onshelf {
  color: #059669;
  border-color: rgba(5, 150, 105, 0.28);
}

/* —— 回收站 —— */
.recycle-source-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg-soft);
}
.recycle-source-orders { color: #4f46e5; }
.recycle-source-fulfillment { color: #0891b2; }
.recycle-days-warn { color: #e11d48; font-weight: 600; }

/* order item stale vs product master */
tr.order-item-stale td,
tr.order-item-stale td .price,
tr.order-item-stale td input {
  color: #e11d48 !important;
}
tr.order-item-stale td .muted {
  color: #fb7185 !important;
}
