:root {
  color-scheme: light;

  /* Slate neutral scale */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  /* Indigo primary */
  --indigo-50: #eef2ff;
  --indigo-100: #e0e7ff;
  --indigo-200: #c7d2fe;
  --indigo-300: #a5b4fc;
  --indigo-500: #6366f1;
  --indigo-600: #4f46e5;
  --indigo-700: #4338ca;

  /* Warm accent (used sparingly: today, overdue, AI success, primary CTA hover) */
  --warm-400: #fbbf24;
  --warm-500: #f59e0b;
  --warm-600: #d97706;
  --warm-soft: #fef3c7;

  /* Elevation */
  --elev-1: 0 1px 2px rgba(15, 23, 42, 0.04);
  --elev-2: 0 4px 12px rgba(15, 23, 42, 0.06);
  --elev-3: 0 12px 28px rgba(15, 23, 42, 0.10);

  /* Radius scale */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  /* Semantic aliases (mapped to new palette so existing var(--*) usages refresh) */
  --bg: #f8fafc;
  --sidebar: #f1f5f9;
  --panel: #ffffff;
  --panel-2: #f1f5f9;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #4f46e5;
  --accent-2: #6366f1;
  --accent-soft: #eef2ff;
  --brand: #4f46e5;
  --human: #f59e0b;
  --hermes: #0891b2;
  --codex: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --success: #16a34a;
  --radius: 10px;
  --shadow-soft: var(--elev-2);
  --shadow-card: var(--elev-1);
  --focus-ring: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button,
textarea,
select,
input {
  font: inherit;
}

button {
  white-space: nowrap;
}

.hidden,
.tab-panel.hidden {
  display: none !important;
}

body.hide-module-labels [data-module]::after {
  display: none !important;
}

[data-module] {
  position: relative;
}

[data-module]::after {
  content: attr(data-module);
  position: absolute;
  top: 4px;
  right: 6px;
  z-index: 20;
  border: 1px solid rgba(220, 38, 38, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #dc2626;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  padding: 4px 7px;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.08);
  transform: none;
}

#ads-view [data-module^="AD04"]::after,
#ads-view [data-module^="AD05"]::after,
#ads-view [data-module^="AD06"]::after,
#ads-view [data-module^="AD07"]::after {
  top: 8px;
  left: 8px;
  right: auto;
}

#ads-view .view-card[data-module^="AD04"],
#ads-view .view-card[data-module^="AD05"],
#ads-view .view-card[data-module^="AD06"],
#ads-view .view-card[data-module^="AD07"],
#ads-view .ads-home-grid[data-module],
#ads-view .ads-two-pane[data-module],
#ads-view .ads-calendar-card[data-module] {
  padding-top: 28px;
}

.app-rail[data-module]::after {
  left: 6px;
  right: auto;
  top: auto;
  bottom: 8px;
  writing-mode: vertical-rl;
  padding: 6px 4px;
}

.status-bar[data-module]::after,
.flow-header[data-module]::after {
  top: 6px;
  right: 8px;
}

.flow-map-card[data-module]::after {
  top: 48px;
  right: 24px;
}

#tasks-view[data-module]::after,
#skills-view[data-module]::after,
#control-view[data-module]::after {
  position: fixed;
  top: 72px;
  right: 14px;
  transform: none;
  z-index: 60;
}

.app-shell {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-columns: 56px 300px minmax(0, 1fr);
  overflow: hidden;
}

.auth-shell {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: rgba(241, 245, 249, 0.96);
  backdrop-filter: blur(6px);
}

.welcome-shell {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 18% 18%, rgba(59, 130, 246, 0.2), transparent 24%),
    radial-gradient(circle at 80% 12%, rgba(34, 211, 238, 0.16), transparent 22%),
    linear-gradient(180deg, #071121 0%, #0d1d35 44%, #102744 100%);
  backdrop-filter: blur(8px);
  opacity: 1;
  visibility: visible;
  transition: opacity 180ms ease, visibility 180ms ease;
  overflow: hidden;
}

.welcome-shell.hidden {
  display: grid !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.welcome-eyebrow {
  color: #9fc0ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.welcome-card h1 {
  font-size: 30px;
  line-height: 1.1;
}

.welcome-copy {
  color: rgba(235, 241, 255, 0.9);
  font-size: 15px;
  line-height: 1.6;
}

.welcome-stage {
  width: min(1220px, calc(100vw - 56px));
  min-height: min(720px, calc(100vh - 56px));
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 28px;
  align-items: stretch;
}

.welcome-copy-panel {
  align-self: center;
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 1px solid rgba(191, 219, 254, 0.16);
  border-radius: 28px;
  background: rgba(10, 20, 40, 0.46);
  box-shadow: 0 28px 80px rgba(8, 15, 30, 0.3);
  backdrop-filter: blur(10px);
  color: #f5f7ff;
}

.welcome-copy-panel h1 {
  font-size: 48px;
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.welcome-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.welcome-badges span {
  border: 1px solid rgba(147, 197, 253, 0.26);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #d8e7ff;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 12px;
}

.welcome-visual {
  position: relative;
  min-height: 100%;
  border: 1px solid rgba(191, 219, 254, 0.14);
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(18, 37, 68, 0.88), rgba(9, 22, 44, 0.86)),
    linear-gradient(0deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.04));
  box-shadow: 0 30px 90px rgba(8, 15, 30, 0.34);
  overflow: hidden;
}

.welcome-grid-glow {
  position: absolute;
  inset: auto 0 0 0;
  height: 58%;
  background:
    linear-gradient(rgba(96, 165, 250, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 165, 250, 0.1) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.9));
  opacity: 0.5;
}

.welcome-world {
  position: absolute;
  top: 44px;
  right: 54px;
  width: 280px;
  height: 180px;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.24);
  background: radial-gradient(circle at center, rgba(79, 70, 229, 0.14), transparent 70%);
}

.world-node {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #7dd3fc;
  box-shadow: 0 0 0 8px rgba(125, 211, 252, 0.12);
}

.node-us { top: 78px; left: 44px; }
.node-eu { top: 56px; left: 138px; }
.node-cn { top: 96px; right: 42px; }

.world-link {
  position: absolute;
  height: 2px;
  transform-origin: left center;
  background: linear-gradient(90deg, rgba(96, 165, 250, 0.95), rgba(34, 211, 238, 0.7));
}

.link-us {
  top: 84px;
  left: 54px;
  width: 102px;
  transform: rotate(-18deg);
}

.link-eu {
  top: 78px;
  left: 150px;
  width: 86px;
  transform: rotate(26deg);
}

.welcome-desk {
  position: absolute;
  left: 58px;
  right: 58px;
  bottom: 74px;
  height: 360px;
  z-index: 2;
}

.desk-screen {
  position: absolute;
  border: 1px solid rgba(147, 197, 253, 0.15);
  border-radius: 24px;
  background: rgba(9, 19, 38, 0.88);
  box-shadow: 0 18px 36px rgba(4, 10, 24, 0.4);
}

.screen-main {
  left: 0;
  bottom: 58px;
  width: 56%;
  height: 250px;
  padding: 26px 28px;
}

.screen-ai {
  right: 18px;
  bottom: 62px;
  width: 31%;
  height: 220px;
  padding: 24px 22px;
}

.screen-title,
.sidecard-title {
  color: #d8e7ff;
  font-size: 20px;
  font-weight: 800;
}

.screen-bars {
  margin-top: 18px;
  display: flex;
  gap: 12px;
}

.screen-bars span {
  width: 86px;
  height: 16px;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.18);
}

.screen-chart {
  margin-top: 24px;
  display: flex;
  align-items: end;
  gap: 14px;
  height: 82px;
}

