
/* ============================================================
   ShopHub · 多店管理中枢
   Single-file demo console — design system
   ============================================================ */

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

:root {
  --bg: #f2f5f3;
  --bg-glow: rgba(0, 128, 96, .07);
  --surface: #ffffff;
  --surface-2: #f7faf8;
  --surface-3: #eef3f0;
  --text: #10201a;
  --text-2: #2f413a;
  --muted: #6c7f77;
  --faint: #93a49d;
  --line: #e1e8e4;
  --line-strong: #cfdad5;
  --accent: #008060;
  --accent-2: #0a9c76;
  --accent-soft: #e6f4ee;
  --accent-ring: rgba(0, 128, 96, .18);
  --lime: #95bf47;
  --amber: #a85a06;
  --amber-soft: #fdf1d6;
  --red: #b42318;
  --red-soft: #fde8e6;
  --blue: #1d4ed8;
  --blue-soft: #e5edff;
  --purple: #6d28d9;
  --purple-soft: #efeafe;
  --sidebar: #0a1b16;
  --sidebar-2: #0d241d;
  --sidebar-text: #c6d6cf;
  --sidebar-muted: #7c948b;
  --shadow: 0 1px 2px rgba(16, 36, 29, .05), 0 14px 34px -28px rgba(16, 36, 29, .45);
  --shadow-lg: 0 30px 70px -28px rgba(6, 24, 18, .45);
  --r: 14px;
  --r-sm: 10px;
  --topbar-h: 66px;
  --sidebar-w: 248px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", "Cascadia Code", Consolas, "Liberation Mono", monospace;
}

html[data-theme="dark"] {
  --bg: #07110d;
  --bg-glow: rgba(56, 211, 155, .08);
  --surface: #0d1915;
  --surface-2: #11201a;
  --surface-3: #16271f;
  --text: #e9f2ed;
  --text-2: #c2d3cb;
  --muted: #8ba198;
  --faint: #6e857b;
  --line: #1d3028;
  --line-strong: #2a4238;
  --accent: #35d19a;
  --accent-2: #4ce0a9;
  --accent-soft: #0e2c22;
  --accent-ring: rgba(53, 209, 154, .22);
  --amber: #f0b35a;
  --amber-soft: #2c2110;
  --red: #ff8b82;
  --red-soft: #2e1513;
  --blue: #8fb0ff;
  --blue-soft: #111d3a;
  --purple: #c4b0ff;
  --purple-soft: #1e1738;
  --sidebar: #07120e;
  --sidebar-2: #0a1d17;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 18px 44px -30px rgba(0, 0, 0, .9);
  --shadow-lg: 0 34px 80px -30px rgba(0, 0, 0, .9);
  color-scheme: dark;
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 520px at 88% -12%, var(--bg-glow), transparent 62%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

body.locked { overflow: hidden; }

h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.ico { flex: 0 0 auto; display: block; }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   Layout
   ============================================================ */

.app { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  z-index: 60;
  color: var(--sidebar-text);
  background:
    radial-gradient(420px 260px at 20% -8%, rgba(149, 191, 71, .16), transparent 60%),
    radial-gradient(520px 380px at 110% 108%, rgba(0, 128, 96, .28), transparent 62%),
    linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  border-right: 1px solid rgba(255, 255, 255, .05);
  transition: transform .28s ease, width .2s ease;
}

.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .35;
  background-image: radial-gradient(rgba(255, 255, 255, .16) .5px, transparent .5px);
  background-size: 18px 18px;
  mask-image: linear-gradient(180deg, #000, transparent 45%);
}

.sidebar > * { position: relative; z-index: 1; }

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  height: var(--topbar-h);
  padding: 0 18px;
  flex: 0 0 auto;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #07130f;
  background: linear-gradient(145deg, #b7e26a, #38b98a 78%);
  box-shadow: 0 6px 18px -8px rgba(149, 191, 71, .9), inset 0 1px 0 rgba(255, 255, 255, .45);
  flex: 0 0 auto;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name { font-weight: 750; font-size: 15.5px; letter-spacing: -.01em; color: #f1f8f4; }
.brand-sub { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--sidebar-muted); margin-top: 3px; }

.workspace-pill {
  margin: 2px 14px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, .09);
  background: rgba(255, 255, 255, .045);
  border-radius: 10px;
  font-size: 12px;
  color: #d9e8e1;
  flex: 0 0 auto;
}

.workspace-pill .dot-live {
  width: 7px; height: 7px; border-radius: 50%;
  background: #63e6b4;
  box-shadow: 0 0 0 4px rgba(99, 230, 180, .12);
}
.workspace-pill b { font-weight: 600; }
.workspace-pill .count { margin-left: auto; color: var(--sidebar-muted); font-size: 11px; }

.nav {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 4px 12px 16px;
  scrollbar-color: rgba(255, 255, 255, .16) transparent;
}
.nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); }

.nav-group { margin-top: 15px; }
.nav-group:first-child { margin-top: 4px; }

.nav-group-title {
  padding: 0 10px 7px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(198, 214, 207, .45);
}