.screen-chart i {
  width: 28px;
  border-radius: 14px 14px 8px 8px;
  background: linear-gradient(180deg, #60a5fa, #4f46e5);
}

.screen-chart i:nth-child(1) { height: 36px; }
.screen-chart i:nth-child(2) { height: 64px; }
.screen-chart i:nth-child(3) { height: 52px; }
.screen-chart i:nth-child(4) { height: 78px; }
.screen-chart i:nth-child(5) { height: 58px; }

.screen-metrics {
  margin-top: 20px;
  display: grid;
  gap: 8px;
}

.screen-metrics strong {
  color: #f5f7ff;
  font-size: 34px;
  line-height: 1;
}

.screen-metrics small {
  color: #86efac;
  font-size: 15px;
  font-weight: 700;
}

.thread-bubble {
  height: 28px;
  border-radius: 14px;
  margin-top: 16px;
  background: rgba(96, 165, 250, 0.18);
}

.bubble-human {
  width: 56%;
  background: rgba(245, 158, 11, 0.22);
}

.bubble-ai {
  width: 72%;
}

.bubble-ai.wide {
  width: 88%;
}

.welcome-sidecard {
  position: absolute;
  width: 184px;
  border: 1px solid rgba(147, 197, 253, 0.14);
  border-radius: 20px;
  background: rgba(12, 24, 46, 0.74);
  box-shadow: 0 16px 30px rgba(4, 10, 24, 0.32);
  padding: 18px;
  z-index: 3;
}

.sidecard-left {
  left: 52px;
  top: 64px;
}

.sidecard-right {
  right: 24px;
  top: 214px;
  width: 172px;
}

.sidecard-lines {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.sidecard-lines span {
  height: 14px;
  border-radius: 999px;
  background: rgba(216, 231, 255, 0.14);
}

.desk-boxes {
  position: absolute;
  right: 22%;
  bottom: 0;
  display: flex;
  align-items: end;
  gap: 14px;
}

.box {
  width: 54px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(180deg, #fbbf24, #f59e0b);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.18);
}

.box.tall {
  height: 58px;
}

.welcome-laptop-glow {
  position: absolute;
  left: 38%;
  right: 18%;
  bottom: 82px;
  height: 28px;
  border-radius: 50%;
  background: rgba(34, 211, 238, 0.26);
  filter: blur(18px);
}

@media (max-width: 960px) {
  .welcome-stage {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .welcome-copy-panel h1 {
    font-size: 36px;
  }

  .welcome-visual {
    min-height: 420px;
  }

  .screen-main {
    width: 58%;
  }

  .screen-ai {
    width: 38%;
  }
}

.auth-card {
  width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  padding: 24px;
  display: grid;
  gap: 14px;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form .field {
  gap: 8px;
}

.auth-form .field span {
  color: #475569;
  font-size: 13px;
  font-weight: 700;
}

.auth-form input {
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #f5f7ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  padding: 11px 12px;
}

.auth-form input::placeholder {
  color: #94a3b8;
}

.auth-form input:hover {
  border-color: #94a3b8;
  background: #ffffff;
}

.auth-form input:focus {
  border-color: var(--accent);
  background: #ffffff;
  box-shadow: var(--focus-ring);
}

.auth-error {
  border: 1px solid rgba(220, 38, 38, 0.18);
  border-radius: 10px;
  background: rgba(254, 242, 242, 0.9);
  color: #991b1b;
  padding: 10px 12px;
}

.app-shell.sidebarless {
  grid-template-columns: 56px minmax(0, 1fr);
}

.app-shell.sidebarless .sidebar {
  display: none;
}

.app-rail {
  min-height: 0;
  background: #edf2f8;
  border-right: 1px solid var(--line);
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px 8px;
}

.rail-button {
  width: 40px;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  gap: 2px;
}

.rail-button:hover,
.rail-button.active {
  border-color: #d4def0;
  background: #ffffff;
  color: var(--text);
}

.rail-button.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.rail-button.rail-primary {
  color: #24324a;
}

.rail-button.rail-secondary {
  min-height: 42px;
  color: #7c8aa0;
  opacity: 0.82;
}

.rail-button.rail-secondary .rail-icon {
  color: #64748b;
}

.rail-button.rail-secondary .rail-label {
  font-size: 9px;
}

.rail-button.rail-contact {
  margin-top: 0;
}

.rail-button.rail-contact:hover,
.rail-button.rail-contact.active {
  background: #fff;
  border-color: #d4def0;
  box-shadow: inset 3px 0 0 var(--accent);
}

.rail-icon {
  font-weight: 800;
  line-height: 1;
  display: grid;
  place-items: center;
  color: currentColor;
}

.rail-icon svg {
  width: 20px;
  height: 20px;
}

.rail-icon svg path,
.rail-icon svg rect,
.rail-icon svg circle,
.rail-icon svg line,
.rail-icon svg polyline {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rail-label {
  font-size: 10px;
  line-height: 1;
}

.sidebar {
  position: relative;
  z-index: 1;
  width: auto;
  min-height: 0;
  background: rgba(245, 247, 251, 0.92);
  border: 0;
  border-right: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: blur(10px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  opacity: 1;
  pointer-events: auto;
  transform: none;
  transition: none;
}

.sidebar-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.current-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  padding: 6px 10px;
}

.refresh-icon-button {
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 15px;
  line-height: 1;
}

.contacts-backdrop {
  position: fixed;
  inset: 0;
  z-index: 44;
  background: rgba(15, 23, 42, 0.02);
  opacity: 0;
  transition: opacity 160ms ease;
}

.contacts-backdrop.open {
  opacity: 1;
}

.contacts-backdrop.closing {
  opacity: 0;
}

.contacts-popover {
  position: fixed;
  left: 64px;
  top: 92px;
  z-index: 45;
  width: 340px;
  max-height: calc(100vh - 120px);
  overflow: hidden;
  border: 1px solid rgba(203, 213, 225, 0.92);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(8px);
  opacity: 0;
  padding: 14px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  transform: translateY(8px) scale(0.98);
  transform-origin: top left;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.settings-popover {
  position: fixed;
  left: 64px;
  top: 92px;
  z-index: 45;
  width: 420px;
  max-height: calc(100vh - 120px);
  overflow: auto;
  border: 1px solid rgba(203, 213, 225, 0.92);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(8px);
  opacity: 0;
  padding: 14px;
  transform: translateY(8px) scale(0.98);
  transform-origin: top left;
  transition: opacity 160ms ease, transform 160ms ease;
}

.settings-popover.open {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.settings-popover.closing {
  opacity: 0;
  transform: translateY(6px) scale(0.985);
}

.settings-groups {
  display: grid;
  gap: 14px;
  padding-top: 12px;
}

.settings-group {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdff;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.toggle-row input {
  width: auto;
}

.contacts-popover.open {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.contacts-popover.closing {
  opacity: 0;
  transform: translateY(6px) scale(0.985);
}

.contacts-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.contacts-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.contacts-head h3 {
  margin-top: 3px;
  font-size: 18px;
  line-height: 1.2;
}

.contacts-search {
  display: grid;
  gap: 6px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}

.contacts-search span {
  color: var(--muted);
  font-size: 12px;
}

.contacts-list,
.contacts-group {
  display: grid;
  gap: 8px;
}

.contacts-list {
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.contacts-group + .contacts-group {
  margin-top: 10px;
}

.contacts-group-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.contact-item {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  text-align: left;
}

.contact-item:hover {
  border-color: #bfdbfe;
  background: #f5f7ff;
}

.contact-item.group-mode {
  cursor: pointer;
}

.contact-item.selected {
  border-color: #93c5fd;
  background: #eff6ff;
}

.contact-item:disabled {
  cursor: default;
  opacity: 0.72;
}

.contact-avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 900;
}

.contact-avatar.human {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
}

.contact-avatar.agent {
  background: linear-gradient(135deg, #14b8a6, #22c55e);
}

.contact-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.contact-main strong,
.contact-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-main span {
  color: var(--muted);
  font-size: 12px;
}

.contact-action {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.contacts-group-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.contacts-group-fields {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 8px;
}

.contacts-group-name-field {
  display: grid;
  gap: 6px;
}

.contacts-group-name-field span {
  color: var(--muted);
  font-size: 12px;
}

.contacts-group-name-field input {
  width: 100%;
}

.contacts-group-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.contacts-head-actions .compact-button.active {
  border-color: #93c5fd;
  background: #eff6ff;
  color: var(--accent);
}

.sidebar-head {
  min-height: 86px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-head h1 {
  margin-top: 4px;
  font-size: 26px;
  line-height: 1;
  letter-spacing: 0;
}

.eyebrow {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-section {
  min-height: 0;
  padding: 14px 12px;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.sidebar-note {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.section-head h2,
.section-head h3 {
  font-size: 15px;
  line-height: 1.25;
}

.section-meta,
.meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.thread-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 2px 4px 12px 0;
}

.conversation-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 4px 10px 0;
  min-height: 0;
}

.conversation-tab {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.86);
  color: #526173;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  min-height: 30px;
  padding: 6px 11px;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.conversation-tab:hover {
  border-color: #bdd0f5;
  color: #2454a6;
}

.conversation-tab.active {
  border-color: #7da2f3;
  background: #eef2ff;
  color: #1d4ed8;
  box-shadow: 0 1px 3px rgba(29, 78, 216, 0.12);
}

.conversation-tree {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.thread-row {
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  padding: 10px 11px 9px;
  cursor: pointer;
  position: relative;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.thread-row:hover {
  border-color: var(--line-strong);
  background: #fff;
  box-shadow: var(--shadow-card);
}

.thread-row.active {
  border-color: #9db9f8;
  background: linear-gradient(180deg, #f5f7ff 0%, #eef2ff 100%);
  box-shadow: var(--shadow-card);
}

.conversation-row {
  border-left: 3px solid #d8dee8;
}

.conversation-row.conversation-group {
  border-left-color: #8fb5d6;
  background: #fbfdff;
}

.conversation-row.conversation-agent {
  border-left-color: #8ec5bd;
  background: #fbfefc;
}

.conversation-row.conversation-human {
  border-left-color: #d9b68b;
  background: #fffdf9;
}

.conversation-archive-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  border: 1px solid #dbe3ee;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #7b8798;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 13px;
  line-height: 1;
  opacity: 0.88;
}

.conversation-archive-button:hover {
  border-color: #f1c7c7;
  background: #fff5f5;
  color: #dc2626;
}

.conversation-archive-placeholder {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
}

.conversation-kind-badge {
  flex: 0 0 auto;
  border: 1px solid #dbe3ee;
  border-radius: 999px;
  background: #f7f9fc;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 3px 6px;
}

.conversation-group .conversation-kind-badge {
  border-color: #cfe0ef;
  background: #f4f9fd;
  color: #426f91;
}

.conversation-agent .conversation-kind-badge {
  border-color: #cce6df;
  background: #f4fbf8;
  color: #3f776f;
}

.conversation-human .conversation-kind-badge {
  border-color: #ead9c2;
  background: #fff8ef;
  color: #8a6841;
}

.conversation-row.archived {
  opacity: 0.78;
  background: #f8fafc;
}

.conversation-row.archived .thread-title-line {
  padding-right: 60px;
}

.conversation-archived-token {
  position: absolute;
  top: 10px;
  right: 10px;
}

.thread-title-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
  min-width: 0;
  padding-right: 26px;
}

.conversation-peer-avatar {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  background: linear-gradient(145deg, #0891b2, #22c55e);
}

.conversation-peer-avatar.human {
  background: linear-gradient(145deg, #4f46e5, #60a5fa);
}

.thread-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  padding-right: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-count-badge {
  flex: 0 0 auto;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 7px;
}

.sidebar-topic-list {
  display: grid;
  gap: 5px;
  min-width: 0;
  margin-left: 12px;
  padding-left: 8px;
  border-left: 2px solid #dbeafe;
}

.sidebar-topic {
  display: grid;
  min-width: 0;
  max-width: 100%;
  gap: 5px;
  border: 1px solid #e5eaf2;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  padding: 8px 9px;
  cursor: pointer;
}

.sidebar-topic:hover {
  border-color: #bfdbfe;
  background: #fff;
}

.sidebar-topic.active {
  border-color: var(--accent);
  background: #eff6ff;
}

.topic-sidebar-row.archived,
.sidebar-topic.archived {
  border-color: #e2e8f0;
  background: #f8fafc;
  opacity: 0.72;
}

.topic-sidebar-row.archived:hover,
.sidebar-topic.archived:hover {
  opacity: 0.92;
}

.sidebar-topic-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.sidebar-topic-title {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-close-button {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.topic-close-button:hover {
  border-color: #fecaca;
  background: #fff5f5;
  color: var(--danger);
}

.topic-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.compact-danger-button {
  border: 1px solid #fecaca;
  border-radius: 999px;
  background: #fff;
  color: var(--danger);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  white-space: nowrap;
}

.compact-danger-button:hover {
  background: #fef2f2;
}

.sidebar-topic-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  min-width: 0;
}

.sidebar-topic-meta > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-subline,
.thread-last {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.thread-subline {
  min-width: 0;
  max-width: 100%;
  color: #475569;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-last {
  margin-top: 3px;
  text-align: right;
}

.thread-badges,
.message-meta,
.token-row,
.participant-strip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.thread-badges {
  margin: 7px 0;
}

.thread-human-alert {
  position: absolute;
  top: 12px;
  right: 30px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #4f46e5;
  box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.42);
  animation: threadHumanAlertPulse 1.5s ease-in-out infinite;
}

@keyframes threadHumanAlertPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.42);
    opacity: 1;
  }

  70% {
    transform: scale(1.06);
    box-shadow: 0 0 0 8px rgba(79, 70, 229, 0);
    opacity: 0.9;
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
    opacity: 1;
  }
}

.thread-state-dot {
  position: absolute;
  top: 14px;
  right: 12px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #94a3b8;
}

.thread-state-dot.state-running {
  background: #0891b2;
}

.thread-state-dot.state-waiting {
  background: #d97706;
}

.thread-state-dot.state-blocked {
  background: #dc2626;
}

.thread-state-dot.state-archived,
.thread-state-dot.state-idle {
  background: #94a3b8;
}

.main-pane {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
}

.flow-view {
  height: 100vh;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.hub-view {
  height: 100vh;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  background: var(--bg);
}

.empty-state,
.empty-card {
  display: none;
}

.thread-detail {
  height: 100vh;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(79, 70, 229, 0.06), transparent 240px),
    linear-gradient(180deg, #f9fbff 0%, var(--bg) 180px);
}

.status-bar {
  min-width: 0;
  position: relative;
  overflow: hidden;
  margin: 14px 18px 0;
  border: 1px solid rgba(203, 213, 225, 0.92);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 249, 255, 0.96) 52%, rgba(237, 244, 255, 0.94) 100%);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.07);
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "topic"
    "people people";
  gap: 12px;
  padding: 18px 22px 16px;
}

.status-bar::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 72px;
  background: linear-gradient(90deg, rgba(79, 70, 229, 0.08), rgba(79, 70, 229, 0.01) 58%, transparent 100%);
  pointer-events: none;
}

.status-summary {
  grid-area: topic;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.status-summary h2 {
  margin-top: 6px;
  font-size: 33px;
  line-height: 1.08;
  letter-spacing: 0;
  white-space: normal;
}

.topic-detail-tabs {
  border-bottom: 1px solid var(--line);
  background: #fff;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  flex: 0 0 auto;
}

.topic-back-button {
  margin-right: 8px;
  border-color: #cbd5e1;
}

.topic-detail-tabs-inline {
  border-bottom: 0;
  padding: 0;
  margin-left: auto;
  align-self: start;
}

.topic-detail-tab {
  flex: 0 0 auto;
  align-self: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  padding: 7px 13px;
  min-height: 36px;
  line-height: 1;
}

.topic-detail-tab:hover,
.topic-detail-tab.active {
  border-color: #cfe0ff;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.status-sentence {
  margin-top: 10px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  max-width: 920px;
}

.status-block {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
}

.status-label {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 5px;
}

.status-block strong {
  display: block;
  min-width: 0;
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
}

.participant-strip {
  grid-area: people;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 0;
  position: relative;
  z-index: 1;
}

.participant-inline-label {
  color: #52627a;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.participant-strip-list {
  min-width: 0;
  overflow: visible;
  max-height: none;
}

.participant-pill {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 4px 8px;
}

.participant-pill-name {
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}

.participant-pill-meta {
  display: inline-flex;
  gap: 4px;
}

.participant-runtime {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.agent-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.12);
  flex: 0 0 auto;
}

.agent-dot.dot-busy {
  background: var(--warn);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.14);
}

.agent-dot.dot-offline,
.agent-dot.dot-unknown {
  background: var(--muted);
  box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.12);
}

.content-grid {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 0;
  padding: 14px 18px 18px;
}

.chat-pane {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 16px 0 0 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-card);
}

.conversation-info {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: #f8fafc;
  border: 0;
  border-left: 0;
  border-radius: 0;
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 12px;
  box-shadow: none;
}

.conversation-info-card {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 14px 2px 2px;
  box-shadow: none;
}

.conversation-info-card:first-child {
  border-top: 0;
  padding-top: 2px;
}

.conversation-summary {
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}

.conversation-member-list,
.conversation-agent-list {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.conversation-member {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: start;
  gap: 6px 8px;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  padding: 8px;
  text-align: left;
  position: relative;
}

.conversation-member > div {
  min-width: 0;
  grid-column: 1 / -1;
}

.conversation-member:hover {
  border-color: #dbeafe;
  background: #f4f8ff;
}

.conversation-member strong,
.conversation-agent strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.conversation-member p,
.conversation-agent p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-info-summary-card {
  grid-column: 1 / -1;
}

.conversation-agent {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
  padding: 10px;
}

.conversation-agent .compact-button {
  margin-top: 8px;
}

.conversation-topic-list {
  display: grid;
  gap: 8px;
}

.conversation-info-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.conversation-info-tab {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.conversation-info-tab:hover,
.conversation-info-tab.active {
  border-color: #cfe0ff;
  background: var(--accent-soft);
  color: var(--accent);
}

.conversation-flow-list {
  display: grid;
  gap: 8px;
}

.conversation-flow-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
  padding: 10px;
}

.conversation-flow-card.compact {
  padding: 10px 12px;
  gap: 8px;
}

.conversation-flow-compact-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.conversation-flow-compact-name {
  min-width: 0;
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  color: var(--text);
}

.conversation-flow-compact-arrow {
  color: var(--muted);
  font-weight: 700;
}

.conversation-flow-card.status-pending {
  border-color: #fed7aa;
  background: #fffaf3;
}

.conversation-flow-card.status-claimed {
  border-color: #bfdbfe;
  background: #f5f7ff;
}

.conversation-flow-card.status-done {
  border-color: #bbf7d0;
  background: #f7fff8;
}

.conversation-flow-card.status-failed {
  border-color: #fecaca;
  background: #fff8f8;
}

.conversation-flow-graphic {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 74px;
  align-items: center;
  gap: 8px;
}

.conversation-flow-node {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 0;
}

.conversation-flow-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
}

.conversation-flow-avatar.human {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.conversation-flow-avatar.agent {
  background: linear-gradient(135deg, #4f46e5, #22c55e);
}

.conversation-flow-avatar.thread,
.conversation-flow-avatar.unknown {
  background: linear-gradient(135deg, #94a3b8, #64748b);
}

.conversation-flow-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.conversation-flow-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.conversation-flow-track::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.9;
}

.conversation-flow-track.status-message::after {
  background: linear-gradient(90deg, #cbd5e1 0%, #94a3b8 100%);
}

.conversation-flow-track.status-pending::after {
  background: linear-gradient(90deg, #fdba74 0%, #f59e0b 100%);
}

.conversation-flow-track.status-claimed::after {
  background: linear-gradient(90deg, #60a5fa 0%, #4f46e5 100%);
}

.conversation-flow-track.status-done::after {
  background: linear-gradient(90deg, #86efac 0%, #16a34a 100%);
}

.conversation-flow-track.status-failed::after {
  background: linear-gradient(90deg, #fca5a5 0%, #dc2626 100%);
}

.conversation-flow-dot {
  position: absolute;
  top: 50%;
  left: 0;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: currentColor;
  transform: translateY(-50%);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
  color: #94a3b8;
}

.conversation-flow-track.status-pending .conversation-flow-dot {
  color: #f59e0b;
  left: 18%;
}

.conversation-flow-track.status-claimed .conversation-flow-dot {
  color: #4f46e5;
  animation: miniFlowMove 1.4s linear infinite;
}

.conversation-flow-track.status-done .conversation-flow-dot {
  color: #16a34a;
  left: calc(100% - 12px);
}

.conversation-flow-track.status-failed .conversation-flow-dot {
  color: #dc2626;
  left: calc(100% - 12px);
}

.conversation-flow-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.conversation-flow-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

@keyframes miniFlowMove {
  0% { left: 0; }
  100% { left: calc(100% - 12px); }
}

.topic-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.conversation-topic-group {
  display: grid;
  gap: 8px;
}

.conversation-topic-group + .conversation-topic-group {
  margin-top: 12px;
}

.conversation-topic-card {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-left: 4px solid #38bdf8;
  border-radius: 12px;
  background: #fbfdff;
  padding: 10px;
  cursor: pointer;
}

.conversation-topic-card:hover {
  border-color: #bfdbfe;
}

.conversation-topic-card.active {
  border-color: var(--accent);
  border-left-color: var(--accent);
  background: #eff6ff;
}

.conversation-topic-card.archived {
  border-left-color: #94a3b8;
  background: #f8fafc;
  opacity: 0.72;
}

.conversation-topic-card.archived:hover,
.conversation-topic-card.archived.active {
  opacity: 0.92;
}

.conversation-topic-card p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.topic-next-action-hint {
  width: fit-content;
  max-width: 100%;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  padding: 5px 8px;
}

.topic-info-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.topic-info-summary strong {
  color: var(--text);
}

.topic-info-summary-card {
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
  padding: 9px 10px;
}

.topic-side-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.topic-side-facts div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 9px 10px;
}

.topic-side-facts span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.topic-side-facts strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 13px;
}

.topic-side-final {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  background: #f0fdf4;
  padding: 10px;
}

.topic-side-final p {
  margin: 0;
  color: #166534;
  font-size: 12px;
  line-height: 1.55;
}

.thread-goal-card {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
}

.thread-goal {
  max-height: 58px;
  overflow: auto;
  color: var(--text);
  line-height: 1.6;
}

.context-identity-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.context-identity-line code {
  border: 1px solid #dbe7f6;
  border-radius: 8px;
  background: #f7fbff;
  color: #36506f;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  padding: 2px 6px;
}

.timeline-shell {
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

.timeline {
  height: 100%;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 18px 18px 112px;
}

.timeline-item {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.timeline-item.message-own {
  justify-items: end;
}

.timeline-item.message-other {
  justify-items: start;
}

.topic-thread-view {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 860px;
  align-content: start;
  justify-items: start;
}

.topic-root-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.topic-active-status {
  display: grid;
  gap: 8px;
}

.topic-active-item {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 10px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #fff;
  color: #1e3a8a;
  padding: 8px 12px;
  box-shadow: 0 8px 22px rgba(79, 70, 229, 0.1);
}

.topic-active-item.status-claimed {
  border-color: #a5f3fc;
  background: #f0fdff;
}

.topic-active-item.status-pending {
  border-color: #fed7aa;
  background: #fffaf2;
  color: #9a3412;
}

.topic-active-item.status-stale {
  border-color: #fecaca;
  background: #fff5f5;
  color: #991b1b;
}

.topic-active-item strong {
  display: block;
  font-size: 13px;
  line-height: 1.25;
}

.topic-active-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.topic-active-spinner {
  width: 16px;
  height: 16px;
}

.pinned-final-result {
  display: grid;
  gap: 8px;
  border: 1px solid #bbf7d0;
  border-left: 4px solid var(--success);
  border-radius: 12px;
  background: #f0fdf4;
  padding: 12px 14px;
  box-shadow: var(--shadow-card);
}

.pinned-final-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #166534;
  font-size: 12px;
  font-weight: 700;
}

.pinned-final-result p {
  margin: 0;
  color: #14532d;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.collapsed-messages-button {
  width: fit-content;
  justify-self: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--brand);
  cursor: pointer;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: var(--shadow-card);
}

.collapsed-messages-button:hover {
  border-color: #bfdbfe;
  background: #f5f7ff;
}

.topic-message-card {
  max-width: 100%;
}

.topic-root-message {
  border-color: #cfe0ff;
  background: #fbfdff;
}

.topic-replies-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  color: var(--text);
}

.topic-replies-head span {
  color: var(--muted);
  font-size: 12px;
}

.topic-reply-list {
  display: grid;
  gap: 10px;
  width: 100%;
  padding-left: 18px;
  border-left: 2px solid #e3e9f2;
  justify-items: start;
}

.message-card {
  max-width: min(760px, 88%);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px 14px;
  box-shadow: var(--shadow-card);
}

.message-card.message-kind-human {
  max-width: min(720px, 78%);
  border-color: #cfe0ff;
  background: #f7faff;
}

.message-card.message-kind-agent {
  margin-right: auto;
  max-width: min(780px, 82%);
  border-left: 3px solid #9fd6ce;
  background: #fff;
}

.message-card.message-kind-system {
  max-width: 100%;
  margin: 0 auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 2px 0;
}

.message-card.message-kind-system .message-head,
.message-card.message-kind-system .message-body {
  display: inline;
  color: var(--muted);
  font-size: 12px;
}

.message-card.human {
  background: #f7faff;
  border-color: #cfe0ff;
}

.message-card.message-own {
  justify-self: end;
  margin-left: auto;
  margin-right: 0;
  border-color: #cfe0ff;
  background: #f7faff;
}

.message-card.message-other {
  justify-self: start;
  margin-left: 0;
  margin-right: auto;
}

.message-card.message-other.message-kind-agent {
  border-left: 3px solid #9fd6ce;
}

.message-card.human .message-reply-status-list {
  justify-items: start;
}

.message-card.agent.actor-huochao-hermes {
  border-left: 4px solid var(--hermes);
}

.message-card.agent.actor-huochao-codex {
  border-left: 4px solid var(--codex);
}

.message-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.message-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.message-route {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  line-height: 1.35;
}

.route-actor,
.participant-name-tag {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  vertical-align: baseline;
}

.participant-name-tag {
  background: var(--tag-bg);
  border-color: var(--tag-border);
  color: var(--tag-text);
  white-space: nowrap;
}

.participant-name-agent {
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.05);
}

.participant-name-human {
  box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.04);
}

.participant-name-group {
  font-weight: 900;
}

.route-from {
  background: rgba(79, 70, 229, 0.1);
  color: #1d4ed8;
}

.route-to {
  background: rgba(8, 145, 178, 0.1);
  color: #0f766e;
}

.route-verb {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.message-time {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.message-meta:empty {
  display: none;
}

.message-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.65;
}

.message-body .mention-name {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}

.message-body .mention-name .participant-name-tag {
  padding: 1px 7px;
  font-size: 12px;
}

.pinned-final-head .participant-name-tag,
.message-reply-status .participant-name-tag,
.topic-active-item .participant-name-tag {
  padding: 1px 7px;
  font-size: 12px;
}

.message-detail {
  margin-top: 10px;
}

.message-detail-toggle {
  display: inline-flex;
  align-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  user-select: none;
}

.message-detail-toggle::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-right: 6px;
  border-radius: 999px;
  background: #eaf1ff;
  color: var(--brand);
  font-size: 12px;
  line-height: 1;
}

.message-detail.expanded .message-detail-toggle::before {
  content: "-";
}

.message-detail .detail-close {
  display: none;
}

.message-detail.expanded .detail-open {
  display: none;
}

.message-detail.expanded .detail-close {
  display: inline;
}

.message-detail-body {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 320px;
  overflow: auto;
}

.message-reply-status-list {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin-top: 7px;
  max-height: none;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
}

.message-reply-status {
  display: inline-flex;
  flex: 0 0 auto;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #ffffff;
  color: #1e3a8a;
  padding: 3px 8px;
  font-size: 12px;
  line-height: 1.35;
  box-shadow: none;
}

.message-reply-status.status-claimed {
  border-color: #a5f3fc;
  background: #f0fdff;
}

.message-reply-status.status-done {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.message-reply-status.status-pending {
  border-color: #fed7aa;
  background: #fffaf2;
}

.message-reply-status.status-queued {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #475569;
}

.message-reply-status.status-failed {
  border-color: #fecaca;
  background: #fff5f5;
}

.message-reply-status.status-stale {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.message-reply-status strong {
  display: block;
  font-size: 12px;
  line-height: 1.25;
}

.reply-spinner {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border: 2px solid #cbd5e1;
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: replySpin 0.8s linear infinite;
}

.reply-status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
}

.reply-status-dot.failed {
  background: var(--danger);
}

.reply-status-dot.done {
  background: var(--success);
}

@keyframes replySpin {
  to {
    transform: rotate(360deg);
  }
}

.event-row {
  display: flex;
  justify-content: center;
  position: relative;
  margin: 2px 0;
}

.event-row::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 50%;
  height: 1px;
  background: #e3e9f2;
}

.event-chip {
  position: relative;
  z-index: 1;
  max-width: 92%;
  border: 1px solid #e3e9f2;
  border-radius: 999px;
  background: var(--panel);
  color: #6b7788;
  padding: 4px 10px;
  font-size: 12px;
  line-height: 1.45;
}

.topic-card {
  width: 100%;
  margin-top: 10px;
  border: 1px solid #cfe0ff;
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  background: #f5f7ff;
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  text-align: left;
}

.topic-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.topic-card:hover {
  border-color: #93b4ff;
  background: #f2f7ff;
}

.topic-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.topic-display-code {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  padding: 4px 8px;
}

.topic-card-reply-preview {
  margin: 2px 0 0;
  color: #334155;
  font-size: 12px;
  line-height: 1.5;
  max-height: 38px;
  overflow: hidden;
}

.topic-card-final-preview,
.topic-preview-final {
  display: grid;
  gap: 5px;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  background: #f0fdf4;
  padding: 8px 9px;
}

.topic-card-final-preview p,
.topic-preview-final p {
  margin: 0;
  color: #166534;
  font-size: 12px;
  line-height: 1.5;
}

.topic-card-final-badge {
  width: fit-content;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d !important;
  font-size: 11px !important;
  font-weight: 800;
  line-height: 1.2 !important;
  padding: 3px 7px;
}

.final-message-list {
  margin-bottom: 12px;
}

.final-message-card {
  border-color: #bfdbfe;
  background: #f5f7ff;
}

.final-message-card p {
  margin: 8px 0 0;
  color: #334155;
  line-height: 1.6;
  white-space: pre-wrap;
}

.topic-card-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  border-radius: 999px;
  padding: 3px 8px;
  font-weight: 700;
}

.topic-card-spinner {
  width: 12px;
  height: 12px;
  border-width: 2px;
}

.topic-card-pending .topic-card-status {
  background: #fff7ed;
  color: var(--warn);
}

.topic-card-claimed .topic-card-status {
  background: #eff6ff;
  color: var(--accent);
}

.topic-card-done .topic-card-status {
  background: #ecfdf3;
  color: var(--success);
}

.topic-card-failed .topic-card-status {
  background: #fef2f2;
  color: var(--danger);
}

.topic-card-archived {
  border-color: #dbe3ee;
  border-left-color: #94a3b8;
  background: #f8fafc;
  opacity: 0.72;
}

.topic-card-archived:hover {
  opacity: 0.92;
  background: #f8fafc;
}

.topic-card-archived .topic-card-status {
  background: #f1f5f9;
  color: #64748b;
}

.topic-card-close {
  width: 22px;
  height: 22px;
}

.topic-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(6px);
}

.topic-preview-card {
  width: min(620px, calc(100vw - 48px));
  max-height: min(76vh, 680px);
  overflow: auto;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.2);
  padding: 18px;
}

.topic-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  padding-bottom: 12px;
}

.topic-preview-head h3 {
  margin-top: 4px;
  font-size: 20px;
  line-height: 1.25;
}

.topic-preview-close {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.topic-preview-close:hover {
  color: var(--danger);
  border-color: #fecaca;
}

.topic-preview-body {
  display: grid;
  gap: 12px;
  padding: 14px 0;
}

.topic-preview-body p {
  margin: 0;
  color: var(--text);
  line-height: 1.55;
}

.topic-preview-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.topic-preview-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.topic-preview-facts div {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.82);
  padding: 10px;
}

.topic-preview-facts span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.topic-preview-facts strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-preview-hint {
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.78);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  padding: 10px;
}

.topic-preview-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  padding-top: 12px;
}

.member-preview-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.member-preview-profile strong {
  display: block;
  font-size: 18px;
  line-height: 1.25;
}

.member-preview-profile p {
  margin-top: 3px;
  color: var(--muted);
}

.member-skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.member-skill-list .contacts-group-title {
  flex: 0 0 100%;
}

#member-preview-name-input {
  border: 1px solid var(--line);
  background: #fff;
}

.composer-shell {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 12px;
  z-index: 12;
  border: 1px solid rgba(203, 213, 225, 0.68);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(12px);
  padding: 6px 8px;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.composer-shell.drag-over {
  border-color: #60a5fa;
  background: rgba(239, 246, 255, 0.88);
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.1);
}

.composer-shell.archived {
  border-color: #e2e8f0;
  background: rgba(248, 250, 252, 0.86);
  box-shadow: none;
}

.composer-shell.archived textarea,
.composer-shell.archived button {
  cursor: not-allowed;
}

.ghost-button,
.icon-button,
.primary-button,
.workbench-tab,
.compact-button {
  border-radius: 999px;
  border: 1px solid var(--line);
  cursor: pointer;
}

.ghost-button,
.icon-button,
.workbench-tab,
.compact-button {
  background: #fff;
  color: var(--text);
  padding: 7px 11px;
}

.compact-select {
  min-height: 34px;
  max-width: 150px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  padding: 7px 28px 7px 11px;
  font: inherit;
}

.primary-button {
  border-color: var(--accent-2);
  background: var(--accent-2);
  color: #fff;
  padding: 10px 16px;
}

.ghost-button:hover,
.icon-button:hover,
.workbench-tab:hover,
.compact-button:hover {
  border-color: var(--line-strong);
  background: #f5f7ff;
}

.primary-button:hover {
  background: #1d4ed8;
}

.composer-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.attachment-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 4px 6px 36px;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 220px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #f4f8ff;
  color: #334155;
  font-size: 12px;
  line-height: 1;
  padding: 5px 7px 5px 9px;
}

.attachment-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-chip button {
  border: 0;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: var(--muted);
  font-size: 12px;
}

.field-wide {
  min-width: 0;
}

select,
textarea,
input {
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.4);
  color: var(--text);
  outline: none;
  padding: 6px 8px;
}

textarea {
  min-height: 38px;
  max-height: 150px;
  resize: none;
  line-height: 1.45;
  overflow-y: hidden;
  box-shadow: none;
}

.send-button {
  height: 32px;
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
}

.composer-icon-button {
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
}

.composer-icon-button:hover {
  border-color: rgba(191, 219, 254, 0.9);
  background: rgba(239, 246, 255, 0.78);
  color: var(--accent);
}

.mention-popover {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: calc(100% + 6px);
  z-index: 13;
  max-height: 260px;
  overflow: auto;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(8px);
  padding: 8px;
}

.mention-option {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px;
  text-align: left;
}

.mention-option:hover {
  border-color: #bfdbfe;
  background: #f5f7ff;
}

.mention-option strong,
.mention-option small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mention-option small,
.mention-empty {
  color: var(--muted);
  font-size: 12px;
}

.mention-empty {
  padding: 10px;
}

.workbench {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: transparent;
  padding: 0;
  display: grid;
  align-content: start;
  gap: 12px;
}

.control-content {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 14px;
  align-items: start;
}

.control-workbench-card {
  min-height: 0;
}

.flow-header {
  border-bottom: 1px solid var(--line);
  background: #fbfcff;
  padding: 16px 18px 14px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.view-header {
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  padding: 16px 18px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.view-header h2 {
  margin-top: 4px;
  font-size: 24px;
  line-height: 1.2;
}

.inventory-overview-header-main {
  min-width: 0;
  display: grid;
  gap: 8px;
  flex: 1;
}

.inventory-overview-header-nav {
  max-width: 100%;
  min-width: 0;
}

.view-content {
  min-height: 0;
  overflow: auto;
  padding: 18px;
}

.results-grid,
.records-grid,
.task-overview-grid,
.inventory-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 14px;
  align-items: start;
}

.task-overview-grid {
  grid-template-columns: minmax(420px, 1fr) minmax(360px, 0.92fr);
}

.results-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
}

.inventory-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.view-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inventory-overview-layout {
  display: block;
  position: relative;
}

.inventory-planning-layout {
  display: grid;
  gap: 14px;
}

.inventory-overview-chip-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
}

.inventory-chip-entry {
  position: relative;
}

.inventory-chip-link {
  border: 1px solid #dbe7f5;
  border-radius: 999px;
  background: #ffffff;
  color: #31507a;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
  padding: 7px 11px;
  cursor: pointer;
}

.inventory-chip-entry.active .inventory-chip-link,
.inventory-chip-link:hover {
  border-color: #93c5fd;
  background: #f5f7ff;
}

.inventory-chip-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 12;
  min-width: 140px;
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid #d7e6fb;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.inventory-chip-series-link {
  width: 100%;
  border: 1px solid #e3ebf7;
  border-radius: 8px;
  background: #fbfdff;
  color: #4b6382;
  font-size: 11px;
  line-height: 1.2;
  padding: 6px 8px;
  text-align: left;
  cursor: pointer;
}

.inventory-chip-series-link:hover {
  border-color: #bfdbfe;
  background: #f4f8ff;
}

.inventory-overview-main,
.inventory-overview-suppliers,
.inventory-overview-series-stack,
.inventory-supplier-content-stack {
  display: grid;
  gap: 14px;
}

.inventory-overview-suppliers {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.inventory-overview-main {
  width: auto;
  max-width: none;
  margin: 0;
  padding-left: 0;
  padding-right: 0;
}

.inventory-summary-card .inventory-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.inventory-summary-card .inventory-kpi-card {
  padding: 12px;
  gap: 6px;
  border-radius: 10px;
}

.inventory-summary-card .inventory-kpi-card span {
  font-size: 12px;
}

.inventory-summary-card .inventory-kpi-card strong {
  font-size: 20px;
}

.inventory-watchlist-card {
  display: grid;
  gap: 14px;
}

.inventory-watchlist-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.inventory-watchlist-body {
  min-width: 0;
}

.inventory-watchlist-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.inventory-watchlist-panel {
  border: 1px solid #e3ebf7;
  border-radius: 14px;
  background: #fbfdff;
  padding: 12px;
  min-width: 0;
}

.inventory-watchlist-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 460px;
  overflow-y: auto;
  padding-right: 4px;
}

.ads-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(520px, 1.4fr);
  gap: 14px;
  align-content: start;
}

.ads-shell {
  display: grid;
  grid-template-columns: 232px minmax(260px, 320px) minmax(0, 1fr);
  grid-template-areas: "rail browser workspace";
  gap: 16px;
  align-items: stretch;
  position: relative;
  grid-row: 1 / -1;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 18px;
}

.ads-shell[data-ads-shell-mode="calendar"] {
  grid-template-columns: 232px minmax(0, 1fr);
  grid-template-areas: "rail workspace";
}

.ads-rail {
  grid-area: rail;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 10px 10px;
  background: linear-gradient(180deg, #ffffff 0%, var(--slate-50) 100%);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--elev-1);
  overflow: hidden;
  min-height: 0;
  height: 100%;
}

.ads-rail-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}

.ads-rail-section.flex {
  flex: 1;
  min-height: 0;
}

.ads-rail-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 6px 8px 4px;
  border-top: 1px solid var(--slate-100);
  margin-top: 4px;
}

.ads-rail-section-head h3 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--slate-500);
  margin: 0;
}

.ads-rail-section-head .ads-rail-section-meta {
  font-size: 11px;
  color: var(--slate-400);
}

.ads-rail-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow-y: auto;
  padding: 2px 2px 4px;
}

.ads-rail-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-weight: 500;
  font-size: 13px;
  color: var(--slate-700);
  text-align: left;
  line-height: 1.3;
  transition: background 0.12s ease, color 0.12s ease;
  cursor: pointer;
  position: relative;
}

.ads-rail-item:hover {
  background: var(--slate-100);
  color: var(--slate-900);
}

.ads-rail-item.active {
  background: var(--indigo-50);
  color: var(--indigo-700);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--indigo-600);
}

.ads-rail-item-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ads-rail-item-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--slate-400);
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--slate-100);
  flex-shrink: 0;
}

.ads-rail-item.active .ads-rail-item-badge {
  background: #fff;
  color: var(--indigo-700);
}

.ads-rail-item-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ads-rail-item-dot.overdue { background: var(--danger); }
.ads-rail-item-dot.today { background: var(--warm-500); }
.ads-rail-item-dot.normal { background: transparent; }

.ads-rail-brand {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 2px 8px 8px;
  border-bottom: 1px solid var(--slate-100);
}

.ads-rail-brand .eyebrow {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate-500);
  margin-bottom: 1px;
}

.ads-rail-brand strong {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--slate-900);
}

.ads-mode-tabs.vertical {
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: static;
  margin: 0;
  padding: 0;
  background: none;
  backdrop-filter: none;
  border-bottom: none;
}

.ads-mode-tabs.vertical .ads-mode-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  font-weight: 500;
  font-size: 13.5px;
  color: var(--slate-700);
  text-align: left;
  transition: background 0.12s ease, color 0.12s ease;
}

.ads-mode-tabs.vertical .ads-mode-tab:hover {
  background: var(--slate-100);
  color: var(--slate-900);
}

.ads-mode-tabs.vertical .ads-mode-tab.active {
  background: var(--indigo-50);
  color: var(--indigo-700);
  font-weight: 600;
  border-color: transparent;
  box-shadow: inset 2px 0 0 var(--indigo-600);
}

.ads-mode-tabs.vertical .ads-mode-tab-glyph {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: currentColor;
  opacity: 0.85;
}

.ads-browser {
  grid-area: browser;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 10px 10px;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--elev-1);
  min-height: 0;
  height: 100%;
}

.ads-browser-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 4px;
}

.ads-browser-head h3 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--slate-500);
  margin: 0;
}

.ads-browser-head .ads-browser-head-meta {
  font-size: 11px;
  color: var(--slate-400);
}

.ads-browser .ads-chip-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 140px;
  overflow-y: auto;
  padding: 2px 4px 4px;
}

.ads-browser .ads-chip-strip .ads-nav-chip {
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12.5px;
  font-weight: 500;
  background: var(--slate-50);
  border-color: var(--slate-200);
  color: var(--slate-700);
}

.ads-browser .ads-chip-strip .ads-nav-chip:hover {
  background: #fff;
  border-color: var(--indigo-300);
  color: var(--slate-900);
}

.ads-browser .ads-chip-strip .ads-nav-chip.active {
  background: var(--indigo-600);
  border-color: var(--indigo-600);
  color: #fff;
  box-shadow: none;
}

.ads-browser .ads-chip-strip .ads-nav-chip small {
  color: inherit;
  opacity: 0.75;
  font-weight: 500;
}

.ads-browser .ads-series-table {
  flex: 1;
  max-height: none;
  overflow-y: auto;
  padding: 0 2px;
  align-content: start;
  grid-auto-rows: max-content;
}

.ads-workspace {
  grid-area: workspace;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.ads-hero {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--elev-1);
}

.ads-hero-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ads-hero-title h2 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--slate-900);
}

.ads-hero-title .section-meta {
  color: var(--slate-500);
  font-size: 12.5px;
}

.ads-hero-digest {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: center;
  justify-content: flex-end;
}

.ads-hero-digest .ads-hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  font-size: 12px;
  font-weight: 500;
  color: var(--slate-700);
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
  font-family: inherit;
}

.ads-hero-digest .ads-hero-chip:hover {
  background: #fff;
  border-color: var(--indigo-300);
  transform: translateY(-1px);
}

.ads-hero-digest .ads-hero-chip.today:hover {
  border-color: var(--warm-500);
  background: #fff8eb;
}

.ads-hero-digest .ads-hero-chip.overdue:hover {
  border-color: var(--danger);
  background: #fff5f5;
}

.ads-hero-digest .ads-hero-chip strong {
  color: var(--slate-900);
  font-weight: 600;
}

.ads-hero-digest .ads-hero-chip.today {
  background: var(--warm-soft);
  border-color: #fde68a;
  color: var(--warm-600);
}

.ads-hero-digest .ads-hero-chip.today strong {
  color: var(--warm-600);
}

.ads-hero-digest .ads-hero-chip.overdue {
  background: #fef2f2;
  border-color: #fecaca;
  color: var(--danger);
}

.ads-hero-digest .ads-hero-chip.overdue strong {
  color: var(--danger);
}

.ads-workspace-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  min-height: 0;
  flex: 1;
}

.ads-workspace-card {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--elev-1);
  padding: 16px 18px;
  min-width: 0;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ads-workspace-card > .section-head {
  flex-shrink: 0;
}

.ads-workspace-card > .ads-campaign-filter {
  flex-shrink: 0;
}

.ads-workspace-card > .ads-campaign-history-table {
  flex: 1;
  min-height: 0;
  overflow: auto;
  margin: 0;
}

.ads-workspace-body > .ads-calendar-card {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

@media (max-width: 1180px) {
  .ads-shell {
    grid-template-columns: 184px minmax(240px, 280px) minmax(0, 1fr);
  }
  .ads-shell[data-ads-mode="calendar"] {
    grid-template-columns: 184px minmax(0, 1fr);
  }
}

@media (max-width: 980px) {
  .ads-shell,
  .ads-shell[data-ads-shell-mode="calendar"] {
    grid-template-columns: 1fr;
    grid-template-areas: "rail" "browser" "workspace";
    overflow: auto;
    height: auto;
  }
  .ads-rail,
  .ads-browser,
  .ads-workspace {
    height: auto;
  }
  .ads-workspace-card {
    overflow: visible;
  }
  .ads-workspace-card > .ads-campaign-history-table {
    overflow: visible;
  }
}

.ads-page-head {
  padding: 12px 14px;
}

.ads-page-head h2 {
  margin-top: 4px;
}

.ads-top-digest {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: #475467;
  font-size: 12px;
}

.ads-top-digest strong {
  color: #0f172a;
}

.ads-quick-card,
.ads-kpi-strip,
.ads-reminders-card,
.ads-series-card,
.ads-detail-card,
.ads-records-card {
  min-width: 0;
}

.ads-quick-card {
  grid-column: 1 / -1;
}

.ads-quick-float {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  display: grid;
  justify-items: end;
  gap: 6px;
}

.ads-quick-float-toggle {
  width: 52px;
  height: 52px;
  border: 1px solid var(--indigo-600);
  border-radius: 999px;
  background: var(--indigo-600);
  color: white;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(79, 70, 229, 0.30);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  user-select: none;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.ads-quick-float-toggle:hover {
  transform: translateY(-1px);
  background: var(--warm-500);
  border-color: var(--warm-500);
  box-shadow: 0 10px 26px rgba(245, 158, 11, 0.32);
}

.ads-quick-float.open .ads-quick-float-toggle {
  width: 42px;
  height: 42px;
  border-color: var(--slate-200);
  background: #ffffff;
  color: var(--slate-600);
  box-shadow: var(--elev-2);
}

.ads-quick-float-icon {
  display: block;
  font-size: 18px;
  line-height: 1;
}

.ads-quick-float.open .ads-quick-float-icon {
  font-size: 16px;
}

.ads-quick-float-label {
  display: block;
}

.ads-quick-float-panel {
  width: min(460px, calc(100vw - 40px));
  padding: 10px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
}

.ads-quick-float-panel.hidden {
  display: none;
}

.ads-quick-float-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: move;
  margin-bottom: 6px;
}

.ads-bid-calc-float {
  position: fixed;
  right: 22px;
  bottom: 82px;
  z-index: 31;
  display: grid;
  justify-items: end;
  gap: 6px;
}

.ads-bid-calc-toggle {
  width: 52px;
  height: 52px;
  border: 1px solid var(--slate-200);
  border-radius: 999px;
  background: #ffffff;
  color: var(--slate-700);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  box-shadow: var(--elev-2);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  user-select: none;
  touch-action: none;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.ads-bid-calc-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--indigo-300);
  color: var(--indigo-700);
  box-shadow: var(--elev-3);
}

.ads-bid-calc-float.open .ads-bid-calc-toggle {
  width: 42px;
  height: 42px;
  border-color: var(--slate-200);
  background: #ffffff;
  color: var(--slate-600);
  box-shadow: var(--elev-2);
}

.ads-bid-calc-icon {
  font-size: 19px;
  line-height: 1;
}

.ads-bid-calc-panel {
  width: min(520px, calc(100vw - 40px));
  padding: 12px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
}

.ads-bid-calc-panel.hidden {
  display: none;
}

.ads-bid-calc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  cursor: move;
  margin-bottom: 10px;
}

.ads-bid-calc-head > div {
  display: grid;
  gap: 2px;
}

.ads-bid-calc-head strong {
  color: var(--text);
  font-size: 16px;
}

.ads-bid-calc-head small,
.ads-bid-calc-batch-note {
  color: var(--muted);
  font-size: 12px;
}

.ads-bid-calc-toolbar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.ads-bid-calc-toolbar button {
  border: 1px solid #d6e0f0;
  border-radius: 999px;
  background: #fff;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  cursor: pointer;
}

.ads-bid-calc-toolbar button:hover,
.ads-bid-calc-toolbar button.active {
  border-color: #4f46e5;
  background: #eff6ff;
  color: #175cd3;
}

.ads-bid-calc-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 10px;
}

.ads-bid-calc-field {
  min-width: 0;
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  color: #667085;
  font-size: 12px;
  font-weight: 700;
}

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

.ads-bid-calc-field input,
.ads-bid-calc-field select,
.ads-bid-calc-table input {
  width: 100%;
  min-width: 0;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  color: #101828;
  font: inherit;
  padding: 8px 9px;
}

.ads-bid-calc-field input:focus,
.ads-bid-calc-field select:focus,
.ads-bid-calc-table input:focus {
  outline: 2px solid rgba(79, 70, 229, 0.18);
  border-color: #4f46e5;
}

.ads-bid-calc-result {
  display: grid;
  gap: 4px;
  border: 1px solid #dbe7f8;
  border-radius: 12px;
  background: #f5f7ff;
  padding: 12px;
}

.ads-bid-calc-result span,
.ads-bid-calc-result small {
  color: var(--muted);
  font-size: 12px;
}

.ads-bid-calc-result strong {
  color: #175cd3;
  font-size: 24px;
}

.ads-bid-calc-result.up strong,
.ads-bid-calc-table td.up strong {
  color: #067647;
}

.ads-bid-calc-result.down strong,
.ads-bid-calc-table td.down strong {
  color: #b54708;
}

.ads-bid-calc-result.danger strong,
.ads-bid-calc-table td.danger strong {
  color: #d92d20;
}

.ads-bid-calc-result.warning strong,
.ads-bid-calc-table td.warning strong {
  color: #93370d;
  font-size: 16px;
}

.ads-bid-calc-table-wrap {
  max-height: min(360px, calc(100vh - 300px));
  overflow: auto;
  margin-top: 8px;
  border: 1px solid #e4eaf3;
  border-radius: 10px;
}

.ads-bid-calc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.ads-bid-calc-table th,
.ads-bid-calc-table td {
  border-bottom: 1px solid #e4eaf3;
  padding: 7px 8px;
  text-align: left;
  vertical-align: middle;
}

.ads-bid-calc-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f5f7ff;
  color: #667085;
  font-weight: 800;
}

.ads-bid-calc-table tbody th {
  color: #344054;
  font-weight: 800;
  white-space: nowrap;
}

.ads-bid-calc-table input {
  padding: 6px 7px;
}

.ads-mode-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 18;
  margin: 0 -18px;
  padding: 10px 18px 8px;
  background: linear-gradient(180deg, rgba(247, 249, 252, 0.98) 0%, rgba(247, 249, 252, 0.92) 100%);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(229, 234, 242, 0.92);
}

.ads-mode-tab {
  border: 1px solid #c7d2fe;
  background: #fff;
  border-radius: 999px;
  padding: 7px 14px;
  font-weight: 700;
  color: #344054;
}

.ads-mode-tab.active {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #fff;
}

.ads-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  grid-column: 1 / -1;
}

.ads-kpi-strip-inline {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
  grid-column: auto;
}

.ads-kpi {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.ads-kpi span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.ads-kpi strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  line-height: 1.1;
}

.ads-kpi.danger strong {
  color: #d92d20;
}

.ads-kpi.warning strong {
  color: #b54708;
}

.ads-kpi.info strong {
  color: #175cd3;
}

.ads-quick-input {
  width: 100%;
  min-height: 68px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  line-height: 1.35;
  background: #fff;
}

.ads-quick-input.compact {
  min-height: 52px;
  padding: 7px 9px;
}

.ads-quick-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.ads-quick-actions.compact {
  margin-top: 6px;
}

.ads-quick-result {
  margin-top: 12px;
  border-radius: 8px;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.ads-quick-result .mini {
  justify-self: start;
  padding: 4px 10px;
  min-height: 0;
  font-size: 12px;
}

.ads-quick-result.good {
  border: 1px solid #abefc6;
  background: #ecfdf3;
  color: #067647;
}

.ads-quick-result.warning {
  border: 1px solid #fedf89;
  background: #fffaeb;
  color: #93370d;
}

.ads-reminder-list,
.ads-series-list,
.ads-record-list {
  display: grid;
  gap: 8px;
}

.ads-reminder-row,
.ads-series-row {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  text-align: left;
  display: grid;
  gap: 5px;
  color: var(--text);
}

.ads-reminder-row:hover,
.ads-series-row:hover,
.ads-series-row.active {
  border-color: #a5b4fc;
  background: #f5f7ff;
}

.ads-reminder-row.danger {
  border-color: #fecdca;
  background: #fffbfa;
}

.ads-reminder-row.warning {
  border-color: #fedf89;
  background: #fffcf5;
}

.ads-reminder-date {
  font-weight: 700;
  color: #344054;
}

.ads-reminder-title,
.ads-series-row strong {
  font-weight: 700;
}

.ads-reminder-note,
.ads-series-row small,
.ads-series-meta {
  color: var(--muted);
  font-size: 12px;
}

.ads-series-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.ads-series-row > span:first-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.ads-series-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ads-series-meta {
  display: grid;
  gap: 4px;
  text-align: right;
  font-style: normal;
}

.ads-series-meta em {
  font-style: normal;
}

.ads-campaign-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px -18px 0;
  padding: 10px 18px 10px;
  border-bottom: 1px solid var(--slate-100);
  background: #ffffff;
}

.ads-campaign-chip {
  border: 1px solid #c7d2fe;
  background: #fff;
  color: #344054;
  border-radius: 999px;
  padding: 5px 10px;
  font-weight: 700;
}

.ads-campaign-chip:hover {
  border-color: #a5b4fc;
  background: #f7faff;
}

.ads-campaign-chip.active {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #fff;
}

.ads-detail-title {
  margin: 0 0 10px;
  font-size: 14px;
}

.ads-record-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  display: grid;
  gap: 8px;
}

.ads-record-main {
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
}

.ads-record-main strong {
  min-width: 72px;
  color: #101828;
}

.ads-record-main span {
  line-height: 1.45;
}

.ads-record-main small {
  color: var(--muted);
}

.ads-record-meta {
  color: var(--muted);
  font-size: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ads-home-grid {
  display: grid;
  gap: 14px;
}

.ads-store-grid,
.ads-series-code-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.ads-store-card,
.ads-series-code-card {
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  text-align: left;
  display: grid;
  align-content: start;
  gap: 6px;
  color: var(--text);
}

.ads-store-card:hover,
.ads-series-code-card:hover {
  border-color: #a5b4fc;
  background: #f5f7ff;
}

.ads-store-card.danger,
.ads-series-code-card.danger {
  border-color: #fecdca;
  background: #fffbfa;
}

.ads-store-card.warning,
.ads-series-code-card.warning {
  border-color: #fedf89;
  background: #fffcf5;
}

.ads-store-card strong,
.ads-series-code-card strong {
  font-size: 16px;
  color: #101828;
}

.ads-store-card span,
.ads-series-code-card span,
.ads-store-card small,
.ads-series-code-card small {
  color: var(--muted);
  font-size: 12px;
}

.ads-home-calendar {
  min-width: 0;
}

.ads-calendar-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 8px;
}

.ads-calendar-day {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px;
  display: grid;
  gap: 4px;
  text-align: left;
}

.ads-calendar-day.today {
  border-color: #a5b4fc;
  background: #f5f7ff;
}

.ads-calendar-day.future {
  border-color: #fedf89;
  background: #fffcf5;
}

.ads-calendar-day span {
  color: var(--muted);
  font-size: 12px;
}

.ads-two-pane {
  display: grid;
  grid-template-columns: minmax(160px, 190px) minmax(220px, 260px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.ads-directory-card,
.ads-series-table-card,
.ads-detail-card {
  min-width: 0;
}

#ads-view .view-card[data-module^="AD"]:hover {
  border-color: #a5b4fc;
  box-shadow: 0 0 0 1px rgba(37, 94, 232, 0.06);
}

.ads-chip-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 640px;
  overflow: auto;
}

.ads-nav-chip {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
  text-align: left;
  font-weight: 700;
  color: #344054;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.ads-nav-chip:hover {
  border-color: #a5b4fc;
  background: #f7faff;
}

.ads-nav-chip.active {
  border-color: #4f46e5;
  background: #eef2ff;
  color: #175cd3;
}

.ads-nav-chip small {
  color: var(--muted);
  font-weight: 600;
}

.ads-series-table {
  display: grid;
  gap: 5px;
  grid-auto-rows: max-content;
  align-content: start;
  max-height: 720px;
  overflow: auto;
  padding: 0 2px 2px;
}

.ads-series-table-row {
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 7px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  text-align: left;
  align-items: center;
  color: var(--slate-900);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.ads-series-table-row strong {
  font-size: 13px;
}

.ads-series-title-line {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.ads-series-table-row span {
  color: var(--muted);
  font-size: 12px;
}

.ads-series-next-badge {
  width: fit-content;
  border-radius: 999px;
  border: 1px solid #dbe7f8;
  padding: 2px 8px;
  font-size: 11px !important;
  font-weight: 700;
  color: #334155 !important;
  background: #f5f7ff;
}

.ads-series-next-badge.overdue-1 {
  border-color: #fecaca;
  color: #b42318 !important;
  background: #fff8f8;
}

.ads-series-next-badge.overdue-2 {
  border-color: #fca5a5;
  color: #b42318 !important;
  background: #feeceb;
}

.ads-series-next-badge.overdue-3 {
  border-color: #ef4444;
  color: #912018 !important;
  background: #fee2e2;
}

.ads-series-next-badge.future {
  border-color: #bfdbfe;
  color: #175cd3 !important;
  background: #eff6ff;
}

.ads-series-table-row:hover,
.ads-series-table-row.active {
  border-color: #a5b4fc;
  background: #f5f7ff;
}

.ads-series-table-row.danger {
  border-color: #fecdca;
  background: #fffbfa;
}

.ads-series-table-row.warning {
  border-color: #fedf89;
  background: #fffcf5;
}

.ads-series-table-row:hover,
.ads-series-table-row.active {
  border-color: #4f46e5;
  background: #eef2ff;
  box-shadow: inset 3px 0 0 #4f46e5, 0 0 0 1px rgba(79, 70, 229, 0.12);
}

.ads-series-table-row.all-paused {
  opacity: 0.62;
}

.ads-series-table-row.all-paused:hover,
.ads-series-table-row.all-paused.active {
  opacity: 1;
}

.ads-series-paused-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--slate-100);
  color: var(--slate-500);
  font-size: 10px !important;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ads-campaign-history-table {
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  overflow: visible;
  margin: 10px 0 14px;
  background: #fff;
}

.ads-campaign-history-head,
.ads-campaign-history-row {
  display: grid;
  grid-template-columns: minmax(175px, 0.8fr) minmax(88px, 0.35fr) minmax(155px, 0.65fr) minmax(195px, 1fr) minmax(195px, 1fr);
  gap: 10px;
  padding: 7px 12px;
  align-items: start;
}

.ads-campaign-history-head {
  background: var(--slate-50);
  color: var(--slate-500);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--slate-200);
  padding-top: 9px;
  padding-bottom: 9px;
  position: sticky;
  top: 0;
  z-index: 4;
}

.ads-campaign-history-row {
  border-bottom: 1px solid var(--slate-100);
  background: #fff;
  position: relative;
  transition: background 0.14s ease, box-shadow 0.14s ease;
}

.ads-campaign-history-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--indigo-500);
  opacity: 0;
  transition: opacity 0.12s ease, background 0.12s ease;
}

.ads-campaign-history-row:hover {
  background: var(--slate-50);
}

.ads-campaign-history-row:hover::before {
  opacity: 0.55;
}

.ads-campaign-history-row.active {
  background: var(--indigo-50);
}

.ads-campaign-history-row.active::before {
  opacity: 1;
  background: var(--indigo-600);
  width: 3px;
}

.ads-campaign-history-row:last-child {
  border-bottom: 0;
}

.ads-campaign-history-row div,
.ads-campaign-history-row span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.ads-name-line {
  display: flex !important;
  align-items: center;
  gap: 8px;
}

.ads-adgroup-list {
  display: grid;
  gap: 2px;
}