.nav-item {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 40px;
  padding: 0 11px;
  margin: 2px 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--sidebar-text);
  font-size: 13.2px;
  font-weight: 500;
  text-align: left;
  transition: background .16s ease, color .16s ease;
}
.nav-item svg { opacity: .78; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(149, 191, 71, .17), rgba(149, 191, 71, .05));
  color: #effbf4;
}
.nav-item.active svg { opacity: 1; color: #a9dd68; }
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, #b7e26a, #38b98a);
}

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 19px;
  padding: 0 6px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
  color: #c9f0dd;
  background: rgba(255, 255, 255, .1);
}
.nav-badge.warn { background: rgba(240, 179, 90, .18); color: #ffd79a; }

.sidebar-foot { flex: 0 0 auto; padding: 10px 12px 14px; }

.quota-card {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: linear-gradient(160deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
  margin-bottom: 10px;
}
.quota-head { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--sidebar-muted); margin-bottom: 8px; }
.quota-head b { color: #d7e8e0; font-weight: 600; }
.quota-bar { height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.quota-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #95bf47, #3ecf8e); }
.quota-foot { margin-top: 7px; font-size: 10.5px; color: var(--sidebar-muted); display: flex; justify-content: space-between; }

.user-card { display: flex; align-items: center; gap: 10px; padding: 6px 4px; }
.user-card .avatar { background: linear-gradient(145deg, #26463b, #173229); color: #d9f0e6; border: 1px solid rgba(255, 255, 255, .1); }
.user-meta { min-width: 0; line-height: 1.25; }
.user-meta b { display: block; font-size: 12.5px; color: #e4f1eb; font-weight: 600; }
.user-meta span { font-size: 10.5px; color: var(--sidebar-muted); }
.user-card .icon-btn { margin-left: auto; color: var(--sidebar-muted); border-color: transparent; background: transparent; }
.user-card .icon-btn:hover { color: #fff; background: rgba(255, 255, 255, .08); }

/* Main column */
.main { flex: 1 1 auto; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 26px;
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.crumbs { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.crumbs b { color: var(--text); font-weight: 600; }
.crumbs .sep { opacity: .5; }

.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.demo-pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 9px;
  border-radius: 99px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
  color: var(--amber);
  background: var(--amber-soft);
  border: 1px solid color-mix(in srgb, var(--amber) 22%, transparent);
  white-space: nowrap;
}
.demo-pill i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.view {
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
  padding: 24px 26px 64px;
  flex: 1 0 auto;
}

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.page-head h1 { font-size: 23px; line-height: 1.2; letter-spacing: -.025em; font-weight: 700; }
.page-head p { margin-top: 5px; font-size: 13px; color: var(--muted); max-width: 720px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ============================================================
   Buttons / inputs
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, transform .06s ease, box-shadow .15s ease;
}
.btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; pointer-events: none; }

.btn-primary {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  box-shadow: 0 6px 16px -9px color-mix(in srgb, var(--accent) 90%, #000), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-primary:hover { background: linear-gradient(180deg, var(--accent), #006b51); border-color: transparent; }
html[data-theme="dark"] .btn-primary { color: #04231a; }
html[data-theme="dark"] .btn-primary:hover { background: linear-gradient(180deg, var(--accent-2), var(--accent)); }

.btn-soft { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.btn-soft:hover { background: color-mix(in srgb, var(--accent-soft) 76%, var(--accent) 8%); border-color: transparent; }

.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); border-color: transparent; }

.btn-danger { color: var(--red); background: var(--red-soft); border-color: transparent; }
.btn-danger:hover { background: color-mix(in srgb, var(--red-soft) 82%, var(--red) 8%); border-color: transparent; }

.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; gap: 5px; }
.btn-lg { height: 42px; padding: 0 18px; font-size: 13.5px; }
.btn-icon { width: 36px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }

.icon-btn {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.input, .select, .textarea {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 92px; padding: 10px 11px; resize: vertical; line-height: 1.55; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }

.search-box { position: relative; display: flex; align-items: center; }
.search-box svg { position: absolute; left: 10px; color: var(--faint); pointer-events: none; }
.search-box .input { padding-left: 33px; width: 220px; }
.search-box .input:focus { width: 260px; }
.search-box .input { transition: width .18s ease, border-color .15s, box-shadow .15s; }

.checkbox {
  appearance: none;
  width: 16px; height: 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  display: inline-grid;
  place-content: center;
  cursor: pointer;
  flex: 0 0 auto;
  transition: background .12s, border-color .12s;
}
.checkbox::after {
  content: "";
  width: 8px; height: 4.5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) scale(0);
  transition: transform .12s;
  margin-top: -1px;
}
.checkbox:checked { background: var(--accent); border-color: var(--accent); }
.checkbox:checked::after { transform: rotate(-45deg) scale(1); }

.radio {
  appearance: none;
  width: 16px; height: 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  display: inline-grid;
  place-content: center;
  cursor: pointer;
  flex: 0 0 auto;
}
.radio:checked { border-color: var(--accent); }
.radio:checked::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.checkbox:indeterminate { background: var(--accent); border-color: var(--accent); }
.checkbox:indeterminate::after { content: ""; width: 8px; height: 2px; background: #fff; border: 0; transform: none; margin: 0; }

.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 9px;
}
.segmented button {
  height: 27px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(16, 36, 29, .12); }

/* Switch */
.switch { position: relative; width: 38px; height: 22px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line-strong); transition: background .18s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .18s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-ring); }

/* ============================================================
   Cards / grids / misc
   ============================================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  min-width: 0;
}
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px 0; }
.card-head h2, .card-head h3 { font-size: 14.5px; font-weight: 650; letter-spacing: -.01em; }
.card-head p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card-head .right { margin-left: auto; display: flex; align-items: center; gap: 7px; }
.card-body { padding: 16px 18px 18px; }
.card-body.tight { padding: 10px 12px 12px; }
.card-foot { border-top: 1px solid var(--line); padding: 11px 18px; display: flex; align-items: center; gap: 10px; }

.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr); }
.g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.62fr); }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1 1 auto; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

/* KPI */
.kpi {
  position: relative;
  padding: 16px 18px 15px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface) 88%, var(--surface-2)));
}
.kpi::after {
  content: "";
  position: absolute;
  width: 130px; height: 130px;
  right: -52px; top: -62px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 10%, transparent), transparent 68%);
  pointer-events: none;
}
.kpi-top { display: flex; align-items: center; gap: 8px; }
.kpi-label { font-size: 12px; font-weight: 550; color: var(--muted); }
.kpi-icon { margin-left: auto; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); }
.kpi-icon.accent { background: var(--accent-soft); color: var(--accent); }
.kpi-value { margin-top: 9px; font-size: 27px; line-height: 1.1; font-weight: 700; letter-spacing: -.035em; }
.kpi-value .unit { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.kpi-foot { margin-top: 8px; display: flex; align-items: center; gap: 7px; min-height: 22px; }
.kpi-foot .spark { margin-left: auto; opacity: .95; }
.delta { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 6px; border-radius: 6px; font-size: 11px; font-weight: 700; }
.delta.up { color: var(--accent); background: var(--accent-soft); }
.delta.down { color: var(--red); background: var(--red-soft); }
.delta.flat { color: var(--muted); background: var(--surface-3); }
.delta-note { font-size: 11px; color: var(--faint); }

/* Pills */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px;
  border-radius: 99px;
  font-size: 11px; font-weight: 650; line-height: 1;
  color: var(--muted); background: var(--surface-3);
  white-space: nowrap;
}
.pill i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill.success { color: var(--accent); background: var(--accent-soft); }
.pill.warn { color: var(--amber); background: var(--amber-soft); }
.pill.danger { color: var(--red); background: var(--red-soft); }
.pill.info { color: var(--blue); background: var(--blue-soft); }
.pill.purple { color: var(--purple); background: var(--purple-soft); }
.pill.neutral { color: var(--muted); background: var(--surface-3); }
.pill.outline { background: transparent; border: 1px solid var(--line); color: var(--muted); }

.status-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; background: var(--muted); }
.status-dot.ok { background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, .12); }
.status-dot.warn { background: #d97706; box-shadow: 0 0 0 3px rgba(217, 119, 6, .12); }
.status-dot.err { background: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, .12); }
.status-dot.idle { background: var(--faint); }

/* Avatars / product thumbs */
.avatar {
  width: 34px; height: 34px;
  border-radius: 9px;
  display: grid; place-items: center;
  font-size: 11.5px; font-weight: 750;
  letter-spacing: .02em;
  color: #fff;
  flex: 0 0 auto;
  background: var(--surface-3);
}
.avatar.sm { width: 26px; height: 26px; border-radius: 7px; font-size: 9.5px; }
.avatar.lg { width: 44px; height: 44px; border-radius: 11px; font-size: 14px; }