.ads-campaign-status-badge {
  width: fit-content;
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  margin-top: 0;
  height: 22px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.ads-campaign-status-badge i {
  font-style: normal;
  font-size: 10px;
  line-height: 1;
}

.ads-campaign-status-badge.active {
  border: 1px solid #86efac;
  background: #f0fdf4;
  color: #15803d;
}

.ads-campaign-status-badge.active:hover {
  border-color: #22c55e;
  background: #dcfce7;
}

.ads-campaign-status-badge.paused {
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #dc2626;
}

.ads-campaign-status-badge.paused:hover {
  border-color: #f87171;
  background: #fee2e2;
}

.ads-adgroup-name {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* AD08 campaign meta row: status badge + intensity badge — single line, no wrap.
   Must use !important because .ads-campaign-history-row div/span applies display:grid
   at higher specificity (0,1,1) vs these class-only rules (0,1,0). */
.ads-campaign-meta-row {
  display: flex !important;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  margin-top: 4px;
  overflow: hidden;
}

/* Intensity badge — pill, matches status badge height */
.ads-intensity-badge {
  display: inline-flex !important;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  user-select: none;
  flex-shrink: 0;
  cursor: default;
}
.ads-intensity-badge.set {
  background: var(--indigo-50);
  color: var(--indigo-600);
  border: 1px solid var(--indigo-300);
}
.ads-intensity-badge.unset {
  display: none !important;
}

/* Intensity edit — pill container with inline input (active rows only) */
.ads-intensity-edit {
  display: inline-flex !important;
  align-items: center;
  height: 22px;
  border-radius: 999px;
  border: 1px solid var(--indigo-300);
  background: #fff;
  padding: 0 9px;
  gap: 3px;
  flex-shrink: 0;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.ads-intensity-edit:focus-within {
  border-color: var(--indigo-500);
  box-shadow: 0 0 0 2px var(--indigo-50);
}
.ads-intensity-label {
  font-size: 11.5px;
  color: var(--slate-500);
  font-weight: 500;
  white-space: nowrap;
  line-height: 1;
}
/* The inner span wrapper is no longer needed for border/bg — transparent passthrough */
.ads-intensity-field {
  display: inline-flex !important;
  align-items: center;
  gap: 2px;
  font-size: 11.5px;
  color: var(--slate-600);
  background: transparent;
  border: none;
  padding: 0;
  height: auto;
}
.ads-intensity-input {
  width: 44px;
  border: none;
  outline: none;
  background: transparent;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--indigo-700);
  padding: 0;
  text-align: right;
  -moz-appearance: textfield;
}
.ads-intensity-input::-webkit-outer-spin-button,
.ads-intensity-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.ads-inline-name {
  cursor: text;
}

.ads-inline-name:hover {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

.ads-inline-rename-input {
  width: min(260px, 100%);
  min-width: 120px;
  border: 1px solid #7da2f7;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: inherit;
  padding: 2px 6px;
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.ads-campaign-note-input {
  width: 100%;
  height: 100%;
  min-height: 74px;
  min-width: 0;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  line-height: 1.3;
  padding: 10px 12px;
  outline: none;
  resize: vertical;
}

.ads-campaign-note-box {
  position: relative;
  display: block !important;
  height: 100%;
}

.ads-campaign-note-box.has-today-record::before {
  content: "*";
  position: absolute;
  left: -8px;
  top: -8px;
  z-index: 1;
  color: #dc2626;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.ads-campaign-note-box.saving .ads-campaign-note-input {
  padding-right: 34px;
  background: #f5f7ff;
}

.ads-campaign-note-spinner {
  position: absolute;
  right: 10px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border: 2px solid #bfdbfe;
  border-top-color: #4f46e5;
  border-radius: 999px;
  animation: ads-spin 0.72s linear infinite;
}

@keyframes ads-spin {
  to {
    transform: rotate(360deg);
  }
}

.ads-campaign-note-input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.10);
}

.ads-campaign-note-input:disabled {
  background: #f2f4f7;
  color: #667085;
}

.ads-inline-date-text {
  width: fit-content;
  border: 1px solid transparent;
  background: transparent;
  color: #c2410c;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  padding: 1px 6px;
  margin-left: -6px;
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.ads-inline-date-text:hover {
  background: #fff5ec;
  border-color: #fed7aa;
}

.ads-inline-date-text.active {
  background: var(--indigo-50);
  border-color: var(--indigo-300);
  color: var(--indigo-700);
}

.ads-campaign-dates {
  position: relative;
}

.ads-date-popover {
  position: fixed;
  z-index: 60;
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 12px 10px;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  box-shadow: var(--elev-3);
  animation: ads-date-pop-in 0.14s ease-out;
}

@keyframes ads-date-pop-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.ads-date-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ads-date-popover-head strong {
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-700);
  letter-spacing: 0.02em;
}

.ads-date-popover-close {
  border: 0;
  background: transparent;
  color: var(--slate-400);
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ads-date-popover-close:hover {
  background: var(--slate-100);
  color: var(--slate-700);
}

.ads-date-popover-quick {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.ads-date-quick {
  border: 1px solid var(--slate-200);
  background: var(--slate-50);
  color: var(--slate-700);
  border-radius: var(--radius-sm);
  padding: 7px 0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.ads-date-quick:hover {
  background: #fff;
  border-color: var(--indigo-300);
  color: var(--indigo-700);
}

.ads-date-quick.primary {
  background: var(--indigo-600);
  border-color: var(--indigo-600);
  color: #fff;
}

.ads-date-quick.primary:hover {
  background: var(--indigo-700);
  border-color: var(--indigo-700);
}

.ads-date-popover-field label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--slate-500);
  letter-spacing: 0.03em;
}

.ads-inline-date-input {
  width: 100%;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--slate-900);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  padding: 6px 8px;
  outline: none;
  font-family: inherit;
}

.ads-inline-date-input:focus {
  border-color: var(--indigo-500);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.ads-date-popover-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--slate-100);
  margin-top: 2px;
}

.ads-date-popover-clear {
  border: 0;
  background: transparent;
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 6px;
  cursor: pointer;
  border-radius: 6px;
}

.ads-date-popover-clear:hover {
  background: #fef2f2;
}

.ads-date-popover-confirm {
  border: 1px solid var(--indigo-600);
  background: var(--indigo-600);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.ads-date-popover-confirm:hover {
  background: var(--indigo-700);
  border-color: var(--indigo-700);
}

.ads-campaign-history-row small,
.ads-campaign-history-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.ads-campaign-history-row .ads-recent-record.latest {
  color: #1d2939;
  font-weight: 800;
}

.ads-campaign-history-row .ads-recent-record {
  display: flex !important;
  align-items: center;
  gap: 6px;
}

.ads-campaign-history-row .ads-recent-record.voided {
  color: var(--muted);
  font-weight: 400;
}

.ads-campaign-history-row .ads-recent-record.voided span {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  text-decoration-color: #667085;
}

.ads-record-void-toggle {
  display: none;
  border: 0;
  border-radius: 999px;
  background: #f2f4f7;
  color: #667085;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 3px 7px;
  cursor: pointer;
}

.ads-recent-record:hover .ads-record-void-toggle,
.ads-record-void-toggle:focus-visible {
  display: inline-flex;
}

.ads-record-void-toggle:hover {
  background: #fee4e2;
  color: #b42318;
}

.ads-recent-record.voided .ads-record-void-toggle:hover {
  background: #dcfae6;
  color: #067647;
}

/* AI bid adjustment records (rightmost column) */
.ads-ai-record {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
  font-size: 11.5px;
  line-height: 1.45;
  padding: 2px 0 4px;
  color: var(--slate-700);
  border-bottom: 1px dashed var(--slate-100);
}
.ads-ai-record:last-of-type {
  border-bottom: 0;
}
.ads-ai-record-date {
  flex-shrink: 0;
  color: var(--slate-500);
  font-size: 11px;
}
.ads-ai-record-bid {
  font-weight: 600;
  color: var(--indigo-600);
  white-space: nowrap;
}
.ads-ai-record-bid.up   { color: #059669; }
.ads-ai-record-bid.down { color: #dc2626; }
.ads-ai-record-note {
  color: var(--slate-500);
  font-size: 11px;
  flex: 1 1 100%;
  white-space: normal;
  word-break: break-word;
}
.ads-ai-adjust-empty {
  font-size: 11.5px;
  color: var(--slate-400);
  font-style: italic;
}

/* AI modal row */
.ads-ai-modal-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 18px;
  border-bottom: 1px solid var(--slate-100);
  font-size: 12.5px;
  flex-wrap: wrap;
}
.ads-ai-modal-row:last-child {
  border-bottom: none;
}

.ads-inline-groups {
  display: flex !important;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.ads-context-menu {
  position: fixed;
  z-index: 999;
  min-width: 172px;
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.15);
  padding: 6px;
  display: grid;
  gap: 2px;
}

.ads-context-item {
  border: 0;
  background: transparent;
  text-align: left;
  font-size: 13px;
  color: #344054;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.ads-context-item:hover {
  background: #eef2ff;
  color: #1d4ed8;
}

.ads-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.24);
  display: grid;
  place-items: center;
}

.ads-dialog {
  width: min(460px, calc(100vw - 40px));
  border-radius: 12px;
  border: 1px solid #d0d5dd;
  background: #fff;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
  padding: 16px;
  display: grid;
  gap: 14px;
}

.ads-dialog-head,
.ads-dialog-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.ads-dialog-body {
  display: grid;
  gap: 10px;
}

.ads-dialog-field {
  display: grid;
  gap: 5px;
  color: #475467;
  font-size: 12px;
  font-weight: 700;
}

.ads-dialog-field input {
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 14px;
  color: #101828;
}

.ads-dialog-field input:focus {
  outline: 2px solid rgba(79, 70, 229, 0.18);
  border-color: #4f46e5;
}

.ads-dialog-actions {
  justify-content: flex-end;
}

.ads-campaign-dates .ads-campaign-last {
  color: #155eef;
  font-weight: 700;
}

.ads-campaign-dates .ads-campaign-next {
  color: #b54708;
  font-weight: 700;
}

.ads-text-button {
  width: fit-content;
  border: 0;
  background: transparent;
  color: #4f46e5;
  font-size: 12px;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}

.ads-text-button:hover {
  text-decoration: underline;
}

.ads-campaign-history-extra {
  display: grid;
  gap: 3px;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed #dbe7f8;
}

.ads-history-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.18);
}

.ads-history-modal {
  width: min(720px, calc(100vw - 48px));
  max-height: min(680px, calc(100vh - 64px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid #d6e0f0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
}

.ads-history-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid #e4eaf3;
}

.ads-history-modal-head > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.ads-history-modal-head strong {
  color: var(--text);
  font-size: 16px;
  line-height: 1.35;
}

.ads-history-modal-head small {
  color: var(--muted);
  font-size: 12px;
}

.ads-history-modal-body {
  min-height: 260px;
  max-height: 480px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 14px 18px;
}

.ads-history-record {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #e4eaf3;
  border-radius: 10px;
  background: #f5f7ff;
}

.ads-history-record strong {
  color: #1d4ed8;
  font-size: 12px;
}

.ads-history-record span {
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.ads-history-record small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.ads-history-modal-foot {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid #e4eaf3;
  background: #fbfdff;
}

.ads-rename-entry {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.ads-campaign-history-row:hover .ads-rename-entry,
.ads-campaign-history-row.active .ads-rename-entry {
  opacity: 1;
  pointer-events: auto;
}

.ads-calendar-card {
  min-width: 0;
}

.ads-calendar-card.drag-switch-left,
.ads-calendar-card.drag-switch-right {
  box-shadow: inset 0 0 0 2px rgba(79, 70, 229, 0.18);
}

.ads-calendar-card.drag-switch-left::before,
.ads-calendar-card.drag-switch-right::after {
  position: fixed;
  top: 50%;
  z-index: 80;
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.88);
  color: white;
  font-size: 14px;
  font-weight: 800;
  pointer-events: none;
  transform: translateY(-50%);
  box-shadow: 0 16px 34px rgba(79, 70, 229, 0.28);
}

.ads-calendar-card.drag-switch-left::before {
  left: 84px;
  content: "上个月";
}

.ads-calendar-card.drag-switch-right::after {
  right: 28px;
  content: "下个月";
}

.ads-calendar-month-title {
  font-size: 28px !important;
  line-height: 1.15;
  letter-spacing: 0;
  color: var(--text);
}

.ads-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.ads-calendar-weekday {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5f7ff;
  padding: 6px 8px;
  text-align: center;
  font-size: 12px;
  color: #667085;
  font-weight: 700;
}

.ads-calendar-full-day {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  min-height: 248px;
  padding: 10px;
  display: grid;
  gap: 7px;
  align-content: start;
  transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.ads-calendar-full-day.is-empty {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.ads-calendar-full-day.today {
  border-color: #a5b4fc;
  box-shadow: 0 0 0 1px rgba(37, 94, 232, 0.08);
}

.ads-calendar-full-day.ads-calendar-drop-over {
  border-color: #4f46e5;
  background: #eef2ff;
  box-shadow: inset 0 0 0 2px rgba(79, 70, 229, 0.18);
}

.ads-calendar-full-day header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.ads-calendar-full-day header span,
.ads-calendar-counts span {
  color: var(--muted);
  font-size: 12px;
}

.ads-calendar-events {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.ads-calendar-event {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 6px 7px;
  display: grid;
  gap: 2px;
  text-align: left;
  min-width: 0;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.ads-calendar-event.dragging {
  opacity: 0.45;
}

.ads-calendar-event:hover {
  border-color: #4f46e5;
  background: #eef2ff;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.16);
}

.ads-calendar-event.due.danger {
  border-color: #fecdca;
  background: #fffbfa;
}

.ads-calendar-event.due.warning {
  border-color: #fedf89;
  background: #fffcf5;
}

.ads-calendar-event.due.overdue-1 {
  border-color: #fecaca;
  background: #fff8f8;
}

.ads-calendar-event.due.overdue-2 {
  border-color: #fca5a5;
  background: #feeceb;
}

.ads-calendar-event.due.overdue-3 {
  border-color: #ef4444;
  background: #fee2e2;
}

.ads-calendar-event.due.future {
  border-color: #bfdbfe;
  background: #f5f7ff;
}

.ads-calendar-event:hover {
  border-color: #4f46e5;
  background: #eef2ff;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.16);
}

.ads-calendar-event strong {
  min-width: 0;
  color: #1f2a44;
  font-size: 12px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ads-calendar-event span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ads-calendar-more {
  grid-column: 1 / -1;
  border: 1px dashed #c7d7ee;
  border-radius: 7px;
  background: #f5f7ff;
  color: #35537a;
  font-size: 12px;
  line-height: 1.2;
  padding: 5px 7px;
  text-align: left;
  cursor: pointer;
}

.ads-calendar-more:hover {
  border-color: #7da2f7;
  background: #eef2ff;
  color: #1d4ed8;
}

.ads-calendar-more.due.overdue-1 {
  border-color: #fecaca;
  background: #fff8f8;
  color: #b42318;
}

.ads-calendar-more.due.overdue-2 {
  border-color: #fca5a5;
  background: #feeceb;
  color: #b42318;
}

.ads-calendar-more.due.overdue-3 {
  border-color: #ef4444;
  background: #fee2e2;
  color: #912018;
}

.ads-calendar-more.due.future {
  border-color: #bfdbfe;
  background: #f5f7ff;
  color: #175cd3;
}

.ads-calendar-more.done {
  border-color: #d0d5dd;
  background: #f8fafc;
  color: #475467;
}

.ads-calendar-more:hover {
  border-color: #4f46e5;
  background: #eef2ff;
  color: #1d4ed8;
}

.ads-calendar-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.16);
}

.ads-calendar-modal {
  width: min(560px, calc(100vw - 48px));
  max-height: min(620px, calc(100vh - 64px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #d6e0f0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
}

.ads-calendar-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid #e4eaf3;
}

.ads-calendar-modal-head > div {
  display: grid;
  gap: 3px;
}

.ads-calendar-modal-head strong {
  color: var(--text);
  font-size: 16px;
}

.ads-calendar-modal-body {
  max-height: 480px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 8px;
  padding: 14px 18px 18px;
}

.ads-calendar-modal-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  padding: 9px 10px;
  display: grid;
  gap: 3px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.ads-calendar-modal-item:hover {
  border-color: #4f46e5;
  background: #eef2ff;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.16);
}

.ads-calendar-modal-item.due.overdue-1 {
  border-color: #fecaca;
  background: #fff8f8;
}

.ads-calendar-modal-item.due.overdue-2 {
  border-color: #fca5a5;
  background: #feeceb;
}

.ads-calendar-modal-item.due.overdue-3 {
  border-color: #ef4444;
  background: #fee2e2;
}

.ads-calendar-modal-item.due.future {
  border-color: #bfdbfe;
  background: #f5f7ff;
}

.ads-calendar-modal-item.done {
  border-color: #d0d5dd;
  background: #f8fafc;
}

.ads-calendar-modal-item:hover {
  border-color: #4f46e5;
  background: #eef2ff;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.16);
}

.ads-calendar-modal-item strong,
.ads-calendar-modal-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ads-calendar-modal-item strong {
  color: #1f2a44;
  font-size: 13px;
}

.ads-calendar-modal-item span {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1180px) {
  .inventory-watchlist-list {
    grid-template-columns: 1fr;
  }
}

.inventory-watchlist-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 9px;
  padding: 8px;
  border: 1px solid #d9e6f8;
  border-radius: 10px;
  background: white;
}

.inventory-watchlist-image {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  min-height: 104px;
}

.inventory-watchlist-image .inventory-overview-image,
.inventory-watchlist-image .inventory-overview-image-placeholder {
  width: 100%;
  height: 100%;
  min-height: 104px;
  flex: 1 1 auto;
  object-fit: cover;
  border-radius: 8px;
}

.inventory-watchlist-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.inventory-watchlist-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-height: 0;
}

.inventory-watchlist-title-row strong {
  display: block;
  font-size: 14px;
  color: var(--text);
  line-height: 1.2;
  word-break: break-word;
}

.inventory-watchlist-statuses {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px;
  flex: 0 0 auto;
}

.inventory-watchlist-meta,
.inventory-watchlist-change-text {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.25;
  word-break: break-word;
}

.inventory-watchlist-info-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.inventory-watchlist-window-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.inventory-watchlist-window-line {
  border: 1px solid #d9e6f8;
  border-radius: 999px;
  background: #f5f7ff;
  padding: 3px 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.inventory-watchlist-window-line strong {
  font-size: 12px;
  color: #334155;
}

.inventory-watchlist-window-pill,
.inventory-watchlist-window-net {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.inventory-watchlist-window-pill.good {
  color: #047857;
}

.inventory-watchlist-window-pill.danger {
  color: #c2410c;
}

.inventory-watchlist-window-net.good {
  color: #15803d;
}

.inventory-watchlist-window-net.danger {
  color: #dc2626;
}

.inventory-watchlist-window-net.muted {
  color: #64748b;
}

.inventory-unmatched-card {
  border-color: #fed7aa;
  background: #fffaf5;
}

.inventory-unmatched-note {
  border: 1px solid #fed7aa;
  border-radius: 12px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 12px;
}

.inventory-unmatched-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}

.inventory-unmatched-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid #fde7c7;
  border-radius: 12px;
  background: #ffffff;
  padding: 10px 12px;
}

.inventory-unmatched-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.inventory-unmatched-main strong {
  color: #0f172a;
  font-size: 14px;
}

.inventory-unmatched-main span,
.inventory-unmatched-main em {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.inventory-unmatched-side {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.inventory-unmatched-side strong {
  color: #9a3412;
  font-size: 14px;
}

.product-onboarding-layout {
  display: grid;
  gap: 16px;
  align-items: start;
}

.product-onboarding-maintenance-card {
  display: grid;
  gap: 14px;
}

.product-onboarding-toast {
  position: sticky;
  top: 12px;
  z-index: 8;
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid #d9e6f8;
  background: #eff6ff;
  color: #1d4ed8;
}

.product-onboarding-toast.success {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #15803d;
}

.product-onboarding-toast.info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.product-onboarding-unmatched-list,
.product-onboarding-workbench {
  display: grid;
  gap: 16px;
}

.product-onboarding-card,
.product-onboarding-side-card {
  min-width: 0;
}

.product-maintenance-query-bar {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.product-maintenance-query-field {
  min-width: 220px;
}

.product-maintenance-panel {
  display: grid;
  gap: 12px;
}

.product-maintenance-product-card,
.product-maintenance-list-card {
  display: grid;
  gap: 10px;
  border: 1px solid #d9e6f8;
  border-radius: 12px;
  background: #f5f7ff;
  padding: 12px;
}

.product-maintenance-product-grid {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-gutter: stable;
  gap: 8px;
}

.product-maintenance-product-field {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: auto;
  flex: 0 0 auto;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
}

.product-maintenance-product-field span {
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
  color: #64748b;
}

.product-maintenance-product-field input {
  width: 92px;
  min-width: 92px;
  padding: 5px 8px;
  line-height: 1.15;
  border-radius: 7px;
  border: 1px solid #d7e2f2;
  background: #ffffff;
}

.product-maintenance-product-field[data-product-field-key="product_code"] input,
.product-maintenance-product-field[data-product-field-key="supplier_code"] input,
.product-maintenance-product-field[data-product-field-key="series_name"] input {
  width: 110px;
  min-width: 110px;
}

.product-maintenance-item-list {
  display: grid;
  gap: 8px;
}

.product-maintenance-item-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 120px auto;
  gap: 10px;
  align-items: end;
  border: 1px solid #d9e6f8;
  border-radius: 12px;
  background: #ffffff;
  padding: 10px;
}

.product-maintenance-item-row.new-item {
  grid-template-columns: minmax(180px, 1fr) 140px 110px auto;
}

.product-maintenance-item-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.product-maintenance-item-copy {
  display: flex;
  align-items: center;
  min-width: 0;
}

.product-maintenance-item-copy strong {
  color: #0f172a;
  font-size: 14px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.product-maintenance-item-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.product-onboarding-existing-compact {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid #d9e6f8;
  border-radius: 10px;
  background: #f5f7ff;
  color: #475569;
  font-size: 12px;
}

.product-onboarding-existing-compact strong {
  color: #0f172a;
  font-size: 13px;
}

.product-onboarding-existing-compact small {
  color: #64748b;
  font-size: 12px;
}

.product-onboarding-field input[readonly] {
  background: #f8fafc;
  color: #64748b;
  cursor: default;
}

.product-onboarding-field {
  display: grid;
  gap: 6px;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.product-onboarding-field input {
  width: 100%;
  min-width: 0;
  border: 1px solid #d7e2f2;
  border-radius: 10px;
  padding: 10px 11px;
  color: #0f172a;
  font: inherit;
  background: #ffffff;
}

.product-onboarding-field input:focus {
  outline: 2px solid rgba(79, 70, 229, 0.18);
  border-color: #93b4ef;
}

.product-onboarding-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.product-onboarding-unmatched-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid #d9e6f8;
  border-radius: 14px;
  background: #f5f7ff;
  padding: 12px 14px;
}

.product-onboarding-unmatched-main {
  display: grid;
  gap: 4px;
}

.product-onboarding-unmatched-main strong {
  color: #0f172a;
  font-size: 15px;
}

.product-onboarding-unmatched-main span {
  color: #475569;
  font-size: 13px;
}

.product-onboarding-unmatched-main em {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
}

.product-onboarding-unmatched-side {
  display: grid;
  gap: 8px;
  justify-items: end;
  align-items: center;
}

.product-onboarding-workbench-row {
  display: grid;
  gap: 12px;
  border: 1px solid #d9e6f8;
  border-radius: 12px;
  background: #f5f7ff;
  padding: 12px;
}

.product-onboarding-workbench-row-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.product-onboarding-workbench-row-head strong {
  display: block;
  color: #0f172a;
  font-size: 15px;
}

.product-onboarding-workbench-row-head span {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 12px;
}

.product-onboarding-workbench-row-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.product-onboarding-workbench-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.product-onboarding-workbench-row-meta {
  display: grid;
  gap: 4px;
}

.product-onboarding-workbench-row-compact {
  gap: 6px;
  padding: 8px 10px;
}

.product-onboarding-workbench-grid-compact {
  display: flex;
  flex-wrap: nowrap;
  align-items: end;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  scrollbar-gutter: stable;
}

.product-onboarding-field-compact {
  display: grid;
  gap: 2px;
  min-width: 120px;
  flex: 0 0 auto;
}

.product-onboarding-field-compact span {
  font-size: 10px;
  line-height: 1.1;
  white-space: nowrap;
}

.product-onboarding-field-compact input {
  width: 120px;
  min-width: 120px;
  padding: 5px 8px;
  line-height: 1.15;
  border-radius: 7px;
}

.product-onboarding-field-compact[data-product-field-key="series_number"] {
  min-width: 84px;
  flex-basis: 84px;
}

.product-onboarding-field-compact[data-product-field-key="series_number"] input {
  width: 84px;
  min-width: 84px;
}

.product-onboarding-field-compact[data-product-field-key="unit_price"] {
  min-width: 92px;
  flex-basis: 92px;
}

.product-onboarding-field-compact[data-product-field-key="unit_price"] input {
  width: 92px;
  min-width: 92px;
}

.product-onboarding-row-messages {
  color: #334155;
  font-size: 13px;
  line-height: 1.4;
}

.product-onboarding-row-messages.muted,
.product-onboarding-row-features {
  color: #64748b;
  font-size: 12px;
}

.product-onboarding-existing-inline {
  margin-top: 4px;
}

.product-onboarding-existing-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #334155;
  font-size: 13px;
  margin-bottom: 8px;
}

.product-onboarding-existing-product-card {
  display: grid;
  gap: 0;
  margin-bottom: 8px;
  padding: 10px 12px;
  border: 1px solid #d9e6f8;
  border-radius: 12px;
  background: #f5f7ff;
}

.product-onboarding-existing-product-card strong {
  color: #0f172a;
  font-size: 14px;
}

.product-onboarding-existing-product-card span {
  color: #475569;
  font-size: 12px;
}

.product-onboarding-existing-product-card small {
  color: #64748b;
  font-size: 11px;
  line-height: 1.35;
}

.product-onboarding-existing-list {
  display: grid;
  gap: 8px;
}

.product-onboarding-existing-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 110px 110px;
  gap: 10px;
  align-items: center;
  border: 1px solid #d9e6f8;
  border-radius: 12px;
  background: #ffffff;
  padding: 10px;
}

.product-onboarding-existing-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.product-onboarding-existing-image {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #d7e2f2;
  background: #f8fafc;
  flex: 0 0 auto;
}

.product-onboarding-existing-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.product-onboarding-existing-copy strong {
  color: #0f172a;
  font-size: 14px;
  line-height: 1.2;
  min-width: 0;
  overflow-wrap: anywhere;
}

.product-onboarding-existing-copy span {
  color: #64748b;
  font-size: 12px;
  line-height: 1.2;
}

.product-onboarding-existing-copy small {
  color: #64748b;
  font-size: 11px;
  line-height: 1.3;
}

.product-onboarding-existing-metric {
  display: grid;
  gap: 3px;
  color: #64748b;
  font-size: 12px;
  text-align: right;
}

.product-onboarding-existing-metric strong {
  color: #0f172a;
  font-size: 14px;
  line-height: 1.2;
}

@media (max-width: 980px) {
  .product-onboarding-workbench-grid {
    grid-template-columns: 1fr;
  }

  .product-maintenance-product-grid {
    display: flex;
    flex-wrap: nowrap;
  }

  .product-onboarding-unmatched-row,
  .product-onboarding-workbench-row-head {
    grid-template-columns: 1fr;
    display: grid;
  }

  .product-onboarding-existing-row {
    grid-template-columns: 1fr;
  }

  .product-maintenance-item-row,
  .product-maintenance-item-row.new-item {
    grid-template-columns: 1fr;
  }

  .product-onboarding-existing-metric {
    text-align: left;
  }
}

.inventory-watchlist-change-item {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid #d9e6f8;
  border-radius: 12px;
  background: white;
}

.inventory-watchlist-change-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

@media (max-width: 1180px) {
  .inventory-watchlist-content {
    grid-template-columns: 1fr;
  }
}

.inventory-overview-summary-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#inventory-overview-view.inventory-directory-collapsed .inventory-overview-main {
  padding-left: 0;
}

.inventory-overview-supplier-card {
  scroll-margin-top: 18px;
  padding: 12px;
  gap: 10px;
}

.inventory-overview-supplier-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.inventory-overview-supplier-head h3 {
  margin: 2px 0 0;
  font-size: 18px;
  line-height: 1.2;
}

.inventory-overview-summary-supplier-card .view-actions {
  flex: 0 0 auto;
}

.inventory-overview-summary-supplier-card .compact-button {
  white-space: nowrap;
}

.inventory-overview-summary-supplier-card .section-meta.compact {
  margin: 6px 0 0;
  max-width: 38ch;
  font-size: 12px;
  line-height: 1.45;
}

.inventory-overview-summary-supplier-card .inventory-group-metrics {
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.inventory-overview-summary-supplier-card .inventory-metric-chip {
  padding: 4px 8px;
  font-size: 12px;
}

.inventory-supplier-risk-images {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
  margin-top: 6px;
}

.inventory-supplier-risk-images.empty {
  border: 1px dashed #d9e5f4;
  border-radius: 10px;
  color: #64748b;
  font-size: 12px;
  padding: 12px;
}

.inventory-supplier-risk-image {
  position: relative;
  display: block;
  min-width: 0;
  aspect-ratio: 1 / 1;
  border: 1px solid #d9e6f8;
  border-radius: 10px;
  background: #f5f7ff;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
}

.inventory-supplier-risk-image .inventory-image-hover {
  width: 100%;
  height: 100%;
  display: block;
}

.inventory-supplier-risk-image .inventory-overview-image,
.inventory-supplier-risk-image .inventory-overview-image-placeholder {
  width: 100%;
  height: 100%;
  min-width: 0;
  object-fit: cover;
  border: 0;
  border-radius: 9px;
}

.inventory-supplier-risk-image-status {
  position: absolute;
  left: 4px;
  bottom: 4px;
  max-width: calc(100% - 8px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #334155;
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
  padding: 3px 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inventory-supplier-risk-image-status.danger {
  color: #dc2626;
}

.inventory-supplier-risk-image-status.warn,
.inventory-supplier-risk-image-status.warn-strong {
  color: #c2410c;
}

.inventory-supplier-risk-image-status.good {
  color: #047857;
}

.inventory-overview-mini-block {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.inventory-overview-mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #5b6f8e;
  font-size: 12px;
}

.inventory-overview-mini-head strong {
  color: #1f2f46;
  font-size: 12px;
}

.inventory-overview-status-matrix {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.inventory-overview-status-cell {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 8px 9px;
  border-radius: 10px;
  border: 1px solid #d9e5f4;
  background: #f5f7ff;
  cursor: pointer;
}

.inventory-overview-status-name {
  font-size: 11px;
  line-height: 1.2;
}

.inventory-overview-status-value {
  font-size: 16px;
  line-height: 1.1;
}

.inventory-overview-status-cell.danger {
  border-color: #fecaca;
  background: #fff5f5;
  color: #b91c1c;
}

.inventory-overview-status-cell.warn-strong {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}

.inventory-overview-status-cell.warn {
  border-color: #fde68a;
  background: #fffbeb;
  color: #a16207;
}

.inventory-overview-status-cell.good {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.inventory-overview-status-cell.good-soft {
  border-color: #c7f9cc;
  background: #f7fff8;
  color: #3f8f50;
}

.inventory-overview-status-cell.muted {
  border-color: #dbe3ef;
  background: #f8fafc;
  color: #64748b;
}

.inventory-overview-status-cell::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 20;
  width: max-content;
  max-width: 240px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.94);
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
  white-space: normal;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.inventory-overview-status-cell:hover::after,
.inventory-overview-status-cell:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.inventory-overview-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 10px 0 14px;
}

.inventory-overview-activity-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.inventory-overview-control-card {
  display: inline-flex;
  flex-direction: column;
  width: fit-content;
  max-width: 100%;
  padding: 6px 8px;
}

.inventory-overview-controls {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.inventory-overview-control-card .section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.inventory-overview-control-card .section-head h3 {
  margin: 0;
  white-space: nowrap;
}

.inventory-overview-control-card .section-head .section-meta {
  margin: 0;
}

.inventory-overview-event-card {
  border: 1px solid #e3ebf7;
  border-radius: 12px;
  background: #f9fbff;
  padding: 12px;
}

.inventory-overview-event-list {
  display: grid;
  gap: 8px;
}

.inventory-overview-event-list.scrollable {
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.inventory-overview-event-item {
  display: grid;
  grid-template-columns: 92px 44px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
}

.inventory-overview-event-item-detailed {
  grid-template-columns: 44px 92px minmax(0, 1fr) 64px;
  align-items: center;
}

.inventory-overview-event-date {
  color: var(--muted);
  white-space: nowrap;
}

.inventory-overview-event-kind {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.inventory-overview-event-kind.replenish {
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  color: #0f766e;
}

.inventory-overview-event-kind.outflow {
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #c2410c;
}

.inventory-overview-event-text {
  min-width: 0;
}

.inventory-overview-event-qty {
  justify-self: end;
  font-weight: 700;
  white-space: nowrap;
}

.inventory-overview-event-qty.positive {
  color: #15803d;
}

.inventory-overview-event-qty.negative {
  color: #c2410c;
}

.inventory-overview-extra {
  margin: 10px 0 0;
  border: 1px dashed #d7e6fb;
  border-radius: 10px;
  padding: 10px 12px;
}

.inventory-overview-extra-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  cursor: pointer;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  color: #31507a;
}

.inventory-overview-extra-label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.inventory-overview-extra-prompt.expanded {
  color: #1d4ed8;
}

.inventory-overview-extra-prompt.collapsed {
  color: #64748b;
}

.inventory-overview-extra-prompt.static {
  color: #64748b;
}

.inventory-overview-series-card {
  border: 1px solid #e5edf8;
  border-radius: 12px;
  background: #ffffff;
  padding: 14px;
}

.inventory-overview-product {
  display: grid;
  gap: 3px;
}

.inventory-overview-image-placeholder {
  width: 30px;
  height: 30px;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  background: #f5f7ff;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0;
  line-height: 1;
}

.inventory-overview-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  display: block;
}

.inventory-overview-table td,
.inventory-overview-table th {
  vertical-align: top;
  font-size: 13px;
  white-space: normal;
  word-break: break-word;
}

.inventory-overview-table th {
  white-space: normal;
  font-size: 12px;
  line-height: 1.2;
  padding: 7px 6px;
}

.inventory-overview-table td {
  padding: 7px 6px;
}

.inventory-overview-table th:nth-child(1),
.inventory-overview-table td:nth-child(1) {
  width: auto;
}

.inventory-overview-table th:nth-child(2),
.inventory-overview-table td:nth-child(2) {
  width: auto;
}

.inventory-overview-table th:nth-child(3),
.inventory-overview-table td:nth-child(3),
.inventory-overview-table th:nth-child(4),
.inventory-overview-table td:nth-child(4),
.inventory-overview-table th:nth-child(5),
.inventory-overview-table td:nth-child(5),
.inventory-overview-table th:nth-child(8),
.inventory-overview-table td:nth-child(8) {
  width: auto;
}

.inventory-overview-table th:nth-child(6),
.inventory-overview-table td:nth-child(6),
.inventory-overview-table th:nth-child(7),
.inventory-overview-table td:nth-child(7) {
  width: auto;
}

.inventory-overview-product {
  gap: 3px;
  word-break: break-all;
}

.inventory-product-title-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.inventory-overview-product strong {
  font-size: 13px;
  line-height: 1.2;
}

.inventory-sibling-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 1px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
  padding: 3px 6px;
  white-space: nowrap;
}

.inventory-overview-table .inventory-sibling-row td:first-child {
  border-left: 3px solid #60a5fa;
}

.inventory-overview-product .inventory-inline-meta,
.inventory-overview-product .inventory-feature-stack,
.inventory-overview-product .inventory-compact-lines,
.inventory-overview-inbound-cell,
.inventory-overview-supplier-sales,
.inventory-overview-monthly-avg {
  color: #52647c;
  font-size: 12px;
  line-height: 1.25;
}

.inventory-overview-product .inventory-inline-meta {
  font-size: 11px;
  line-height: 1.2;
}

.inventory-group-metrics {
  gap: 6px;
}

.inventory-overview-supplier-card .inventory-metric-chip,
.inventory-overview-series-card .inventory-metric-chip {
  font-size: 12px;
  line-height: 1.1;
  padding: 8px 10px;
}

.inventory-compact-stack {
  gap: 2px;
}

.inventory-compact-stack span {
  line-height: 1.2;
}

.inventory-price-cell {
  min-width: 0;
}

.inventory-price-popover {
  position: absolute;
  top: 26px;
  left: 0;
  z-index: 80;
  width: 238px;
  padding: 12px;
  border: 1px solid #cfe0f5;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.18);
}

.inventory-price-popover-head,
.inventory-price-popover-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.inventory-price-popover-head strong {
  color: #0f172a;
  font-size: 14px;
}

.inventory-price-popover-meta,
.inventory-price-readonly {
  display: grid;
  gap: 2px;
  margin-top: 8px;
  color: #64748b;
  font-size: 12px;
}

.inventory-price-readonly {
  grid-template-columns: 1fr auto;
  align-items: center;
  border: 1px solid #e5edf8;
  border-radius: 10px;
  background: #f5f7ff;
  padding: 8px 10px;
}

.inventory-price-readonly strong {
  color: #0f172a;
}

.inventory-price-popover-field {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.inventory-price-popover-field input {
  width: 100%;
  height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  color: #0f172a;
  font-size: 14px;
  font-weight: 800;
  padding: 0 10px;
}

.inventory-price-popover-actions {
  justify-content: flex-end;
  margin-top: 10px;
}

.inventory-row-group-menu-item.price {
  border-top: 1px solid #e5edf8;
  border-radius: 0 0 7px 7px;
  color: #1d4ed8;
  margin-top: 3px;
}

.inventory-row-group-price-panel {
  border-top: 1px solid #e5edf8;
  margin-top: 4px;
  padding-top: 6px;
}

.inventory-store-mapping-popover {
  width: 320px;
}

.inventory-store-mapping-rows {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.inventory-store-mapping-row {
  display: grid;
  grid-template-columns: 1fr 12px 72px 28px;
  align-items: center;
  gap: 6px;
}

.inventory-store-mapping-code,
.inventory-store-mapping-qty {
  height: 30px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
  padding: 0 8px;
  font-variant-numeric: tabular-nums;
}

.inventory-store-mapping-qty {
  text-align: right;
  -moz-appearance: textfield;
}

.inventory-store-mapping-qty::-webkit-outer-spin-button,
.inventory-store-mapping-qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.inventory-store-mapping-times {
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 700;
}

.inventory-store-mapping-row-remove {
  width: 26px;
  height: 26px;
  color: #94a3b8;
  font-size: 16px;
  line-height: 1;
}

.inventory-store-mapping-row-remove:hover:not(:disabled) {
  color: #b91c1c;
  background: #fee2e2;
}

.inventory-store-mapping-row-remove:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.inventory-store-mapping-add {
  width: 100%;
  margin-top: 8px;
  justify-content: center;
  color: #1d4ed8;
}

#inventory-store-view .inventory-store-mapping-cell.combo .inventory-mapping-chip.combo {
  background: #ede9fe;
  border: 1px solid #c4b5fd;
  color: #5b21b6;
}

#inventory-store-view .inventory-store-mapping-cell.pack .inventory-mapping-chip.pack {
  background: #e0f2fe;
  border: 1px solid #93c5fd;
  color: #1d4ed8;
}

#inventory-store-view .inventory-store-mapping-cell.pack .inventory-mapping-component-qty {
  color: #1d4ed8;
}

#inventory-store-view .inventory-mapping-component-list {
  display: grid;
  gap: 2px;
  margin-top: 4px;
}

#inventory-store-view .inventory-mapping-component {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

#inventory-store-view .inventory-mapping-component-code {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.2px;
}

#inventory-store-view .inventory-mapping-component-qty {
  font-size: 11px;
  font-weight: 700;
  color: #5b21b6;
}

#inventory-store-view .inventory-mapping-component {
  cursor: help;
  padding: 1px 4px;
  margin-left: -4px;
  border-radius: 6px;
  transition: background 0.1s ease;
}

#inventory-store-view .inventory-mapping-component:hover {
  background: #f1f5ff;
}

#inventory-store-view .inventory-mapping-hover-target {
  cursor: help;
  border-radius: 4px;
  padding: 0 2px;
  transition: background 0.1s ease;
}

#inventory-store-view .inventory-mapping-hover-target:hover {
  background: #f1f5ff;
}

.inventory-mapping-component-overlay {
  position: fixed;
  z-index: 200;
  min-width: 200px;
  max-width: 280px;
  padding: 10px 12px;
  border: 1px solid #cfdcf2;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.99);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18);
  color: #0f172a;
  font-size: 12px;
  pointer-events: none;
}

.inventory-mapping-component-overlay.hidden {
  display: none;
}

.inventory-mapping-component-overlay-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #eef2f7;
  padding-bottom: 5px;
  margin-bottom: 6px;
}

.inventory-mapping-component-overlay-head strong {
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
  color: #0f172a;
  word-break: break-all;
}

.inventory-mapping-component-overlay-qty {
  font-size: 11px;
  font-weight: 800;
  color: #5b21b6;
  font-variant-numeric: tabular-nums;
}

.inventory-mapping-component-overlay-pc {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.2px;
  font-variant-numeric: tabular-nums;
  margin-bottom: 6px;
}

.inventory-mapping-component-overlay-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
}

.inventory-mapping-component-overlay-grid > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.inventory-mapping-component-overlay-grid span {
  color: #64748b;
  font-size: 10.5px;
  font-weight: 600;
}

.inventory-mapping-component-overlay-grid strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.inventory-row-group-price-panel .inventory-price-popover {
  position: static;
  width: 238px;
  max-width: calc(100vw - 110px);
  border-radius: 12px;
  box-shadow: none;
  padding: 8px;
}

.inventory-status-chip {
  min-width: 44px;
  height: 24px;
  padding: 0 10px;
  font-size: 12px;
}

.inventory-overview-table {
  table-layout: auto;
  width: 100%;
  min-width: 0;
}

.inventory-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.inventory-status-stack {
  display: grid;
  gap: 4px;
  justify-items: start;
}

.inventory-status-chip.normal {
  background: #ecfdf3;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.inventory-status-chip.warning {
  background: #fff7ed;
  color: #b45309;
  border: 1px solid #fed7aa;
}

.inventory-status-chip.danger {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.inventory-status-chip.muted {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.inventory-status-chip.high {
  background: #ecfdf3;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.inventory-status-chip.secondary {
  min-width: 0;
  height: 22px;
  padding: 0 8px;
  font-size: 11px;
}

.inventory-status-chip.info {
  background: #ecfeff;
  color: #0f766e;
  border: 1px solid #a5f3fc;
}

.inventory-status-chip.warn {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fdba74;
}

.inventory-status-chip.attention {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.inventory-status-chip.good {
  background: #ecfdf3;
  color: #15803d;
  border: 1px solid #86efac;
}

.inventory-supplier-stock-cell {
  position: relative;
}

.inventory-supplier-stock-hint {
  font-size: 11px;
  line-height: 1.2;
  font-weight: 400;
}

.inventory-supplier-stock-hint.danger {
  color: #ea580c;
}

.inventory-supplier-stock-hint.critical {
  color: #dc2626;
  font-size: 12px;
  font-weight: 700;
}

.inventory-supplier-stock-hint.warn {
  color: #d97706;
  font-weight: 700;
}

.inventory-supplier-stock-hint.attention {
  color: #d97706;
}

.inventory-supplier-stock-cell[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 24;
  width: max-content;
  max-width: 220px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.94);
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
  white-space: normal;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.inventory-supplier-stock-cell[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateY(0);
}

#inventory-supplier-view .inventory-supplier-stock-cell .inventory-cell-number {
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
}

.results-side-stack {
  display: grid;
  gap: 14px;
  align-content: start;
}

.workbench-results-panel,
.workbench-topic-panel {
  min-width: 0;
}

.workbench-results-grid {
  display: grid;
  gap: 14px;
}

.compact-section-head {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.compact-section-head h4 {
  margin: 0;
  font-size: 14px;
}

.view-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.inventory-summary-card,
.inventory-table-card {
  grid-column: 1 / -1;
}

.inventory-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.inventory-kpi-card {
  border: 1px solid #dbe7f5;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
  padding: 14px;
  display: grid;
  gap: 6px;
}

.inventory-kpi-card span {
  color: var(--muted);
  font-size: 12px;
}

.inventory-kpi-card strong {
  font-size: 24px;
  line-height: 1.1;
}

.inventory-kpi-meta {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.2;
}

.inventory-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.inventory-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  align-items: end;
}

.inventory-toolbar-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 160px;
}

.inventory-toolbar-field.compact {
  min-width: 112px;
}

.inventory-toolbar-field span,
.inventory-toolbar-note {
  color: var(--muted);
  font-size: 11px;
}

.inventory-toolbar-field select {
  border: 1px solid #dbe7f5;
  border-radius: 999px;
  background: #ffffff;
  padding: 5px 24px 5px 9px;
  font-size: 12px;
  color: var(--text);
}

.inventory-filter-chip {
  border: 1px solid #dbe7f5;
  border-radius: 999px;
  background: #ffffff;
  color: #31507a;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  padding: 8px 12px;
  cursor: pointer;
}

.inventory-filter-chip:hover {
  border-color: #93c5fd;
  background: #f5f7ff;
}

.inventory-filter-chip.active {
  border-color: #4f46e5;
  background: #4f46e5;
  color: #ffffff;
}

#inventory-supplier-controls {
  position: static;
  height: 0;
  margin: 0;
  padding: 0;
}

.inventory-filter-float {
  position: fixed;
  right: 24px;
  top: 126px;
  z-index: 95;
  pointer-events: none;
}

.inventory-filter-floating-button {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  gap: 1px;
  border: 1px solid rgba(191, 219, 254, 0.95);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
  color: #1d4ed8;
  cursor: pointer;
  user-select: none;
  touch-action: none;
  pointer-events: auto;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.inventory-filter-floating-button span {
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.inventory-filter-floating-button strong {
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  color: #64748b;
}

.inventory-filter-floating-button.active,
.inventory-filter-floating-button.dirty,
.inventory-filter-floating-button:hover {
  border-color: #4f46e5;
  background: #4f46e5;
  color: #ffffff;
}

.inventory-filter-floating-button.active strong,
.inventory-filter-floating-button.dirty strong,
.inventory-filter-floating-button:hover strong {
  color: rgba(255, 255, 255, 0.86);
}

.inventory-filter-popover {
  position: absolute;
  top: 72px;
  right: 0;
  width: min(520px, calc(100vw - 120px));
  border: 1px solid rgba(214, 226, 243, 0.96);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
  padding: 12px;
  pointer-events: auto;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.inventory-filter-popover.open-up {
  top: auto;
  bottom: 72px;
}

.inventory-filter-popover.align-left {
  right: auto;
  left: 0;
}

.inventory-filter-popover.hidden {
  display: none;
}

.inventory-filter-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.inventory-filter-popover-head strong {
  font-size: 14px;
  color: #0f172a;
}

#inventory-supplier-controls .inventory-toolbar {
  align-items: center;
  border: 1px solid #e6eef8;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  padding: 7px 9px;
}

#inventory-supplier-controls .compact-button {
  padding: 5px 10px;
  font-size: 12px;
}

.inventory-action-row {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.inventory-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.inventory-group-stack,
.inventory-series-stack {
  display: grid;
  gap: 14px;
}

.inventory-arranged-stack {
  display: grid;
  gap: 8px;
}

.inventory-arranged-stack.nested {
  margin-top: 6px;
  margin-left: 28px;
}

.inventory-arranged-block {
  border-top: 1px solid #e5edf8;
  padding-top: 4px;
}

.inventory-arranged-toggle {
  width: 100%;
  border: 1px solid #dbe7f5;
  border-radius: 10px;
  background: #f5f7ff;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  text-align: left;
}

.inventory-arranged-block.level-0 .inventory-arranged-toggle {
  background: #eef5ff;
  border-color: #bfd8ff;
}

.inventory-arranged-block.level-1 .inventory-arranged-toggle {
  background: #f5f7ff;
  border-color: #dbe7f5;
  margin-left: 36px;
  border-left: 3px solid #dbeafe;
}

.inventory-arranged-toggle:hover {
  border-color: #93c5fd;
}

.inventory-arranged-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.inventory-arranged-caret {
  color: #31507a;
  font-size: 12px;
  white-space: nowrap;
}

.inventory-level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 20px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  color: #1e3a5f;
  background: #dbeafe;
}

.inventory-arranged-block.level-1 .inventory-level-badge {
  background: #eff6ff;
  color: #46627f;
}

.inventory-arranged-block.expanded .inventory-table-wrap {
  margin-top: 6px;
}

.inventory-series-toolbar {
  position: relative;
  z-index: 6;
  margin-bottom: 6px;
}

.inventory-supplier-card,
.inventory-series-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fcfdff;
  padding: 14px;
}

.inventory-supplier-card {
  border-color: #d7e6fb;
}

.inventory-series-card {
  background: #ffffff;
}

.inventory-supplier-head,
.inventory-series-head {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}

.inventory-supplier-head h4,
.inventory-series-head h5 {
  margin: 2px 0 0;
  font-size: 18px;
  line-height: 1.25;
}

.inventory-series-head h5 {
  font-size: 16px;
}

.inventory-group-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inventory-metric-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid #dbe7f5;
  border-radius: 999px;
  background: #f5f7ff;
  color: #31507a;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  padding: 6px 10px;
}

.inventory-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: grab;
  user-select: none;
}

.inventory-table-wrap .inventory-product-selectable,
.inventory-table-wrap .inventory-product-selectable * {
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
}

.inventory-table-wrap.dragging {
  cursor: grabbing;
}

.inventory-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 2800px;
}

.inventory-table th,
.inventory-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.inventory-table th {
  position: sticky;
  top: 0;
  background: #f5f7ff;
  z-index: 1;
  font-size: 12px;
  color: var(--muted);
}

.inventory-table tbody tr:hover {
  background: #fafcff;
}

/* Inventory overview must not inherit the planning table's oversized layout. */
#inventory-overview-view .inventory-overview-main {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

#inventory-supplier-view .inventory-overview-main {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

#inventory-supplier-view {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: auto;
}

#inventory-supplier-view .view-content {
  position: relative;
  overflow: visible;
}

#inventory-supplier-view .inventory-supplier-content-stack {
  grid-template-columns: 1fr;
}

#inventory-overview-view .inventory-summary-card .inventory-kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  gap: 8px;
}

#inventory-overview-view .inventory-overview-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  gap: 10px;
}

#inventory-overview-view .inventory-overview-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  cursor: grab;
  user-select: none;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  touch-action: auto;
}

#inventory-supplier-view .inventory-overview-table-wrap {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  cursor: default;
  user-select: none;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  touch-action: auto;
}

#inventory-supplier-view .inventory-overview-table-wrap.dragging {
  cursor: grabbing;
}

#inventory-store-view,
#inventory-store-view .view-content,
#inventory-store-view .inventory-overview-main,
#inventory-store-view .inventory-supplier-content-stack,
#inventory-store-view .inventory-overview-series-card,
#inventory-store-view .inventory-series-body {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

#inventory-store-view .inventory-supplier-content-stack {
  grid-template-columns: 1fr;
}

#inventory-store-view .inventory-overview-table-wrap {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  cursor: default;
  user-select: none;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  touch-action: auto;
}

#inventory-store-view .inventory-overview-table {
  width: 100%;
  min-width: 960px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