.thumb {
  width: 38px; height: 38px;
  border-radius: 9px;
  display: grid; place-items: center;
  font-size: 18px;
  flex: 0 0 auto;
  border: 1px solid rgba(0, 0, 0, .05);
  background: linear-gradient(145deg, #eef4ef, #e2ece6);
  position: relative;
  overflow: hidden;
}
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.thumb-emoji { position: relative; z-index: 0; }

.image-gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.image-gallery.single { grid-template-columns: minmax(0, 1fr); }
.gallery-item { display: block; position: relative; aspect-ratio: 1; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.image-gallery.single .gallery-item { aspect-ratio: 16 / 10; max-height: 240px; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-item:hover { border-color: var(--accent); }
@media (max-width: 520px) {
  .image-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
html[data-theme="dark"] .thumb { border-color: rgba(255, 255, 255, .06); background: linear-gradient(145deg, #1a2b24, #12211b); }
.thumb.lg { width: 56px; height: 56px; border-radius: 12px; font-size: 26px; }

/* Store badge */
.store-badge { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.store-badge .name { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================
   Tables
   ============================================================ */

.table-wrap { width: 100%; overflow: auto; border-radius: 0 0 var(--r) var(--r); }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.8px; }
thead th {
  position: sticky; top: 0; z-index: 2;
  padding: 9px 12px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .055em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
tbody tr.clickable { cursor: pointer; }
th.check, td.check { width: 38px; padding-right: 2px; text-align: center; }
th.num, td.num { text-align: right; }
td .cell-main { font-weight: 600; color: var(--text); }
td .cell-sub { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.table-empty { padding: 44px 18px; text-align: center; color: var(--muted); }
.table-empty .ico { margin: 0 auto 10px; opacity: .5; }

.pager { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.pager .pages { display: flex; gap: 3px; margin-left: auto; }
.pager button { min-width: 29px; height: 29px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); font-size: 12px; font-weight: 600; color: var(--muted); }
.pager button:hover { background: var(--surface-2); color: var(--text); }
.pager button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager button[disabled] { opacity: .35; pointer-events: none; }

/* ============================================================
   Toolbar / tabs / filters
   ============================================================ */

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.toolbar.no-border { border-bottom: 0; }
.toolbar .search-box { flex: 0 1 auto; }

.tabs { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 16px; overflow-x: auto; }
.tab {
  position: relative;
  height: 43px;
  padding: 0 11px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12.8px;
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); }
.tab.active::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0; background: var(--accent); }
.tab .count { min-width: 19px; height: 18px; padding: 0 5px; border-radius: 6px; display: inline-grid; place-items: center; font-size: 10px; font-weight: 700; background: var(--surface-3); color: var(--muted); }
.tab.active .count { background: var(--accent-soft); color: var(--accent); }

.filter-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px; background: var(--surface-3); }
.filter-tabs button { height: 27px; padding: 0 9px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 11.5px; font-weight: 650; }
.filter-tabs button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(16, 36, 29, .1); }

.bulkbar {
  display: flex; align-items: center; gap: 8px;
  margin: 0 16px 12px;
  padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
}
.bulkbar .btn { background: var(--surface); border-color: color-mix(in srgb, var(--accent) 22%, var(--line)); color: var(--text); }

/* ============================================================
   Dashboard specific
   ============================================================ */

.chart-card .card-body { padding-top: 8px; }
.chart-wrap { position: relative; width: 100%; }
.chart-wrap svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-tip {
  position: absolute;
  pointer-events: none;
  min-width: 128px;
  padding: 9px 11px;
  border-radius: 9px;
  background: #0c1e18;
  color: #e8f5ef;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .6);
  font-size: 11.5px;
  opacity: 0;
  transform: translate(-50%, -112%);
  transition: opacity .1s;
  z-index: 5;
}
.chart-tip.show { opacity: 1; }
.chart-tip .t-label { color: #8fb0a3; font-size: 10px; letter-spacing: .04em; margin-bottom: 4px; }
.chart-tip .t-value { font-size: 14px; font-weight: 700; }
.chart-tip .t-prev { color: #8fb0a3; margin-top: 3px; }

.legend { display: flex; align-items: center; gap: 14px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 3px; background: var(--accent); }
.legend i.dashed { width: 14px; height: 0; border-top: 2px dashed var(--faint); border-radius: 0; background: transparent; }

.contrib-row { display: grid; grid-template-columns: 118px minmax(0, 1fr) 62px; align-items: center; gap: 10px; padding: 7px 0; }
.contrib-name { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 12px; font-weight: 550; }
.contrib-name .truncate { min-width: 0; }
.contrib-track { height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.contrib-track span { display: block; height: 100%; border-radius: inherit; }
.contrib-val { text-align: right; font-size: 11.5px; color: var(--muted); font-weight: 600; }

.alert-list { display: flex; flex-direction: column; }
.alert-item { display: flex; align-items: flex-start; gap: 11px; padding: 11px 0; border-bottom: 1px dashed var(--line); cursor: pointer; }
.alert-item:last-child { border-bottom: 0; padding-bottom: 2px; }
.alert-item:hover .alert-title { color: var(--accent); }
.alert-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: 0 0 auto; }
.alert-icon.warn { background: var(--amber-soft); color: var(--amber); }
.alert-icon.err { background: var(--red-soft); color: var(--red); }
.alert-icon.info { background: var(--blue-soft); color: var(--blue); }
.alert-icon.ok { background: var(--accent-soft); color: var(--accent); }
.alert-title { font-size: 12.5px; font-weight: 600; line-height: 1.35; }
.alert-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.alert-time { margin-left: auto; font-size: 10.5px; color: var(--faint); white-space: nowrap; }

/* ============================================================
   Store cards
   ============================================================ */

.store-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.store-card { padding: 16px; display: flex; flex-direction: column; gap: 13px; transition: transform .16s, box-shadow .16s, border-color .16s; }
.store-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: 0 18px 40px -30px rgba(16, 36, 29, .5); }
.store-card-top { display: flex; align-items: flex-start; gap: 11px; }
.store-title { min-width: 0; }
.store-title h3 { font-size: 14px; font-weight: 650; }
.store-title .domain { font-size: 11.5px; color: var(--muted); margin-top: 2px; display: flex; align-items: center; gap: 4px; }
.store-card-top .pill { margin-left: auto; }
.store-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 11px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }
.store-metric span { display: block; font-size: 10.5px; color: var(--muted); margin-bottom: 2px; }
.store-metric b { font-size: 14px; font-weight: 700; letter-spacing: -.02em; }
.store-scopes { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.scope-chip {
  display: inline-flex; align-items: center;
  height: 20px; padding: 0 6px;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 9.8px;
  color: var(--muted);
  background: var(--surface-3);
  border: 1px solid transparent;
}
.scope-chip.on { color: var(--accent); background: var(--accent-soft); }
.store-card-foot { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.store-card-foot .btn { margin-left: auto; }

.quota-line { display: flex; align-items: center; gap: 8px; font-size: 10.5px; color: var(--muted); }
.quota-line .track { flex: 1; height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.quota-line .track span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.quota-line .track span.high { background: var(--amber); }

/* ============================================================
   Inventory matrix
   ============================================================ */

.matrix { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.matrix th, .matrix td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
.matrix thead th { background: var(--surface-2); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.matrix thead th.store-col { text-align: center; min-width: 92px; }
.matrix tbody tr:hover { background: var(--surface-2); }
.matrix td.store-col { text-align: center; }
.stock-cell {
  min-width: 52px; height: 28px; padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  font-size: 12px; font-weight: 650;
  color: var(--text);
}
.stock-cell:hover { border-color: var(--accent); color: var(--accent); }
.stock-cell.low { color: var(--amber); background: var(--amber-soft); border-color: transparent; }
.stock-cell.out { color: var(--red); background: var(--red-soft); border-color: transparent; }
.matrix .sku { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.matrix-name { display: flex; align-items: center; gap: 9px; min-width: 190px; }

/* ============================================================
   Rules / webhooks / API
   ============================================================ */

.rule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.rule-card { padding: 15px 16px; display: flex; flex-direction: column; gap: 11px; }
.rule-top { display: flex; align-items: flex-start; gap: 10px; }
.rule-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: 0 0 auto; }
.rule-icon.amber { background: var(--amber-soft); color: var(--amber); }
.rule-icon.blue { background: var(--blue-soft); color: var(--blue); }
.rule-icon.purple { background: var(--purple-soft); color: var(--purple); }
.rule-title { font-size: 13.5px; font-weight: 650; }
.rule-desc { font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.rule-top .switch { margin-left: auto; }
.rule-flow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 10.5px; }
.flow-chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); font-family: var(--mono); font-size: 9.8px; }
.flow-arrow { color: var(--faint); }
.rule-foot { display: flex; align-items: center; gap: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 10.5px; color: var(--muted); }
.rule-foot .btn { margin-left: auto; }

.topic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.topic {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
}
.topic .mono { font-size: 10.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.topic .switch { margin-left: auto; transform: scale(.86); transform-origin: right center; }
.topic .t-count { font-size: 10px; color: var(--faint); }

.endpoint {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-2);
  overflow: hidden;
}
.endpoint span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.endpoint .btn { margin-left: auto; flex: 0 0 auto; }

.event-status { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 650; }
.event-status.ok { color: var(--accent); }
.event-status.retry { color: var(--amber); }
.event-status.fail { color: var(--red); }

.api-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.editor-shell { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #0a1511; }
.editor-bar { display: flex; align-items: center; gap: 5px; padding: 8px 10px; background: #0e1d17; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.editor-dot { width: 8px; height: 8px; border-radius: 50%; background: #2b4a3d; }
.editor-dot.r { background: #7a3b34; } .editor-dot.y { background: #7a6534; } .editor-dot.g { background: #2f6b4f; }
.editor-tab { margin-left: 8px; font-family: var(--mono); font-size: 10.5px; color: #7fa392; }
.editor-shell textarea {
  width: 100%; min-height: 260px; resize: vertical;
  padding: 13px 14px;
  border: 0; outline: 0;
  background: transparent;
  color: #b9e6d1;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.65;
  tab-size: 2;
}
.editor-foot { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-top: 1px solid rgba(255, 255, 255, .07); background: #0e1d17; }
.editor-foot .mono { font-size: 10px; color: #6f9383; }
.editor-foot .btn { margin-left: auto; }

.response {
  margin: 0;
  max-height: 342px;
  overflow: auto;
  padding: 13px 14px;
  border-radius: 10px;
  background: #0a1511;
  border: 1px solid var(--line);
  color: #a9d8c4;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.6;
  white-space: pre;
}
.response .j-key { color: #7fb7ff; }
.response .j-str { color: #a8e6a3; }
.response .j-num { color: #ffc978; }
.response .j-bool { color: #d8a2ff; }
.response .j-null { color: #8b9e96; }
.response .j-punc { color: #638174; }

.meta-strip { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 9px 0 0; font-size: 11px; color: var(--muted); }
.meta-strip b { color: var(--text); font-weight: 650; }
.meta-strip .ok { color: var(--accent); }

.quota-meter { margin-top: 4px; }
.quota-meter .track { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.quota-meter .track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #6ee7b7); }
.scope-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 11.5px; }
.scope-row:last-child { border-bottom: 0; }
.scope-row .mono { font-size: 10px; color: var(--accent); background: var(--accent-soft); padding: 2px 5px; border-radius: 4px; }
.scope-row .desc { color: var(--muted); font-size: 10.5px; }
.scope-row .count { margin-left: auto; color: var(--muted); font-size: 10.5px; }

/* ============================================================
   Drawer / modal / toast
   ============================================================ */

.scrim {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(5, 16, 12, .46);
  backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden;
  transition: opacity .22s, visibility .22s;
}
.scrim.show { opacity: 1; visibility: visible; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 80;
  width: min(540px, 100vw);
  display: flex; flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  transform: translateX(102%);
  transition: transform .26s cubic-bezier(.2, .8, .2, 1);
  visibility: hidden;
}
.drawer.open { transform: translateX(0); visibility: visible; }
.drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 15px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 16.5px; font-weight: 700; letter-spacing: -.015em; }
.drawer-head p { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.drawer-head .icon-btn { margin-left: auto; }
.drawer-body { flex: 1 1 auto; overflow-y: auto; padding: 18px 20px 26px; }
.drawer-foot { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 13px 20px; border-top: 1px solid var(--line); background: var(--surface-2); }
.drawer-foot .left { margin-right: auto; font-size: 10.5px; color: var(--muted); }

.modal-layer {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(5, 16, 12, .5);
  backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden;
  transition: opacity .2s, visibility .2s;
}
.modal-layer.open { opacity: 1; visibility: visible; }
.modal {
  width: min(560px, 100%);
  max-height: min(88vh, 860px);
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  transform: translateY(10px) scale(.985);
  transition: transform .2s;
}
.modal-layer.open .modal { transform: none; }
.modal.wide { width: min(760px, 100%); }
.modal.queue-wide { width: min(1120px, 96vw); }
@media (max-width: 760px) { .modal.queue-wide { width: 100%; } }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 16.5px; font-weight: 700; letter-spacing: -.015em; }
.modal-head p { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 18px 20px; overflow-y: auto; overflow-x: hidden; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 13px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 16px 16px; }
.modal-foot .left { margin-right: auto; font-size: 10.5px; color: var(--muted); }

.form-grid { display: flex; flex-direction: column; gap: 13px; }
.form-grid .field-row { gap: 12px; }
.form-section { padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.form-section-title { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }

.scope-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; }
.scope-option { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-2); min-width: 0; }
.scope-option .mono { font-size: 10px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.callout { display: flex; gap: 9px; padding: 10px 12px; border-radius: 9px; font-size: 11.5px; line-height: 1.5; }
.callout.warn { background: var(--amber-soft); color: var(--amber); }
.callout.info { background: var(--blue-soft); color: var(--blue); }
.callout.success { background: var(--accent-soft); color: var(--accent); }
.callout.error { background: var(--red-soft); color: var(--red); }
.callout .ico { margin-top: 1px; }

.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: flex; flex-direction: column; gap: 8px; width: min(370px, calc(100vw - 36px)); pointer-events: none; }
body:has(.drawer.open) .toasts { right: 558px; }
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: toastIn .25s cubic-bezier(.2, .8, .2, 1);
  pointer-events: auto;
}
.toast.out { animation: toastOut .2s forwards; }
.toast .t-icon { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; flex: 0 0 auto; color: var(--accent); background: var(--accent-soft); margin-top: 1px; }
.toast.warn { border-left-color: var(--amber); }
.toast.warn .t-icon { color: var(--amber); background: var(--amber-soft); }
.toast.error { border-left-color: var(--red); }
.toast.error .t-icon { color: var(--red); background: var(--red-soft); }
.toast.info { border-left-color: var(--blue); }
.toast.info .t-icon { color: var(--blue); background: var(--blue-soft); }
.toast .t-title { font-size: 12.5px; font-weight: 650; line-height: 1.35; }
.toast .t-msg { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.4; }

@keyframes toastIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(10px); } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

.view > * { animation: rise .3s both; }
.view > *:nth-child(2) { animation-delay: .03s; }
.view > *:nth-child(3) { animation-delay: .06s; }
.view > *:nth-child(4) { animation-delay: .09s; }

/* ============================================================
   Popover / dropdown
   ============================================================ */

.pop-wrap { position: relative; }
.popover {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 55;
  width: 280px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: rise .14s;
}
.popover-head { display: flex; align-items: center; gap: 8px; padding: 5px 7px 8px; border-bottom: 1px solid var(--line); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.popover-head button { margin-left: auto; border: 0; background: transparent; color: var(--accent); font-size: 10.5px; font-weight: 650; }
.popover-list { max-height: 290px; overflow: auto; padding: 4px 0; }
.pop-row { display: flex; align-items: center; gap: 9px; padding: 7px 7px; border-radius: 7px; font-size: 12px; cursor: pointer; }
.pop-row:hover { background: var(--surface-2); }
.pop-row .avatar { width: 25px; height: 25px; border-radius: 6px; font-size: 9px; }
.pop-row .sub { display: block; font-size: 10px; color: var(--muted); }
.pop-row .num { margin-left: auto; font-size: 10px; color: var(--faint); }
.pop-foot { display: flex; gap: 6px; padding: 8px 4px 2px; border-top: 1px solid var(--line); }
.pop-foot .btn { flex: 1; }

/* ============================================================
   Empty / helper
   ============================================================ */

.empty { padding: 54px 20px; text-align: center; color: var(--muted); }
.empty .empty-ico { width: 46px; height: 46px; border-radius: 14px; margin: 0 auto 12px; display: grid; place-items: center; background: var(--surface-3); color: var(--faint); }
.empty h3 { font-size: 14px; color: var(--text); margin-bottom: 4px; }
.empty p { font-size: 12px; max-width: 330px; margin: 0 auto; line-height: 1.55; }

.divider { height: 1px; background: var(--line); margin: 14px 0; }
.kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px 12px; font-size: 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--text); font-weight: 550; }
.kv dd.mono { font-size: 10.5px; }

.code-block {
  margin: 0;
  padding: 12px 13px;
  border-radius: 10px;
  background: #0a1511;
  color: #b9e6d1;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.6;
  overflow: auto;
  max-height: 280px;
  white-space: pre;
}
.code-block .c { color: #6f9383; }
.code-block .s { color: #a8e6a3; }
.code-block .k { color: #7fb7ff; }

.copy-row { display: flex; align-items: center; gap: 8px; }
.copy-row .code-block { flex: 1; min-width: 0; }

/* Order detail */
.order-hero { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 16px; }
.order-hero .big { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.line-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.line-item:last-child { border-bottom: 0; }
.line-item .li-title { font-size: 12px; font-weight: 600; }
.line-item .li-meta { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.line-item .li-price { margin-left: auto; font-size: 12px; font-weight: 650; white-space: nowrap; }
.total-row { display: flex; align-items: center; justify-content: space-between; padding: 5px 0; font-size: 12px; color: var(--muted); }
.total-row.grand { padding-top: 10px; margin-top: 5px; border-top: 1px solid var(--line); color: var(--text); font-weight: 700; font-size: 14px; }

.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 6px; width: 1px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 13px; font-size: 11.5px; }
.tl-item::before { content: ""; position: absolute; left: -17px; top: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); }
.tl-item.done::before { border-color: var(--accent); background: var(--accent-soft); }
.tl-item b { font-weight: 600; }
.tl-item span { display: block; color: var(--muted); font-size: 10.5px; margin-top: 1px; }

/* Automation log */
.log-list { display: flex; flex-direction: column; }
.log-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 11.5px; }
.log-item:last-child { border-bottom: 0; }
.log-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }
.log-dot.warn { background: var(--amber); }
.log-dot.err { background: var(--red); }
.log-item .time { margin-left: auto; color: var(--faint); font-size: 10px; white-space: nowrap; }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1280px) {
  :root { --sidebar-w: 224px; }
  .view { padding: 22px 20px 56px; }
  .topbar { padding: 0 20px; }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1120px) {
  :root { --sidebar-w: 74px; }
  .brand { padding: 0 20px; justify-content: center; }
  .brand-text, .workspace-pill, .nav-group-title, .quota-card, .user-meta, .nav-item .label, .nav-badge, .brand-sub { display: none; }
  .nav { padding: 8px 10px 16px; }
  .nav-group { margin-top: 6px; }
  .nav-item { justify-content: center; padding: 0; height: 44px; }
  .nav-item.active::before { left: -10px; top: 12px; bottom: 12px; }
  .user-card { justify-content: center; padding: 8px 0; }
  .sidebar-foot { padding: 8px; }
  .g-2-1, .g-1-2, .g-3 { grid-template-columns: minmax(0, 1fr); }
  .store-grid { grid-template-columns: minmax(0, 1fr); }
  .rule-grid { grid-template-columns: minmax(0, 1fr); }
  .api-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .g-2 { grid-template-columns: minmax(0, 1fr); }
  .kpi-value { font-size: 24px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-actions { justify-content: flex-start; }
  .search-box .input, .search-box .input:focus { width: 170px; }
  .topbar .demo-pill { display: none; }
}

@media (max-width: 760px) {
  :root { --sidebar-w: 0px; --topbar-h: 60px; }
  .sidebar { transform: translateX(-100%); width: 248px; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); z-index: 75; }
  .sidebar .brand { justify-content: flex-start; }
  .sidebar .brand-text { display: flex; }
  .sidebar .workspace-pill { display: flex; }
  .sidebar .nav-group-title { display: block; }
  .sidebar .quota-card { display: block; }
  .sidebar .user-meta { display: block; }
  .sidebar .nav-item .label { display: inline; }
  .sidebar .nav-badge { display: inline-flex; }
  .sidebar .nav-item { justify-content: flex-start; padding: 0 11px; height: 40px; }
  .sidebar .nav-item.active::before { left: -12px; }
  .sidebar .user-card { justify-content: flex-start; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex !important; }
  .topbar { padding: 0 14px; gap: 8px; }
  .crumbs .crumb-root, .crumbs .sep { display: none; }
  .view { padding: 16px 14px 50px; }
  .kpi-grid.g-4, .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .drawer { width: 100vw; }
  .modal { width: 100%; max-height: 92vh; }
  .store-grid, .rule-grid { grid-template-columns: minmax(0, 1fr); }
  .field-row, .scope-picker { grid-template-columns: minmax(0, 1fr); }
  .topic-grid { grid-template-columns: minmax(0, 1fr); }
  .toolbar { padding: 12px; }
  .search-box .input, .search-box .input:focus { width: 100%; }
  .toolbar .search-box { flex: 1 1 100%; }
  .topbar .range-seg { display: none; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 22px; }
  .page-head h1 { font-size: 20px; }
}

@media (max-width: 520px) {
  .g-4, .kpi-grid.g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .store-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px; }
  .kpi-value { font-size: 20px; }
  .kpi-icon { display: none; }
  .kpi-foot .spark { display: none; }
  .chart-wrap svg { height: 190px; }
  .chart-wrap svg text { display: none; }
  .hide-sm { display: none !important; }
  .page-actions .btn span { display: none; }
  .page-actions .btn { width: 36px; padding: 0; }
  .page-actions .btn.btn-primary { width: auto; padding: 0 12px; }
  .page-actions .btn.btn-primary span { display: inline; }
  .toasts { right: 10px; bottom: 10px; width: calc(100vw - 20px); }
}

@media print {
  .sidebar, .topbar, .toasts, .drawer, .scrim, .modal-layer { display: none !important; }
  .main { margin: 0; }
  body { background: #fff; }
}

/* ============================================================
   Late additions
   ============================================================ */

@keyframes spin { to { transform: rotate(360deg); } }
.spinning .ico { animation: spin .9s linear infinite; }

.tab-pane { display: none; }
.tab-pane.active { display: block; }

.store-card.is-warning { border-color: color-mix(in srgb, var(--amber) 40%, var(--line)); }
.store-card h3 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.store-card h3 .pill { font-size: 9.5px; height: 18px; padding: 0 6px; }
.store-card .domain { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 215px; }

.pop-row { cursor: pointer; }
.pop-row input { pointer-events: auto; }

.theme-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  text-align: left;
  transition: border-color .15s, box-shadow .15s;
}
.theme-card:hover { border-color: var(--line-strong); }
.theme-card.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-ring); }
.theme-preview {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 58px;
  border-radius: 7px;
  padding: 8px;
  border: 1px solid rgba(0, 0, 0, .06);
}
.theme-preview span { display: block; height: 8px; border-radius: 3px; opacity: .92; }
.theme-preview span:nth-child(1) { width: 55%; }
.theme-preview span:nth-child(2) { width: 100%; }
.theme-preview span:nth-child(3) { width: 78%; }
.theme-check {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
}

.scope-option .checkbox { width: 14px; height: 14px; border-radius: 4px; }
.scope-option .checkbox::after { width: 7px; height: 4px; }

.callout .ico { flex: 0 0 auto; }
.callout b { font-weight: 650; }

.response::-webkit-scrollbar-thumb { background: #264638; }

.matrix .thumb { flex: 0 0 auto; }

@media (max-width: 760px) {
  .store-card .domain { max-width: 190px; }
  body:has(.drawer.open) .toasts { right: 10px; }
}

/* ============================================================
   Store tags · product library · distribution
   ============================================================ */

.store-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-height: 22px; }
.store-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid transparent;
  white-space: nowrap;
}
.store-tag.muted { color: var(--muted); background: var(--surface-3); font-weight: 500; }
.store-tag.add { border: 1px dashed var(--line-strong); background: transparent; color: var(--muted); cursor: pointer; }
.store-tag.add:hover { color: var(--accent); border-color: var(--accent); }

.tag-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  font-size: 11.5px;
  color: var(--text-2);
  cursor: pointer;
  background: var(--surface);
}
.tag-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.tag-option .checkbox { width: 14px; height: 14px; border-radius: 4px; }
.tag-option .checkbox::after { width: 7px; height: 4px; }

.listed-stores { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.listed-store-chip { display: inline-flex; align-items: center; gap: 5px; min-width: 0; max-width: 160px; }
.listed-store-chip .avatar {
  width: 22px;
  height: 22px;
  margin-left: 0;
  border-radius: 6px;
  border: 1px solid var(--line);
  font-size: 7.5px;
  flex: 0 0 auto;
}
.listed-name {
  max-width: 124px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10.5px;
  color: var(--text);
}
.library-mini-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }

.dist-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dist-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  cursor: pointer;
}
.dist-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.dist-option input { margin-top: 3px; }
.dist-option b { display: block; font-size: 12px; }
.dist-option small { display: block; margin-top: 2px; font-size: 10.5px; color: var(--muted); }

.dist-store-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; max-height: 215px; overflow: auto; }
.dist-store {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  cursor: pointer;
}
.dist-store .avatar { width: 24px; height: 24px; border-radius: 6px; font-size: 8.5px; }
.dist-store-list.is-disabled { opacity: .5; }
.dist-store-list.is-disabled .dist-store { pointer-events: none; }

@media (max-width: 520px) {
  .dist-options, .dist-store-list { grid-template-columns: minmax(0, 1fr); }
}

/* Finance account table: fixed columns so the action buttons never clip */
.finance-table { table-layout: fixed; min-width: 720px; }
.finance-table th, .finance-table td { padding-left: 8px; padding-right: 8px; }
.finance-table th:nth-child(1) { width: 23%; }
.finance-table th:nth-child(2), .finance-table th:nth-child(3), .finance-table th:nth-child(4) { width: 11%; }
.finance-table th:nth-child(5) { width: 13%; }
.finance-table th:nth-child(6) { width: 13%; }
.finance-table th:nth-child(7) { width: 18%; }
.finance-table td .btn { white-space: nowrap; }
.finance-table td .pill { white-space: nowrap; }

.price-original { color: var(--muted); }
.price-original s { color: var(--faint); }
.price-original.adjusted { color: var(--amber); }
.price-original.adjusted s { color: var(--amber); opacity: .85; }

.kpi[data-action] { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.kpi[data-action]:hover { border-color: var(--accent); }
.kpi.is-active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-ring); }

.trend-filterbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; padding: 0 16px 14px; }
.filter-field { display: flex; flex-direction: column; gap: 4px; min-width: 120px; }
.filter-field > span { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.trend-cell { display: flex; flex-direction: column; gap: 3px; min-width: 100px; }
.trend-cell b { font-size: 12px; font-weight: 700; }
.trend-growth { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.rank-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 700; }



/* production loading gate (does not alter loaded UI) */
#legacy-loading { position: fixed; inset: 0; z-index: 100000; display: grid; place-items: center; background: #f2f5f3; color: #0a1b16; font: 13px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; letter-spacing: .02em; }
#legacy-loading div { padding: 14px 18px; border: 1px solid #e1e8e4; border-radius: 10px; background: #fff; box-shadow: 0 10px 30px rgba(10, 27, 22, .06); }

/* legacy login */
.legacy-login-body { min-height: 100vh; display: grid; place-items: center; background: #f2f5f3; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; color: #10201a; }
.legacy-login { width: min(420px, calc(100vw - 32px)); }
.legacy-login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; padding-left: 4px; }
.legacy-login-brand .brand-mark { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: #0a1b16; color: #a8e4c9; }
.legacy-login-brand .brand-name { display: block; font-size: 15px; font-weight: 750; letter-spacing: -.02em; }
.legacy-login-brand .brand-sub { display: block; margin-top: 1px; font-size: 8px; letter-spacing: .14em; color: #7c948b; }
.legacy-login-panel { padding: 26px 28px 22px; border: 1px solid #e1e8e4; border-radius: 14px; background: #fff; box-shadow: 0 18px 50px -24px rgba(16,36,29,.3); }
.legacy-login-panel .eyebrow { margin: 0; font-size: 9px; letter-spacing: .16em; color: #8a9b93; font-weight: 700; }
.legacy-login-panel h1 { margin: 7px 0 0; font-size: 23px; line-height: 1.2; letter-spacing: -.03em; }
.legacy-login-panel .eyebrow, .legacy-login-panel h1 { text-align: center; }
.legacy-login-panel h1 { margin-bottom: 20px; }
.legacy-login-sub { margin: 8px 0 20px; font-size: 12px; line-height: 1.6; color: #6c7f77; }
.legacy-field { display: grid; gap: 6px; margin-bottom: 13px; }
.legacy-field > span { font-size: 10px; font-weight: 650; color: #465b51; }
.legacy-field em { font-style: normal; font-weight: 400; color: #93a49d; }
.legacy-field input { width: 100%; padding: 10px 11px; border: 1px solid #d9e3de; border-radius: 9px; background: #fbfdfc; color: #10201a; font: inherit; font-size: 12px; outline: none; }
.legacy-field input:focus { border-color: #008060; box-shadow: 0 0 0 3px rgba(0,128,96,.1); background: #fff; }
.legacy-login-submit { width: 100%; margin-top: 5px; padding: 11px 14px; font-size: 12px; }
.legacy-login-error { min-height: 18px; margin-top: 10px; font-size: 11px; color: #b42318; line-height: 1.5; }
.legacy-login-note { margin: 16px 0 0; padding-top: 13px; border-top: 1px solid #edf3f0; font-size: 9px; line-height: 1.7; color: #93a49d; }
.legacy-login-brand .brand-name { color: #10201a !important; }
.legacy-login-brand .brand-sub { color: #7c948b !important; }

/* Per-store sync progress */
.store-sync-progress { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.store-sync-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; font-size: 11px; color: var(--muted); }
.store-sync-label b { color: var(--text); font-weight: 600; }
.store-sync-track { height: 4px; overflow: hidden; border-radius: 99px; background: var(--line); }
.store-sync-bar { height: 100%; width: 34%; border-radius: 99px; background: var(--accent); animation: storeSyncSlide 1.1s ease-in-out infinite; }
.store-sync-progress.done .store-sync-bar { width: 100%; animation: none; background: var(--accent); }
.store-sync-progress.error .store-sync-bar { width: 100%; animation: none; background: var(--red); }
.store-sync-progress.error .store-sync-label { color: var(--red); }
@keyframes storeSyncSlide { 0% { transform: translateX(-100%); } 100% { transform: translateX(320%); } }
.global-sync-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 10050; height: 3px; background: rgba(0,0,0,.08); }
.global-sync-bar span { display: block; width: 32%; height: 100%; background: var(--accent); animation: storeSyncSlide 1.1s ease-in-out infinite; }
.global-sync-bar.done span { width: 100%; animation: none; }
.global-sync-bar.error span { width: 100%; animation: none; background: var(--red); }

/* Server resource usage bars */
.resource-bar { height: 6px; margin-top: 12px; overflow: hidden; border-radius: 99px; background: var(--line); }
.resource-bar span { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .55s ease, background .25s ease; }
.resource-bar.warn span { background: var(--amber); }
.resource-bar.danger span { background: var(--red); }

/* collector currency/count reading progress */
.collector-read-progress { margin-top: 8px; }
.collector-read-track {
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(127, 127, 127, .18);
}
.collector-read-track span {
  display: block;
  width: 35%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, white));
  animation: collector-read-slide 1.15s ease-in-out infinite;
}
@keyframes collector-read-slide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(330%); }
}

/* collector live status */
.collector-live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--amber);
  animation: collector-live-pulse 1.1s ease-in-out infinite;
}
@keyframes collector-live-pulse {
  0%, 100% { opacity: .35; transform: scale(.8); }
  50% { opacity: 1; transform: scale(1.15); }
}

.collector-job-track { height:6px; min-width:120px; max-width:180px; margin-top:7px; border-radius:999px; background:var(--line); overflow:hidden; }
.collector-job-track > span { display:block; height:100%; width:0; border-radius:999px; background:var(--brand,#0f766e); transition:width .35s ease; }
.collector-job-track.success > span { background:var(--success,#16a34a); }
.collector-job-track.danger > span { background:var(--danger,#dc2626); }
.collector-job-track.indeterminate > span { width:35% !important; animation:collector-job-slide 1.35s ease-in-out infinite; }
@keyframes collector-job-slide { 0% { transform:translateX(-110%); } 100% { transform:translateX(310%); } }

.collector-job-track.indeterminate > span { width:100% !important; transform:none; background-color:transparent; background-image:repeating-linear-gradient(135deg, rgba(15,118,110,.95) 0 10px, rgba(15,118,110,.55) 10px 20px); background-size:28px 100%; animation:collector-job-stripes 1s linear infinite; }
@keyframes collector-job-stripes { to { background-position:28px 0; } }

.thumb.thumb-failed::after { content:'📦'; font-size:18px; position:relative; z-index:0; }

.finance-account-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:10px; }
.finance-account-card { min-width:0; padding:12px; border:1px solid var(--line); border-radius:12px; background:var(--surface); cursor:pointer; transition:border-color .15s ease, box-shadow .15s ease; }
.finance-account-card:hover { border-color:var(--accent); box-shadow:0 4px 14px rgba(15,118,110,.08); }
.finance-account-name { font-size:12px; font-weight:650; }
.finance-account-balance { font-size:20px; font-weight:700; letter-spacing:-.02em; margin-top:1px; }
.finance-account-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; margin-top:10px; padding-top:9px; border-top:1px dashed var(--line); }
.finance-account-metrics span { display:block; font-size:10px; color:var(--muted); }
.finance-account-metrics b { display:block; margin-top:2px; font-size:11px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.dashboard-store-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(225px,1fr)); gap:10px; }
.dashboard-store-card { min-width:0; padding:12px; border:1px solid var(--line); border-radius:12px; background:var(--surface); cursor:pointer; transition:border-color .15s ease, box-shadow .15s ease; }
.dashboard-store-card:hover { border-color:var(--accent); box-shadow:0 4px 14px rgba(15,118,110,.08); }
.dashboard-store-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; margin-top:10px; padding-top:9px; border-top:1px dashed var(--line); }
.dashboard-store-metrics span { display:block; font-size:10px; color:var(--muted); }
.dashboard-store-metrics b { display:block; margin-top:2px; font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dashboard-alert-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:8px; }

.finance-account-grid { grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:14px; }
.finance-account-card { padding:16px; }
.dashboard-store-grid { grid-template-columns:repeat(auto-fill,minmax(330px,1fr)); gap:14px; }
.dashboard-store-card { padding:16px; }
.dashboard-store-metrics { gap:10px; margin-top:12px; padding-top:11px; }
.dashboard-store-metrics span { font-size:10.5px; }
.dashboard-store-metrics b { font-size:13px; }
.finance-account-name { font-size:13px; }
.finance-account-balance { font-size:22px; }
.finance-more { display:flex; justify-content:center; padding:12px 0 2px; }

.library-toolbar { display:flex; flex-direction:column; gap:10px; margin-bottom:12px; }
.library-toolbar-tabs { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.library-toolbar-tabs .filter-tabs { flex:1 1 auto; min-width:0; flex-wrap:wrap; }
.library-toolbar-filters { display:grid; grid-template-columns:minmax(240px,1fr) 150px 210px 130px minmax(170px,auto); gap:10px; align-items:center; }
.library-toolbar-filters .search-box, .library-toolbar-filters .select { width:100%; min-width:0; }
.library-toolbar-actions { display:flex; justify-content:flex-end; min-width:0; }
.library-filter-placeholder { min-height:1px; }
@media (max-width: 1000px) { .library-toolbar-filters { grid-template-columns:minmax(220px,1fr) 150px 200px; } .library-toolbar-actions { grid-column:1/-1; justify-content:flex-start; } }
@media (max-width: 680px) { .library-toolbar-filters { grid-template-columns:1fr; } }

.library-toolbar-tabs .filter-tabs { flex:0 1 auto; }
.library-toolbar-filters { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.library-toolbar-filters .search-box { flex:1 1 320px; max-width:560px; min-width:220px; }
.library-toolbar-filters .search-box .input, .library-toolbar-filters .search-box .input:focus { width:100%; }
.library-toolbar-filters > .select { flex:0 0 auto; width:auto; min-width:150px; max-width:240px; }
.library-toolbar-filters > .select:nth-of-type(2) { min-width:170px; }
.library-toolbar-filters > .select:nth-of-type(3) { min-width:220px; }
.library-toolbar-filters .library-filter-placeholder { display:none; }
.library-toolbar-actions { margin-left:auto; display:flex; justify-content:flex-end; }
@media (max-width: 900px) { .library-toolbar-filters .search-box { flex:1 1 100%; max-width:none; } .library-toolbar-actions { margin-left:0; width:100%; justify-content:flex-start; } }

/* product library toolbar polish */
.library-toolbar { margin:0; gap:0; }
.library-toolbar-tabs { padding:0 16px; border-bottom:1px solid var(--line); gap:8px; flex-wrap:nowrap; }
.library-toolbar-tabs .filter-tabs { background:transparent; padding:0; border-radius:0; gap:2px; flex:0 1 auto; flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; }
.library-toolbar-tabs .filter-tabs::-webkit-scrollbar { display:none; }
.library-toolbar-tabs .filter-tabs button { height:44px; padding:0 12px; border-radius:0; background:transparent; box-shadow:none; color:var(--muted); font-size:12.5px; font-weight:600; position:relative; white-space:nowrap; }
.library-toolbar-tabs .filter-tabs button:hover { color:var(--text); background:transparent; }
.library-toolbar-tabs .filter-tabs button.active { color:var(--accent); background:transparent; box-shadow:none; }
.library-toolbar-tabs .filter-tabs button.active::after { content:''; position:absolute; left:10px; right:10px; bottom:-1px; height:2px; border-radius:2px 2px 0 0; background:var(--accent); }
.library-tab-count { margin-left:6px; display:inline-block; padding:1px 6px; border-radius:999px; background:var(--surface-3); color:var(--muted); font-size:10.5px; font-weight:650; }
.library-toolbar-tabs .filter-tabs button.active .library-tab-count { background:color-mix(in srgb, var(--accent) 12%, transparent); color:var(--accent); }
.library-toolbar-tabs > .pill.outline { border:0; background:var(--surface-3); color:var(--muted); font-size:11px; }
.library-toolbar-filters { margin:12px 16px 14px; padding:10px 12px; border:1px solid var(--line); border-radius:12px; background:var(--surface-2); gap:8px; }
.library-toolbar-filters .search-box { flex:1 1 320px; max-width:560px; min-width:220px; }
.library-toolbar-filters .search-box .input, .library-toolbar-filters .search-box .input:focus { height:34px; width:100%; border-radius:8px; background:var(--surface); }
.library-toolbar-filters > .select { height:34px; border-radius:8px; background:var(--surface); min-width:150px; }
.library-toolbar-actions .btn { height:32px; }
@media (max-width: 900px) { .library-toolbar-tabs { flex-wrap:wrap; padding-bottom:0; } .library-toolbar-tabs > .pill.outline { margin-left:auto; } .library-toolbar-filters { margin:10px 12px 12px; } }

.library-toolbar-actions .btn-ghost { border:1px solid var(--line); background:var(--surface); color:var(--text); }
.library-toolbar-actions .btn-ghost:hover { background:var(--surface-3); }


/* Compact store cards + top pagination */
.store-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.store-card { padding: 12px; gap: 9px; border-radius: 12px; }
.store-card .avatar.lg { width: 36px; height: 36px; font-size: 14px; }
.store-card .store-title h3 { font-size: 13px; }
.store-card .store-title .domain { font-size: 10.5px; }
.store-card .store-metrics { gap: 6px; }
.store-card .store-metric span { font-size: 10px; }
.store-card .store-metric b { font-size: 15px; }
.store-card .quota-line { font-size: 10px; margin-top: 2px; }
.store-card .store-scopes { margin-top: 4px; gap: 3px; }
.store-card .scope-chip { font-size: 9.5px; padding: 2px 4px; }
.store-card .store-card-foot { padding-top: 7px; gap: 5px; }
.store-page-top { margin-bottom: 12px; }
.store-page-top .pager { border-top: 0; border-bottom: 1px solid var(--line); padding: 0 0 10px; }
@media (max-width: 1180px) { .store-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .store-grid { grid-template-columns: minmax(0, 1fr); } }