#inventory-store-view .inventory-overview-table th,
#inventory-store-view .inventory-overview-table td {
  white-space: normal;
  word-break: break-word;
  padding: 3px 5px;
  vertical-align: middle;
  border-bottom: 1px solid #edf2f7;
}

#inventory-store-view .inventory-overview-table th {
  position: sticky;
  top: var(--inventory-series-head-height, 46px);
  z-index: 2;
  background: #f5f7ff;
}

#inventory-store-view .inventory-overview-table th:nth-child(1),
#inventory-store-view .inventory-overview-table td:nth-child(1) {
  width: 52px;
}

#inventory-store-view .inventory-overview-table th:nth-child(2),
#inventory-store-view .inventory-overview-table td:nth-child(2) {
  width: 16%;
}

#inventory-store-view .inventory-overview-table th:nth-child(3),
#inventory-store-view .inventory-overview-table td:nth-child(3) {
  width: 18%;
}

#inventory-store-view .inventory-overview-table th:nth-child(4),
#inventory-store-view .inventory-overview-table td:nth-child(4),
#inventory-store-view .inventory-overview-table th:nth-child(5),
#inventory-store-view .inventory-overview-table td:nth-child(5) {
  width: 6.5%;
  text-align: center;
}

#inventory-store-view .inventory-overview-table th:nth-child(6),
#inventory-store-view .inventory-overview-table td:nth-child(6),
#inventory-store-view .inventory-overview-table th:nth-child(7),
#inventory-store-view .inventory-overview-table td:nth-child(7),
#inventory-store-view .inventory-overview-table th:nth-child(11),
#inventory-store-view .inventory-overview-table td:nth-child(11) {
  width: 6%;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#inventory-store-view .inventory-overview-table th:nth-child(6),
#inventory-store-view .inventory-overview-table th:nth-child(7),
#inventory-store-view .inventory-overview-table th:nth-child(11) {
  padding-right: 8px;
}

#inventory-store-view .inventory-overview-table th:nth-child(8),
#inventory-store-view .inventory-overview-table td:nth-child(8) {
  width: 11%;
}

#inventory-store-view .inventory-overview-table th:nth-child(9),
#inventory-store-view .inventory-overview-table td:nth-child(9) {
  width: 9%;
}

#inventory-store-view .inventory-overview-table th:nth-child(10),
#inventory-store-view .inventory-overview-table td:nth-child(10) {
  width: 8%;
}

#inventory-store-view .inventory-overview-table th:nth-child(12),
#inventory-store-view .inventory-overview-table td:nth-child(12) {
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  padding-left: 2px;
  padding-right: 2px;
}

#inventory-store-view .inventory-overview-table td:nth-child(6) .inventory-status-stack,
#inventory-store-view .inventory-overview-table td:nth-child(7) .inventory-status-stack,
#inventory-store-view .inventory-overview-table td:nth-child(11) .inventory-status-stack {
  align-items: flex-end;
  justify-items: flex-end;
}

#inventory-store-view .inventory-sales-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px 6px;
}

#inventory-store-view .inventory-sales-grid span {
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
}

#inventory-store-view .inventory-store-product-cell .inventory-store-sku {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
  word-break: break-all;
}

#inventory-store-view .inventory-store-product-cell .inventory-store-asin {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
  color: #475569;
}

#inventory-store-view .inventory-store-pack-badge {
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #c2410c;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

#inventory-store-view .inventory-store-title-hint {
  cursor: help;
}

#inventory-store-view .inventory-store-title-hint:hover,
#inventory-store-view .inventory-store-title-hint:focus-visible {
  background: #eef2ff;
  border-color: #93c5fd;
  color: #1d4ed8;
  outline: none;
}

#inventory-store-view .inventory-store-mapping-cell .inventory-mapping-chip {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

#inventory-store-view .inventory-store-mapping-cell .inventory-mapping-chip.unmatched {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
}

#inventory-store-view .inventory-store-mapping-cell .inventory-mapping-product-code {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: #475569;
  letter-spacing: 0.2px;
}

#inventory-store-view .inventory-store-mapping-cell.matched strong {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
}

#inventory-store-view .inventory-overview-image {
  width: 45px;
  height: 45px;
  min-width: 45px;
}

#inventory-store-view .inventory-overview-image-placeholder {
  width: 32px;
  height: 32px;
  min-width: 32px;
}

#inventory-store-view .inventory-status-stack,
#inventory-store-view .inventory-overview-table td:nth-child(4) .inventory-status-stack,
#inventory-store-view .inventory-overview-table td:nth-child(5) .inventory-status-stack {
  align-items: center;
  justify-items: center;
}

#inventory-overview-view {
  -webkit-overflow-scrolling: touch;
  touch-action: auto;
}

#inventory-supplier-view .inventory-overview-table {
  --inventory-sticky-image-col: 55px;
  --inventory-sticky-product-col: 218px;
  width: max(100%, 1320px);
  min-width: 1320px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

#inventory-supplier-view .inventory-overview-table th,
#inventory-supplier-view .inventory-overview-table td {
  white-space: normal;
  word-break: break-word;
  padding: 2px 5px;
  vertical-align: middle;
  border-bottom: 1px solid #edf2f7;
}

#inventory-supplier-view .inventory-overview-table th {
  position: sticky;
  top: var(--inventory-series-head-height, 46px);
  z-index: 5;
  color: #64748b;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.2;
  background: #f9fbfd;
  box-shadow: 0 1px 0 #e8eef6, 0 3px 8px rgba(15, 23, 42, 0.035);
}

#inventory-supplier-view .inventory-overview-series-card {
  position: relative;
  scroll-margin-top: calc(var(--inventory-series-head-height, 46px) + 18px);
}

#inventory-supplier-view .inventory-series-head {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #f5f7ff;
  border-bottom: 1px solid #e8eef6;
  padding: 0 0 8px;
  margin-bottom: 8px;
  width: 100%;
  color: inherit;
  text-align: left;
  box-shadow: 0 1px 0 #dbe7f5, 0 8px 12px rgba(248, 251, 255, 0.92);
}

#inventory-supplier-view .inventory-series-head h5 {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

#inventory-supplier-view .inventory-series-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-align: left;
}

#inventory-supplier-view .inventory-series-summary {
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

#inventory-supplier-view .inventory-overview-series-card.collapsed .inventory-series-body,
#inventory-store-view .inventory-overview-series-card.collapsed .inventory-series-body {
  display: none;
}

#inventory-store-view .inventory-overview-series-card {
  background: #ffffff;
  border: 1px solid #e5edf8;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  overflow: hidden;
  scroll-margin-top: calc(var(--inventory-series-head-height, 46px) + 18px);
}

#inventory-store-view .inventory-overview-series-card + .inventory-overview-series-card {
  margin-top: 8px;
}

#inventory-store-view .inventory-overview-series-card.collapsed {
  border-color: #e8eef6;
  background: #fbfcfe;
}

#inventory-store-view .inventory-overview-series-card.collapsed:hover {
  background: #f6f9ff;
  border-color: #cfdcf2;
}

#inventory-store-view .inventory-series-head {
  display: block;
  margin: 0;
  padding: 0;
  gap: 0;
}

#inventory-store-view .inventory-overview-series-card:not(.collapsed) .inventory-series-head {
  border-bottom: 1px solid #eef2f7;
  background: #f5f7ff;
}

#inventory-store-view .inventory-series-title {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 14px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: background 0.12s ease;
  min-height: 38px;
}

#inventory-store-view .inventory-series-title:hover {
  background: rgba(186, 213, 247, 0.18);
}

#inventory-store-view .inventory-series-title:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: -2px;
}

#inventory-store-view .inventory-series-head h5 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

#inventory-store-view .inventory-series-head .inventory-collapse-caret {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
}

#inventory-store-view .inventory-series-head .inventory-collapse-caret::before {
  border-top-color: #94a3b8;
  border-left-width: 4px;
  border-right-width: 4px;
  border-top-width: 5px;
}

#inventory-store-view .inventory-series-summary {
  margin-left: auto;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  letter-spacing: 0.1px;
  font-variant-numeric: tabular-nums;
}

#inventory-store-view .inventory-series-body {
  padding: 0;
}

#inventory-store-view .inventory-overview-series-card.collapsed .inventory-series-title {
  color: #334155;
}

#inventory-store-view .inventory-overview-series-card.collapsed .inventory-series-head h5 {
  font-weight: 600;
}

.inventory-custom-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 22px;
  padding: 2px 6px;
  background: #f5f9ff;
}

.inventory-custom-group-row td {
  padding: 0 !important;
  background: #f5f9ff !important;
  border-top: 1px solid #e8f0fb;
  border-bottom: 1px solid #edf3fb;
}

.inventory-custom-group-row[draggable="true"] {
  cursor: grab;
}

.inventory-custom-group-row.dragging {
  opacity: 0.55;
}

.inventory-custom-group-row.drag-over td {
  border-top-color: #4f46e5;
  box-shadow: inset 0 2px 0 #4f46e5;
}

.inventory-custom-group-row.drag-over.drag-after td {
  border-top-color: #e8f0fb;
  border-bottom-color: #4f46e5;
  box-shadow: inset 0 -2px 0 #4f46e5;
}

.inventory-custom-group-row.ungrouped td {
  background: #fbfdff !important;
}

.inventory-custom-group-empty-row td {
  background: #ffffff !important;
  padding: 8px !important;
}

.inventory-custom-group-title {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #0f172a;
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.inventory-collapse-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
}

.inventory-collapse-caret::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid #64748b;
  transition: transform 0.12s ease;
}

.inventory-overview-series-card.collapsed > .inventory-series-head .inventory-collapse-caret::before,
.inventory-custom-group-row.collapsed .inventory-collapse-caret::before {
  transform: rotate(-90deg);
}

.inventory-custom-group-title strong {
  font-size: 12px;
  line-height: 1;
}

.inventory-custom-group-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  min-width: 22px;
  justify-content: flex-end;
}

.inventory-custom-group-actions .compact-button,
.inventory-custom-group-actions .compact-danger-button {
  display: none;
  height: 20px;
  min-height: 20px;
  padding: 0 7px;
  font-size: 11px;
  line-height: 18px;
}

.inventory-custom-group-actions:hover .compact-button,
.inventory-custom-group-actions:hover .compact-danger-button,
.inventory-custom-group-actions:focus-within .compact-button,
.inventory-custom-group-actions:focus-within .compact-danger-button {
  display: inline-flex;
}

.inventory-custom-group-actions:hover .inventory-custom-group-more,
.inventory-custom-group-actions:focus-within .inventory-custom-group-more {
  display: none;
}

.inventory-custom-group-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 18px;
  border-radius: 999px;
  color: #64748b;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.inventory-custom-group-title .inventory-level-badge {
  height: 16px;
  padding: 0 5px;
  font-size: 10px;
  line-height: 16px;
}

.inventory-custom-group-title .inventory-inline-meta {
  font-size: 11px;
  line-height: 1;
}

.inventory-custom-group-body {
  padding: 0;
}

.inventory-custom-group-card.collapsed .inventory-custom-group-body {
  display: none;
}

.inventory-row-group-action {
  display: none;
  width: 30px;
  height: 20px;
  margin: 0;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #4f46e5;
  font-size: 0;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.inventory-row-group-action::before {
  content: "修改";
  font-size: 11px;
  line-height: 1;
}

#inventory-supplier-view .inventory-row-group-action-cell:hover .inventory-row-group-action,
#inventory-supplier-view .inventory-row-group-action-cell:focus-within .inventory-row-group-action,
#inventory-store-view .inventory-row-group-action-cell:hover .inventory-row-group-action,
#inventory-store-view .inventory-row-group-action-cell:focus-within .inventory-row-group-action {
  display: inline-flex;
}

#inventory-supplier-view .inventory-row-group-action-cell:hover .inventory-row-group-more,
#inventory-supplier-view .inventory-row-group-action-cell:focus-within .inventory-row-group-more,
#inventory-store-view .inventory-row-group-action-cell:hover .inventory-row-group-more,
#inventory-store-view .inventory-row-group-action-cell:focus-within .inventory-row-group-more {
  display: none;
}

.inventory-row-group-action-cell {
  position: relative;
  text-align: center;
}

.inventory-row-group-action-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  min-height: 20px;
}

.inventory-row-group-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 18px;
  border-radius: 999px;
  color: #64748b;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.inventory-row-group-menu {
  position: absolute;
  top: 22px;
  right: 2px;
  z-index: 60;
  min-width: 132px;
  max-width: 260px;
  padding: 5px;
  border: 1px solid #dbe7f5;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}

.inventory-row-group-menu-item {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #334155;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  padding: 7px 8px;
  text-align: left;
}

.inventory-row-group-menu-item:hover,
.inventory-row-group-menu-item.active {
  background: #eff6ff;
  color: #1d4ed8;
}

.inventory-row-group-menu-item.create {
  border-top: 1px solid #e5edf8;
  border-radius: 0 0 7px 7px;
  color: #0f766e;
  margin-top: 3px;
}

.inventory-row-group-menu-item.mapping {
  color: #7c3aed;
}

.inventory-store-title-hint {
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 6px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #f5f7ff;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.inventory-store-lazy-note {
  margin: 8px 0;
}

#inventory-supplier-view .inventory-overview-table td {
  font-size: 13px;
}

#inventory-supplier-view .inventory-overview-table tbody tr:nth-child(odd) td {
  background: #ffffff;
}

#inventory-supplier-view .inventory-overview-table tbody tr:nth-child(even) td {
  background: #fbfdff;
}

#inventory-supplier-view .inventory-overview-table tbody tr.inventory-row-risk-danger td {
  background: #fff7f7;
}

#inventory-supplier-view .inventory-overview-table tbody tr.inventory-row-risk-warn td {
  background: #fffbf3;
}

#inventory-supplier-view .inventory-overview-table tbody tr.inventory-row-risk-danger td:nth-child(1),
#inventory-supplier-view .inventory-overview-table tbody tr.inventory-row-risk-danger td:nth-child(2) {
  background: #fff7f7;
}

#inventory-supplier-view .inventory-overview-table tbody tr.inventory-row-risk-warn td:nth-child(1),
#inventory-supplier-view .inventory-overview-table tbody tr.inventory-row-risk-warn td:nth-child(2) {
  background: #fffbf3;
}

#inventory-supplier-view .inventory-overview-table tbody tr.inventory-sibling-row td:first-child {
  border-left: 3px solid #60a5fa;
}

#inventory-supplier-view .inventory-overview-table th:nth-child(1),
#inventory-supplier-view .inventory-overview-table td:nth-child(1) {
  width: var(--inventory-sticky-image-col);
  min-width: var(--inventory-sticky-image-col);
  max-width: var(--inventory-sticky-image-col);
}

#inventory-supplier-view .inventory-overview-table th:nth-child(2),
#inventory-supplier-view .inventory-overview-table td:nth-child(2) {
  width: var(--inventory-sticky-product-col);
  min-width: var(--inventory-sticky-product-col);
  max-width: var(--inventory-sticky-product-col);
}

#inventory-supplier-view .inventory-overview-table td:nth-child(1) {
  overflow: visible;
}

#inventory-supplier-view .inventory-overview-image {
  width: 45px;
  height: 45px;
  min-width: 45px;
  flex: 0 0 45px;
}

#inventory-supplier-view .inventory-overview-image-placeholder {
  width: clamp(28px, 4vw, 36px);
  height: clamp(28px, 4vw, 36px);
  min-width: clamp(28px, 4vw, 36px);
  flex: 0 0 clamp(28px, 4vw, 36px);
}

#inventory-supplier-view .inventory-status-stack {
  gap: 2px;
}

#inventory-supplier-view .inventory-status-chip {
  min-width: 42px;
  height: 18px;
  padding: 0 7px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
}

#inventory-supplier-view .inventory-sales-detail-trigger {
  align-self: center;
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  font-size: 10px;
  padding: 1px 6px;
  line-height: 1;
}

#inventory-supplier-view .inventory-image-hover {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.inventory-image-preview-overlay {
  position: fixed;
  z-index: 9999;
  width: 316px;
  height: 316px;
  padding: 8px;
  border: 1px solid #dbe7f5;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.18);
  pointer-events: none;
}

.inventory-image-preview-overlay-img {
  display: block;
  width: 300px;
  height: 300px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

#inventory-supplier-view .inventory-overview-table th:nth-child(3),
#inventory-supplier-view .inventory-overview-table td:nth-child(3),
#inventory-supplier-view .inventory-overview-table th:nth-child(4),
#inventory-supplier-view .inventory-overview-table td:nth-child(4),
#inventory-supplier-view .inventory-overview-table th:nth-child(5),
#inventory-supplier-view .inventory-overview-table td:nth-child(5) {
  width: 5.4%;
  text-align: center;
}

#inventory-supplier-view .inventory-overview-table td:nth-child(3) .inventory-compact-stack,
#inventory-supplier-view .inventory-overview-table td:nth-child(4) .inventory-status-stack,
#inventory-supplier-view .inventory-overview-table td:nth-child(5) .inventory-status-stack {
  align-items: center;
  justify-items: center;
}

#inventory-supplier-view .inventory-overview-table th:nth-child(6),
#inventory-supplier-view .inventory-overview-table td:nth-child(6) {
  width: 4.5%;
}

#inventory-supplier-view .inventory-overview-table th:nth-child(7),
#inventory-supplier-view .inventory-overview-table td:nth-child(7) {
  width: 6%;
}

#inventory-supplier-view .inventory-overview-table th:nth-child(8),
#inventory-supplier-view .inventory-overview-table td:nth-child(8),
#inventory-supplier-view .inventory-overview-table th:nth-child(9),
#inventory-supplier-view .inventory-overview-table td:nth-child(9) {
  width: 4.5%;
}

#inventory-supplier-view .inventory-overview-table th:nth-child(10),
#inventory-supplier-view .inventory-overview-table td:nth-child(10) {
  width: 5%;
}

#inventory-supplier-view .inventory-overview-table th:nth-child(11),
#inventory-supplier-view .inventory-overview-table td:nth-child(11) {
  width: 10%;
}

#inventory-supplier-view .inventory-overview-table th:nth-child(12),
#inventory-supplier-view .inventory-overview-table td:nth-child(12) {
  width: 6%;
}

#inventory-supplier-view .inventory-overview-table th:nth-child(13),
#inventory-supplier-view .inventory-overview-table td:nth-child(13) {
  width: 12%;
}

#inventory-supplier-view .inventory-overview-table th:nth-child(14),
#inventory-supplier-view .inventory-overview-table td:nth-child(14) {
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  padding-left: 2px;
  padding-right: 2px;
}

.inventory-purchase-action-cell {
  display: grid;
  gap: 3px;
  align-items: start;
}

.inventory-purchase-action-cell .compact-button {
  font-size: 11px;
  font-weight: 800;
  min-width: 0;
  padding: 3px 9px;
  width: fit-content;
  justify-self: start;
}

.inventory-purchase-action-cell .inventory-cart-add-button.idle {
  border-color: #cbd5e1;
  background: #ffffff;
  color: #64748b;
}

.inventory-purchase-action-cell .inventory-cart-add-button.idle:hover {
  border-color: #94a3b8;
  background: #f8fafc;
  color: #334155;
}

.inventory-purchase-action-cell .inventory-cart-add-button.in-cart {
  border-color: #bfdbfe;
  background: #ffffff;
  color: #1d4ed8;
}

.inventory-purchase-action-cell .inventory-cart-add-button.in-cart:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.inventory-purchase-action-cell .inventory-cart-add-button.needs-purchase {
  border-color: #fca5a5;
  background: #fff1f2;
  color: #dc2626;
}

.inventory-purchase-action-cell .inventory-cart-add-button.needs-purchase:hover {
  border-color: #ef4444;
  background: #fee2e2;
  color: #b91c1c;
}

.inventory-compact-numbers span {
  font-size: 11px;
  line-height: 1.15;
}

.inventory-price-cell .inventory-price-primary {
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.inventory-post-purchase-balance {
  display: inline-grid;
  gap: 2px;
  min-width: 58px;
  line-height: 1.2;
}

.inventory-post-purchase-balance strong {
  font-size: 14px;
  font-weight: 900;
}

.inventory-post-purchase-balance span {
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
}

.inventory-post-purchase-balance.danger strong,
.inventory-post-purchase-balance.danger span {
  color: #dc2626;
}

.inventory-post-purchase-balance.warn strong,
.inventory-post-purchase-balance.warn span {
  color: #c2410c;
}

.inventory-post-purchase-balance.ok strong {
  color: #047857;
}

.inventory-post-purchase-balance.neutral strong {
  color: #334155;
}

.inventory-post-purchase-balance strong.negative {
  color: #dc2626;
}

.inventory-cart-row-status {
  display: inline-flex;
  width: fit-content;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  padding: 3px 7px;
}

.compact-button.active-soft {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.inventory-purchase-cart-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #4f46e5;
  color: white;
  box-shadow: 0 12px 24px rgba(79, 70, 229, 0.24);
  cursor: pointer;
  user-select: none;
  touch-action: none;
  font-weight: 800;
  padding: 10px 14px;
}

.inventory-filter-float.floating-dragging,
.inventory-purchase-cart-toggle.floating-dragging,
.ads-quick-float.floating-dragging,
.ads-bid-calc-float.floating-dragging {
  cursor: grabbing;
  opacity: 0.92;
}

.inventory-filter-float.floating-dragging .inventory-filter-floating-button,
.inventory-purchase-cart-toggle.floating-dragging,
.ads-quick-float.floating-dragging button,
.ads-bid-calc-float.floating-dragging button {
  cursor: grabbing;
}

.inventory-purchase-cart-toggle span {
  display: inline-flex;
  min-width: 22px;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  margin-left: 0;
  padding: 2px 7px;
  white-space: nowrap;
}

.inventory-purchase-cart-bump {
  animation: inventory-cart-bump 260ms ease-out;
}

.inventory-purchase-flyer {
  position: fixed;
  z-index: 10000;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
  object-fit: cover;
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.22);
  pointer-events: none;
  transform: translate(0, 0) scale(1);
  transform-origin: center center;
  opacity: 0.96;
  transition: transform 620ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 620ms ease;
}

@keyframes inventory-cart-bump {
  0% { transform: scale(1); }
  45% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.inventory-purchase-cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(3px);
  padding: 24px;
  overflow: hidden;
}

.inventory-purchase-cart-panel {
  width: min(520px, calc(100vw - 24px));
  height: min(86dvh, 920px);
  max-height: calc(100dvh - 48px);
  border: 1px solid #dbe7f5;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.inventory-purchase-cart-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #e2e8f0;
  padding: 14px 16px;
  background: #ffffff;
  flex: 0 0 auto;
}

.inventory-purchase-cart-head-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.inventory-purchase-cart-body {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 12px 14px 14px;
  display: block;
}

.inventory-purchase-cart-body > * + * {
  margin-top: 12px;
}

.inventory-cart-supplier {
  border: 1px solid #dbe7f5;
  border-radius: 12px;
  background: #f5f7ff;
  overflow: hidden;
}

.inventory-cart-supplier-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #dbe7f5;
  background: #ffffff;
  padding: 10px 12px;
}

.inventory-cart-supplier-head-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.inventory-cart-supplier-side {
  display: grid;
  gap: 4px;
  justify-items: end;
}

.inventory-cart-clear-supplier-inline {
  padding: 4px 10px;
  font-size: 11px;
}

.inventory-cart-total {
  display: grid;
  gap: 3px;
  justify-items: end;
  color: #475569;
  font-size: 12px;
}

.inventory-cart-total strong {
  color: #0f172a;
  font-size: 15px;
}

.inventory-cart-total .warn {
  color: #c2410c;
  font-weight: 800;
}

.inventory-cart-total .good {
  color: #047857;
  font-weight: 800;
}

.inventory-cart-items {
  display: grid;
  min-height: 0;
}

.inventory-cart-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  justify-content: stretch;
  gap: 8px;
  border-bottom: 1px solid #e5edf8;
  padding: 10px 10px;
}

.inventory-cart-item:last-child {
  border-bottom: 0;
}

.inventory-cart-item-main {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  width: 100%;
}

.inventory-cart-item-image-wrap {
  width: 76px;
  display: grid;
  gap: 4px;
  justify-items: center;
}

.inventory-cart-item-image-wrap .inventory-image-hover {
  width: 60px;
  height: 60px;
}

.inventory-cart-item-image-wrap .inventory-overview-image {
  width: 60px;
  height: 60px;
  border-radius: 10px;
}

.inventory-cart-item-sku {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 11px;
  line-height: 1.2;
  color: #475569;
  overflow-wrap: anywhere;
}

.inventory-cart-item-meta {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 2px;
}

.inventory-cart-item-series {
  color: #475569;
  font-size: 12px;
  line-height: 1.35;
  word-break: break-word;
}

.inventory-cart-item-features {
  color: #475569;
  font-size: 10px;
  line-height: 1.25;
  word-break: break-word;
  opacity: 0.9;
}

.inventory-cart-item-controls {
  display: grid;
  grid-template-columns: 60px 48px 68px 44px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  width: max-content;
}

.inventory-cart-qty-input {
  width: 60px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 6px 7px;
}

.inventory-purchase-qty-card {
  width: min(460px, calc(100vw - 32px));
  border: 1px solid #dbe7f5;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
  padding: 16px;
  display: grid;
  gap: 14px;
}

.inventory-purchase-qty-body {
  display: grid;
  gap: 12px;
}

.inventory-purchase-qty-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 14px;
  align-items: start;
}

.inventory-purchase-qty-summary {
  display: grid;
  gap: 3px;
}

.inventory-purchase-qty-summary strong {
  font-size: 16px;
}

.inventory-purchase-qty-summary span {
  color: #64748b;
  font-size: 12px;
}

.inventory-purchase-qty-image {
  justify-self: end;
  width: 112px;
  min-height: 96px;
  display: flex;
  justify-content: flex-end;
}

.inventory-purchase-qty-image .inventory-overview-image {
  width: 96px;
  height: 96px;
  min-width: 96px;
  border-radius: 8px;
  object-fit: cover;
}

.inventory-purchase-qty-image .inventory-overview-image-placeholder {
  width: 96px;
  height: 96px;
  min-width: 96px;
}

.inventory-purchase-qty-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.inventory-purchase-qty-facts div {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  padding: 9px;
  display: grid;
  gap: 3px;
}

.inventory-purchase-qty-facts span {
  color: #64748b;
  font-size: 12px;
}

.inventory-purchase-qty-field input {
  width: 100%;
}

.inventory-upload-result-card {
  width: min(520px, calc(100vw - 32px));
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #dbe7f5;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  padding: 22px;
  display: grid;
  gap: 16px;
}

.inventory-upload-result-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.inventory-upload-result-head h3 {
  margin: 3px 0 0;
  font-size: 22px;
  letter-spacing: 0;
}

.inventory-upload-result-body {
  display: grid;
  gap: 12px;
}

.inventory-upload-result-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.inventory-upload-result-metric {
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #f5f7ff;
  padding: 12px;
  display: grid;
  gap: 4px;
}

.inventory-upload-result-metric span {
  color: #64748b;
  font-size: 12px;
}

.inventory-upload-result-metric strong {
  color: #0f172a;
  font-size: 20px;
}

.inventory-upload-result-note {
  border-radius: 12px;
  background: #ecfdf5;
  color: #166534;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
}

.inventory-upload-result-note.warn {
  background: #fff7ed;
  color: #9a3412;
}

.inventory-upload-result-actions {
  display: flex;
  justify-content: flex-end;
}

.inventory-upload-progress {
  display: flex;
  gap: 14px;
  align-items: center;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  background: #f5f7ff;
  padding: 14px;
}

.inventory-upload-progress strong {
  display: block;
  color: #0f172a;
  font-size: 15px;
}

.inventory-upload-progress p {
  margin: 3px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.4;
}

.inventory-upload-spinner {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 3px solid #dbeafe;
  border-top-color: #4f46e5;
  animation: inventory-upload-spin 0.8s linear infinite;
  flex: 0 0 auto;
}

@keyframes inventory-upload-spin {
  to {
    transform: rotate(360deg);
  }
}

#inventory-overview-view .inventory-overview-table {
  width: max(100%, 1080px);
  min-width: 1080px;
  table-layout: fixed;
}

#inventory-overview-view .inventory-overview-table th,
#inventory-overview-view .inventory-overview-table td {
  white-space: normal;
  word-break: break-word;
  padding: 7px 6px;
  vertical-align: top;
}

#inventory-overview-view .inventory-overview-table th {
  font-size: 12px;
  line-height: 1.2;
}

#inventory-overview-view .inventory-overview-table td {
  font-size: 13px;
}

#inventory-overview-view .inventory-overview-table th:nth-child(1),
#inventory-overview-view .inventory-overview-table td:nth-child(1) {
  width: 3.5%;
}

#inventory-overview-view .inventory-overview-table th:nth-child(2),
#inventory-overview-view .inventory-overview-table td:nth-child(2) {
  width: 11%;
}

#inventory-overview-view .inventory-overview-table th:nth-child(3),
#inventory-overview-view .inventory-overview-table td:nth-child(3) {
  width: 6%;
}

#inventory-overview-view .inventory-overview-table th:nth-child(4),
#inventory-overview-view .inventory-overview-table td:nth-child(4),
#inventory-overview-view .inventory-overview-table th:nth-child(5),
#inventory-overview-view .inventory-overview-table td:nth-child(5),
#inventory-overview-view .inventory-overview-table th:nth-child(6),
#inventory-overview-view .inventory-overview-table td:nth-child(6),
#inventory-overview-view .inventory-overview-table th:nth-child(7),
#inventory-overview-view .inventory-overview-table td:nth-child(7) {
  width: 9%;
}

#inventory-overview-view .inventory-overview-table th:nth-child(8),
#inventory-overview-view .inventory-overview-table td:nth-child(8),
#inventory-overview-view .inventory-overview-table th:nth-child(9),
#inventory-overview-view .inventory-overview-table td:nth-child(9) {
  width: 10%;
}

#inventory-overview-view .inventory-overview-table th:nth-child(10),
#inventory-overview-view .inventory-overview-table td:nth-child(10) {
  width: 12%;
}

#inventory-overview-view .inventory-overview-product .inventory-inline-meta,
#inventory-overview-view .inventory-overview-product .inventory-feature-stack,
#inventory-overview-view .inventory-overview-product .inventory-compact-lines,
#inventory-overview-view .inventory-overview-inbound-cell,
#inventory-overview-view .inventory-overview-supplier-sales,
#inventory-overview-view .inventory-overview-monthly-avg {
  font-size: 12px;
  line-height: 1.25;
}

.inventory-sticky-col {
  position: sticky;
  background: #ffffff;
  z-index: 2;
}

.inventory-table th.inventory-sticky-col {
  z-index: 4;
  background: #f5f7ff;
}

.inventory-sticky-col-1 { left: 0; min-width: 72px; }
.inventory-sticky-col-2 { left: 72px; min-width: 180px; }
.inventory-sticky-col-3 { left: 252px; min-width: 112px; }
.inventory-sticky-col-4 { left: 364px; min-width: 130px; }

.inventory-draft-input {
  width: 92px;
  border: 1px solid #cfe0ff;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
  padding: 7px 9px;
}

.inventory-draft-input:focus {
  border-color: #4f46e5;
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.inventory-compact-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
}

.inventory-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px 8px;
  min-width: 0;
}

.inventory-metric-grid span {
  line-height: 1.15;
  white-space: nowrap;
}

.inventory-compact-stack span {
  line-height: 1.2;
}

.inventory-compact-numbers span {
  color: var(--muted);
  font-size: 12px;
}

.inventory-sales-cell {
  position: relative;
  min-width: 0;
}

.inventory-restock-cell {
  position: relative;
}

.inventory-sales-detail-trigger {
  align-self: flex-start;
  border: 1px solid #dbe7f5;
  border-radius: 999px;
  background: #ffffff;
  color: #31507a;
  font-size: 10.5px;
  line-height: 1;
  padding: 2px 7px;
  cursor: pointer;
}

.inventory-sales-detail-trigger:hover {
  border-color: #93c5fd;
  background: #f5f7ff;
}

.inventory-sales-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  width: 560px;
  max-width: min(560px, calc(100vw - 40px));
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(215, 230, 251, 0.82);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.16);
}

.inventory-monthly-sales-cell {
  cursor: default;
}

.inventory-monthly-sales-popover {
  width: 300px;
}

.inventory-monthly-sales-list {
  display: grid;
  gap: 5px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 2px;
}

.inventory-monthly-sales-row {
  display: grid;
  grid-template-columns: 58px minmax(96px, 1fr) 42px;
  align-items: center;
  gap: 8px;
  color: #334155;
  font-size: 12px;
  line-height: 1.15;
}

.inventory-monthly-sales-label {
  color: #64748b;
  white-space: nowrap;
}

.inventory-monthly-sales-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf4fb;
}

.inventory-monthly-sales-bar i {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: #60a5fa;
}

.inventory-monthly-sales-row strong {
  text-align: right;
  font-size: 12px;
  color: #0f172a;
}

.inventory-sales-popover-overlay {
  position: fixed;
  z-index: 9998;
  pointer-events: auto;
}

.inventory-sales-popover-overlay .inventory-sales-popover {
  position: static;
  width: 560px;
  max-width: min(560px, calc(100vw - 40px));
  pointer-events: auto;
}

.inventory-sales-popover-head {
  display: grid;
  gap: 2px;
}

.inventory-sales-popover-list {
  display: grid;
  gap: 6px;
}

.inventory-sales-popover-list.scrollable {
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}

.inventory-sales-popover-row {
  display: grid;
  grid-template-columns: 48px minmax(84px, 1fr) 64px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  min-width: 0;
}

.inventory-sales-popover-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.inventory-sales-popover-section {
  min-width: 0;
  border: 1px solid rgba(227, 235, 247, 0.82);
  border-radius: 12px;
  background: rgba(249, 251, 255, 0.7);
  padding: 10px;
}

.inventory-sales-popover-section .section-head.compact {
  margin-bottom: 8px;
}

.inventory-sales-popover-section .section-head.compact h4 {
  margin: 0;
  font-size: 13px;
}

.inventory-sales-popover-meta {
  display: grid;
  gap: 2px;
}

.inventory-sales-popover-head .inventory-inline-meta {
  overflow-wrap: anywhere;
}

.inventory-sales-popover-row .inventory-overview-event-date,
.inventory-sales-popover-row .inventory-overview-event-qty {
  white-space: nowrap;
}

.inventory-inline-meta {
  color: var(--muted);
  font-size: 12px;
}

.inventory-sparkline {
  width: 120px;
  height: 32px;
  display: block;
}

.result-summary-panel {
  margin-bottom: 12px;
}

.result-summary-card {
  border: 1px solid #cfe0ff;
  border-radius: 12px;
  background: #f5f7ff;
  padding: 12px;
  display: grid;
  gap: 12px;
}

.result-summary-main {
  display: grid;
  gap: 7px;
}

.result-summary-main strong {
  font-size: 16px;
  line-height: 1.35;
}

.result-summary-main p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.result-summary-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.result-summary-facts div,
.result-next-step {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 9px;
}

.result-summary-facts span,
.result-next-step span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.result-summary-facts strong,
.result-next-step strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  line-height: 1.35;
}

.result-summary-failed {
  border-color: #fecaca;
  background: #fff5f5;
}

.result-summary-waiting {
  border-color: #fed7aa;
  background: #fffaf2;
}

.result-summary-running {
  border-color: #bae6fd;
  background: #f0f9ff;
}

.asset-list,
.record-list,
.task-overview-list {
  display: grid;
  gap: 10px;
}

.task-overview-list {
  gap: 14px;
}

.topic-overview-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.topic-overview-metric {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 4px;
}

.topic-overview-metric span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.topic-overview-metric strong {
  color: var(--text);
  font-size: 22px;
  line-height: 1;
}

.topic-metric-waiting-me {
  border-color: #fed7aa;
  background: #fffaf2;
}

.topic-metric-running {
  border-color: #bae6fd;
  background: #f0f9ff;
}

.topic-metric-replied {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.topic-metric-archived {
  background: #f8fafc;
}

.topic-metric-blocked {
  border-color: #fecaca;
  background: #fff5f5;
}

.task-group {
  display: grid;
  gap: 8px;
}

.task-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 0;
}

.task-group-head h4 {
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
}

.task-group-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.task-group-head > span {
  min-width: 28px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.task-group-list {
  display: grid;
  gap: 8px;
}

.task-group-empty {
  border: 1px dashed var(--line);
  border-radius: 9px;
  background: #f8fafc;
  color: var(--muted);
  padding: 12px;
  font-size: 13px;
  text-align: center;
}

.asset-card,
.record-card,
.member-card,
.record-row,
.task-overview-card,
.skill-card {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  padding: 11px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.025);
}

.task-overview-card {
  cursor: pointer;
  display: grid;
  gap: 8px;
  border-left: 4px solid #cbd5e1;
}

.task-overview-card:hover,
.task-overview-card.active {
  border-color: #a8c4ff;
  background: #f5f7ff;
  box-shadow: var(--shadow-card);
}

.task-overview-card.task-state-pending {
  border-left-color: var(--warn);
}

.task-overview-card.task-state-claimed {
  border-left-color: #0ea5e9;
}

.task-overview-card.task-state-done {
  border-left-color: var(--success);
}

.task-overview-card.task-state-failed {
  border-left-color: var(--danger);
}

.task-overview-card.task-state-archived {
  border-left-color: #94a3b8;
  background: #f8fafc;
  opacity: 0.72;
}

.task-overview-card.task-state-archived:hover,
.task-overview-card.task-state-archived.active {
  opacity: 0.92;
}

.task-card-summary {
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

.task-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.task-card-alert {
  border-radius: 8px;
  background: #fef2f2;
  color: #b91c1c;
  padding: 7px 9px;
  font-size: 12px;
  font-weight: 700;
}

.selected-task-card {
  display: grid;
  gap: 10px;
}

.task-fact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.task-fact-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  padding: 8px;
}

.task-fact-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  margin-bottom: 3px;
}

.task-fact-grid strong {
  display: block;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.35;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
  align-items: start;
}

.skill-toolbar {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 14px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  box-shadow: var(--shadow-soft);
}

.skill-toolbar h3 {
  margin: 0 0 4px;
  font-size: 16px;
  line-height: 1.3;
}

.skill-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.skill-search {
  min-width: 280px;
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.skill-search input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 11px;
  font: inherit;
  outline: none;
}

.skill-search input:focus {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.skill-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 8px;
}

.skill-filter-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #475569;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.skill-filter-button span {
  color: var(--muted);
  margin-left: 4px;
}

.skill-filter-button.active {
  color: #1d4ed8;
  border-color: #a8c4ff;
  background: #eef2ff;
}

.skill-count-line {
  margin-bottom: 10px;
}

.skill-card {
  display: grid;
  gap: 10px;
  border-left: 4px solid #cbd5e1;
}

.skill-card.skill-agent-codex {
  border-left-color: var(--codex);
}

.skill-card.skill-agent-hermes {
  border-left-color: var(--hermes);
}

.skill-card-head,
.skill-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.skill-card-head strong {
  display: block;
  font-size: 15px;
  line-height: 1.35;
}

.skill-purpose {
  border-radius: 9px;
  background: #f8fafc;
  color: var(--text);
  padding: 9px 10px;
  font-size: 13px;
  line-height: 1.5;
}

.skill-detail-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.skill-detail-row span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.skill-detail-row p {
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}

.skills-scene-view {
  position: relative;
  isolation: isolate;
}

.skills-scene-view::before {
  content: none;
}

.skills-scene-view::after {
  content: none;
}

.skills-scene-header {
  margin-bottom: 14px;
  padding: 0;
}

.skills-scene-header .eyebrow {
  color: var(--muted);
}

.skills-scene-header h2 {
  color: var(--text);
}

.skills-scene-header .section-meta {
  color: var(--muted);
}

.skills-scene-header .view-module-badge {
  border-color: var(--line);
  background: #fff;
  color: var(--muted);
}

.skills-scene-content {
  padding: 0;
}

.skill-hero-panel {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 14px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.skill-hero-copy {
  display: grid;
  gap: 6px;
  max-width: 620px;
}

.skill-hero-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid #dbe5f5;
  background: #f8fafc;
  color: #5b6b82;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.skill-hero-panel h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  color: var(--text);
}

.skill-hero-panel p,
.skill-count-line {
  margin: 0;
  color: var(--muted);
}

.skill-search {
  min-width: 300px;
  gap: 6px;
  color: var(--muted);
}

.skill-search input {
  height: 40px;
  border-color: var(--line);
  background: #fff;
  color: var(--text);
}

.skill-search input::placeholder {
  color: #94a3b8;
}

.skill-search input:focus {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.skill-filter-shell {
  margin-bottom: 12px;
  padding: 0;
  border-radius: 0;
  border: 0;
  background: transparent;
}

.skill-filter-bar {
  gap: 8px;
  margin-bottom: 0;
}

.skill-filter-button {
  border-color: var(--line);
  background: #fff;
  color: #475569;
}

.skill-filter-button span {
  color: var(--muted);
}

.skill-filter-button.active {
  color: #1d4ed8;
  border-color: #a8c4ff;
  background: #eef2ff;
}

.skill-grid {
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}

.skill-card {
  position: relative;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.skill-card.skill-agent-codex {
  border-left-color: var(--codex);
}

.skill-card.skill-agent-hermes {
  border-left-color: var(--hermes);
}

.skill-card-head,
.skill-card-foot {
  align-items: center;
}

.skill-card-title-block {
  display: grid;
  gap: 8px;
}

.skill-card-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-card-head strong {
  font-size: 18px;
  color: var(--text);
}

.skill-agent-chip,
.skill-category-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.skill-agent-chip {
  background: #eff6ff;
  color: #31558f;
}

.skill-category-chip {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #dbe5f5;
}

.skill-mode-token,
.skill-status-token {
  color: inherit;
}

.skill-status-subtle {
  color: inherit;
}

.skill-purpose {
  background: #f8fafc;
  color: var(--text);
  border: 0;
}

.skill-profile {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.skill-detail-row {
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid #eef2f7;
}

.skill-detail-row span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.skill-detail-row p {
  color: var(--text);
}

@media (max-width: 960px) {
  .skill-hero-panel {
    flex-direction: column;
  }

  .skill-search {
    min-width: 100%;
    width: 100%;
  }
}

.asset-card.asset-deliverable {
  border-left: 4px solid var(--success);
}

.asset-card.asset-material {
  border-left: 4px solid #94a3b8;
}

.asset-card {
  display: grid;
  gap: 8px;
}

.asset-card.asset-primary {
  padding: 14px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.asset-card.asset-compact {
  padding: 10px;
}

.asset-card.asset-compact .asset-summary {
  -webkit-line-clamp: 3;
}

.asset-meta,
.asset-path,
.asset-thread {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.asset-path,
.record-detail,
.asset-summary {
  margin-top: 5px;
  padding: 6px 8px;
  border-radius: 7px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.asset-summary {
  margin-top: 0;
  color: var(--text);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.asset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 2px;
}

.asset-actions .compact-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.compact-asset-list {
  gap: 8px;
}

.empty-note {
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  background: #f8fafc;
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.member-card-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 10px;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.member-avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #0891b2, #22c55e);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  grid-column: 1 / 2;
  grid-row: 1 / 2;
}

.member-avatar.human {
  border-radius: 999px;
  background: linear-gradient(145deg, #4f46e5, #60a5fa);
}

.member-state {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #94a3b8;
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  justify-self: end;
  align-self: center;
}

.member-state.state-running {
  background: #0891b2;
}

.member-state.state-waiting {
  background: #d97706;
}

@media (max-width: 1440px) {
  .conversation-member-list,
  .conversation-agent-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

.member-state.state-blocked {
  background: #dc2626;
}

.member-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 9px;
}

.record-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.record-row span {
  color: var(--muted);
  font-size: 12px;
}

.record-row strong {
  min-width: 0;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.flow-header h2 {
  margin-top: 4px;
  font-size: 24px;
  line-height: 1.2;
}

.flow-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.flow-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 5px 8px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--muted);
}

.legend-dot.pending {
  background: var(--warn);
}

.legend-dot.claimed {
  background: var(--hermes);
}

.legend-dot.failed {
  background: var(--danger);
}

.flow-layout {
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
}

.flow-map-card {
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-right: 1px solid var(--line);
  background: var(--bg);
}

.flow-map-card > .section-head {
  margin: 0;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.flow-map {
  position: relative;
  min-height: 0;
  overflow: hidden;
  margin: 14px;
  border: 1px solid #dfe7f1;
  border-radius: 14px;
  background:
    radial-gradient(circle at 24px 24px, rgba(79, 70, 229, 0.12) 1px, transparent 1.6px),
    #fbfdff;
  background-size: 26px 26px;
}

.flow-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.flow-lines marker path {
  fill: #7a8797;
}

.flow-line {
  fill: none;
  stroke: #7a8797;
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0.68;
}

.flow-line.status-message {
  stroke: #64748b;
  stroke-width: 2;
  stroke-dasharray: 7 9;
  animation: flowDash 1.8s linear infinite;
  opacity: 0.58;
}

.flow-line.status-pending {
  stroke: var(--warn);
  stroke-dasharray: 8 10;
  animation: flowDash 1.8s linear infinite;
}

.flow-line.status-claimed {
  stroke: var(--hermes);
  stroke-width: 2.6;
  stroke-dasharray: 8 10;
  animation: flowDash 1.2s linear infinite;
}

.flow-line.status-done {
  stroke: var(--success);
}

.flow-line.status-failed {
  stroke: var(--danger);
  stroke-width: 2.8;
  stroke-dasharray: 10 7;
}

@keyframes flowDash {
  to {
    stroke-dashoffset: -34;
  }
}

.flow-edge-card {
  position: absolute;
  min-width: 132px;
  max-width: 188px;
  transform: translate(-50%, -50%);
  z-index: 3;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  padding: 8px 9px;
  box-shadow: none;
  backdrop-filter: blur(8px);
}

.flow-edge-card.status-pending {
  border-color: #fed7aa;
}

.flow-edge-card.status-claimed {
  border-color: #a5f3fc;
}

.flow-edge-card.status-done {
  border-color: #bbf7d0;
}

.flow-edge-card.status-failed {
  border-color: #fecaca;
}

.flow-edge-route {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.flow-edge-statuses {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.flow-edge-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.flow-edge-pill.status-message {
  color: #475569;
  background: #f8fafc;
  border-color: #cbd5e1;
}

.flow-edge-pill.status-pending {
  color: #b45309;
  background: #fff7ed;
  border-color: #fed7aa;
}

.flow-edge-pill.status-claimed {
  color: #0e7490;
  background: #ecfeff;
  border-color: #a5f3fc;
}

.flow-edge-pill.status-done {
  color: #15803d;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.flow-edge-pill.status-failed {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}

.flow-node {
  position: absolute;
  width: 188px;
  min-height: 104px;
  transform: translate(-50%, -50%);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  padding: 12px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  box-shadow: none;
  z-index: 2;
}

.flow-node strong {
  font-size: 16px;
  line-height: 1.2;
}

.flow-node-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.flow-node-main span {
  color: var(--muted);
  font-size: 12px;
}

.flow-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  color: #fff;
  background: linear-gradient(145deg, #4f46e5, #38bdf8);
}

.flow-node-dot {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--muted);
}

.flow-node-pending .flow-node-dot {
  background: var(--warn);
}

.flow-node-claimed {
  border-color: rgba(14, 116, 144, 0.38);
  box-shadow: 0 0 0 4px rgba(14, 116, 144, 0.08) !important;
  animation: nodePulse 1.8s ease-in-out infinite;
}

.flow-node-claimed .flow-node-dot {
  background: var(--hermes);
}

.flow-node-failed {
  border-color: rgba(185, 28, 28, 0.35);
}

.flow-node-failed .flow-node-dot {
  background: var(--danger);
}

.flow-node-thread {
  background: #ffffff;
  border-style: dashed;
  border-color: #93b4f8;
}

.flow-node-thread .flow-avatar {
  border-radius: 50%;
  background: linear-gradient(145deg, #1d4ed8, #8b5cf6);
}

.flow-node-human {
  border-color: #cfe0ff;
}

.flow-node-human .flow-avatar {
  border-radius: 999px;
  background: linear-gradient(145deg, #4f46e5, #60a5fa);
}

.flow-node-agent {
  border-color: #bfe8ef;
}

.flow-node-agent .flow-avatar {
  border-radius: 12px;
  background: linear-gradient(145deg, #0891b2, #22c55e);
  box-shadow: inset 0 -10px 18px rgba(255, 255, 255, 0.16);
}

@keyframes nodePulse {
  50% {
    box-shadow: 0 0 0 8px rgba(14, 116, 144, 0.08) !important;
  }
}

.flow-node-counts {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.flow-side {
  min-height: 0;
  overflow: auto;
  background: var(--sidebar);
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 12px;
}

.flow-side .workbench-card {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 12px 2px;
}

.flow-side .workbench-card:first-child {
  border-top: 0;
  padding-top: 2px;
}

.flow-status-card {
  border-left: 4px solid var(--line-strong);
}

.workbench-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 12px;
}

.workbench-scroll-card {
  display: grid;
  gap: 8px;
}

.metric-stack {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.metric-chip {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 7px 8px;
}

.metric-chip-label {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  margin-bottom: 3px;
}

.metric-chip-value {
  display: block;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workbench-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.workbench-tab {
  color: var(--muted);
  padding: 6px 10px;
}

.workbench-tab.active {
  color: #1d4ed8;
  border-color: #a8c4ff;
  background: #eef2ff;
  font-weight: 700;
}

.tab-panel {
  min-height: 0;
  display: grid;
  gap: 10px;
}

.stack {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 8px;
}

.stack-card,
.metric-card,
.job-control-panel {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  padding: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.025);
}

.stack-card strong,
.metric-card strong {
  display: block;
  margin-bottom: 4px;
}

.row-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 5px;
}

.token {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
}

.token.subtle {
  color: var(--muted);
  border-color: var(--line);
  background: #fff;
}

.status-pending {
  color: #b45309;
  background: #fff7ed;
  border-color: #fed7aa;
}

.status-queued {
  color: #475569;
  background: #f8fafc;
  border-color: #cbd5e1;
}

.status-claimed {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.status-done {
  color: #15803d;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.status-failed {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}

.status-archived {
  color: #475569;
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.risk-L1,
.risk-L2,
.risk-L3,
.risk-L4 {
  color: var(--text);
  background: #f8fafc;
  border-color: var(--line);
}

.risk-L3,
.risk-L4 {
  color: #b45309;
  background: #fff7ed;
  border-color: #fed7aa;
}

.blocked-no {
  color: var(--success);
}

.blocked-yes,
.error-text {
  color: var(--danger);
}

.workbench-subhead {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.job-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 150px) auto;
  gap: 8px;
  align-items: end;
}

.run-update-grid {
  grid-template-columns: minmax(120px, 1fr) minmax(0, 1.2fr) auto auto auto;
}

.danger-action {
  border-color: #fecaca;
  color: var(--danger);
}

.form-status {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.task-status-group {
  display: grid;
  gap: 7px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.task-status-group:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.task-status-head,
.task-status-list {
  display: grid;
  gap: 7px;
}

.queue-token-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.agent-queue-card {
  background: #fbfcff;
}

.inbox-item-card {
  padding: 9px;
}

/* Flatter product UI pass: keep layout, reduce visual weight. */
.app-shell {
  --bg: #f8fafc;
  --sidebar: #f3f6fa;
  --panel-2: #f6f8fb;
  --line: #e6ebf2;
  --line-strong: #cbd5e1;
  --shadow-soft: none;
  --shadow-card: none;
}

.sidebar,
.status-bar,
.conversation-info,
.app-rail {
  background: #f6f8fb;
}

.thread-row,
.sidebar-topic,
.conversation-info-card,
.conversation-member,
.conversation-topic-card,
.thread-goal-card,
.message-card,
.topic-card,
.view-card,
.workbench-card,
.stack-card,
.task-overview-card,
.asset-card,
.record-row,
.result-summary-card,
.flow-side-card,
.flow-map-card,
.contact-card,
.member-preview-card,
.topic-preview-card,
.contacts-popover,
.composer-shell,
.flow-edge-card,
.flow-node {
  box-shadow: none !important;
}

.thread-row,
.sidebar-topic,
.conversation-info-card,
.conversation-member,
.conversation-topic-card,
.thread-goal-card,
.message-card,
.topic-card,
.view-card,
.workbench-card,
.stack-card,
.task-overview-card,
.asset-card,
.record-row,
.result-summary-card,
.flow-side-card,
.contact-card,
.agent-queue-card,
.inbox-item-card,
.flow-edge-card,
.flow-node {
  border-color: #e6ebf2;
  border-radius: 10px;
  background: #fff;
}

.thread-row.active,
.sidebar-topic.active,
.conversation-topic-card.active,
.task-overview-card.active {
  background: #f4f7ff;
  border-color: #bfdbfe;
  box-shadow: inset 3px 0 0 var(--accent) !important;
}

.message-card.human {
  background: #f7faff;
  border-color: #d8e5ff;
}

.message-card.agent,
.message-card.codex,
.message-card.hermes {
  background: #fff;
}

.topic-card,
.conversation-topic-card,
.task-overview-card {
  border-left-width: 3px;
}

.composer-shell {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  border-color: #dce4ee;
}

.composer-shell.drag-over {
  background: #f4f8ff;
  box-shadow: none !important;
}

.contacts-popover,
.member-preview-card,
.topic-preview-card {
  border-radius: 12px;
  background: #fff;
  border-color: #dce4ee;
}

.agent-avatar.codex,
.agent-avatar.hermes,
.member-preview-avatar,
.node-avatar.agent,
.node-avatar.human {
  background: var(--accent);
  box-shadow: none !important;
}

.sidebar {
  background: rgba(246, 248, 251, 0.72);
  border-color: rgba(203, 213, 225, 0.58);
  backdrop-filter: blur(14px);
}

.sidebar-head,
.sidebar-section {
  background: transparent;
}

.thread-row,
.sidebar-topic {
  background: rgba(255, 255, 255, 0.68);
  border-color: rgba(203, 213, 225, 0.58);
}

.thread-row:hover,
.sidebar-topic:hover {
  background: rgba(255, 255, 255, 0.82);
}

.conversation-row.conversation-group {
  background: rgba(251, 253, 255, 0.7);
}

.conversation-row.conversation-agent {
  background: rgba(251, 254, 252, 0.7);
}

.conversation-row.conversation-human {
  background: rgba(255, 253, 249, 0.72);
}

.thread-row.active,
.sidebar-topic.active {
  background: rgba(244, 247, 255, 0.82);
}

@media (max-width: 1180px) {
  .app-shell:not(.sidebarless) {
    grid-template-columns: 56px 280px minmax(0, 1fr);
  }

  .app-shell.sidebarless {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .flow-layout {
    grid-template-columns: minmax(0, 1fr) 330px;
  }

  .status-strip {
    grid-template-columns: repeat(3, minmax(100px, 1fr));
  }
}

@media (max-width: 920px) {
  body {
    overflow: hidden;
  }

  .app-shell {
    height: 100vh;
    min-height: 0;
    width: max-content;
    min-width: 696px;
    grid-template-columns: 56px 280px minmax(640px, 1fr);
    overflow: hidden;
  }

  .app-shell.sidebarless {
    grid-template-columns: 56px minmax(640px, 1fr);
  }

  .sidebar,
  .main-pane,
  .thread-detail,
  .hub-view,
  .content-grid,
  .chat-pane,
  .conversation-info {
    min-height: 0;
  }

  .main-pane,
  .thread-detail,
  .hub-view,
  .content-grid,
  .chat-pane {
    height: 100%;
    overflow: hidden;
  }

  .conversation-info {
    height: 100%;
    overflow: auto;
  }

  .sidebar {
    width: 280px;
    max-height: calc(100vh - 32px);
  }

  .content-grid {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  .chat-pane {
    border-right: 0;
  }

  .flow-layout {
    grid-template-columns: 1fr;
  }

  .results-grid,
  .records-grid,
  .control-content,
  .inventory-grid {
    grid-template-columns: 1fr;
  }

  .inventory-overview-layout {
    grid-template-columns: 1fr;
  }

  .inventory-directory-card {
    position: static;
    width: auto;
    max-height: none;
    overflow: visible;
    box-shadow: var(--shadow-soft);
    backdrop-filter: none;
  }

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

  .inventory-overview-main {
    width: auto;
    max-width: none;
    margin: 0;
    padding-left: 0;
    padding-right: 0;
  }

  .view-header {
    display: grid;
  }

  .workbench {
    overflow: visible;
  }

  .flow-side {
    overflow: visible;
  }
}

@media (max-width: 720px) {
  .status-bar {
    grid-template-columns: 1fr;
    grid-template-areas:
      "topic"
      "stats"
      "people";
  }

  .status-strip,
  .composer-grid,
  .job-form-grid,
  .run-update-grid,
  .metric-stack,
  .record-row {
    grid-template-columns: 1fr;
  }

  .message-card {
    max-width: 100%;
  }

  .composer-shell {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }

  .composer-grid {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .message-head {
    display: grid;
  }
}


@media (max-width: 960px) {
  #inventory-overview-view,
  #inventory-supplier-view {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  #inventory-overview-view .view-content,
  #inventory-supplier-view .view-content {
    width: max-content;
    min-width: 1024px;
  }

  #inventory-overview-view .inventory-overview-main,
  #inventory-supplier-view .inventory-overview-main,
  #inventory-supplier-view .inventory-supplier-content-stack,
  #inventory-supplier-view .inventory-overview-series-card {
    width: 100%;
    min-width: 1024px;
    max-width: none;
  }

  #inventory-overview-view .inventory-overview-summary-card,
  #inventory-overview-view .inventory-overview-summary-supplier-card,
  #inventory-overview-view .inventory-watchlist-card,
  #inventory-overview-view .inventory-kpi-card,
  #inventory-overview-view .inventory-summary-card {
    min-width: 0;
  }

  #inventory-supplier-view .inventory-overview-table-wrap {
    overflow: visible;
    width: 100%;
    min-width: 1024px;
    max-width: none;
    cursor: default;
    user-select: auto;
  }

  #inventory-supplier-view .inventory-overview-table {
    --inventory-sticky-image-col: 55px;
    --inventory-sticky-product-col: 229px;
    width: 1024px;
    min-width: 1024px;
  }

  #inventory-supplier-view .inventory-series-head {
    position: sticky;
    top: 0;
    z-index: 10;
  }

  #inventory-supplier-view .inventory-overview-table th {
    position: sticky;
    top: var(--inventory-series-head-height, 46px);
    z-index: 5;
  }
}

/* ================================================== */
/* 店铺详情页：双栏布局（KPI + 左列表 + 右详情）         */
/* ================================================== */

#inventory-store-view .inventory-store-layout {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  min-width: 0;
}

#inventory-store-view .inventory-store-kpi-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  background: #f5f7ff;
  border: 1px solid #e5edf8;
  border-radius: 12px;
}

#inventory-store-view .inventory-store-kpi-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  height: 32px;
  border: 1px solid #dbe7f5;
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  font: inherit;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.05s ease;
}

#inventory-store-view .inventory-store-kpi-chip:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

#inventory-store-view .inventory-store-kpi-chip:active {
  transform: scale(0.98);
}

#inventory-store-view .inventory-store-kpi-chip.active {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
}

#inventory-store-view .inventory-store-kpi-chip.active strong {
  color: #ffffff;
}

#inventory-store-view .inventory-store-kpi-chip .inventory-store-kpi-label {
  font-size: 12px;
  font-weight: 600;
}

#inventory-store-view .inventory-store-kpi-chip strong {
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}

#inventory-store-view .inventory-store-kpi-chip.danger:not(.active) strong { color: #b91c1c; }
#inventory-store-view .inventory-store-kpi-chip.danger:not(.active) { border-color: #fecaca; background: #fef2f2; }
#inventory-store-view .inventory-store-kpi-chip.danger:not(.active):hover { background: #fee2e2; }

#inventory-store-view .inventory-store-kpi-chip.warn:not(.active) strong { color: #b45309; }
#inventory-store-view .inventory-store-kpi-chip.warn:not(.active) { border-color: #fde68a; background: #fffbeb; }
#inventory-store-view .inventory-store-kpi-chip.warn:not(.active):hover { background: #fef3c7; }

#inventory-store-view .inventory-store-kpi-chip.good:not(.active) strong { color: #15803d; }
#inventory-store-view .inventory-store-kpi-chip.good:not(.active) { border-color: #bbf7d0; background: #f0fdf4; }
#inventory-store-view .inventory-store-kpi-chip.good:not(.active):hover { background: #dcfce7; }

#inventory-store-view .inventory-store-kpi-chip.neutral:not(.active) { border-color: #e2e8f0; background: #f8fafc; }
#inventory-store-view .inventory-store-kpi-chip.combo:not(.active) strong { color: #5b21b6; }
#inventory-store-view .inventory-store-kpi-chip.combo:not(.active) { border-color: #c4b5fd; background: #f5f3ff; }
#inventory-store-view .inventory-store-kpi-chip.pack:not(.active) strong { color: #1d4ed8; }
#inventory-store-view .inventory-store-kpi-chip.pack:not(.active) { border-color: #93c5fd; background: #eff6ff; }

#inventory-store-view .inventory-store-panes {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
  align-items: start;
}

#inventory-store-view .inventory-store-sidebar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #e5edf8;
  border-radius: 12px;
  padding: 8px;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  scrollbar-gutter: stable;
}

#inventory-store-view .inventory-store-sidebar-empty,
#inventory-store-view .inventory-store-sidebar-loading {
  padding: 12px;
  color: #94a3b8;
  font-size: 12px;
  text-align: center;
}

#inventory-store-view .inventory-store-sidebar-series {
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

#inventory-store-view .inventory-store-sidebar-series-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: #f5f7ff;
  cursor: pointer;
  font: inherit;
  text-align: left;
  color: #0f172a;
  transition: background 0.1s ease;
}

#inventory-store-view .inventory-store-sidebar-series-head:hover {
  background: #eff6ff;
}

#inventory-store-view .inventory-store-sidebar-series-title {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
}

#inventory-store-view .inventory-store-sidebar-series-count {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  font-variant-numeric: tabular-nums;
  background: rgba(148, 163, 184, 0.18);
  padding: 1px 7px;
  border-radius: 999px;
}

#inventory-store-view .inventory-store-sidebar-series.collapsed .inventory-store-sidebar-series-body {
  display: none;
}

#inventory-store-view .inventory-store-sidebar-empty-inner {
  padding: 8px 12px;
  color: #94a3b8;
  font-size: 12px;
}

#inventory-store-view .inventory-store-sidebar-rows {
  display: flex;
  flex-direction: column;
  margin-top: 2px;
  max-height: 420px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

#inventory-store-view .inventory-store-sidebar-row {
  display: grid;
  grid-template-columns: 4px 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: left;
  color: #0f172a;
  border-radius: 6px;
  transition: background 0.08s ease;
}

#inventory-store-view .inventory-store-sidebar-row:hover {
  background: rgba(186, 213, 247, 0.18);
}

#inventory-store-view .inventory-store-sidebar-row.selected {
  background: #dbeafe;
}

#inventory-store-view .inventory-store-sidebar-row .inventory-store-sidebar-row-status {
  display: block;
  width: 4px;
  height: 24px;
  border-radius: 0 2px 2px 0;
  background: #cbd5e1;
}

#inventory-store-view .inventory-store-sidebar-row.status-oos .inventory-store-sidebar-row-status { background: #ef4444; }
#inventory-store-view .inventory-store-sidebar-row.status-low .inventory-store-sidebar-row-status { background: #f59e0b; }
#inventory-store-view .inventory-store-sidebar-row.status-healthy .inventory-store-sidebar-row-status { background: #22c55e; }
#inventory-store-view .inventory-store-sidebar-row.status-unmapped .inventory-store-sidebar-row-status { background: #94a3b8; }

#inventory-store-view .inventory-store-sidebar-row-sku {
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#inventory-store-view .inventory-store-sidebar-tag {
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 4px;
  white-space: nowrap;
}

#inventory-store-view .inventory-store-sidebar-tag.combo {
  background: #ede9fe;
  color: #5b21b6;
}

#inventory-store-view .inventory-store-sidebar-tag.pack {
  background: #e0f2fe;
  color: #1d4ed8;
}

#inventory-store-view .inventory-store-sidebar-row-stock {
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
  text-align: right;
  min-width: 36px;
}

#inventory-store-view .inventory-store-sidebar-row.status-oos .inventory-store-sidebar-row-stock { color: #b91c1c; }
#inventory-store-view .inventory-store-sidebar-row.status-low .inventory-store-sidebar-row-stock { color: #b45309; }

/* 右侧详情面板 */

#inventory-store-view .inventory-store-detail {
  position: relative;
  background: #ffffff;
  border: 1px solid #e5edf8;
  border-radius: 12px;
  padding: 14px 16px;
  min-height: 300px;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
}

#inventory-store-view .inventory-store-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 100%;
  min-height: 240px;
  color: #94a3b8;
  font-size: 13px;
}

#inventory-store-view .inventory-store-empty strong {
  color: #475569;
  font-size: 14px;
  font-weight: 700;
}

#inventory-store-view .inventory-store-detail-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#inventory-store-view .inventory-store-detail-head {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 14px;
  align-items: start;
  padding-bottom: 12px;
  border-bottom: 1px solid #eef2f7;
}

#inventory-store-view .inventory-store-detail-image .inventory-overview-image,
#inventory-store-view .inventory-store-detail-image img {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
}

#inventory-store-view .inventory-store-detail-sku-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

#inventory-store-view .inventory-store-detail-sku-line > strong {
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
  color: #0f172a;
}

#inventory-store-view .inventory-store-detail-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

#inventory-store-view .inventory-store-detail-tag.combo {
  background: #ede9fe;
  border: 1px solid #c4b5fd;
  color: #5b21b6;
}

#inventory-store-view .inventory-store-detail-tag.pack {
  background: #e0f2fe;
  border: 1px solid #93c5fd;
  color: #1d4ed8;
}

#inventory-store-view .inventory-store-detail-asin,
#inventory-store-view .inventory-store-detail-series {
  font-size: 12px;
  color: #64748b;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
}

#inventory-store-view .inventory-store-detail-title {
  font-size: 12px;
  color: #475569;
  line-height: 1.3;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#inventory-store-view .inventory-store-detail-actions {
  align-self: start;
}

#inventory-store-view .inventory-store-detail-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#inventory-store-view .inventory-store-detail-block-head h6 {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#inventory-store-view .inventory-store-detail-block.primary {
  background: #f5f7ff;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  padding: 12px;
}

#inventory-store-view .inventory-store-detail-stock {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 18px;
  align-items: center;
}

#inventory-store-view .inventory-store-detail-stock-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#inventory-store-view .inventory-store-detail-stock-big {
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}

#inventory-store-view .inventory-store-detail-stock-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}

#inventory-store-view .inventory-store-detail-stock-side {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 14px;
}

#inventory-store-view .inventory-store-detail-stock-side > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

#inventory-store-view .inventory-store-detail-stock-side span {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
}

#inventory-store-view .inventory-store-detail-stock-side strong {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

#inventory-store-view .inventory-store-detail-component-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#inventory-store-view .inventory-store-detail-component {
  border: 1px solid #e5edf8;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fbfdff;
}

#inventory-store-view .inventory-store-detail-component-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

#inventory-store-view .inventory-store-detail-component-head strong {
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
  color: #0f172a;
  word-break: break-all;
}

#inventory-store-view .inventory-store-detail-component-qty {
  font-size: 12px;
  font-weight: 800;
  color: #5b21b6;
  font-variant-numeric: tabular-nums;
}

#inventory-store-view .inventory-store-detail-component-pc {
  font-size: 11px;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

#inventory-store-view .inventory-store-detail-component-stocks {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px 12px;
}

#inventory-store-view .inventory-store-detail-component-stocks > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

#inventory-store-view .inventory-store-detail-component-stocks span {
  font-size: 10.5px;
  color: #64748b;
  font-weight: 600;
}

#inventory-store-view .inventory-store-detail-component-stocks strong {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

#inventory-store-view .inventory-store-detail-sales-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px 14px;
}

#inventory-store-view .inventory-store-detail-sales-grid > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

#inventory-store-view .inventory-store-detail-sales-grid span {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
}

#inventory-store-view .inventory-store-detail-sales-grid strong {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

#inventory-store-view .inventory-store-detail-popover-wrap {
  position: relative;
  margin-top: 6px;
}

#inventory-store-view .inventory-store-detail-popover-wrap .inventory-price-popover {
  position: static;
}

@media (max-width: 1080px) {
  #inventory-store-view .inventory-store-panes {
    grid-template-columns: 1fr;
  }
  #inventory-store-view .inventory-store-sidebar,
  #inventory-store-view .inventory-store-detail {
    max-height: none;
  }
  #inventory-store-view .inventory-store-detail-sales-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  #inventory-store-view .inventory-store-detail-component-stocks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ── 定时任务控制面板 ────────────────────────────────── */
#cron-view {
  padding: 32px 40px;
  max-width: 860px;
  margin: 0 auto;
}
.cron-loading,
.cron-error,
.cron-empty {
  padding: 48px 0;
  text-align: center;
  color: var(--slate-500, #64748b);
  font-size: 14px;
}
.cron-error { color: #dc2626; }
.cron-panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.cron-panel-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--slate-900, #0f172a);
  margin: 0;
}
.cron-panel-count {
  font-size: 12px;
  color: var(--slate-500, #64748b);
  background: var(--slate-100, #f1f5f9);
  padding: 2px 8px;
  border-radius: 999px;
}
.cron-refresh-btn {
  margin-left: auto;
}
.cron-job-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cron-job-card {
  background: #fff;
  border: 1px solid var(--slate-200, #e2e8f0);
  border-radius: 10px;
  padding: 14px 16px;
  transition: box-shadow .15s ease;
}
.cron-job-card:hover {
  box-shadow: 0 4px 12px rgba(15,23,42,.06);
}
.cron-job-card.disabled {
  opacity: .6;
  background: var(--slate-50, #f8fafc);
}
.cron-job-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.cron-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cron-status-dot.on  { background: #22c55e; box-shadow: 0 0 0 2px rgba(34,197,94,.2); }
.cron-status-dot.off { background: var(--slate-300, #cbd5e1); }
.cron-job-info {
  min-width: 0;
}
.cron-job-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--slate-900, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cron-job-schedule {
  font-size: 11.5px;
  color: var(--slate-500, #64748b);
  margin-top: 1px;
}
.cron-job-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.cron-action-btn {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .12s, border-color .12s;
  white-space: nowrap;
}
.cron-action-btn.run {
  background: var(--indigo-50, #eef2ff);
  color: var(--indigo-600, #4f46e5);
  border-color: var(--indigo-200, #c7d2fe);
}
.cron-action-btn.run:hover {
  background: var(--indigo-600, #4f46e5);
  color: #fff;
}
.cron-action-btn.log {
  background: var(--slate-100, #f1f5f9);
  color: var(--slate-700, #334155);
  border-color: var(--slate-200, #e2e8f0);
}
.cron-action-btn.log:hover {
  background: var(--slate-200, #e2e8f0);
}
.cron-action-btn.pause {
  background: #fff7ed;
  color: #ea580c;
  border-color: #fed7aa;
}
.cron-action-btn.pause:hover {
  background: #ea580c;
  color: #fff;
}
.cron-action-btn.resume {
  background: #f0fdf4;
  color: #16a34a;
  border-color: #bbf7d0;
}
.cron-action-btn.resume:hover {
  background: #16a34a;
  color: #fff;
}
.cron-job-command {
  font-size: 11px;
  font-family: ui-monospace, "SF Mono", monospace;
  color: var(--slate-500, #64748b);
  margin-top: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 4px 8px;
  background: var(--slate-50, #f8fafc);
  border-radius: 4px;
}
.cron-log-panel {
  margin-top: 10px;
  border-top: 1px solid var(--slate-100, #f1f5f9);
  padding-top: 10px;
}
.cron-log-path {
  font-size: 10.5px;
  color: var(--slate-400, #94a3b8);
  font-family: ui-monospace, "SF Mono", monospace;
  margin-bottom: 6px;
}
.cron-log-pre {
  font-size: 11px;
  font-family: ui-monospace, "SF Mono", monospace;
  color: var(--slate-700, #334155);
  background: var(--slate-900, #0f172a);
  color: #e2e8f0;
  padding: 12px 14px;
  border-radius: 6px;
  overflow-x: auto;
  white-space: pre;
  max-height: 320px;
  overflow-y: auto;
  margin: 0;
  line-height: 1.6;
}
