:root {
  --sidebar-width: clamp(168px, 12vw, 220px);
  --page-padding: clamp(12px, 1.4vw, 24px);
  --panel-radius: 8px;
  --bg: #edf4f8;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #64748b;
  --line: #dbe4f0;
  --blue: #2563eb;
  --blue-soft: #eaf2ff;
  --green: #059669;
  --red: #dc2626;
  --amber: #d97706;
  --shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 18px 48px rgba(15, 23, 42, 0.09);
}

* {
  box-sizing: border-box;
}

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

body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, #f6fbff 0, var(--bg) 280px),
    var(--bg);
  color: var(--ink);
  font-family: Arial, "Microsoft YaHei", "PingFang SC", sans-serif;
}

body:not(.authenticated) .sidebar,
body:not(.authenticated) .sidebar-toggle,
body:not(.authenticated) .sidebar-resize-handle,
body:not(.authenticated) .main {
  display: none;
}

body.authenticated .login-screen {
  display: none;
}

body.system-alert-open {
  overflow: hidden;
}

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

.login-screen {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #edf4f8;
}

.login-card {
  width: min(400px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.login-brand {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0;
  text-align: center;
}

.login-card h1 {
  margin: 6px 0 0;
  font-size: 22px;
  text-align: center;
}

.login-card p {
  margin: 10px 0 26px;
  color: var(--muted);
  font-size: 15px;
  text-align: center;
}

.login-card label {
  display: block;
  margin-bottom: 16px;
}

.login-card input {
  height: 48px;
  border-radius: 8px;
  background: #fff;
  font-size: 15px;
}

.login-card .btn {
  width: 100%;
  height: 52px;
  margin-top: 6px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  font-size: 17px;
  box-shadow: none;
}

.login-card .btn:hover {
  background: #1d4ed8;
  box-shadow: none;
}

@media (max-width: 900px) {
  .login-screen {
    padding: 20px;
  }
}

@media (max-width: 520px) {
  .login-screen {
    padding: 16px;
  }

  .login-card {
    border-radius: 8px;
    padding: 22px;
  }
}

.login-error {
  margin-top: 12px;
  border: 1px solid #fecaca;
  border-radius: 6px;
  background: #fef2f2;
  padding: 10px 12px;
  color: var(--red);
  font-weight: 800;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0, #f8fbff 100%);
  overflow-y: auto;
  padding-bottom: 18px;
  overflow-x: hidden;
  box-shadow: 8px 0 28px rgba(15, 23, 42, 0.035);
  transition: transform 0.18s ease;
}

.brand {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.09), rgba(5, 150, 105, 0.06)),
    #fff;
}

.brand-title {
  font-size: 19px;
  font-weight: 900;
}

.brand-sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

nav {
  padding: 12px 10px 18px;
}

.nav-group-title {
  margin: 16px 10px 7px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

nav a {
  position: relative;
  display: flex;
  height: 40px;
  align-items: center;
  padding: 0 12px;
  border-radius: 6px;
  color: #334155;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

nav a:hover {
  background: #f1f6fb;
  color: #0f172a;
  transform: translateX(1px);
}

nav a.active {
  background: linear-gradient(90deg, var(--blue-soft), #f8fbff);
  color: #1d4ed8;
  box-shadow: inset 3px 0 0 var(--blue), 0 8px 18px rgba(37, 99, 235, 0.08);
}

nav a.permission-hidden {
  display: none;
}

.main {
  min-width: 0;
  width: calc(100% - var(--sidebar-width));
  max-width: none;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding: var(--page-padding);
  transition: margin-left 0.18s ease, width 0.18s ease;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 2px 0 4px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  font-size: 18px;
}

.topbar p,
.panel-head p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
}

.page-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.help-guide-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #2563eb;
  cursor: pointer;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.help-guide-btn:hover {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.12);
}

.help-guide-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.34);
}

.help-guide-modal {
  position: relative;
  width: min(680px, 100%);
  max-height: min(76vh, 720px);
  overflow-y: auto;
  border: 1px solid #dbe5ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
  padding: 22px;
}

.help-guide-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid #dbe5ef;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.help-guide-close:hover {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.help-guide-kicker {
  margin-bottom: 8px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 900;
}

.help-guide-modal h2 {
  padding-right: 40px;
  font-size: 22px;
}

.help-guide-modal p {
  margin-top: 8px;
  color: #475569;
  line-height: 1.65;
}

.help-guide-steps {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.system-alert-overlay {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.58);
}

.system-alert-modal {
  position: relative;
  width: min(560px, 100%);
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-top: 4px solid #f59e0b;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.32);
}

.system-alert-header {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 22px;
}

.system-alert-title-wrap {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.system-alert-warning-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
}

.system-alert-title-wrap h2 {
  margin: 0;
  color: #0f172a;
  font-size: 21px;
  font-weight: 900;
  line-height: 1.2;
}

.system-alert-only-reminder {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  background: #fff7ed;
  padding: 0 10px;
  color: #c2410c;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.system-alert-close {
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.system-alert-close:hover {
  background: #f1f5f9;
}

.system-alert-close img {
  width: 22px;
  height: 22px;
}

.system-alert-product {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 14px 22px 0;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #f8fafc;
  padding: 10px 12px;
}

.system-alert-product-image {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  object-fit: cover;
}

.system-alert-product-copy {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.system-alert-product-copy strong {
  overflow: hidden;
  color: #111827;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-alert-product-copy span {
  overflow: hidden;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-alert-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 12px 22px 0;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

.system-alert-metric {
  display: grid;
  min-width: 0;
  gap: 7px;
  padding: 14px 18px;
}

.system-alert-metric + .system-alert-metric {
  border-left: 1px solid #e2e8f0;
}

.system-alert-metric span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.system-alert-metric strong {
  color: #dc2626;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.system-alert-metric:first-child strong {
  color: #d97706;
}

.system-alert-message {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin: 16px 22px 0;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  background: #fff7ed;
  padding: 14px 16px;
}

.system-alert-message > img {
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

.system-alert-message strong {
  display: block;
  color: #9a3412;
  font-size: 14px;
  font-weight: 900;
}

.system-alert-message p {
  margin: 7px 0 0;
  color: #7c2d12;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.65;
}

.system-alert-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) 1.3fr;
  gap: 8px;
  padding: 18px 22px 14px;
}

.system-alert-actions .btn {
  min-width: 0;
  height: 42px;
  padding: 0 10px;
  font-size: 13px;
  white-space: nowrap;
}

.system-alert-secondary {
  border-color: #cbd5e1;
  color: #334155;
}

.system-alert-actions .btn.system-alert-attention {
  border-color: #fecaca;
  color: #dc2626;
}

.system-alert-actions .btn.system-alert-attention:hover {
  border-color: #fca5a5;
  background: #fff1f2;
  color: #b91c1c;
}

.system-alert-primary {
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

.system-alert-footnote {
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 10px 22px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

@media (max-width: 680px) {
  .system-alert-overlay {
    align-items: flex-end;
    padding: 12px;
  }

  .system-alert-modal {
    width: 100%;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
  }

  .system-alert-header,
  .system-alert-product {
    padding-right: 16px;
    padding-left: 16px;
  }

  .system-alert-product {
    margin-right: 16px;
    margin-left: 16px;
  }

  .system-alert-metrics,
  .system-alert-message {
    margin-right: 16px;
    margin-left: 16px;
  }

  .system-alert-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-right: 16px;
    padding-left: 16px;
  }

  .system-alert-primary {
    grid-column: 1 / -1;
  }
}

.help-guide-step {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.help-guide-step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
}

.help-guide-step strong {
  display: block;
  color: #0f172a;
  font-size: 14px;
}

.help-guide-step span {
  display: block;
  margin-top: 4px;
  color: #475569;
  font-size: 13px;
  line-height: 1.55;
}

.top-actions {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.store-switcher {
  display: inline-flex;
  min-width: 176px;
  height: 40px;
  align-items: center;
  gap: 8px;
  border: 1px solid #cbd9ee;
  border-radius: 7px;
  background: #fff;
  padding: 0 9px 0 11px;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.store-switcher:hover {
  border-color: #93b4e8;
  background: #f8fbff;
}

.store-switcher-label {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.store-live-dot {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #059669;
  box-shadow: 0 0 0 3px #d8f5e9;
}

.store-switcher select {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: 30px;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 0 22px 0 0;
  color: #0f172a;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

.store-switcher:focus-within {
  border-color: #4f83db;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.account-actions,
.utility-actions {
  display: inline-flex;
  height: 40px;
  align-items: center;
}

.account-actions {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.utility-actions {
  gap: 6px;
}

body.store-switching {
  cursor: wait;
}

body.store-switching .main,
body.store-switching .sidebar {
  pointer-events: none;
}

body.store-switching .store-live-dot {
  background: #2563eb;
  box-shadow: 0 0 0 3px #dbeafe;
  animation: store-switch-pulse 0.8s ease-in-out infinite alternate;
}

@keyframes store-switch-pulse {
  to {
    opacity: 0.38;
    transform: scale(0.75);
  }
}

.auth-user {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  border: 0;
  background: transparent;
  padding: 0 11px;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.account-actions .topbar-quiet-btn {
  height: 26px;
  border: 0;
  border-left: 1px solid #e2e8f0;
  border-radius: 0;
  background: transparent;
  padding: 0 10px;
  color: #64748b;
  font-size: 12px;
}

.account-actions .topbar-quiet-btn:hover {
  background: #f8fafc;
  color: #dc2626;
}

.utility-actions .btn {
  padding: 0 12px;
}

.topbar-quiet-btn {
  color: #475569;
}

.topbar-export-btn {
  border-color: #c9d8ee;
  background: #f6f9fd;
  color: #1e3a5f;
}

.topbar-export-btn:hover {
  border-color: #8ba9d3;
  background: #edf4fc;
  color: #15365f;
}

.btn {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 0 16px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.btn:hover {
  border-color: #bfdbfe;
  background: #f8fbff;
  color: #1d4ed8;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
}

.btn.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.btn.primary:hover {
  border-color: #1d4ed8;
  background: #1d4ed8;
  color: #fff;
}

.install-app-btn {
  border-color: #bbf7d0;
  background: #ecfdf5;
  color: #047857;
}

.install-app-btn:hover {
  border-color: #86efac;
  background: #dcfce7;
  color: #065f46;
}

.btn:disabled {
  cursor: wait;
  opacity: 0.65;
}

.panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(clamp(150px, 12vw, 190px), 1fr));
  gap: 14px;
  padding: 18px;
  margin-bottom: 16px;
}

.date-shortcuts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  align-self: end;
}

.date-shortcuts button {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #0f172a;
  font-weight: 800;
  cursor: pointer;
}

.date-shortcuts button:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #eff6ff;
}

label span {
  display: block;
  margin-bottom: 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 0 11px;
  color: var(--ink);
  outline: none;
}

input,
select {
  height: 40px;
}

textarea {
  min-height: 82px;
  padding-top: 10px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.notice {
  max-width: 100%;
  margin-bottom: 16px;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-word;
}

.notice.ok {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: var(--green);
}

.notice.error {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: var(--red);
}

.assignment-alert,
.final-price-alert {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  padding: 12px 14px;
  color: #9a3412;
  font-size: 14px;
  font-weight: 800;
}

.assignment-alert .sub,
.final-price-alert .sub {
  margin-top: 5px;
  color: #9a3412;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.assignment-alert .btn,
.final-price-alert .btn {
  flex: 0 0 auto;
  height: 34px;
  border-color: #fdba74;
}

.assignment-alert {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1e40af;
}

.assignment-alert .sub {
  color: #1e40af;
}

.assignment-alert .btn {
  border-color: #93c5fd;
}

.assignment-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  max-height: 310px;
  overflow: auto;
}

.assignment-item {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 0.9fr);
  gap: 10px;
  align-items: center;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
}

.assignment-meta {
  min-width: 0;
}

.assignment-meta strong {
  display: block;
  overflow: hidden;
  color: #0f172a;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assignment-meta span {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assignment-bind {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.assignment-bind input {
  width: 100%;
  height: 34px;
}

.hidden {
  display: none !important;
}

body:not([data-view-mode="ads"]) #assignmentAlert,
body:not([data-view-mode="ads"]) #finalPriceAlert,
body:not([data-view-mode="ads"]) #diagnosticPanel,
body:not([data-view-mode="ads"]) #metaOnsiteCorrectionBar {
  display: none !important;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(clamp(150px, 12vw, 190px), 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.config-panel {
  margin-bottom: 16px;
}

.diagnostic-panel {
  margin-bottom: 16px;
}

.diagnostic-body {
  padding: 16px 18px;
}

.diagnostic-summary {
  margin-bottom: 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  padding: 14px;
}

.diagnostic-summary b {
  display: block;
  margin-bottom: 8px;
  color: #1e40af;
  font-size: 16px;
}

.diagnostic-summary ul {
  margin: 0;
  padding-left: 20px;
  color: #334155;
}

.diagnostic-summary li + li {
  margin-top: 4px;
}

.visible-accounts {
  margin-top: 14px;
}

.visible-accounts h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.account-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}

.account-chip {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
  font-size: 13px;
}

.account-chip b {
  display: block;
  margin-bottom: 4px;
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  padding: 18px;
}

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

.meta-account-config {
  min-width: 0;
  border: 1px solid #d7e1ed;
  border-radius: 12px;
  background: #f8fafc;
  overflow: hidden;
}

.meta-account-config-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid #d7e1ed;
  background: #fff;
}

.meta-account-config-head h3 {
  margin: 0;
  color: #172033;
  font-size: 16px;
}

.meta-account-config-head p {
  max-width: 72ch;
  margin: 5px 0 0;
  color: #637188;
  font-size: 12px;
  line-height: 1.55;
}

.meta-account-add {
  flex: 0 0 auto;
  border-color: #9bbcf4;
  background: #edf4ff;
  color: #174fc7;
}

.meta-account-rows {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.meta-account-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(210px, 1fr) minmax(260px, 1.45fr) 116px auto;
  gap: 10px;
  align-items: end;
  min-width: 0;
  border: 1px solid #d7e1ed;
  border-radius: 10px;
  background: #fff;
  padding: 12px;
  transition: border-color 160ms ease-out, background-color 160ms ease-out;
}

.meta-account-row.is-disabled {
  background: #f5f7fa;
}

.meta-account-row label {
  min-width: 0;
}

.meta-account-row label > span {
  margin-bottom: 6px;
  font-size: 11px;
}

.meta-account-row input,
.meta-account-row select {
  height: 38px;
}

.meta-account-token-field {
  position: relative;
}

.meta-account-token-state {
  display: block;
  min-height: 17px;
  margin-top: 5px;
  color: #62728a;
  font-size: 10px;
  line-height: 1.4;
}

.meta-account-token-state.is-configured {
  color: #087a50;
  font-weight: 800;
}

.meta-account-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 22px;
}

.meta-account-row-actions button {
  min-width: 54px;
  height: 34px;
  border: 1px solid #cbd7e5;
  border-radius: 7px;
  background: #fff;
  color: #42526a;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.meta-account-row-actions button:hover {
  border-color: #8fb0e5;
  color: #174fc7;
}

.meta-account-row-actions .remove-meta-account:hover {
  border-color: #efb2b6;
  background: #fff5f5;
  color: #b4232a;
}

.meta-account-row-actions button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.meta-account-security {
  margin: 0;
  border-top: 1px solid #d7e1ed;
  padding: 10px 18px;
  color: #62728a;
  font-size: 11px;
  line-height: 1.55;
}

.meta-account-empty {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: center;
  border: 1px dashed #b8c6d8;
  border-radius: 10px;
  background: #fff;
  color: #62728a;
  font-size: 12px;
}

.openai-config-section {
  margin: 18px;
  border: 1px solid #c7d2fe;
  border-radius: 14px;
  background:
    radial-gradient(circle at 100% 0, rgba(99, 102, 241, 0.11), transparent 32%),
    linear-gradient(145deg, #ffffff 0%, #f8faff 100%);
  padding: 18px;
  box-shadow: 0 10px 28px rgba(79, 70, 229, 0.08);
}

.openai-config-head,
.openai-config-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.openai-config-head h3 {
  margin: 4px 0 6px;
  color: #172554;
  font-size: 18px;
}

.openai-config-head p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.openai-config-eyebrow {
  color: #4f46e5;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.openai-config-status {
  flex: 0 0 auto;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  padding: 7px 12px;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}

.openai-config-status.success {
  border-color: #86efac;
  background: #ecfdf5;
  color: #047857;
}

.openai-config-status.error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #dc2626;
}

.openai-config-status.configured {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.openai-config-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.4fr) minmax(220px, 0.6fr);
  gap: 14px;
  margin-top: 16px;
}

.openai-config-grid label {
  min-width: 0;
}

.openai-config-grid small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.openai-config-footer {
  align-items: center;
  margin-top: 16px;
}

.openai-config-meta {
  color: #475569;
  font-size: 12px;
  line-height: 1.6;
}

.openai-config-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.openai-security-note {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  border-top: 1px solid #e0e7ff;
  padding-top: 12px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.6;
}

.openai-security-note b {
  flex: 0 0 auto;
  color: #4338ca;
}

.field-hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.config-actions {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.config-actions span {
  color: var(--muted);
  font-size: 13px;
}

.main > .config-panel,
.main > .log-panel,
.main > .permission-panel {
  margin-bottom: 16px;
}

.permission-layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 18px;
  padding: 18px;
  border-top: 1px solid var(--line);
}

.permission-form,
.permission-right {
  min-width: 0;
}

.permission-form h3,
.permission-right h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.permission-form label {
  display: block;
  margin-bottom: 12px;
}

.permission-form .inline-check {
  display: flex;
  gap: 8px;
  align-items: center;
}

.permission-form .inline-check input {
  width: auto;
}

.permission-form .inline-check span {
  margin: 0;
}

.permission-actions {
  display: flex;
  gap: 10px;
}

.permission-actions .btn {
  flex: 1;
}

.permission-checks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.permission-checks label {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  padding: 0 10px;
  font-weight: 800;
}

.permission-checks input {
  width: auto;
}

.permission-checks span {
  margin: 0;
}

.permission-table-wrap {
  border-top: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

@media (max-width: 820px) {
  .meta-account-config-head {
    align-items: stretch;
    flex-direction: column;
  }

  .meta-account-add {
    width: 100%;
  }

  .meta-account-row {
    grid-template-columns: 1fr;
  }

  .meta-account-row-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding-bottom: 0;
  }

  .meta-account-row-actions button {
    width: 100%;
  }

  .openai-config-section {
    margin: 12px;
    padding: 14px;
  }

  .openai-config-head,
  .openai-config-footer {
    display: grid;
    grid-template-columns: 1fr;
  }

  .openai-config-grid {
    grid-template-columns: 1fr;
  }

  .openai-config-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .openai-config-actions .btn {
    width: 100%;
  }

  .permission-layout {
    grid-template-columns: 1fr;
  }
}

.config-section-label {
  border-top: 1px solid var(--line);
  padding: 14px 18px 0;
  color: #334155;
  font-size: 13px;
  font-weight: 900;
}

.config-panel .panel-head + .config-section-label {
  border-top: 0;
}

.config-log-table {
  max-height: min(62vh, 640px);
  overflow: auto;
}

.meta-usage-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  margin: 0 18px 12px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
  padding: 10px 12px;
  color: #166534;
  font-size: 13px;
  line-height: 1.45;
}

.meta-usage-panel.warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.meta-usage-panel.danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.meta-usage-panel.muted {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #475569;
}

.meta-usage-badge {
  display: inline-flex;
  align-items: center;
  min-width: 68px;
  justify-content: center;
  border-radius: 999px;
  background: #dcfce7;
  padding: 3px 8px;
  color: #166534;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.meta-usage-badge.warning {
  background: #fef3c7;
  color: #92400e;
}

.meta-usage-badge.danger {
  background: #fee2e2;
  color: #b91c1c;
}

.meta-usage-badge.muted {
  background: #f1f5f9;
  color: #64748b;
}


.sidebar .config-panel,
.sidebar .log-panel {
  margin: 12px;
  border-radius: 8px;
  box-shadow: none;
}

.sidebar .config-panel .panel-head,
.sidebar .log-panel .panel-head {
  display: block;
  padding: 14px;
}

.sidebar .config-panel h2,
.sidebar .log-panel h2 {
  font-size: 16px;
}

.sidebar .config-panel .panel-head p,
.sidebar .log-panel .panel-head p {
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.45;
}

.sidebar .config-panel .account-info {
  max-width: none;
  margin-top: 8px;
  text-align: left;
  font-size: 12px;
}

.sidebar .config-grid {
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 14px;
}

.sidebar .config-grid .wide,
.sidebar .config-actions {
  grid-column: auto;
}

.sidebar .config-actions {
  display: grid;
  gap: 8px;
  align-items: stretch;
}

.sidebar .config-actions .btn {
  width: 100%;
}

.sidebar .config-actions span {
  font-size: 12px;
  line-height: 1.45;
}

.sidebar label span {
  margin-bottom: 5px;
  font-size: 12px;
}

.sidebar input,
.sidebar select {
  height: 34px;
}

.sidebar textarea {
  min-height: 62px;
}

.sidebar #accountIdsInput {
  min-height: 58px;
}

.sidebar #coupangMatchRules {
  min-height: 86px;
}

.sidebar .config-section-label {
  border-top: 1px solid var(--line);
  padding: 12px 14px 0;
  color: #334155;
  font-size: 13px;
  font-weight: 900;
}

.sidebar .config-panel .panel-head + .config-section-label {
  border-top: 0;
}

.sidebar .config-log-table {
  max-height: 360px;
  margin-top: 10px;
  overflow: auto;
}

.sidebar .config-log-table table {
  min-width: 640px;
  table-layout: fixed;
  font-size: 12px;
}

.sidebar .config-log-table th,
.sidebar .config-log-table td {
  overflow: hidden;
  padding: 8px;
  text-overflow: ellipsis;
}

.sidebar .config-log-table th:nth-child(1) { width: 120px; }
.sidebar .config-log-table th:nth-child(2) { width: 42px; }
.sidebar .config-log-table th:nth-child(3) { width: 56px; }
.sidebar .config-log-table th:nth-child(4) { width: 52px; }
.sidebar .config-log-table th:nth-child(5) { width: 66px; }
.sidebar .config-log-table th:nth-child(6) { width: 88px; }
.sidebar .config-log-table th:nth-child(7) { width: 216px; }

.card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff 0, #fbfdff 100%);
  padding: clamp(12px, 1vw, 16px);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.035);
}

.card span {
  color: var(--muted);
  font-size: 13px;
}

.card b {
  display: block;
  margin-top: 9px;
  font-size: clamp(18px, 1.45vw, 24px);
  line-height: 1.1;
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff 0, #fbfdff 100%);
  padding: 16px 18px;
}

.panel-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.account-info {
  max-width: 420px;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

#accountInfo {
  max-width: min(760px, 100%);
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8fafc;
  color: #52627a;
  line-height: 1.45;
}

#accountInfo.combined-account-context {
  border-color: #b9e6ce;
  background: #effcf5;
  color: #16724a;
}

#accountInfo.meta-only-account-context {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #245aa5;
}

.ad-account-cell {
  min-width: 154px;
}

.ad-account-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 9px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #245aa5;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.ad-account-badge.manual {
  border-color: #d8dee9;
  background: #f5f7fa;
  color: #5b677a;
}

.attribution-muted {
  color: #94a3b8;
  font-weight: 700;
}

body[data-view-mode="ads"] .product-frozen-head {
  position: sticky;
  top: 0;
  z-index: 55;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

body[data-view-mode="ads"] #productGroupsPanel {
  overflow: visible;
}

body[data-view-mode="ads"] #filtersPanel {
  gap: 10px;
  margin-bottom: 10px;
  padding: 12px 14px;
}

body[data-view-mode="ads"] #filtersPanel label span {
  margin-bottom: 5px;
  font-size: 12px;
}

body[data-view-mode="ads"] #filtersPanel input,
body[data-view-mode="ads"] #filtersPanel select {
  height: 36px;
}

body[data-view-mode="ads"] .assignment-alert,
body[data-view-mode="ads"] .final-price-alert {
  margin-bottom: 10px;
  padding: 10px 12px;
  font-size: 13px;
}

body[data-view-mode="ads"] .ad-summary-cards {
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

body[data-view-mode="ads"] .ad-summary-cards .card {
  padding: 10px 12px;
  box-shadow: none;
}

body[data-view-mode="ads"] .ad-summary-cards .card span {
  font-size: 12px;
}

body[data-view-mode="ads"] .ad-summary-cards .card b {
  margin-top: 6px;
  font-size: 19px;
}

body[data-view-mode="ads"] .ad-summary-cards .card small {
  display: block;
  min-height: 14px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
}

body[data-view-mode="ads"] #productGroupsPanel .panel-head {
  min-height: 50px;
  padding: 9px 14px;
}

body[data-view-mode="ads"] #productGroupsPanel .panel-head h2 {
  font-size: 17px;
}

.product-view-actions,
.product-view-settings {
  position: relative;
}

.product-view-settings > summary {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eff6ff;
  padding: 0 12px;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.product-view-settings > summary::-webkit-details-marker {
  display: none;
}

.product-view-settings[open] > summary {
  border-color: #60a5fa;
  background: #dbeafe;
}

.product-view-settings-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 8px);
  right: 0;
  width: min(560px, 84vw);
  max-height: min(640px, 72vh);
  overflow: auto;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
}

.product-view-settings-title {
  margin: 10px 0 8px;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}

.product-view-settings-title:first-child {
  margin-top: 0;
}

.product-view-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.product-view-presets button {
  min-width: 58px;
  height: 32px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #334155;
  font-weight: 800;
  cursor: pointer;
}

.product-view-presets button:hover,
.product-view-presets button.active {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.product-view-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px 10px;
}

.product-view-options label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.product-view-options label span {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-view-options input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  min-height: 0;
}

.product-column-hidden {
  display: none !important;
}

.product-roi-panel {
  margin: 12px 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  overflow: hidden;
}

.product-roi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
}

.product-roi-title {
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
}

.product-roi-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  padding: 12px 14px;
}

.product-roi-cards > div {
  border: 1px solid #dbe5f1;
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

.product-roi-cards > div.product-roi-primary {
  border-color: #93c5fd;
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
}

.product-roi-cards span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.product-roi-cards b {
  display: block;
  margin-top: 6px;
  color: #0f172a;
  font-size: 19px;
  line-height: 1.1;
}

.product-roi-primary b {
  color: #1d4ed8;
}

.product-roi-periods {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
  padding: 0 14px 14px;
}

.product-roi-period-card {
  min-width: 0;
  border: 1px solid #dbe5f1;
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

.product-roi-period-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.product-roi-period-card b {
  display: block;
  margin-top: 6px;
  color: #0f172a;
  font-size: 20px;
  line-height: 1.1;
}

.product-roi-period-card small {
  display: block;
  margin-top: 7px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
}

.product-roi-chart {
  margin: 0 14px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.product-roi-chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.product-roi-chart-head strong {
  display: block;
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
}

.product-roi-chart-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.product-roi-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  justify-content: flex-end;
}

.product-roi-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #334155;
  white-space: nowrap;
}

.product-roi-chart-legend i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.product-roi-chart-svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 260px;
}

.product-roi-chart-grid {
  stroke: #e2e8f0;
  stroke-width: 1;
}

.product-roi-chart-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.product-roi-chart-label {
  fill: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.product-roi-sections {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
  padding: 0 14px 14px;
}

.product-roi-section {
  min-width: 0;
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.product-roi-section-title {
  border-bottom: 1px solid #e2e8f0;
  padding: 9px 10px;
  color: #334155;
  font-size: 13px;
  font-weight: 900;
}

.product-roi-table {
  min-width: 560px;
  font-size: 12px;
}

.product-roi-table th,
.product-roi-table td {
  padding: 8px 10px;
}

.manual-spend-cell {
  min-width: 180px;
}

.manual-spend-editor {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}

.manual-ad-spend-input {
  width: 86px;
  height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 1900px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

th {
  border-bottom: 1px solid var(--line);
  background: #f7fafd;
  padding: 11px 12px;
  color: #475569;
  font-weight: 900;
  text-align: left;
  white-space: nowrap;
}

.has-tip {
  cursor: help;
  text-decoration: underline dotted rgba(71, 85, 105, 0.55);
  text-underline-offset: 3px;
}

.hover-tip {
  position: fixed;
  z-index: 99999;
  max-width: min(320px, calc(100vw - 24px));
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.96);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.24);
  color: #fff;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.hover-tip.show {
  opacity: 1;
  transform: translateY(0);
}

td {
  border-bottom: 1px solid #edf2f7;
  padding: 11px 12px;
  vertical-align: middle;
  white-space: nowrap;
}

tr:hover td {
  background: #f8fbff;
}

.name {
  max-width: 320px;
  white-space: normal;
  font-weight: 800;
}

.sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.status {
  display: inline-flex;
  align-items: center;
  height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: #f1f5f9;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.status.active {
  background: #dcfce7;
  color: var(--green);
}

.status.paused {
  background: #fef3c7;
  color: var(--amber);
}

.status.pending {
  background: #dbeafe;
  color: #2563eb;
}

.status.deleted,
.status.archived {
  background: #fee2e2;
  color: var(--red);
}

.num {
  font-variant-numeric: tabular-nums;
}

.empty {
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.compact table {
  min-width: 1050px;
}

.trend-panel {
  margin-bottom: 16px;
}

.external-system-panel {
  margin-bottom: 16px;
}

.robot-design-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}

.robot-design-grid div {
  min-width: 0;
  padding: 12px;
  border: 1px solid #dbe5f1;
  border-radius: 8px;
  background: #fff;
}

.robot-design-grid b {
  display: block;
  margin-bottom: 6px;
  color: #0f172a;
  font-size: 13px;
}

.robot-design-grid span {
  display: block;
  color: #475569;
  font-size: 12px;
  line-height: 1.5;
}

.external-system-frame {
  display: block;
  width: 100%;
  height: calc(100dvh - 170px);
  min-height: min(680px, calc(100dvh - 150px));
  border: 0;
  background: #fff;
}

.design-image-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.design-image-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
}

.design-image-form,
.design-image-side {
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.design-image-side h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.design-image-side p {
  margin: 0 0 10px;
  color: #53647a;
  line-height: 1.65;
}

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

.design-image-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #142238;
  font-weight: 700;
}

.design-image-grid label.wide {
  grid-column: 1 / -1;
}

.design-image-grid input,
.design-image-grid select {
  width: 100%;
  border: 1px solid #cbd7e6;
  border-radius: 6px;
  padding: 0 10px;
  min-height: 38px;
  background: #fff;
  font: inherit;
}

.design-image-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.design-image-table table {
  min-width: 1180px;
}

.design-image-table td {
  vertical-align: top;
}

.design-image-table b {
  color: #101828;
}

.design-image-table .good {
  color: #079455;
}

.design-image-table .bad {
  color: #d92d20;
}

.design-image-table .muted {
  color: #667085;
}

.design-image-table .sub {
  margin-top: 4px;
}

@media (max-width: 1100px) {
  .design-image-workspace {
    grid-template-columns: 1fr;
  }
}

.breakeven-roi-card {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.breakeven-roi-head h3 {
  margin: 0 0 4px;
  color: #0f172a;
  font-size: 16px;
}

.breakeven-roi-head p {
  margin: 0;
  color: #64748b;
  font-size: 12px;
}

.breakeven-roi-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(118px, 1fr));
  gap: 10px;
}

.breakeven-roi-grid label {
  min-width: 0;
}

.breakeven-roi-grid label.wide {
  grid-column: span 2;
}

.breakeven-roi-grid span {
  display: block;
  margin-bottom: 5px;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.breakeven-roi-grid input {
  width: 100%;
  height: 36px;
}

.breakeven-roi-result {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.breakeven-roi-result > div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.breakeven-roi-result span {
  display: block;
  margin-bottom: 4px;
  color: #64748b;
  font-size: 12px;
}

.breakeven-roi-result b {
  color: #0f172a;
  font-size: 18px;
}

.breakeven-roi-result .primary {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.breakeven-roi-result .primary b {
  color: #1d4ed8;
}

.breakeven-roi-hint {
  margin-top: 10px;
  color: #475569;
  font-size: 13px;
}

.breakeven-roi-hint.good {
  color: #047857;
}

.breakeven-roi-hint.bad {
  color: #dc2626;
}

.breakeven-roi-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.profit-product-picker {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.profit-product-picker-head {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(260px, 0.9fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 10px;
}

.profit-product-picker-head label {
  min-width: 0;
}

.profit-product-picker-head span {
  display: block;
  margin-bottom: 5px;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.profit-product-picker-head input {
  width: 100%;
  height: 36px;
}

.profit-selected-product {
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 13px;
  font-weight: 700;
}

.profit-selected-product.missing {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  font-weight: 600;
}

.profit-product-table {
  max-height: 280px;
  overflow: auto;
}

.profit-product-table table {
  min-width: 960px;
}

.profit-product-table td {
  vertical-align: middle;
}

.profit-product-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
}

.profit-product-name b {
  display: block;
  color: #0f172a;
  font-size: 13px;
}

.product-breakeven-editor {
  margin: 14px 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.product-breakeven-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(118px, 1fr));
  gap: 10px;
}

.product-breakeven-grid label {
  min-width: 0;
}

.product-breakeven-grid label.wide {
  grid-column: span 2;
}

.product-breakeven-grid span {
  display: block;
  margin-bottom: 5px;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.product-breakeven-grid input {
  width: 100%;
  height: 36px;
}

.product-breakeven-result {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.product-breakeven-result > div {
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.product-breakeven-result span {
  display: block;
  margin-bottom: 4px;
  color: #64748b;
  font-size: 12px;
}

.product-breakeven-result b {
  color: #0f172a;
  font-size: 18px;
}

.product-breakeven-result .primary {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.product-breakeven-result .primary b {
  color: #1d4ed8;
}

.product-breakeven-hint {
  margin-top: 10px;
  color: #475569;
  font-size: 13px;
}

.product-breakeven-hint.good {
  color: #047857;
}

.product-breakeven-hint.bad {
  color: #dc2626;
}

.product-breakeven-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.breakeven-status {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.breakeven-status.good {
  color: #047857;
  background: #d1fae5;
}

.breakeven-status.bad {
  color: #b91c1c;
  background: #fee2e2;
}

.breakeven-status.missing {
  color: #64748b;
  background: #f1f5f9;
}

.daily-trend-table table {
  min-width: 1480px;
}

.returns-table table {
  min-width: 1460px;
}

.daily-trend-table th:first-child,
.daily-trend-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
  box-shadow: 1px 0 0 #e2e8f0;
}

.daily-trend-table thead th:first-child {
  z-index: 3;
  background: #f8fafc;
}

.daily-date-cell {
  min-width: 126px;
}

.daily-date-cell b,
.daily-data-status {
  display: block;
}

.daily-data-status {
  width: max-content;
  max-width: 118px;
  margin-top: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  white-space: nowrap;
}

.daily-data-status.realtime,
.daily-data-status.reconciled {
  color: #047857;
  background: #d1fae5;
}

.daily-data-status.pending {
  color: #b45309;
  background: #fef3c7;
}

.daily-data-status.missing {
  color: #64748b;
  background: #f1f5f9;
}

.daily-refund-value {
  color: #c2410c;
  font-weight: 750;
}

.daily-net-value {
  color: #0f766e;
  font-weight: 800;
}

.return-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.return-status-badge.pending {
  color: #b45309;
  background: #fef3c7;
}

.return-status-badge.completed {
  color: #b91c1c;
  background: #fee2e2;
}

.return-status-badge.withdrawn {
  color: #475569;
  background: #e2e8f0;
}

.return-status-badge.unknown {
  color: #1d4ed8;
  background: #dbeafe;
}

.returns-reason-cell {
  min-width: 210px;
  max-width: 320px;
  white-space: normal;
  line-height: 1.45;
}





.sidebar-toggle {
  position: fixed;
  z-index: 50;
  top: 18px;
  left: calc(var(--sidebar-width) - 13px);
  width: 26px;
  height: 54px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #1d4ed8;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  transition: left 0.18s ease, background 0.15s ease, border-color 0.15s ease;
}

.sidebar-toggle:hover {
  border-color: var(--blue);
  background: #eff6ff;
}

.sidebar-resize-handle {
  position: fixed;
  z-index: 45;
  top: 0;
  bottom: 0;
  left: calc(var(--sidebar-width) - 3px);
  width: 6px;
  cursor: col-resize;
  background: transparent;
  transition: left 0.18s ease, background 0.15s ease;
}

.sidebar-resize-handle:hover,
body.sidebar-resizing .sidebar-resize-handle {
  background: rgba(37, 99, 235, 0.18);
}

body.sidebar-resizing {
  cursor: col-resize;
  user-select: none;
}

body.sidebar-resizing .main,
body.sidebar-resizing .sidebar-toggle,
body.sidebar-resizing .sidebar-resize-handle {
  transition: none;
}

body.sidebar-collapsed .sidebar {
  transform: translateX(calc(-1 * var(--sidebar-width)));
  pointer-events: none;
}

body.sidebar-collapsed .main {
  width: 100%;
  margin-left: 0;
}

body.sidebar-collapsed .sidebar-toggle {
  left: 8px;
}

body.sidebar-collapsed .sidebar-resize-handle {
  left: 0;
  width: 12px;
}

body.sidebar-collapsed .sidebar-toggle {
  color: var(--blue);
}

@media (max-width: 1100px) {
  .sidebar-toggle,
  .sidebar-resize-handle {
    display: none;
  }
}

@media (min-width: 1501px) {
  .cards {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  }
}

@media (max-width: 1366px) {
  :root {
    --sidebar-width: 172px;
    --page-padding: 12px;
  }

  h1 {
    font-size: 24px;
  }

  .brand {
    padding-inline: 14px;
  }

  nav {
    padding-inline: 8px;
  }

  nav a {
    padding-inline: 10px;
    font-size: 13px;
  }

  .filters {
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    gap: 10px;
    padding: 14px;
  }

  .cards {
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 10px;
  }

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

  .btn {
    padding-inline: 12px;
  }

  th,
  td {
    padding: 9px 10px;
    font-size: 12px;
  }

  .external-system-frame {
    height: calc(100dvh - 145px);
    min-height: 540px;
  }
}

@media (max-width: 1100px) {
  .main {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .top-actions {
    flex-basis: 100%;
    justify-content: flex-start;
  }

  .store-switcher {
    grid-template-columns: auto minmax(128px, 1fr);
  }

  .external-system-frame {
    height: calc(100dvh - 190px);
    min-height: 460px;
  }

  .breakeven-roi-grid,
  .breakeven-roi-result {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .robot-design-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
  }

  .brand {
    padding: 14px 16px 8px;
  }

  nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 12px;
  }

  .nav-group-title {
    display: flex;
    flex: 0 0 auto;
    height: 36px;
    align-items: center;
    margin: 0 2px;
    padding: 0 4px;
  }

  nav a {
    flex: 0 0 auto;
    height: 36px;
  }

  .main {
    max-width: none;
    margin-left: 0;
    padding: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  h1 {
    font-size: 22px;
  }

  .page-title-row {
    gap: 6px;
  }

  .help-guide-btn {
    width: 24px;
    height: 24px;
    font-size: 14px;
  }

  .help-guide-overlay {
    align-items: flex-end;
    padding: 12px;
  }

  .help-guide-modal {
    max-height: 82vh;
    padding: 18px;
  }

  .notice {
    margin-bottom: 12px;
    padding: 9px 10px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.45;
  }

  .filters,
  .cards,
  .config-grid {
    grid-template-columns: 1fr;
  }

  .config-grid .wide,
  .config-actions {
    grid-column: 1 / -1;
  }

  .panel-head,
  .assignment-alert,
  .final-price-alert {
    align-items: flex-start;
    flex-direction: column;
  }

  .assignment-item,
  .assignment-bind {
    grid-template-columns: 1fr;
  }

  .account-info {
    max-width: none;
    text-align: left;
  }

  .btn {
    min-width: 0;
  }
}

/* v211: calmer, denser navigation with a clear selected state. */
.sidebar nav a.hidden {
  display: none;
}

@media (min-width: 1101px) {
  .sidebar {
    border-right-color: #dfe6ef;
    background: #f7f9fc;
    box-shadow: 4px 0 18px rgba(15, 23, 42, 0.035);
    scrollbar-color: #c8d2df transparent;
    scrollbar-width: thin;
  }

  .sidebar::-webkit-scrollbar {
    width: 6px;
  }

  .sidebar::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #c8d2df;
  }

  .sidebar::-webkit-scrollbar-track {
    background: transparent;
  }

  .brand {
    padding: 16px 12px 13px;
    border-bottom-color: #e3e9f1;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
  }

  .brand-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #162033;
    font-size: 15px;
    font-weight: 850;
    letter-spacing: -0.01em;
  }

  .brand-title > span:last-child {
    white-space: nowrap;
  }

  .brand-mark {
    display: grid;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    place-items: center;
    border-radius: 8px;
    background: #1f5fbf;
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
  }

  .brand-sub {
    margin: 5px 0 0 32px;
    color: #7b899c;
    font-size: 11px;
    letter-spacing: 0.02em;
  }

  .sidebar nav {
    padding: 8px 10px 22px;
  }

  .sidebar .nav-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 17px 9px 6px;
    color: #8794a7;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1;
    white-space: nowrap;
  }

  .sidebar .nav-group-title:first-child {
    margin-top: 9px;
  }

  .sidebar .nav-group-title::after {
    width: 100%;
    height: 1px;
    flex: 1 1 auto;
    background: #e3e8ef;
    content: "";
  }

  .sidebar nav a {
    height: 38px;
    margin: 2px 0;
    padding: 0 28px 0 11px;
    border-radius: 9px;
    color: #3c4a5f;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.005em;
    transition: background-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
  }

  .sidebar nav a:hover {
    background: #edf2f7;
    color: #1f2a3d;
    transform: none;
  }

  .sidebar nav a.active {
    background: #e8f1ff;
    color: #1859b5;
    box-shadow: inset 0 0 0 1px #d3e3fb;
    font-weight: 850;
  }

  .sidebar nav a.active::after {
    position: absolute;
    right: 11px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #2d6fce;
    content: "";
  }

  .sidebar nav a:focus-visible {
    outline: 2px solid #77a9ee;
    outline-offset: 1px;
  }

  .sidebar-toggle {
    top: 18px;
    left: calc(var(--sidebar-width) - 15px);
    width: 30px;
    height: 38px;
    border-color: #d4dce7;
    border-radius: 10px;
    color: #416487;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.1);
    font-size: 20px;
    font-weight: 800;
  }

  .sidebar-toggle:hover {
    border-color: #aebed1;
    background: #f5f8fc;
    color: #1f5fbf;
  }

  .sidebar-resize-handle:hover,
  body.sidebar-resizing .sidebar-resize-handle {
    background: rgba(31, 95, 191, 0.12);
  }
}

@media (max-width: 1100px) {
  .sidebar {
    border-bottom-color: #e0e7f0;
    background: #fff;
    box-shadow: 0 3px 14px rgba(15, 23, 42, 0.05);
  }

  .brand {
    border-bottom-color: #edf1f5;
    background: #fff;
  }

  .brand-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #172033;
    font-weight: 850;
  }

  .brand-mark {
    display: grid;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    place-items: center;
    border-radius: 7px;
    background: #1f5fbf;
    color: #fff;
    font-size: 10px;
    font-weight: 900;
  }

  .sidebar nav a:hover {
    transform: none;
  }

  .sidebar nav a.active {
    background: #e8f1ff;
    color: #1859b5;
    box-shadow: inset 0 0 0 1px #d3e3fb;
  }
}

@media (max-width: 720px) {
  .brand {
    padding: 9px 12px 7px;
  }

  .brand-title {
    font-size: 15px;
  }

  .brand-sub {
    display: none;
  }
}

/* 独立利润计算器：延续现有后台的白底、细边框和紧凑数据密度。 */
.profit-calculator-panel {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 0;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
}

.profit-calculator-shell {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  background: #fff;
  padding: clamp(14px, 1.5vw, 24px);
  box-shadow: 0 14px 36px rgba(30, 41, 59, 0.07);
}

.profit-calculator-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.profit-calculator-head > div:first-child {
  min-width: 0;
  flex: 1 1 520px;
}

.profit-calculator-head h2 {
  margin: 4px 0 6px;
  font-size: clamp(21px, 1.7vw, 28px);
  line-height: 1.2;
}

.profit-calculator-head p {
  max-width: 760px;
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}

.profit-calculator-kicker {
  color: #4f46e5;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.profit-calculator-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex: 1 1 430px;
  min-width: 0;
  gap: 8px;
}

.profit-calculator-actions .btn {
  min-height: 38px;
  white-space: nowrap;
}

.profit-calculator-ratebar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  border: 1px solid #d8ddff;
  border-radius: 10px;
  background: #eef1ff;
  padding: 12px 16px;
}

.profit-rate-copy {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: #4338ca;
}

.profit-rate-copy span {
  font-size: 12px;
  font-weight: 800;
}

.profit-rate-copy b {
  font-size: 14px;
}

#profitCalculatorExchangeRate {
  width: 96px;
  height: 38px;
  border-color: #c7d2fe;
  background: #f8fafc;
  color: #312e81;
  font-weight: 900;
  text-align: center;
  cursor: default;
}

.profit-rate-unit { color: #4338ca; font-size: 13px; }

.profit-rate-status {
  min-width: 0;
  flex: 1;
  color: #047857;
  font-size: 12px;
  font-weight: 700;
}

.profit-calculator-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 12px 2px 10px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.profit-calculator-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.profit-calculator-legend i {
  width: 11px;
  height: 11px;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
}

.profit-calculator-legend i.manual { background: #fff8e6; border-color: #fbbf24; }
.profit-calculator-legend i.calculated { background: #ecfeff; border-color: #22d3ee; }
.profit-calculator-legend i.archive { background: #eef2ff; border-color: #818cf8; }

.profit-calculator-table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: auto;
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  background: #fff;
  scrollbar-color: #94a3b8 #edf2f7;
}

.profit-calculator-table {
  width: 100%;
  min-width: 2620px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.profit-calculator-table th,
.profit-calculator-table td {
  height: 54px;
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  padding: 8px;
  text-align: center;
  vertical-align: middle;
}

.profit-calculator-table th:last-child,
.profit-calculator-table td:last-child { border-right: 0; }
.profit-calculator-table tbody tr:last-child td { border-bottom: 0; }

.profit-calculator-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.35;
}

.profit-calculator-table thead .profit-calculator-groups th {
  top: 0;
  height: 32px;
  border-bottom: 0;
  color: #fff;
  letter-spacing: 0.03em;
}

.profit-calculator-table thead .profit-calculator-groups + tr th { top: 32px; }
.profit-calculator-groups th[rowspan] { background: #312e81; }
.profit-calculator-groups .group-product { background: #4f46e5; }
.profit-calculator-groups .group-cost { background: #d97706; }
.profit-calculator-groups .group-commission { background: #7c3aed; }
.profit-calculator-groups .group-logistics { background: #0891b2; }
.profit-calculator-groups .group-marketing { background: #ea580c; }
.profit-calculator-groups .group-after-sale { background: #e11d48; }
.profit-calculator-groups .group-profit { background: #059669; }

.profit-calculator-row:hover td { box-shadow: inset 0 0 0 999px rgba(37, 99, 235, 0.025); }
.profit-calculator-row td.manual-cell { background: #fffbeb; }
.profit-calculator-row td.sign-rate-cell { background: #eef6ff; }
.profit-calculator-row td.calculated-cell { background: #ecfeff; color: #0e7490; font-weight: 800; }
.profit-calculator-row td.archive-cell { background: #eef2ff; }
.profit-calculator-row td.simulation { background: #fff1f2; box-shadow: inset 0 0 0 1px #fb7185; }

.profit-product-cell {
  position: sticky;
  left: 40px;
  z-index: 2;
  width: 270px;
  min-width: 270px;
  text-align: left !important;
}

.profit-row-index {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 40px;
  min-width: 40px;
  background: #fff;
  color: #64748b;
  font-weight: 900;
}

.profit-product-select {
  width: 100%;
  height: 36px;
  border: 1px solid #c7d2fe;
  border-radius: 7px;
  background: #fff;
  color: #1e293b;
  font-weight: 800;
}

.profit-product-cell small,
.manual-cell small,
.result-cell small {
  display: block;
  margin-top: 5px;
  color: #64748b;
  font-size: 10px;
  line-height: 1.3;
}

.profit-calculator-input {
  width: 86px;
  height: 34px;
  border: 1px solid #f2d59c;
  border-radius: 6px;
  background: #fffdf5;
  padding: 5px 7px;
  color: #7c2d12;
  font-weight: 800;
  text-align: right;
}

.profit-calculator-input:focus,
.profit-product-select:focus {
  outline: 3px solid rgba(79, 70, 229, 0.16);
  border-color: #6366f1;
}

.percent-cell { white-space: nowrap; }
.percent-cell .profit-calculator-input { width: 66px; }
.percent-cell small { display: inline; margin-left: 2px; }

.result-cell b { display: block; font-size: 14px; }
.result-cell.good b { color: #047857; }
.result-cell.bad b { color: #dc2626; }
.result-cell.pending b { color: #64748b; }
.result-cell.roi { background: #eef2ff; color: #4338ca; }
.result-cell.acos { background: #f0fdf4; }

.profit-row-actions {
  min-width: 112px;
  white-space: nowrap;
}

.profit-row-actions .mini-btn + .mini-btn { margin-left: 5px; }

.profit-calculator-summary-title {
  margin: 22px 0 10px;
  color: #312e81;
  font-size: 15px;
  font-weight: 900;
}

.profit-calculator-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 12px;
}

.profit-summary-card {
  min-width: 0;
  min-height: 104px;
  border: 1px solid #dbe4f0;
  border-left: 4px solid #6366f1;
  border-radius: 10px;
  background: #fbfdff;
  padding: 16px;
}

.profit-summary-card span,
.profit-summary-card small { display: block; color: #64748b; font-size: 11px; }
.profit-summary-card b { display: block; margin: 9px 0 5px; font-size: 22px; }
.profit-summary-card.profit { border-left-color: #10b981; }
.profit-summary-card.profit b { color: #047857; }
.profit-summary-card.roi { border-left-color: #8b5cf6; }
.profit-summary-card.roi b { color: #6d28d9; }
.profit-summary-card.acos { border-left-color: #f59e0b; }
.profit-summary-card.acos b { color: #b45309; }
.profit-summary-card.max-ad {
  border-color: #fdba74;
  border-left-color: #f97316;
  background: linear-gradient(145deg, #fff7ed, #fff);
  box-shadow: 0 8px 20px rgba(249, 115, 22, 0.08);
}
.profit-summary-card.max-ad b { color: #c2410c; }

.profit-calculator-guide {
  margin-top: 16px;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  background: #f0fdf4;
  padding: 16px 18px;
}

.profit-guide-title { color: #166534; font-size: 14px; font-weight: 900; }
.profit-guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 18px; margin-top: 12px; }
.profit-guide-grid > div { border-bottom: 1px dashed #bbf7d0; padding-bottom: 8px; }
.profit-guide-grid b { color: #166534; font-size: 12px; }
.profit-guide-grid p { margin: 3px 0 0; color: #3f6250; font-size: 11px; line-height: 1.55; }
.profit-formula-note { margin-top: 10px; border-radius: 7px; background: #dcfce7; padding: 10px 12px; color: #166534; font-size: 12px; font-weight: 800; }

@media (max-width: 1100px) {
  .profit-calculator-head { display: block; }
  .profit-calculator-actions { justify-content: flex-start; margin-top: 14px; }
  .profit-calculator-summary { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .profit-guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .profit-calculator-shell { border-radius: 9px; padding: 12px; }
  .profit-calculator-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .profit-calculator-actions .btn { width: 100%; min-width: 0; padding-inline: 8px; }
  .profit-calculator-actions .btn.primary { grid-column: 1 / -1; }
  .profit-calculator-ratebar { display: grid; grid-template-columns: 1fr 86px auto; gap: 8px; }
  .profit-rate-copy { display: block; }
  .profit-rate-copy span, .profit-rate-copy b { display: block; }
  .profit-rate-status { grid-column: 1 / -1; }
  .profit-calculator-legend { gap: 10px; }
  .profit-calculator-table-wrap { overflow: visible; border: 0; background: transparent; }
  .profit-calculator-table { display: block; min-width: 0; }
  .profit-calculator-table thead { display: none; }
  .profit-calculator-table tbody { display: grid; gap: 12px; }
  .profit-calculator-table tr { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #dbe4f0; border-radius: 10px; background: #fff; overflow: hidden; }
  .profit-calculator-table td {
    position: static;
    display: grid;
    grid-template-columns: minmax(78px, 0.85fr) minmax(0, 1.15fr);
    align-items: center;
    gap: 8px;
    width: auto;
    min-width: 0;
    height: auto;
    min-height: 50px;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    padding: 8px;
    text-align: right;
  }
  .profit-calculator-table td::before { content: attr(data-label); color: #64748b; font-size: 10px; font-weight: 800; text-align: left; }
  .profit-calculator-table td:nth-child(even) { border-right: 0; }
  .profit-calculator-table td.profit-row-index { display: none; }
  .profit-calculator-table td.profit-product-cell { grid-column: 1 / -1; display: block; width: auto; min-width: 0; border-right: 0; text-align: left !important; }
  .profit-product-cell::before { display: block; margin-bottom: 6px; }
  .profit-calculator-input { width: 100%; min-width: 0; }
  .percent-cell .profit-calculator-input { width: 100%; }
  .profit-row-actions { grid-column: 1 / -1; display: flex !important; justify-content: flex-end; min-width: 0; border-right: 0 !important; }
  .profit-row-actions::before { margin-right: auto; }
  .profit-calculator-summary { grid-template-columns: 1fr 1fr; }
  .profit-summary-card { min-height: 96px; padding: 12px; }
  .profit-summary-card b { font-size: 18px; }
  .profit-guide-grid { grid-template-columns: 1fr; }
}

/* Product archive: automatic Coupang coupon sync */
.product-coupon-sync-bar {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 12px 16px 0;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  padding: 10px 12px;
  background: linear-gradient(135deg, #f8fbff, #eff6ff);
}

.product-coupon-sync-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: #2563eb;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.2);
}

.product-coupon-sync-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.product-coupon-sync-copy b {
  color: #0f172a;
  font-size: 13px;
}

.product-coupon-sync-copy span {
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-coupon-sync-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-coupon-gap-btn {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 7px;
  border: 1px solid #fdba74;
  border-radius: 7px;
  padding: 0 10px;
  background: #fff7ed;
  color: #9a3412;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.product-coupon-gap-btn b {
  display: inline-grid;
  min-width: 21px;
  height: 21px;
  place-items: center;
  border-radius: 999px;
  padding: 0 5px;
  background: #ea580c;
  color: #fff;
  font-size: 11px;
}

.product-coupon-gap-btn:hover:not(:disabled),
.product-coupon-gap-btn.active {
  border-color: #ea580c;
  background: #ffedd5;
}

.product-coupon-gap-btn:disabled {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #94a3b8;
  cursor: not-allowed;
}

.product-coupon-gap-btn:disabled b {
  background: #cbd5e1;
}

.product-coupon-sync-bar.success {
  border-color: #a7f3d0;
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
}

.product-coupon-sync-bar.success .product-coupon-sync-icon {
  background: #059669;
}

.product-coupon-sync-bar.warning,
.product-coupon-sync-bar.error {
  border-color: #fed7aa;
  background: linear-gradient(135deg, #fffaf5, #fff7ed);
}

.product-coupon-sync-bar.warning .product-coupon-sync-icon,
.product-coupon-sync-bar.error .product-coupon-sync-icon {
  background: #ea580c;
}

.product-master-price-auto {
  display: grid;
  min-width: 150px;
  gap: 6px;
}

.product-master-price-auto > div:first-child {
  display: grid;
  gap: 2px;
}

.product-master-price-auto > div:first-child span {
  color: #64748b;
  font-size: 11px;
}

.product-master-coupon-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  color: #047857;
  font-size: 11px;
  font-weight: 750;
}

.product-master-coupon-line.warning {
  color: #b45309;
}

.product-master-coupon-line strong {
  color: #c2410c;
  font-size: 11px;
}

.product-coupon-sku-summary {
  display: grid;
  justify-items: start;
  gap: 4px;
}

.product-archive-coupon em {
  border-radius: 999px;
  padding: 2px 6px;
  background: #fef3c7;
  color: #92400e;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.product-coupon-modal {
  width: min(860px, 100%);
}

.product-coupon-modal .product-review-modal-head h3 {
  margin: 2px 0 0;
  color: #0f172a;
  font-size: 20px;
}

.product-coupon-modal .product-review-modal-head .mini-btn {
  flex: 0 0 auto;
  min-width: 64px;
  white-space: nowrap;
}

.product-coupon-eyebrow {
  color: #2563eb;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
}

.product-coupon-modal-body {
  grid-template-columns: 1fr;
  max-height: calc(100dvh - 150px);
  overflow-y: auto;
  background: #f8fafc;
}

.product-coupon-detail-card {
  display: grid;
  gap: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px;
  background: #fff;
}

.product-coupon-detail-card.conflict,
.product-coupon-detail-card.needs_review {
  border-color: #fed7aa;
}

.product-coupon-detail-head,
.product-coupon-detail-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.product-coupon-detail-head > div,
.product-coupon-detail-list > div > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.product-coupon-detail-head span,
.product-coupon-detail-list span {
  color: #64748b;
  font-size: 11px;
  line-height: 1.35;
}

.product-coupon-price-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr) auto) minmax(0, 1fr);
  align-items: stretch;
  gap: 8px;
}

.product-coupon-price-flow > div {
  display: grid;
  gap: 4px;
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}

.product-coupon-price-flow > div.final {
  background: #eff6ff;
  color: #1d4ed8;
}

.product-coupon-price-flow span {
  color: #64748b;
  font-size: 10px;
}

.product-coupon-price-flow i {
  align-self: center;
  color: #94a3b8;
  font-style: normal;
  font-weight: 900;
}

.product-coupon-detail-list {
  display: grid;
  gap: 7px;
  border-top: 1px solid #eef2f7;
  padding-top: 10px;
}

.product-coupon-detail-list > div + div {
  border-top: 1px dashed #e2e8f0;
  padding-top: 7px;
}

.product-coupon-detail-list strong {
  color: #dc2626;
}

.product-coupon-rule-note {
  margin: 0;
  border-radius: 7px;
  padding: 8px 10px;
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  line-height: 1.5;
}

.product-coupon-empty {
  display: grid;
  place-items: center;
  gap: 5px;
  min-height: 160px;
  color: #64748b;
  text-align: center;
}

@media (max-width: 720px) {
  .product-coupon-sync-bar {
    grid-template-columns: 34px minmax(0, 1fr);
    margin: 10px;
  }

  .product-coupon-sync-icon {
    width: 34px;
    height: 34px;
  }

  .product-coupon-sync-copy span {
    white-space: normal;
  }

  .product-coupon-sync-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .product-coupon-sync-actions > button {
    width: 100%;
    justify-content: center;
  }

  .product-coupon-detail-head,
  .product-coupon-detail-list > div {
    align-items: flex-start;
    flex-direction: column;
  }

  .product-coupon-price-flow {
    grid-template-columns: 1fr;
  }

  .product-coupon-price-flow i {
    display: none;
  }
}

/* v93: advertising details visual refresh. Business logic and other menus stay unchanged. */
body[data-view-mode="ads"] {
  background: #f5f8fc;
}

body[data-view-mode="ads"] .main {
  padding: 0 18px 22px;
}

body[data-view-mode="ads"] .topbar {
  min-height: 92px;
  margin: 0 -18px 16px;
  border-bottom: 1px solid #e5ebf3;
  background: rgba(255, 255, 255, 0.96);
  padding: 17px 22px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.025);
}

body[data-view-mode="ads"] .topbar h1 {
  color: #111827;
  font-size: 27px;
  letter-spacing: -0.02em;
}

body[data-view-mode="ads"] .topbar p {
  margin-top: 6px;
  color: #738198;
  font-size: 13px;
}

body[data-view-mode="ads"] .top-actions {
  gap: 9px;
}

body[data-view-mode="ads"] .top-actions .btn,
body[data-view-mode="ads"] .auth-user {
  min-height: 38px;
  border-color: #dce4ef;
  border-radius: 7px;
  padding: 0 14px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.025);
  font-size: 13px;
}

body[data-view-mode="ads"] .top-actions .install-app-btn {
  border-color: #059669;
  background: #059669;
  color: #fff;
}

body[data-view-mode="ads"] #filtersPanel {
  grid-template-columns: minmax(170px, 1.15fr) minmax(135px, 0.9fr) minmax(135px, 0.9fr) minmax(300px, 1.65fr) minmax(150px, 1fr) minmax(220px, 1.45fr);
  align-items: end;
  gap: 12px;
  margin-bottom: 12px;
  border-color: #e1e8f1;
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.025);
}

body[data-view-mode="ads"] #filtersPanel label span,
body[data-view-mode="ads"] .date-shortcuts-label {
  margin-bottom: 6px;
  color: #526078;
  font-size: 12px;
  font-weight: 800;
}

body[data-view-mode="ads"] #filtersPanel input,
body[data-view-mode="ads"] #filtersPanel select {
  height: 40px;
  border-color: #d8e1ed;
  border-radius: 7px;
  color: #1e293b;
  font-size: 13px;
}

body[data-view-mode="ads"] #filtersPanel input:focus,
body[data-view-mode="ads"] #filtersPanel select:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

body[data-view-mode="ads"] .date-shortcuts {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

body[data-view-mode="ads"] .date-shortcuts-label {
  grid-column: 1 / -1;
}

body[data-view-mode="ads"] .date-shortcuts button {
  height: 40px;
  border-color: #d8e1ed;
  border-radius: 7px;
  color: #334155;
  font-size: 13px;
}

body[data-view-mode="ads"] .date-shortcuts button:hover,
body[data-view-mode="ads"] .date-shortcuts button.active {
  border-color: #93b4f8;
  background: #eef4ff;
  color: #2563eb;
}

body[data-view-mode="ads"] #notice,
body[data-view-mode="ads"] .assignment-alert,
body[data-view-mode="ads"] .final-price-alert {
  min-height: 50px;
  margin-bottom: 12px;
  border-radius: 9px;
  padding: 11px 14px;
  box-shadow: none;
  font-size: 13px;
  line-height: 1.5;
}

body[data-view-mode="ads"] #notice.success,
body[data-view-mode="ads"] #notice.loading {
  border-color: #bcebd7;
  background: #f0fcf6;
  color: #047857;
}

body[data-view-mode="ads"] .final-price-alert {
  border-color: #f7d8bd;
  background: #fff9f3;
  color: #c2410c;
}

body[data-view-mode="ads"] .final-price-alert .btn,
body[data-view-mode="ads"] .assignment-alert .btn {
  min-width: 76px;
  height: 36px;
  border-radius: 7px;
  background: #fff;
}

body[data-view-mode="ads"] .ad-summary-cards {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

body[data-view-mode="ads"] .ad-summary-cards .card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  min-height: 98px;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  border-color: #e1e8f1;
  border-radius: 10px;
  padding: 13px 14px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.025);
}

body[data-view-mode="ads"] .ad-kpi-icon {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  margin: 0;
  border-radius: 10px;
  background: #eef4ff;
}

body[data-view-mode="ads"] .ad-kpi-icon img {
  width: 21px;
  height: 21px;
  opacity: 0.86;
}

body[data-view-mode="ads"] .ad-kpi-icon.tone-green,
body[data-view-mode="ads"] .ad-kpi-icon.tone-emerald { background: #eaf9f2; }
body[data-view-mode="ads"] .ad-kpi-icon.tone-purple,
body[data-view-mode="ads"] .ad-kpi-icon.tone-violet { background: #f1edff; }
body[data-view-mode="ads"] .ad-kpi-icon.tone-orange,
body[data-view-mode="ads"] .ad-kpi-icon.tone-coral { background: #fff1e9; }
body[data-view-mode="ads"] .ad-kpi-icon.tone-sky,
body[data-view-mode="ads"] .ad-kpi-icon.tone-cyan { background: #e9f7fb; }
body[data-view-mode="ads"] .ad-kpi-icon.tone-amber { background: #fff7df; }
body[data-view-mode="ads"] .ad-kpi-icon.tone-pink { background: #fff0f6; }
body[data-view-mode="ads"] .ad-kpi-icon.tone-indigo { background: #edf1ff; }
body[data-view-mode="ads"] .ad-kpi-icon.tone-launch { background: #eafaf2; }

body[data-view-mode="ads"] .launch-rate-card {
  border-color: #cceede;
}

body[data-view-mode="ads"] .launch-rate-card .ad-kpi-copy > b {
  color: #047857;
}

body[data-view-mode="ads"] .ad-kpi-copy {
  min-width: 0;
}

body[data-view-mode="ads"] .ad-summary-cards .ad-kpi-copy > span {
  display: block;
  overflow: hidden;
  color: #61708a;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-view-mode="ads"] .ad-summary-cards .ad-kpi-copy > b {
  margin-top: 5px;
  overflow: hidden;
  color: #111827;
  font-size: clamp(18px, 1.15vw, 23px);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-view-mode="ads"] .ad-summary-cards .ad-kpi-copy > small {
  display: block;
  min-height: 14px;
  margin-top: 5px;
  overflow: hidden;
  color: #8794a8;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-view-mode="ads"] #productGroupsPanel {
  border-color: #dfe7f1;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.035);
}

body[data-view-mode="ads"] #productGroupsPanel .panel-head {
  min-height: 58px;
  border-bottom-color: #e5ebf3;
  padding: 10px 14px;
  background: #fff;
}

body[data-view-mode="ads"] .product-table-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

body[data-view-mode="ads"] .product-table-tabs {
  display: flex;
  align-items: center;
  gap: 18px;
}

body[data-view-mode="ads"] .product-table-tab {
  position: relative;
  min-height: 38px;
  border: 0;
  background: transparent;
  padding: 0 2px;
  color: #64748b;
  font-size: 16px;
  font-weight: 850;
  cursor: pointer;
}

body[data-view-mode="ads"] .product-table-tab::after {
  position: absolute;
  right: 0;
  bottom: -10px;
  left: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: transparent;
  content: "";
}

body[data-view-mode="ads"] .product-table-tab.active {
  color: #1d4ed8;
}

body[data-view-mode="ads"] .product-table-tab.active::after {
  background: #2563eb;
}

body[data-view-mode="ads"] .product-table-tab.loss.active {
  color: #b91c1c;
}

body[data-view-mode="ads"] .product-table-tab.loss.active::after {
  background: #dc2626;
}

body[data-view-mode="ads"] .product-table-tab.pending-ads.active {
  color: #1d4ed8;
}

body[data-view-mode="ads"] .product-table-tab.pending-ads.active::after {
  background: #2563eb;
}

body[data-view-mode="ads"] .product-table-tab b {
  display: inline-flex;
  min-width: 22px;
  height: 20px;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  border-radius: 999px;
  background: #eef2f7;
  padding: 0 6px;
  color: #64748b;
  font-size: 10px;
}

body[data-view-mode="ads"] .product-table-tab.loss b {
  background: #fee2e2;
  color: #b91c1c;
}

body[data-view-mode="ads"] .product-table-tab.pending-ads b {
  background: #dbeafe;
  color: #1d4ed8;
}

body[data-view-mode="ads"] .product-pending-ads-wrap {
  overflow-x: auto;
  border-top: 0;
  background: #fff;
}

body[data-view-mode="ads"] .product-pending-ads-wrap table {
  width: 100%;
  min-width: 760px;
  table-layout: fixed;
}

body[data-view-mode="ads"] .product-pending-ads-wrap th {
  height: 42px;
  background: #f5f8fc;
  color: #475569;
  font-size: 12px;
}

body[data-view-mode="ads"] .product-pending-ads-wrap th:nth-child(1) {
  width: 150px;
}

body[data-view-mode="ads"] .product-pending-ads-wrap th:nth-child(3),
body[data-view-mode="ads"] .product-pending-ads-wrap th:nth-child(4) {
  width: 120px;
}

body[data-view-mode="ads"] .product-pending-ads-wrap th:nth-child(5) {
  width: 180px;
}

body[data-view-mode="ads"] .product-pending-ads-wrap td {
  height: 72px;
  border-bottom: 1px solid #e8edf4;
  padding: 10px 14px;
  vertical-align: middle;
}

body[data-view-mode="ads"] .product-pending-ads-wrap tbody tr:hover {
  background: #f8fbff;
}

body[data-view-mode="ads"] .pending-ad-code-missing {
  color: #b45309;
  font-size: 12px;
  font-weight: 800;
}

body[data-view-mode="ads"] .pending-ad-status {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

body[data-view-mode="ads"] .pending-ad-status .sub {
  margin: 0;
}

body[data-view-mode="ads"] .product-loss-pool-settings {
  min-height: 36px;
  border-color: #fecaca;
  background: #fff7f7;
  color: #b91c1c;
  font-size: 12px;
}

body[data-view-mode="ads"] .product-loss-pool-notice {
  border-bottom: 1px solid #fecaca;
  background: #fff7f7;
  padding: 10px 14px;
  color: #991b1b;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.55;
}

body[data-view-mode="ads"] #productGroupsPanel .panel-head h2 {
  color: #172033;
  font-size: 18px;
}

body[data-view-mode="ads"] .product-table-count {
  margin: 0;
  color: #718096;
  font-size: 12px;
  font-weight: 700;
}

body[data-view-mode="ads"] .product-view-settings > summary {
  min-height: 36px;
  border-color: #d8e1ed;
  border-radius: 7px;
  background: #fff;
  color: #334155;
  font-size: 12px;
}

body[data-view-mode="ads"] .product-view-settings > summary:hover {
  border-color: #93b4f8;
  background: #f8fbff;
  color: #2563eb;
}

body[data-view-mode="ads"] .product-table-wrap {
  border-top: 0;
  background: #fff;
}

body[data-view-mode="ads"] .product-table-wrap table {
  font-size: clamp(11.5px, 0.66vw, 13px);
}

body[data-view-mode="ads"] .product-table-wrap th {
  height: 48px;
  border-bottom-color: #dfe7f1;
  background: #f8fafc;
  color: #40506a;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.01em;
  vertical-align: middle;
}

body[data-view-mode="ads"] .period-performance-head span,
body[data-view-mode="ads"] .period-performance-head small {
  display: block;
}

body[data-view-mode="ads"] .period-performance-head small {
  margin-top: 2px;
  color: #7b8799;
  font-size: 9px;
  font-weight: 750;
  line-height: 1.2;
}

.period-performance-cell {
  font-variant-numeric: tabular-nums;
}

.period-performance {
  display: inline-flex;
  width: 100%;
  min-width: 108px;
  min-height: 32px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  row-gap: 2px;
  gap: 7px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #fff;
  padding: 5px 7px;
  white-space: nowrap;
}

.period-performance .period-spend {
  color: #334155;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
}

.period-performance .period-roi {
  display: inline-flex;
  min-height: 18px;
  align-items: center;
  justify-content: flex-end;
  border-left: 1px solid #d8dee8;
  padding-left: 7px;
  font-size: 10.5px;
  font-weight: 900;
  line-height: 1.2;
  transform-origin: center;
}

.period-performance.is-good-roi {
  border-color: #cbd5e1;
}

.period-performance.is-good-roi .period-roi {
  color: #047857;
}

.period-performance.is-low-roi {
  border-color: #fca5a5;
  background: #fff7f7;
  box-shadow: inset 3px 0 0 #ef4444;
}

.period-performance.is-low-roi .period-roi {
  color: #dc2626;
  animation: product-low-roi-pulse 1.6s ease-in-out infinite;
  will-change: transform;
}

.period-performance.is-pending {
  border-color: #fcd34d;
  background: #fffbeb;
}

.period-performance.is-pending .period-roi {
  color: #b45309;
}

.period-performance.is-historical .period-spend {
  color: #64748b;
}

.period-performance.is-empty .period-spend,
.period-performance.is-empty .period-roi {
  color: #94a3b8;
}

@keyframes product-low-roi-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

@media (prefers-reduced-motion: reduce) {
  .period-performance.is-low-roi .period-roi {
    animation: none;
  }
}

body[data-view-mode="ads"] .product-table-wrap td {
  min-height: 58px;
  border-bottom-color: #edf1f6;
  color: #1f2937;
  vertical-align: middle;
}

body[data-view-mode="ads"] .product-group-row:hover,
body[data-view-mode="ads"] .product-group-row:hover > td:first-child,
body[data-view-mode="ads"] .product-group-row:hover > td:last-child {
  background: #f7faff;
}

body[data-view-mode="ads"] .product-group-row.expanded,
body[data-view-mode="ads"] .product-group-row.expanded > td:first-child,
body[data-view-mode="ads"] .product-group-row.expanded > td:last-child {
  background: #f2f7ff;
}

body[data-view-mode="ads"] .product-group-identity {
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
}

body[data-view-mode="ads"] .product-group-thumb {
  width: 46px;
  height: 46px;
  border-color: #e0e7f0;
  border-radius: 7px;
}

body[data-view-mode="ads"] .product-group-copy b {
  overflow: hidden;
  color: #172033;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-view-mode="ads"] .product-group-copy .sub {
  margin-top: 3px;
  overflow: hidden;
  color: #8390a3;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-view-mode="ads"] .status {
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 10px;
}

body[data-view-mode="ads"] .product-row-action .mini-btn {
  min-width: 54px;
  min-height: 30px;
  border-color: transparent;
  background: transparent;
  color: #2563eb;
  font-size: 11px;
}

body[data-view-mode="ads"] .product-row-action .mini-btn:hover {
  border-color: #bfdbfe;
  background: #eff6ff;
}

body[data-view-mode="ads"] #productGroupTable > thead th:last-child,
body[data-view-mode="ads"] #productGroupTable > tbody > tr.product-group-row > td:last-child,
body[data-view-mode="ads"] #productHeaderTable > thead th:last-child {
  position: sticky;
  right: 0;
  z-index: 13;
  background: #fff;
  box-shadow: -1px 0 0 #e5ebf3;
}

body[data-view-mode="ads"] #productGroupTable > thead th:last-child,
body[data-view-mode="ads"] #productHeaderTable > thead th:last-child {
  z-index: 29;
  background: #f8fafc;
}

@media (max-width: 1350px) {
  body[data-view-mode="ads"] #filtersPanel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body[data-view-mode="ads"] .ad-summary-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  body[data-view-mode="ads"] .main {
    padding: 0 12px 16px;
  }

  body[data-view-mode="ads"] .topbar {
    margin-right: -12px;
    margin-left: -12px;
    padding: 14px 16px;
  }

  body[data-view-mode="ads"] #filtersPanel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-view-mode="ads"] .ad-summary-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  body[data-view-mode="ads"] .topbar {
    align-items: flex-start;
  }

  body[data-view-mode="ads"] .top-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: stretch;
  }

  body[data-view-mode="ads"] .top-actions .auth-user {
    grid-column: 1 / -1;
    justify-content: center;
  }

  body[data-view-mode="ads"] .top-actions .store-switcher {
    grid-column: 1 / -1;
  }

  body[data-view-mode="ads"] .top-actions .btn {
    width: 100%;
    padding: 0 8px;
  }

  body[data-view-mode="ads"] #filtersPanel {
    grid-template-columns: 1fr;
  }

  body[data-view-mode="ads"] .ad-summary-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-view-mode="ads"] .date-shortcuts {
    grid-template-columns: repeat(5, minmax(56px, 1fr));
    overflow-x: auto;
  }

  body[data-view-mode="ads"] .ad-summary-cards .card {
    grid-template-columns: 36px minmax(0, 1fr);
    min-height: 82px;
    gap: 8px;
    padding: 10px;
  }

  body[data-view-mode="ads"] .ad-kpi-icon {
    width: 36px;
    height: 36px;
  }

  body[data-view-mode="ads"] .ad-kpi-icon img {
    width: 18px;
    height: 18px;
  }

  body[data-view-mode="ads"] .ad-summary-cards .ad-kpi-copy > b {
    font-size: 16px;
  }

  body[data-view-mode="ads"] .product-table-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
}

@media (min-width: 1101px) and (max-width: 1500px) {
  .cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}


.product-group-row {
  cursor: pointer;
}

.product-group-row:hover {
  background: #f8fbff;
}

.product-group-row.expanded {
  background: #eff6ff;
}

.product-detail-row > td {
  background: #f8fafc;
  padding: 14px;
}

.product-detail {
  display: grid;
  gap: 10px;
}

.detail-title {
  color: #142033;
  font-weight: 800;
}

.detail-table {
  width: 100%;
  min-width: 1500px;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #d8e1eb;
  border-radius: 8px;
  overflow: hidden;
}

.detail-table th,
.detail-table td {
  border-bottom: 1px solid #e7edf4;
  padding: 8px 10px;
  text-align: left;
}

.product-plan-count {
  min-width: 92px;
}

.product-plan-count b {
  display: block;
  color: #0f172a;
}

.historical-campaign-summary-row > td {
  padding: 0 !important;
  background: #f8fafc;
  color: #475569;
}

.deleted-ad-summary {
  display: grid;
  grid-template-columns: minmax(230px, 1.4fr) minmax(420px, 2fr) auto;
  align-items: center;
  gap: 24px;
  min-height: 66px;
  padding: 10px 16px;
  border-left: 3px solid #94a3b8;
}

.deleted-ad-summary-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.deleted-ad-summary-title > span:last-child {
  min-width: 0;
}

.deleted-ad-summary-title b,
.deleted-ad-summary-title small {
  display: block;
}

.deleted-ad-summary-title b {
  overflow: hidden;
  color: #334155;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deleted-ad-summary-title small {
  margin-top: 3px;
  color: #94a3b8;
  font-size: 11px;
}

.deleted-ad-summary-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(80px, 1fr));
  gap: 18px;
  margin: 0;
}

.deleted-ad-summary-metrics div {
  min-width: 0;
}

.deleted-ad-summary-metrics dt {
  color: #94a3b8;
  font-size: 11px;
}

.deleted-ad-summary-metrics dd {
  margin: 3px 0 0;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.historical-campaign-details {
  position: relative;
  min-width: 76px;
}

.historical-campaign-details summary {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  color: #2563eb;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  list-style: none;
  white-space: nowrap;
}

.historical-campaign-details summary::-webkit-details-marker {
  display: none;
}

.historical-campaign-list {
  display: grid;
  max-height: 260px;
  min-width: min(720px, calc(100vw - 220px));
  margin-top: 10px;
  overflow-y: auto;
  border: 1px solid #dbe4ee;
  border-radius: 6px;
  background: #fff;
}

.deleted-ad-summary .historical-campaign-details[open] {
  grid-column: 1 / -1;
}

.deleted-ad-summary .historical-campaign-details[open] summary {
  margin-left: auto;
}

.historical-campaign-item {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(130px, auto);
  gap: 16px;
  padding: 8px 10px;
  border-bottom: 1px solid #edf2f7;
}

.historical-campaign-item:last-child {
  border-bottom: 0;
}

.historical-campaign-item span:last-child {
  text-align: right;
}

.historical-campaign-item b,
.historical-campaign-item small {
  display: block;
}

.historical-campaign-item b {
  max-width: 420px;
  overflow: hidden;
  color: #334155;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.historical-campaign-item small {
  margin-top: 2px;
  color: #94a3b8;
  font-size: 11px;
}

@media (max-width: 1100px) {
  .deleted-ad-summary {
    grid-template-columns: minmax(210px, 1fr) minmax(360px, 1.5fr) auto;
    gap: 16px;
  }

  .deleted-ad-summary-metrics {
    gap: 12px;
  }
}

.group-editor {
  min-width: 250px;
}

.manual-product-input {
  width: 170px;
  height: 30px;
  padding: 0 9px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #142033;
  font-size: 12px;
  font-weight: 700;
  outline: none;
}

.manual-product-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.mini-btn {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #d8e1eb;
  border-radius: 8px;
  background: #fff;
  color: #142033;
  font-weight: 800;
  cursor: pointer;
}

.mini-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
}

.mini-btn.primary {
  border-color: #bfdbfe;
  color: #2563eb;
  background: #eff6ff;
}

.mini-btn.primary:hover {
  background: #dbeafe;
}

.mini-btn:disabled {
  cursor: wait;
  opacity: 0.55;
}

.save-manual-product {
  margin-left: 6px;
}

.product-picker-portal {
  position: fixed;
  z-index: 10000;
  max-height: min(420px, 70vh);
  overflow-y: auto;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
  padding: 6px;
}

.product-picker-option {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 48px;
  gap: 10px;
  border: 0;
  border-radius: 6px;
  background: #fff;
  padding: 6px 8px;
  color: #0f172a;
  text-align: left;
  cursor: pointer;
}

.product-picker-count {
  position: sticky;
  z-index: 1;
  top: -6px;
  margin: -6px -6px 4px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 7px 10px;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
}

.manual-replenishment-picker-option {
  display: flex;
  align-items: flex-start;
  width: 100%;
  min-height: 66px;
  gap: 10px;
  border: 0;
  border-radius: 6px;
  background: #fff;
  padding: 8px;
  color: #0f172a;
  text-align: left;
  cursor: pointer;
}

.product-picker-option:hover,
.product-picker-option:focus,
.manual-replenishment-picker-option:hover,
.manual-replenishment-picker-option:focus {
  background: #eff6ff;
  outline: none;
}

.product-picker-thumb {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  object-fit: cover;
}

.product-picker-thumb-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 14px;
  font-weight: 800;
}

.product-picker-text {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.product-picker-text strong {
  overflow: hidden;
  font-size: 13px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-picker-text small {
  color: #64748b;
  font-size: 11px;
  line-height: 1.25;
  white-space: normal;
}

.manual-replenishment-picker-text {
  gap: 4px;
}

.manual-replenishment-picker-text strong,
.manual-replenishment-picker-text small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manual-replenishment-picker-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.manual-replenishment-meta-chip {
  display: inline-flex;
  align-items: center;
  max-width: 180px;
  min-height: 18px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #eef2ff;
  color: #475569;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-picker-empty {
  padding: 12px;
  color: #64748b;
  font-size: 13px;
}

.detail-note {
  margin-bottom: 8px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
}

body[data-view-mode="daily"] #diagnoseBtn,
body[data-view-mode="daily"] #exportBtn {
  display: none;
}

body[data-view-mode="daily"] #dailyReportPanel {
  margin-top: 0;
}

body[data-view-mode="logs"] #refreshBtn,
body[data-view-mode="logs"] #diagnoseBtn,
body[data-view-mode="logs"] #exportBtn,
body[data-view-mode="config"] #refreshBtn,
body[data-view-mode="config"] #diagnoseBtn,
body[data-view-mode="config"] #exportBtn {
  display: none;
}

.manual-detail-row td {
  background: #fffdf5;
}

.manual-detail-new td {
  border-top: 2px solid #f59e0b;
}

.manual-detail-actions {
  min-width: 150px;
}

.manual-detail-actions .mini-btn {
  margin-left: 6px;
}

.manual-detail-input {
  width: 112px;
  height: 30px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.manual-detail-input.wide {
  width: 170px;
}

.manual-detail-input.num {
  width: 88px;
  text-align: right;
}

.creative-panel {
  margin-bottom: 16px;
}

.creative-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfdff;
}

.creative-leaderboard {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.creative-leaderboard-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.creative-leaderboard-head h3 {
  margin: 0;
  color: #0f172a;
  font-size: 15px;
}

.creative-leaderboard-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.creative-rank-table {
  border: 1px solid var(--line);
  border-radius: 8px;
}

.creative-rank-table table {
  min-width: 940px;
}

.creative-table table {
  min-width: 1180px;
}

.creative-product-row td {
  background: #fbfdff;
  font-weight: 700;
}

.creative-product-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 300px;
  white-space: normal;
}

.creative-product-thumb {
  display: block;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border: 1px solid #dbe4ef;
  border-radius: 9px;
  background: #fff;
  object-fit: cover;
}

.creative-product-thumb-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  color: #94a3b8;
  font-size: 10px;
  text-align: center;
}

.creative-product-detail-row > td {
  padding: 0;
  background: #f8fafc;
}

.creative-material-count {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}

.creative-material-count b {
  min-width: 18px;
  color: #0f172a;
  font-size: 14px;
  text-align: right;
}

.creative-material-toggle {
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  color: #1d4ed8;
  background: #eff6ff;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.creative-material-toggle:hover,
.creative-material-toggle:focus-visible {
  border-color: #60a5fa;
  background: #dbeafe;
  outline: none;
}

.creative-material-toggle.secondary {
  color: #475569;
  border-color: #cbd5e1;
  background: #fff;
}

.creative-product-detail-panel {
  padding: 12px 14px 14px;
  border-top: 2px solid #bfdbfe;
  background: #f8fafc;
}

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

.creative-product-detail-head > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.creative-product-detail-head b {
  color: #0f172a;
  font-size: 13px;
}

.creative-product-detail-head span {
  color: #64748b;
  font-size: 12px;
}

.creative-material-table {
  min-width: 2250px !important;
  background: #fff;
}

.creative-material-table th,
.creative-material-table td {
  padding: 9px 10px;
}

.creative-editor-control {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 168px;
}

.creative-editor-input {
  width: 112px;
  height: 30px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 5px 8px;
  background: #fff;
  color: #0f172a;
  font-size: 12px;
}

.creative-editor-input[readonly] {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #334155;
}

.creative-editor-input.is-editing {
  background: #fff;
  border-color: #2563eb;
}

.creative-save-editor {
  height: 30px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
}

.creative-score {
  min-width: 86px;
  color: #0f172a;
  font-weight: 900;
}

.creative-score .sub {
  margin-top: 2px;
  font-weight: 700;
}

.creative-commission {
  color: #b45309;
  font-weight: 900;
}

.creative-hit {
  background: #fff7ed;
  color: #c2410c;
}

.creative-reason {
  display: inline-block;
  margin: 2px 5px 2px 0;
  border-radius: 999px;
  background: #eff6ff;
  padding: 3px 8px;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
}


.metric-stack {
  max-width: 190px;
  color: #334155;
  font-size: 12px;
  line-height: 1.55;
  white-space: normal;
}

.creative-trend {
  min-width: 260px;
  color: #334155;
  font-size: 12px;
  line-height: 1.55;
  white-space: normal;
}

.creative-trend div + div {
  margin-top: 2px;
}

.budget-trend {
  min-width: 190px;
  white-space: normal;
  line-height: 1.45;
}

.budget-trend strong {
  display: block;
  font-size: 12px;
  font-weight: 900;
}

.budget-trend span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.budget-trend-good strong {
  color: var(--green);
}

.budget-trend-bad strong {
  color: var(--red);
}

.budget-trend-watch strong,
.budget-trend-stable strong {
  color: var(--amber);
}

.budget-trend-neutral strong {
  color: #64748b;
}

.replenishment-panel {
  margin-bottom: 16px;
}

.replenishment-overview-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.replenishment-overview-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
}

.replenishment-overview-summary > div {
  min-width: 0;
  padding: 13px 16px;
}

.replenishment-overview-summary > div + div {
  border-left: 1px solid var(--line);
}

.replenishment-overview-summary span,
.replenishment-overview-summary small {
  display: block;
  color: #64748b;
  font-size: 11px;
  line-height: 1.35;
}

.replenishment-overview-summary b {
  display: block;
  margin: 3px 0 2px;
  color: #0f172a;
  font-size: 21px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.replenishment-overview-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  align-items: end;
  gap: 16px;
  margin: 14px 18px 10px;
}

.replenishment-overview-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.replenishment-overview-filters button {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.replenishment-overview-filters button:hover,
.replenishment-overview-filters button:focus-visible {
  border-color: #93c5fd;
  color: #1d4ed8;
}

.replenishment-overview-filters button.is-active {
  border-color: #60a5fa;
  background: #eff6ff;
  color: #1d4ed8;
}

.replenishment-overview-filters button b {
  min-width: 18px;
  margin-left: 3px;
  padding: 1px 5px;
  border-radius: 999px;
  background: #e2e8f0;
  color: inherit;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.replenishment-overview-filters button.is-active b {
  background: #dbeafe;
}

.replenishment-overview-search {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.replenishment-overview-search input {
  width: 100%;
  height: 36px;
  min-height: 36px;
}

.replenishment-overview-auto-note {
  margin: 0 18px 10px;
  padding: 8px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 12px;
  line-height: 1.4;
}

.replenishment-overview-table {
  margin: 0 18px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.replenishment-overview-table table {
  width: 100%;
  min-width: 1260px;
  table-layout: fixed;
}

.replenishment-overview-table th:nth-child(1) { width: 23%; }
.replenishment-overview-table th:nth-child(2) { width: 8%; }
.replenishment-overview-table th:nth-child(3) { width: 17%; }
.replenishment-overview-table th:nth-child(4) { width: 21%; }
.replenishment-overview-table th:nth-child(5) { width: 11%; }
.replenishment-overview-table th:nth-child(6) { width: 15%; }
.replenishment-overview-table th:nth-child(7) { width: 5%; }

.replenishment-overview-table th,
.replenishment-overview-table td {
  overflow: hidden;
  vertical-align: middle;
}

.replenishment-overview-row.needs-attention {
  background: #fffafa;
}

.replenishment-overview-product {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.replenishment-overview-product .product-picker-thumb {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
}

.replenishment-overview-product > span,
.replenishment-overview-purchase,
.replenishment-overview-logistics,
.replenishment-overview-arrival,
.replenishment-overview-state,
.replenishment-overview-quantity {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
}

.replenishment-overview-product strong,
.replenishment-overview-purchase strong,
.replenishment-overview-logistics strong,
.replenishment-overview-arrival strong,
.replenishment-overview-quantity strong {
  max-width: 100%;
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.replenishment-overview-product small,
.replenishment-overview-purchase span,
.replenishment-overview-purchase small,
.replenishment-overview-logistics span,
.replenishment-overview-logistics small,
.replenishment-overview-arrival span,
.replenishment-overview-state small,
.replenishment-overview-quantity span {
  max-width: 100%;
  color: #64748b;
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.replenishment-overview-state small {
  color: #475569;
}

.replenishment-overview-logistics small,
.replenishment-overview-state small {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.copy-replenishment-tracking {
  overflow: hidden;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2563eb;
  cursor: copy;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-replenishment-tracking:hover,
.copy-replenishment-tracking:focus-visible {
  color: #1d4ed8;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.replenishment-overview-detail-row > td {
  padding: 0;
  background: #f8fafc;
}

.replenishment-overview-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(240px, .8fr) minmax(300px, 1fr);
  gap: 0;
  border-top: 1px solid #dbeafe;
}

.replenishment-overview-detail > section {
  min-width: 0;
  padding: 14px 16px;
}

.replenishment-overview-detail > section + section {
  border-left: 1px solid var(--line);
}

.replenishment-overview-detail h4 {
  margin: 0 0 10px;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.replenishment-overview-sku-list {
  display: grid;
  gap: 7px;
}

.replenishment-overview-sku-list > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px 72px;
  align-items: center;
  gap: 8px;
  padding-bottom: 7px;
  border-bottom: 1px solid #e2e8f0;
}

.replenishment-overview-sku-list > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.replenishment-overview-sku-list span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.replenishment-overview-sku-list strong,
.replenishment-overview-sku-list small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.replenishment-overview-sku-list strong {
  color: #1e293b;
  font-size: 12px;
}

.replenishment-overview-sku-list small,
.replenishment-overview-sku-list em {
  color: #64748b;
  font-size: 11px;
  font-style: normal;
}

.replenishment-overview-sku-list b,
.replenishment-overview-sku-list em {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.replenishment-overview-detail dl {
  display: grid;
  gap: 6px;
  margin: 0;
}

.replenishment-overview-detail dl > div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
}

.replenishment-overview-detail dt,
.replenishment-overview-detail dd {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
}

.replenishment-overview-detail dt { color: #64748b; }
.replenishment-overview-detail dd { color: #1e293b; font-weight: 700; overflow-wrap: anywhere; }

.replenishment-overview-detail .tracking-status {
  min-width: 0;
  max-width: none;
}

.replenishment-overview-note {
  margin: 9px 0 0;
  color: #475569;
  font-size: 11px;
  line-height: 1.45;
}

.replenishment-overview-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

@media (max-width: 1050px) {
  .replenishment-overview-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .replenishment-overview-summary > div:nth-child(4) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .replenishment-overview-summary > div:nth-child(5) {
    border-top: 1px solid var(--line);
  }

  .replenishment-overview-toolbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .replenishment-overview-head-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .replenishment-overview-head-actions .account-info {
    text-align: left;
  }

  .replenishment-overview-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 12px;
  }

  .replenishment-overview-summary > div:nth-child(n) {
    border-top: 0;
    border-left: 0;
  }

  .replenishment-overview-summary > div:nth-child(even) {
    border-left: 1px solid var(--line);
  }

  .replenishment-overview-summary > div:nth-child(n+3) {
    border-top: 1px solid var(--line);
  }

  .replenishment-overview-toolbar {
    margin: 12px;
  }

  .replenishment-overview-auto-note {
    margin: 0 12px 10px;
  }

  .replenishment-overview-table {
    margin: 0 12px 12px;
  }

  .replenishment-overview-detail {
    grid-template-columns: 1fr;
  }

  .replenishment-overview-detail > section + section {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

.replenishment-cards {
  padding: 16px 18px 0;
}

.manual-replenishment-entry {
  margin: 14px 18px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.manual-replenishment-picker {
  max-height: min(520px, 74vh);
}

.manual-replenishment-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.manual-replenishment-title h3 {
  margin: 0;
  font-size: 15px;
}

.manual-replenishment-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.manual-replenishment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
}

.manual-replenishment-grid label {
  display: grid;
  gap: 5px;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.manual-replenishment-grid label.wide {
  grid-column: span 2;
  min-width: 220px;
}

.manual-replenishment-grid input,
.manual-replenishment-grid select {
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #0f172a;
  font: inherit;
}

.manual-replenishment-grid .btn {
  min-height: 34px;
}

.purchase-entry {
  margin-top: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.purchase-order-editor-home {
  display: none;
}

.purchase-entry .manual-replenishment-title,
.purchase-entry .manual-replenishment-selected {
  margin-left: 18px;
  margin-right: 18px;
}

.purchase-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  padding: 16px 18px 18px;
}

.purchase-order-inline-row > td {
  border-top: 0;
  background: #f5f9ff;
  padding: 0 12px 14px;
}

.purchase-order-inline-shell {
  overflow: hidden;
  border: 1px solid #93c5fd;
  border-radius: 0 0 8px 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.purchase-approved-main-row.is-editing > td {
  border-top-color: #93c5fd;
  border-bottom-color: #93c5fd;
  background: #eff6ff;
}

.purchase-approved-main-row.is-editing > td:first-child {
  box-shadow: inset 1px 0 #3b82f6;
}

.purchase-approved-main-row.is-editing > td:last-child {
  box-shadow: inset -1px 0 #3b82f6;
}

.purchase-order-inline-shell .purchase-entry {
  padding: 14px 16px 16px;
}

.purchase-order-inline-shell .manual-replenishment-title {
  align-items: center;
  margin: 0 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.purchase-order-inline-shell .manual-replenishment-title h3 {
  font-size: 16px;
}

.purchase-order-inline-shell .manual-replenishment-title p {
  max-width: 760px;
  line-height: 1.5;
}

.purchase-order-inline-shell .manual-replenishment-selected {
  display: none;
}

.purchase-order-inline-shell .purchase-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 12px;
  padding: 0;
}

.purchase-order-inline-shell .manual-replenishment-sku-detail {
  gap: 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0 0 12px;
}

.purchase-order-inline-shell .manual-replenishment-sku-head {
  padding: 0 2px;
}

.purchase-order-inline-shell .manual-replenishment-sku-note {
  color: #475569;
  font-weight: 700;
}

.purchase-order-inline-shell .manual-replenishment-sku-option,
.purchase-order-inline-shell .manual-replenishment-sku-line {
  border-color: #d8e2ef;
  background: #f8fafc;
}

.purchase-order-inline-shell .manual-replenishment-sku-option.selected {
  border-color: #60a5fa;
  background: #eff6ff;
  box-shadow: none;
}

.purchase-order-inline-shell .manual-replenishment-grid > .btn.primary {
  min-height: 36px;
}

@media (max-width: 1180px) {
  .purchase-order-inline-shell .purchase-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .purchase-order-inline-row > td {
    padding: 0 8px 10px;
  }

  .purchase-order-inline-shell .purchase-entry {
    padding: 12px;
  }

  .purchase-order-inline-shell .purchase-grid {
    grid-template-columns: 1fr;
  }

  .purchase-order-inline-shell .purchase-grid label.wide {
    grid-column: auto;
    min-width: 0;
  }
}

.panel-subhead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 8px;
  border-top: 1px solid var(--line);
}

.panel-subhead h3 {
  margin: 0;
  color: #0f172a;
  font-size: 15px;
}

.panel-subhead p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.purchase-replenishment-table {
  margin-top: 0;
}

.purchase-replenishment-table table {
  width: 100%;
  min-width: 1180px;
  table-layout: fixed;
}

.purchase-replenishment-table.purchase-card-mode {
  overflow-x: visible;
}

.purchase-replenishment-table.purchase-card-mode table {
  min-width: 0;
}

.purchase-replenishment-table.purchase-card-mode thead {
  display: none;
}

.purchase-replenishment-table th:nth-child(1) { width: 19%; }
.purchase-replenishment-table th:nth-child(2) { width: 10%; }
.purchase-replenishment-table th:nth-child(3) { width: 16%; }
.purchase-replenishment-table th:nth-child(4) { width: 18%; }
.purchase-replenishment-table th:nth-child(5) { width: 27%; }
.purchase-replenishment-table th:nth-child(6) { width: 10%; }

.purchase-replenishment-input {
  width: 100%;
  min-width: 112px;
  height: 34px;
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-size: 12px;
}

.purchase-replenishment-input.product-name-input {
  min-width: 180px;
}

.purchase-replenishment-input.purchase-url-input,
.purchase-replenishment-input.purchase-note-input {
  min-width: 0;
}

.purchase-execution-tabs {
  display: flex;
  gap: 6px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.purchase-execution-tabs button {
  height: 36px;
  padding: 0 14px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #475569;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.purchase-execution-tabs button.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.purchase-execution-tabs b {
  margin-left: 4px;
}

.purchase-batch-head td {
  padding: 10px 12px;
  border-top: 2px solid #dbe4f0;
  background: #f8fafc;
}

.purchase-batch-summary,
.purchase-batch-summary > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.purchase-batch-summary {
  justify-content: space-between;
}

.purchase-batch-summary strong,
.purchase-batch-summary span,
.purchase-sku-cell strong,
.purchase-sku-cell span {
  display: block;
}

.purchase-batch-summary strong {
  color: #0f172a;
  font-size: 14px;
}

.purchase-batch-summary span,
.purchase-sku-cell span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.purchase-execution-row > td {
  padding: 10px;
  vertical-align: top;
}

.purchase-sku-cell {
  min-width: 0;
  white-space: normal;
}

.purchase-sku-cell strong {
  color: #0f172a;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.purchase-record-fields {
  display: grid;
  gap: 6px;
}

.purchase-record-fields.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.purchase-record-field {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.purchase-record-field > span {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.purchase-record-field .purchase-replenishment-input {
  min-width: 0;
}

.purchase-record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.purchase-record-actions small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  white-space: normal;
}

.purchase-batch-detail > td {
  padding: 12px;
  background: #fff;
}

.purchase-order-overview {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(420px, 1.2fr);
  gap: 14px;
  margin-bottom: 12px;
}

.purchase-order-meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px 10px;
  padding: 10px;
  border: 1px solid #dbe4f0;
  border-radius: 6px;
  background: #f8fafc;
  font-size: 12px;
}

.purchase-order-meta b { color: #64748b; }
.purchase-order-meta span { color: #0f172a; font-weight: 800; overflow-wrap: anywhere; }

.purchase-order-meta.purchase-order-edit {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
}

.purchase-order-edit input,
.purchase-order-sku-edit input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  font: inherit;
  font-size: 12px;
}

.purchase-order-skus {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid #dbe4f0;
  border-radius: 6px;
  font-size: 12px;
}

.purchase-order-skus span { display: block; color: #475569; }

.purchase-order-sku-edit {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(90px, 0.7fr));
  gap: 8px;
  align-items: end;
  padding: 7px 0;
  border-bottom: 1px solid #e2e8f0;
}

.purchase-order-sku-edit:last-child { border-bottom: 0; }

.purchase-recycle-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #fecaca;
  border-radius: 6px;
  background: #fff7f7;
}

.purchase-recycle-summary div { display: grid; gap: 3px; }
.purchase-recycle-summary b { color: #64748b; font-size: 11px; }
.purchase-recycle-summary span { color: #0f172a; font-size: 12px; }

.purchase-tracking-editor {
  display: grid;
  gap: 8px;
}

.purchase-tracking-fields {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}

.purchase-tracking-editor input,
.purchase-inspection-line input,
.purchase-batch-input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  font: inherit;
  font-size: 12px;
}

.purchase-inspection-grid { display: grid; gap: 7px; }

.purchase-inspection-line {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(90px, 0.7fr)) minmax(180px, 1.2fr);
  gap: 8px;
  align-items: end;
  padding: 9px;
  border: 1px solid #dbe4f0;
  border-radius: 6px;
  background: #f8fafc;
}

.purchase-batch-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 10px;
  color: #64748b;
  font-size: 12px;
}

.purchase-completed-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.purchase-completed-overview > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #dbe4f0;
  border-radius: 6px;
  background: #f8fafc;
}

.purchase-completed-overview b {
  color: #64748b;
  font-size: 11px;
}

.purchase-completed-overview span {
  overflow: hidden;
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-completed-skus {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.purchase-completed-sku {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(90px, 0.7fr));
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  color: #475569;
  font-size: 12px;
}

.purchase-completed-actions {
  justify-content: space-between;
  border-top: 1px solid #e2e8f0;
}

.purchase-inline-feedback {
  min-height: 18px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
}

.purchase-inline-feedback.working {
  color: #2563eb;
}

.purchase-inline-feedback.success {
  color: #15803d;
}

.purchase-inline-feedback.error {
  color: #dc2626;
  font-weight: 600;
}

.purchase-tracking-status { min-width: 0; }

.row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}

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

.logistics-replenishment-table {
  margin-top: 0;
}

.logistics-replenishment-table table {
  min-width: 2480px;
}

#logisticsReplenishmentPanel .logistics-replenishment-table table {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  table-layout: fixed;
}

#logisticsReplenishmentPanel .logistics-replenishment-table th:nth-child(1) { width: 24%; }
#logisticsReplenishmentPanel .logistics-replenishment-table th:nth-child(2) { width: 9%; }
#logisticsReplenishmentPanel .logistics-replenishment-table th:nth-child(3) { width: 14%; }
#logisticsReplenishmentPanel .logistics-replenishment-table th:nth-child(4) { width: 9%; }
#logisticsReplenishmentPanel .logistics-replenishment-table th:nth-child(5) { width: 11%; }
#logisticsReplenishmentPanel .logistics-replenishment-table th:nth-child(6) { width: 11%; }
#logisticsReplenishmentPanel .logistics-replenishment-table th:nth-child(7) { width: 22%; }

#logisticsReplenishmentPanel .logistics-replenishment-table th,
#logisticsReplenishmentPanel .logistics-replenishment-table td {
  min-width: 0;
}

#weihaiOutboundPanel .logistics-replenishment-table table {
  width: 100%;
  min-width: 1550px;
  table-layout: fixed;
}

#weihaiOutboundPanel .logistics-replenishment-table th:nth-child(1) { width: 160px; }
#weihaiOutboundPanel .logistics-replenishment-table th:nth-child(2) { width: 340px; }
#weihaiOutboundPanel .logistics-replenishment-table th:nth-child(3) { width: 90px; }
#weihaiOutboundPanel .logistics-replenishment-table th:nth-child(4) { width: 110px; }
#weihaiOutboundPanel .logistics-replenishment-table th:nth-child(5) { width: 90px; }
#weihaiOutboundPanel .logistics-replenishment-table th:nth-child(6) { width: 125px; }
#weihaiOutboundPanel .logistics-replenishment-table th:nth-child(7) { width: 120px; }
#weihaiOutboundPanel .logistics-replenishment-table th:nth-child(8) { width: 135px; }
#weihaiOutboundPanel .logistics-replenishment-table th:nth-child(9) { width: 180px; }
#weihaiOutboundPanel .logistics-replenishment-table th:nth-child(10) { width: 145px; }
#weihaiOutboundPanel .logistics-replenishment-table th:nth-child(11) { width: 110px; }

#logisticsReplenishmentPanel .replenishment-stage-input,
#weihaiOutboundPanel .replenishment-stage-input {
  width: 100%;
  min-width: 0;
}

#weihaiOutboundPanel .carton-outbound-input {
  width: 100%;
  min-width: 0;
}

#seaLogisticsPanel .logistics-replenishment-table table {
  min-width: 1500px;
}

.shipping-cost-calculator {
  padding: 16px 18px;
  border-bottom: 1px solid #dbe4ee;
  background: #f8fafc;
}

.replenishment-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

#openShippingCalculatorBtn {
  color: #1d4ed8;
  border-color: #bfdbfe;
  background: #eff6ff;
  font-weight: 700;
}

#openShippingCalculatorBtn:hover {
  border-color: #60a5fa;
  background: #dbeafe;
}

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

.shipping-calculator-head h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
}

.shipping-calculator-head p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
}

.shipping-calculator-head .mini-btn {
  flex: 0 0 auto;
  min-width: 52px;
  white-space: nowrap;
}

.shipping-mode-fieldset {
  display: grid;
  grid-template-columns: auto minmax(340px, 620px) minmax(220px, 1fr);
  align-items: center;
  gap: 10px 14px;
  min-width: 0;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
}

.shipping-mode-fieldset legend {
  float: left;
  width: auto;
  padding: 0;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.shipping-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
  padding: 3px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #e8edf3;
}

.shipping-mode-switch label {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.shipping-mode-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.shipping-mode-switch span {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 7px;
  min-height: 42px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #64748b;
}

.shipping-mode-switch b {
  color: #334155;
  font-size: 13px;
  white-space: nowrap;
}

.shipping-mode-switch small {
  min-width: 0;
  font-size: 11px;
  line-height: 1.35;
}

.shipping-mode-switch input:checked + span {
  border-color: #93c5fd;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  color: #1d4ed8;
}

.shipping-mode-switch input:checked + span b {
  color: #1d4ed8;
}

.shipping-mode-switch input:focus-visible + span {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.shipping-mode-fieldset > p {
  min-width: 0;
  margin: 0;
  color: #64748b;
  font-size: 11px;
  line-height: 1.45;
}

.shipping-input-grid,
.shipping-rate-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
}

.shipping-input-grid {
  grid-template-columns: repeat(7, minmax(105px, 1fr));
}

.shipping-input-section {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #dbe4ee;
}

.shipping-input-section + .shipping-input-section {
  margin-top: 12px;
}

.shipping-input-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.shipping-input-heading b {
  color: #334155;
  font-size: 12px;
}

.shipping-input-heading span {
  color: #64748b;
  font-size: 11px;
}

.shipping-item-section {
  padding: 10px 12px 12px;
  border-bottom: 1px solid #dbe4ee;
  background: #f1f5f9;
}

.shipping-item-input-grid {
  grid-template-columns: repeat(5, minmax(130px, 1fr));
}

.shipping-input-grid label,
.shipping-rate-grid label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.shipping-input-grid label > span,
.shipping-rate-grid label > span {
  color: #475569;
  font-size: 12px;
  font-weight: 600;
}

.shipping-input-grid input,
.shipping-rate-grid input {
  width: 100%;
  min-width: 0;
  height: 36px;
}

.shipping-auto-weight-field {
  position: relative;
}

.shipping-auto-weight-field > small {
  min-height: 15px;
  color: #64748b;
  font-size: 10px;
  line-height: 1.35;
}

.shipping-auto-weight-field .shipping-auto-input {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
}

.shipping-auto-weight-field .shipping-manual-input {
  background: #ffffff;
}

.shipping-auto-reset {
  position: absolute;
  right: 0;
  bottom: -1px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2563eb;
  font-size: 10px;
  line-height: 1.35;
  cursor: pointer;
}

.shipping-auto-reset:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.shipping-auto-reset:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.shipping-input-grid .shipping-calculated-input {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
  cursor: default;
}

.shipping-rate-settings {
  margin-top: 10px;
}

.shipping-rate-settings summary {
  width: max-content;
  cursor: pointer;
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
}

.shipping-rate-settings[open] summary {
  margin-bottom: 10px;
}

.shipping-rate-grid {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  padding: 12px;
  border: 1px solid #dbe4ee;
  border-radius: 6px;
  background: #ffffff;
}

.shipping-rate-grid .shipping-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding-top: 18px;
}

.shipping-rate-grid .shipping-check input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.shipping-rate-grid input:disabled {
  border-color: #dbe4ee;
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}

.shipping-tail-rule {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(420px, 1.8fr);
  align-items: center;
  gap: 12px 18px;
  margin-top: 12px;
  padding: 10px 12px;
  border-top: 1px solid #dbe4ee;
  border-bottom: 1px solid #dbe4ee;
  background: #ffffff;
}

.shipping-tail-rule > div {
  display: grid;
  gap: 2px;
}

.shipping-tail-rule b {
  color: #334155;
  font-size: 12px;
}

.shipping-tail-rule span,
.shipping-tail-rule small {
  color: #64748b;
  font-size: 11px;
  line-height: 1.5;
}

.shipping-tail-rule small {
  font-variant-numeric: tabular-nums;
}

.shipping-result-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  margin-top: 14px;
  border: 1px solid #dbe4ee;
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
}

.shipping-result-strip > div {
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 92px;
  padding: 12px 14px;
  border-right: 1px solid #e2e8f0;
}

.shipping-result-strip > div:last-child {
  border-right: 0;
}

.shipping-result-strip span,
.shipping-result-strip small {
  color: #64748b;
  font-size: 11px;
  line-height: 1.35;
}

.shipping-result-strip b {
  color: #0f172a;
  font-size: 17px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.shipping-result-strip .shipping-total-result {
  border-top: 3px solid #16a34a;
  background: #f0fdf4;
}

.shipping-result-strip .shipping-total-result b {
  color: #15803d;
  font-size: 20px;
}

.shipping-calculator-notice {
  margin-top: 10px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.shipping-calculator-notice.success { color: #15803d; }
.shipping-calculator-notice.warning { color: #b45309; }
.shipping-calculator-notice.danger { color: #dc2626; font-weight: 600; }

@media (max-width: 1280px) {
  .shipping-mode-fieldset {
    grid-template-columns: auto minmax(340px, 1fr);
  }

  .shipping-mode-fieldset > p {
    grid-column: 2;
  }

  .shipping-input-grid,
  .shipping-rate-grid,
  .shipping-result-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .shipping-result-strip > div:nth-child(3) {
    border-right: 0;
  }

  .shipping-result-strip > div:nth-child(-n+3) {
    border-bottom: 1px solid #e2e8f0;
  }
}

@media (max-width: 1100px) {
  .purchase-order-overview { grid-template-columns: 1fr; }
  .purchase-order-sku-edit { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .purchase-order-sku-edit > b { grid-column: 1 / -1; }
  .purchase-recycle-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .purchase-tracking-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .purchase-inspection-line { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .purchase-inspection-line .purchase-sku-cell { grid-column: 1 / -1; }
  .purchase-completed-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .purchase-completed-sku { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .purchase-completed-sku > div:first-child { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .purchase-order-meta.purchase-order-edit,
  .purchase-order-sku-edit,
  .purchase-recycle-summary,
  .purchase-tracking-fields,
  .purchase-completed-overview,
  .purchase-completed-sku { grid-template-columns: 1fr; }
  .shipping-cost-calculator { padding: 14px 12px; }
  .shipping-mode-fieldset { grid-template-columns: 1fr; }
  .shipping-mode-fieldset legend { float: none; margin-bottom: 6px; }
  .shipping-mode-fieldset > p { grid-column: 1; }
  .shipping-mode-switch span {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 2px;
    min-height: 58px;
  }
  .shipping-tail-rule {
    grid-template-columns: 1fr;
    gap: 6px;
    padding-inline: 0;
  }
  .shipping-input-grid,
  .shipping-rate-grid,
  .shipping-result-strip { grid-template-columns: 1fr; }
  .shipping-input-heading {
    display: grid;
    gap: 2px;
  }
  .shipping-item-section {
    padding-inline: 0;
    background: transparent;
  }
  .shipping-result-strip > div,
  .shipping-result-strip > div:nth-child(3) {
    min-height: 76px;
    border-right: 0;
    border-bottom: 1px solid #e2e8f0;
  }
  .shipping-result-strip > div:last-child { border-bottom: 0; }
  .shipping-calculator-head { align-items: flex-start; }
}

.logistics-replenishment-table td {
  vertical-align: middle;
}

.warehouse-flow-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
}

.warehouse-flow-strip span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.warehouse-flow-strip span i {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 50%;
  background: #fff;
  color: #64748b;
  font-style: normal;
  font-weight: 700;
}

.warehouse-flow-strip span.done { color: #15803d; }
.warehouse-flow-strip span.done i { border-color: #86efac; background: #dcfce7; color: #15803d; }
.warehouse-flow-strip span.active { color: #1d4ed8; font-weight: 700; }
.warehouse-flow-strip span.active i { border-color: #2563eb; background: #2563eb; color: #fff; }
.warehouse-flow-strip > b { color: #cbd5e1; font-weight: 400; }

.weihai-inbound-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.weihai-inbound-summary .card {
  min-height: 76px;
  padding: 11px 13px;
}

.weihai-inbound-summary .card:nth-child(1) { border-top: 3px solid #f59e0b; }
.weihai-inbound-summary .card:nth-child(2) { border-top: 3px solid #f97316; }
.weihai-inbound-summary .card:nth-child(3) { border-top: 3px solid #22c55e; }
.weihai-inbound-summary .card:nth-child(4) { border-top: 3px solid #94a3b8; }
.weihai-inbound-summary .card small { margin-top: 3px; color: #64748b; font-size: 10px; }

.repack-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.repack-progress-head span {
  color: #2563eb;
  font-size: 10px;
  font-weight: 700;
}

.repack-progress-track {
  overflow: hidden;
  height: 5px;
  margin: 6px 0 4px;
  border-radius: 99px;
  background: #e2e8f0;
}

.repack-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2563eb;
}

.repack-remaining-number { color: #c2410c; }

.repack-quantity-input {
  height: 36px;
  border-color: #bfdbfe !important;
  background: #f8fbff !important;
  font-weight: 700 !important;
  text-align: center;
}

.repack-row-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 8px;
  align-items: center;
}

.repack-row-actions .mini-btn {
  width: 92px;
  padding-right: 8px;
  padding-left: 8px;
}

.repack-empty-success b,
.repack-empty-success span {
  display: block;
}

.repack-empty-success b { color: #15803d; }
.repack-empty-success span { margin-top: 4px; color: #64748b; font-size: 11px; }

.warehouse-carton-entry {
  margin-top: 14px;
}

.warehouse-carton-summary {
  margin-top: 12px;
}

.warehouse-carton-editor {
  margin-top: 14px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #f8fbff;
  padding: 14px;
}

.warehouse-carton-fields {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.warehouse-carton-fields label {
  display: grid;
  gap: 6px;
}

.warehouse-carton-fields label.wide {
  grid-column: 1 / -1;
}

.warehouse-carton-fields span,
.warehouse-carton-item-head span {
  color: #64748b;
  font-size: 11px;
}

.warehouse-carton-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 15px 0 8px;
}

.warehouse-carton-item-list {
  display: grid;
  gap: 7px;
}

.warehouse-carton-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px 130px;
  gap: 12px;
  align-items: center;
  border: 1px solid #dbe5ef;
  border-radius: 6px;
  background: #fff;
  padding: 9px 10px;
}

.warehouse-carton-item > div,
.warehouse-carton-contents {
  min-width: 0;
}

.warehouse-carton-item b,
.warehouse-carton-item span,
.warehouse-carton-contents span {
  display: block;
}

.warehouse-carton-item > div span {
  overflow: hidden;
  margin-top: 3px;
  color: #64748b;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-ready-quantity {
  color: #166534;
  text-align: right;
}

.warehouse-ready-quantity small,
.warehouse-ready-quantity b { display: block; }
.warehouse-ready-quantity small { color: #64748b; font-size: 10px; }
.warehouse-ready-quantity b { margin-top: 2px; font-size: 14px; }

.warehouse-carton-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.warehouse-carton-table {
  margin-top: 14px;
}

.warehouse-carton-table table {
  min-width: 900px;
  table-layout: fixed;
}

.warehouse-carton-table th:nth-child(1) { width: 18%; }
.warehouse-carton-table th:nth-child(2) { width: 38%; }
.warehouse-carton-table th:nth-child(3) { width: 10%; }
.warehouse-carton-table th:nth-child(4) { width: 12%; }
.warehouse-carton-table th:nth-child(5) { width: 9%; }
.warehouse-carton-table th:nth-child(6) { width: 13%; }

.warehouse-carton-contents {
  display: grid;
  gap: 4px;
}

.warehouse-carton-contents span {
  overflow: hidden;
  color: #334155;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 900px) {
  #logisticsReplenishmentPanel .logistics-replenishment-table table { min-width: 980px; }
  .warehouse-flow-strip { overflow-x: auto; }
  .weihai-inbound-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .warehouse-carton-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .warehouse-carton-item { grid-template-columns: minmax(0, 1fr) 80px 110px; }
}

@media (max-width: 560px) {
  .weihai-inbound-summary { grid-template-columns: 1fr 1fr; padding: 10px; }
  .weihai-inbound-summary .card { min-height: 70px; padding: 9px 10px; }
}

.wing-inbound-entry,
.wing-print-entry {
  margin-bottom: 14px;
}

.wing-inbound-grid,
.wing-print-grid {
  align-items: end;
}

.wing-inbound-summary {
  margin-top: 12px;
}

.wing-inbound-table,
.wing-print-table {
  margin-top: 12px;
}

.wing-inbound-table table {
  min-width: 1100px;
}

.wing-print-table table {
  min-width: 900px;
}

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

.wing-product-cell img {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid #d8e2ef;
  background: #f8fafc;
}

.mini-btn.ghost {
  color: #475569;
  background: #f8fafc;
}

.logistics-replenishment-input {
  min-width: 104px;
  height: 34px;
  padding: 6px 8px;
  font-size: 12px;
}

.logistics-note-input {
  min-width: 180px;
}

.tracking-status-cell {
  min-width: 220px;
}

.tracking-status {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 200px;
  max-width: 300px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
}

.tracking-status b {
  color: var(--text);
  font-size: 12px;
}

.tracking-status small {
  color: var(--muted);
}

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

.tracking-subscription {
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
}

.tracking-subscription.success { background: #dcfce7; color: #047857; }
.tracking-subscription.warning { background: #fef3c7; color: #92400e; }
.tracking-subscription.danger { background: #fee2e2; color: #b91c1c; }

.tracking-stage-line {
  display: grid;
  gap: 3px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.tracking-stage-line span {
  background: #e2e8f0;
  color: #94a3b8;
  font-size: 9px;
  overflow: hidden;
  padding: 3px 2px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tracking-stage-line span.done {
  background: #dbeafe;
  color: #1d4ed8;
}

.tracking-status.success b {
  color: #059669;
}

.tracking-status.info b {
  color: #2563eb;
}

.tracking-status.warning b {
  color: #d97706;
}

.tracking-status.danger b {
  color: #dc2626;
}

.tracking-status.muted,
.tracking-status.muted b {
  color: #94a3b8;
}

.manual-replenishment-sku-detail {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #fff;
}

.manual-replenishment-sku-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.manual-replenishment-sku-head strong,
.manual-replenishment-sku-head small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manual-replenishment-sku-head strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
}

.manual-replenishment-sku-head small,
.manual-replenishment-sku-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.manual-replenishment-sku-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
}

.manual-replenishment-sku-option {
  display: flex;
  align-items: flex-start;
  min-width: 0;
  gap: 10px;
  padding: 8px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #0f172a;
  text-align: left;
  cursor: pointer;
}

.manual-replenishment-sku-option:hover,
.manual-replenishment-sku-option:focus {
  border-color: #93c5fd;
  background: #eff6ff;
  outline: none;
}

.manual-replenishment-sku-option.selected {
  border-color: var(--blue);
  background: #eaf2ff;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.18);
}

.manual-replenishment-sku-lines {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px dashed #cbd5e1;
}

.manual-replenishment-sku-lines-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.manual-replenishment-sku-lines-head strong {
  color: #0f172a;
  font-size: 13px;
}

.manual-replenishment-sku-lines-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.manual-replenishment-sku-line {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) repeat(3, minmax(110px, 1fr));
  gap: 8px;
  align-items: end;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px;
}

.manual-replenishment-sku-line-product {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.manual-replenishment-sku-line-product strong,
.manual-replenishment-sku-line-product small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manual-replenishment-sku-line-product strong {
  color: #0f172a;
  font-size: 13px;
}

.manual-replenishment-sku-line-product small {
  color: var(--muted);
  font-size: 12px;
}

.manual-replenishment-sku-line label {
  display: grid;
  gap: 5px;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.manual-replenishment-sku-line input {
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #0f172a;
  font: inherit;
}

@media (max-width: 1100px) {
  .manual-replenishment-sku-line {
    grid-template-columns: 1fr 1fr;
  }

  .manual-replenishment-sku-line-product {
    grid-column: 1 / -1;
  }
}

.manual-replenishment-selected {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  max-width: 420px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.manual-replenishment-selected.selected {
  color: #0f172a;
}

.manual-replenishment-selected img {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: cover;
}

.manual-replenishment-selected small {
  color: var(--muted);
}

.replenishment-table table {
  min-width: 1880px;
}

.replenishment-product-table {
  margin-top: 12px;
}

.replenishment-product-table table {
  min-width: 2260px;
}

.replenishment-request-table table {
  min-width: 1780px;
}

.replenishment-request-table.review-mode {
  overflow-x: hidden;
}

.replenishment-request-table.review-mode table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.replenishment-request-table.review-mode th:nth-child(1) { width: 9%; }
.replenishment-request-table.review-mode th:nth-child(2) { width: 19%; }
.replenishment-request-table.review-mode th:nth-child(3) { width: 22%; }
.replenishment-request-table.review-mode th:nth-child(4) { width: 18%; }
.replenishment-request-table.review-mode th:nth-child(5) { width: 21%; }
.replenishment-request-table.review-mode th:nth-child(6) { width: 11%; }

.replenishment-review-main-row > td {
  min-width: 0;
  padding: 14px 12px;
  vertical-align: middle;
}

.replenishment-review-main-row.danger > td:first-child {
  box-shadow: inset 4px 0 #ef4444;
}

.replenishment-review-main-row.warning > td:first-child {
  box-shadow: inset 4px 0 #f59e0b;
}

.replenishment-review-main-row.ok > td:first-child {
  box-shadow: inset 4px 0 #22c55e;
}

.replenishment-review-main-row .status,
.replenishment-review-urgency {
  display: table;
  max-width: 100%;
  margin-bottom: 7px;
  white-space: nowrap;
}

.replenishment-review-urgency {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}

.replenishment-review-urgency.danger {
  background: #fee2e2;
  color: #b91c1c;
}

.replenishment-review-urgency.warning {
  background: #fef3c7;
  color: #92400e;
}

.replenishment-review-urgency.ok {
  background: #dcfce7;
  color: #166534;
}

.replenishment-review-product {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.replenishment-review-product img,
.replenishment-review-product .replenishment-product-placeholder {
  width: 46px;
  height: 46px;
  border: 1px solid #dbe4f0;
  border-radius: 6px;
  background: #f1f5f9;
  object-fit: cover;
}

.replenishment-review-product-copy {
  min-width: 0;
}

.replenishment-review-product-copy strong {
  display: -webkit-box;
  overflow: hidden;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.replenishment-review-product-copy span {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: #64748b;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.replenishment-review-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 10px;
}

.replenishment-review-metrics.two-columns {
  grid-template-columns: 1fr;
  gap: 4px;
}

.replenishment-review-metrics span,
.replenishment-review-quantity span {
  min-width: 0;
  color: #64748b;
  font-size: 12px;
  white-space: nowrap;
}

.replenishment-review-metrics b,
.replenishment-review-quantity b,
.replenishment-review-quantity strong {
  color: #0f172a;
  font-size: 13px;
}

.replenishment-review-metrics b.danger {
  color: #dc2626;
}

.replenishment-review-metrics b.warning {
  color: #b45309;
}

.replenishment-review-reason {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.replenishment-review-reason.danger { color: #b91c1c; }
.replenishment-review-reason.warning { color: #92400e; }
.replenishment-review-reason.ok { color: #166534; }

.replenishment-review-quantity {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.replenishment-review-quantity strong {
  color: #dc2626;
  font-size: 16px;
}

.replenishment-review-quantity small {
  color: #64748b;
  font-size: 11px;
}

.replenishment-review-application {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.replenishment-review-applicant {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.replenishment-review-applicant b {
  overflow: hidden;
  color: #0f172a;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.replenishment-review-applicant time,
.replenishment-review-request-no {
  color: #64748b;
  font-size: 11px;
  white-space: nowrap;
}

.replenishment-review-spec-warning {
  color: #b91c1c;
  font-size: 11px;
  font-weight: 800;
}

.replenishment-review-request-no {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.replenishment-review-application > .mini-btn {
  width: fit-content;
  max-width: 100%;
}

.replenishment-review-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  align-items: stretch;
}

.replenishment-review-actions .mini-btn {
  width: 100%;
  min-width: 0;
}

.replenishment-review-detail-row > td {
  border-top: 0;
  background: #f8fafc;
  padding: 0;
}

.replenishment-review-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  border-top: 1px dashed #cbd5e1;
  padding: 14px 18px 16px;
}

.replenishment-review-detail section {
  min-width: 0;
}

.replenishment-review-detail section > b {
  display: block;
  margin-bottom: 8px;
  color: #334155;
  font-size: 12px;
}

.replenishment-review-detail-reason p {
  margin: 0 0 7px;
  color: #0f172a;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.replenishment-review-detail-reason span {
  color: #64748b;
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.replenishment-review-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-bottom: 7px;
}

.replenishment-review-detail-meta span {
  margin: 0;
}

.replenishment-review-detail-meta strong {
  margin-left: 3px;
  color: #0f172a;
}

.replenishment-review-detail-summary {
  margin-bottom: 5px !important;
  color: #b91c1c !important;
  font-size: 12px;
  font-weight: 700;
}

.replenishment-review-detail-reason details {
  color: #475569;
  font-size: 11px;
}

.replenishment-review-detail-reason summary {
  width: fit-content;
  cursor: pointer;
  color: #2563eb;
  font-weight: 700;
}

.replenishment-review-detail-reason details p {
  margin: 7px 0 4px;
  border-left: 3px solid #cbd5e1;
  padding-left: 9px;
  color: #334155;
}

.replenishment-review-detail-skus {
  max-height: none;
  overflow: visible;
}

.replenishment-review-sku-grid {
  display: grid;
  gap: 4px;
}

.replenishment-review-sku-grid-head,
.replenishment-review-sku-grid-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 100px 120px 90px;
  gap: 12px;
  align-items: center;
}

.replenishment-review-sku-grid-head {
  border-bottom: 1px solid #e2e8f0;
  padding: 0 4px 6px;
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
}

.replenishment-review-sku-grid-row {
  border-bottom: 1px solid #eef2f7;
  padding: 5px 4px;
}

.replenishment-review-sku-name {
  min-width: 0;
}

.replenishment-review-sku-name b,
.replenishment-review-sku-name small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.replenishment-review-sku-name.missing-specification b,
.replenishment-review-sku-name.missing-specification small {
  color: #b91c1c;
}

.replenishment-review-sku-name b {
  color: #0f172a;
  font-size: 12px;
}

.replenishment-review-sku-name small {
  margin-top: 2px;
  color: #64748b;
  font-size: 10px;
}

.replenishment-review-sku-grid-row > strong {
  color: #0f172a;
  font-size: 12px;
  text-align: right;
}

.sku-quantity-difference {
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

.sku-quantity-difference.same {
  color: #64748b;
}

.sku-quantity-difference.changed {
  color: #d97706;
}

.replenishment-review-sku-grid-row input {
  width: 100%;
  height: 32px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 5px 7px;
  text-align: right;
}

.replenishment-review-detail-row.has-quantity-adjustment > td {
  background: #fffaf0;
}

.replenishment-review-detail-form {
  display: grid;
  grid-template-columns: minmax(150px, 180px) minmax(150px, 180px) minmax(260px, 1fr);
  gap: 10px 14px;
  align-content: start;
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
}

.replenishment-review-detail-form > b {
  grid-column: 1 / -1;
  margin-bottom: 0 !important;
}

.replenishment-review-detail-form label > span {
  display: block;
  margin-bottom: 5px;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
}

.replenishment-review-detail-form input[readonly] {
  background: #f1f5f9;
  color: #334155;
  cursor: default;
}

body[data-view-mode="replenishment-review"] .replenishment-cards {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  padding-top: 10px;
  margin-bottom: 10px;
}

body[data-view-mode="replenishment-review"] .replenishment-cards .card {
  padding: 9px 12px;
  box-shadow: none;
}

body[data-view-mode="replenishment-review"] .replenishment-cards .card b {
  display: inline;
  margin: 0 0 0 8px;
  font-size: 18px;
}

.replenishment-review-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 18px 0;
}

.replenishment-review-tabs {
  display: inline-flex;
  gap: 2px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #f8fafc;
  padding: 2px;
}

.replenishment-review-tabs button {
  min-height: 32px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  padding: 0 14px;
  color: #475569;
  cursor: pointer;
  font-weight: 800;
}

.replenishment-review-tabs button.active {
  background: #2563eb;
  color: #fff;
}

.replenishment-audit-panel {
  margin-top: 10px;
  border-top: 1px solid #e2e8f0;
}

.replenishment-audit-filters {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) repeat(3, minmax(150px, 0.7fr));
  gap: 10px;
  padding: 12px 18px;
  background: #f8fafc;
}

.replenishment-audit-filters label {
  min-width: 0;
}

.replenishment-audit-filters span {
  display: block;
  margin-bottom: 5px;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
}

.replenishment-audit-filters input,
.replenishment-audit-filters select {
  width: 100%;
  height: 34px;
}

.replenishment-audit-table,
.replenishment-product-history-table {
  overflow-x: hidden;
}

.replenishment-audit-table table,
.replenishment-product-history-table table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.replenishment-audit-table th:nth-child(1) { width: 12%; }
.replenishment-audit-table th:nth-child(2) { width: 12%; }
.replenishment-audit-table th:nth-child(3) { width: 17%; }
.replenishment-audit-table th:nth-child(4) { width: 9%; }
.replenishment-audit-table th:nth-child(5) { width: 10%; }
.replenishment-audit-table th:nth-child(6) { width: 10%; }
.replenishment-audit-table th:nth-child(7) { width: 12%; }
.replenishment-audit-table th:nth-child(8) { width: 10%; }
.replenishment-audit-table th:nth-child(9) { width: 8%; }

.replenishment-audit-table td,
.replenishment-product-history-table td {
  overflow-wrap: anywhere;
  vertical-align: middle;
}

.replenishment-product-history {
  background: #fff;
}

.replenishment-product-history-table {
  margin-top: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
}

.replenishment-product-history-table th:nth-child(1) { width: 16%; }
.replenishment-product-history-table th:nth-child(2) { width: 10%; }
.replenishment-product-history-table th:nth-child(3) { width: 12%; }
.replenishment-product-history-table th:nth-child(4) { width: 12%; }
.replenishment-product-history-table th:nth-child(5) { width: 14%; }
.replenishment-product-history-table th:nth-child(6) { width: 14%; }
.replenishment-product-history-table th:nth-child(7) { width: 11%; }
.replenishment-product-history-table th:nth-child(8) { width: 11%; }

@media (max-width: 900px) {
  .replenishment-audit-filters {
    grid-template-columns: 1fr 1fr;
  }

  .replenishment-audit-table,
  .replenishment-product-history-table {
    overflow-x: auto;
  }

  .replenishment-audit-table table {
    min-width: 1050px;
  }

  .replenishment-product-history-table table {
    min-width: 900px;
  }
}

@media (max-width: 1100px) {
  .replenishment-request-table.review-mode {
    overflow-x: auto;
  }

  .replenishment-request-table.review-mode table {
    min-width: 920px;
  }

  .replenishment-review-detail {
    grid-template-columns: 1fr;
  }

  .replenishment-review-detail-form {
    grid-template-columns: 1fr 1fr;
  }

  .replenishment-review-detail-form label:last-child {
    grid-column: 1 / -1;
  }
}

.purchase-approved-request-table {
  overflow-x: hidden;
}

.purchase-approved-request-table table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.purchase-approved-request-table th:nth-child(1) { width: 25%; }
.purchase-approved-request-table th:nth-child(2) { width: 49%; }
.purchase-approved-request-table th:nth-child(3) { width: 12%; }
.purchase-approved-request-table th:nth-child(4) { width: 14%; }

.purchase-approved-main-row > td {
  min-width: 0;
  padding: 13px 12px;
  vertical-align: top;
}

.purchase-approved-product {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.purchase-approved-product > span {
  overflow: hidden;
  color: #64748b;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-approved-product .purchase-approved-status {
  display: flex;
  align-items: center;
  gap: 7px;
}

.purchase-approved-sku-list {
  display: grid;
  gap: 5px;
}

.purchase-approved-sku-list.compact .purchase-approved-sku-row {
  min-height: 38px;
}

.purchase-approved-sku-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px;
  gap: 10px;
  align-items: center;
  min-width: 0;
  border-bottom: 1px solid #eef2f7;
  padding: 0 0 5px;
}

.purchase-approved-sku-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.purchase-approved-sku-row > div {
  min-width: 0;
}

.purchase-approved-sku-row b,
.purchase-approved-sku-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-approved-sku-row b {
  color: #0f172a;
  font-size: 12px;
}

.purchase-approved-sku-row span {
  margin-top: 2px;
  color: #64748b;
  font-size: 10px;
}

.purchase-approved-sku-row strong {
  color: #dc2626;
  font-size: 15px;
  text-align: right;
  white-space: nowrap;
}

.purchase-approved-sku-row.missing-specification {
  border-radius: 6px;
  background: #fef2f2;
  padding: 6px;
}

.purchase-approved-sku-row.missing-specification b,
.purchase-approved-sku-row.missing-specification span {
  color: #b91c1c;
}

.purchase-approved-sku-more {
  color: #2563eb;
  font-size: 11px;
  line-height: 1.4;
}

.purchase-approved-sku-missing {
  border: 1px solid #fecaca;
  border-radius: 6px;
  background: #fef2f2;
  padding: 8px 10px;
  color: #b91c1c;
  font-size: 12px;
}

.purchase-approved-stock {
  display: grid;
  gap: 5px;
}

.purchase-approved-stock span {
  color: #64748b;
  font-size: 12px;
  white-space: nowrap;
}

.purchase-approved-stock b {
  color: #0f172a;
}

.purchase-approved-quantity {
  display: grid;
  gap: 4px;
}

.purchase-approved-quantity strong {
  color: #dc2626;
  font-size: 17px;
}

.purchase-approved-quantity span,
.purchase-approved-reviewer span {
  color: #64748b;
  font-size: 11px;
}

.purchase-approved-reason {
  display: -webkit-box;
  overflow: hidden;
  color: #334155;
  font-size: 12px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.purchase-approved-reviewer {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.purchase-approved-reviewer b,
.purchase-approved-reviewer span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-approved-actions {
  display: grid;
  gap: 6px;
}

.purchase-approved-actions .mini-btn {
  width: 100%;
}

.purchase-approved-status {
  display: grid;
  gap: 6px;
}

.purchase-approved-status .status {
  width: fit-content;
  max-width: 100%;
}

.purchase-approved-status small {
  color: #64748b;
  font-size: 10px;
  line-height: 1.4;
}

.purchase-approved-detail-row > td {
  border-top: 0;
  background: #f8fafc;
  padding: 0;
}

.purchase-approved-detail {
  display: grid;
  gap: 12px;
  border-top: 1px dashed #cbd5e1;
  padding: 14px 18px 16px;
}

.purchase-approved-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.purchase-approved-detail-head > div {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.purchase-approved-detail-head b {
  color: #0f172a;
  font-size: 13px;
}

.purchase-approved-detail-head span {
  color: #64748b;
  font-size: 11px;
}

.purchase-approved-detail .purchase-approved-sku-list.full {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 18px;
}

.purchase-approved-detail .purchase-approved-sku-row {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  padding: 8px 10px;
}

.purchase-approved-detail section {
  min-width: 0;
}

.purchase-approved-detail section > b {
  display: block;
  margin-bottom: 7px;
  color: #334155;
  font-size: 12px;
}

.purchase-approved-detail p {
  margin: 0;
  color: #334155;
  line-height: 1.55;
}

.purchase-approved-detail section > span,
.purchase-approved-detail section > div {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.45;
}

@media (max-width: 1100px) {
  .purchase-approved-request-table {
    overflow-x: auto;
  }

  .purchase-approved-request-table table {
    min-width: 880px;
  }

  .purchase-approved-detail .purchase-approved-sku-list.full {
    grid-template-columns: 1fr;
  }
}

.replenishment-request-status-strip {
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  gap: 0;
  min-height: 46px;
  padding: 0 18px;
}

.replenishment-request-status-strip span {
  border-right: 1px solid #e2e8f0;
  color: #64748b;
  padding: 0 22px;
}

.replenishment-request-status-strip span:first-child { padding-left: 0; }
.replenishment-request-status-strip span:last-child { border-right: 0; }
.replenishment-request-status-strip b { color: #0f172a; font-size: 16px; margin-left: 5px; }

.replenishment-request-records {
  border-top: 1px solid #e2e8f0;
  margin-top: 12px;
}

.replenishment-request-records > summary {
  color: #334155;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  list-style: none;
  padding: 12px 16px;
}

.replenishment-request-records > summary::-webkit-details-marker { display: none; }
.replenishment-request-records > summary::before { content: "▸"; margin-right: 7px; }
.replenishment-request-records[open] > summary::before { content: "▾"; }
.replenishment-request-records > summary span { color: #64748b; margin-left: 4px; }
.replenishment-request-records.review-mode > summary { display: none; }

.replenishment-simple-head {
  align-items: center;
  border-bottom: 0;
  min-height: 36px;
}

.replenishment-planning-settings {
  position: relative;
}

.replenishment-planning-settings summary {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #334155;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  list-style: none;
  padding: 7px 12px;
}

.replenishment-planning-settings summary::-webkit-details-marker { display: none; }

.replenishment-settings-popover {
  background: #fff;
  border: 1px solid #dbe4f0;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 12px;
  position: absolute;
  right: 0;
  top: 42px;
  width: 360px;
  z-index: 12;
}

.replenishment-settings-popover label,
.replenishment-simple-toolbar label {
  display: grid;
  gap: 5px;
}

.replenishment-settings-popover span,
.replenishment-simple-toolbar label > span {
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.replenishment-settings-note {
  color: #64748b;
  font-size: 11px;
  grid-column: 1 / -1;
  line-height: 1.45;
  margin: 0;
}

.replenishment-settings-save {
  grid-column: 1 / -1;
  justify-self: end;
  min-height: 32px;
  padding: 0 18px;
}

.replenishment-simple-toolbar {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(150px, 190px) minmax(320px, 1fr) auto;
}

.replenishment-decision-card {
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

.replenishment-decision-card span {
  color: #64748b;
  display: block;
  font-size: 12px;
}

.replenishment-decision-card b {
  color: #0f172a;
  display: block;
  font-size: 22px;
  line-height: 1.2;
  margin-top: 4px;
}

.replenishment-decision-card.danger {
  border-top: 3px solid #ef4444;
}

.replenishment-decision-card.warning {
  border-top: 3px solid #f59e0b;
}

.replenishment-decision-card.ok {
  border-top: 3px solid #22c55e;
}

.replenishment-decision-card.neutral {
  border-top: 3px solid #94a3b8;
}

.replenishment-decision-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.replenishment-decision-filters button {
  align-items: center;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
}

.replenishment-decision-filters button.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.replenishment-decision-filters span {
  font-weight: 700;
}

.replenishment-suggestion-table {
  margin: 12px 0 0;
  padding: 0;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #fff;
}

.replenishment-suggestion-table table {
  min-width: 1240px;
  table-layout: fixed;
}

.replenishment-suggestion-table th:nth-child(1) { width: 210px; }
.replenishment-suggestion-table th:nth-child(2) { width: 105px; }
.replenishment-suggestion-table th:nth-child(3) { width: 160px; }
.replenishment-suggestion-table th:nth-child(4) { width: 145px; }
.replenishment-suggestion-table th:nth-child(5) { width: 170px; }
.replenishment-suggestion-table th:nth-child(6) { width: 185px; }
.replenishment-suggestion-table th:nth-child(7) { width: 145px; }
.replenishment-suggestion-table th:nth-child(8) { width: 120px; }

.replenishment-suggestion-table td {
  vertical-align: middle;
}

.replenishment-plan-budget-input {
  height: 32px;
  min-width: 0;
  width: 82px;
}

.replenishment-budget-compact {
  align-items: center;
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

.replenishment-suggested-qty {
  color: #dc2626;
  font-size: 16px;
}

.coupang-rocket-mark {
  color: #f97316;
  display: inline-block;
  font-size: 15px;
  margin-right: 4px;
  vertical-align: -1px;
}

.replenishment-orange-stock {
  color: #ea580c;
  font-size: 16px;
}

.replenishment-inventory-link-note {
  align-items: center;
  background: #effaf5;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  color: #166534;
  display: flex;
  gap: 10px;
  margin-top: 10px;
  padding: 9px 12px;
}

.replenishment-inventory-link-note b {
  font-size: 12px;
  font-weight: 600;
}

.replenishment-link-status {
  background: #16a34a;
  border-radius: 999px;
  color: #fff;
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 9px;
}

.replenishment-auto-deduct-note {
  color: #15803d !important;
}

.replenishment-roi-value {
  color: #047857;
  font-size: 17px;
}

.replenishment-hold-text {
  color: #475569;
  font-size: 14px;
}

.replenishment-days-danger {
  color: #dc2626;
}

.replenishment-purchase-note {
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  margin-top: 4px;
}

.replenishment-product-detail-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 12px;
}

.replenishment-product-detail-grid > div {
  background: #fff;
  border: 1px solid #e2e8f0;
  min-width: 0;
  padding: 9px 10px;
}

.replenishment-product-detail-grid > div.wide { grid-column: 1 / -1; }
.replenishment-product-detail-grid span { color: #64748b; display: block; font-size: 11px; margin-bottom: 4px; }
.replenishment-product-detail-grid b { color: #334155; display: block; font-size: 12px; line-height: 1.45; }

.replenishment-detail-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 12px 10px;
}

.replenishment-reason-cell {
  line-height: 1.55;
  min-width: 280px;
  white-space: normal;
}

.replenishment-decision-row.urgent {
  background: #fff7f7;
}

.replenishment-decision-row.suggested {
  background: #fffaf0;
}

.replenishment-decision-row.watch {
  background: #f8fafc;
}

.replenishment-decision-row.loss,
.replenishment-decision-row.data_issue {
  background: #fafafa;
}

.replenishment-sku-detail-row td {
  background: #f8fafc;
  padding: 0;
}

.replenishment-sku-detail-box {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
}

.replenishment-sku-detail-title {
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.replenishment-sku-detail-item {
  align-items: center;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(240px, 2fr) repeat(5, minmax(90px, 1fr));
  padding: 8px 10px;
}

.replenishment-sku-detail-item strong,
.replenishment-sku-detail-item span {
  display: block;
}

.replenishment-sku-detail-item span {
  color: #64748b;
  font-size: 12px;
  margin-top: 2px;
}

@media (max-width: 900px) {
  .replenishment-simple-toolbar { grid-template-columns: 1fr 1fr; }
  .replenishment-product-control { grid-column: 1 / -1; }
  .replenishment-product-detail-grid { grid-template-columns: 1fr 1fr; }

  .replenishment-sku-detail-item {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .replenishment-request-status-strip { align-items: flex-start; flex-direction: column; gap: 8px; padding: 12px; }
  .replenishment-request-status-strip span { border-right: 0; padding: 0; }
  .replenishment-simple-toolbar { grid-template-columns: 1fr; }
  .replenishment-product-control { grid-column: auto; }
  .replenishment-product-detail-grid { grid-template-columns: 1fr; }
  .replenishment-inventory-link-note { align-items: flex-start; flex-direction: column; }
}

.replenishment-request-editor {
  border: 1px solid #d8e2ef;
  border-radius: 12px;
  background: #f7f9fc;
  padding: 18px;
}

.replenishment-editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
  margin-top: 16px;
}

.replenishment-editor-main { display: grid; gap: 14px; min-width: 0; }

.replenishment-editor-fields {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 12px;
}

.replenishment-editor-fields label,
.replenishment-editor-note,
.replenishment-request-total { display: grid; gap: 7px; color: #334155; font-size: 12px; font-weight: 800; }
.replenishment-editor-fields input,
.replenishment-editor-fields select,
.replenishment-editor-note textarea,
.replenishment-request-total input { width: 100%; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; padding: 9px 11px; color: #0f172a; }
.replenishment-editor-note textarea { resize: vertical; min-height: 76px; font: inherit; font-weight: 500; line-height: 1.5; }

.replenishment-request-snapshot,
.replenishment-request-sku-editor {
  padding: 14px;
  border: 1px solid #dbe5f3;
  border-radius: 10px;
  background: #fff;
}

.replenishment-editor-aside { position: sticky; top: 14px; display: grid; gap: 12px; }

.replenishment-snapshot-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.replenishment-snapshot-metrics > div { min-height: 66px; border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fafc; padding: 9px 10px; }
.replenishment-snapshot-metrics span,
.replenishment-snapshot-metrics small { display: block; color: #64748b; font-size: 10px; font-weight: 600; }
.replenishment-snapshot-metrics strong { display: block; margin-top: 4px; color: #0f172a; font-size: 16px; line-height: 1.15; }
.replenishment-snapshot-metrics .danger strong { color: #dc2626; }
.replenishment-snapshot-metrics .suggested { border-color: #bfdbfe; background: #eff6ff; }
.replenishment-snapshot-metrics .suggested strong { color: #1d4ed8; }
.replenishment-snapshot-budget { display: flex; justify-content: space-between; gap: 7px; margin-top: 10px; border-radius: 7px; background: #f1f5f9; padding: 8px 9px; color: #475569; font-size: 10px; font-weight: 700; }
.replenishment-snapshot-budget span { color: #94a3b8; }

.replenishment-request-total { border: 1px solid #dbe5f3; border-radius: 10px; background: #fff; padding: 13px; }
.replenishment-request-total input { background: #f8fafc; color: #1d4ed8; font-size: 18px; font-weight: 900; }
.replenishment-request-total small { color: #64748b; font-size: 10px; font-weight: 500; }
.replenishment-editor-actions { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; }
.replenishment-editor-actions .btn { min-height: 42px; }

.replenishment-request-sku-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.replenishment-review-sku-line {
  display: grid;
  gap: 4px;
  min-width: 150px;
  margin-bottom: 6px;
}

.replenishment-review-sku-line input {
  width: 100%;
  height: 32px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 5px 7px;
}

.replenishment-request-cell {
  display: grid;
  gap: 6px;
  min-width: 96px;
}

.replenishment-request-review-input {
  width: 100%;
  min-width: 120px;
  height: 34px;
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-size: 12px;
}

.replenishment-request-review-input.review-note {
  min-width: 170px;
}

.replenishment-request-actions {
  min-width: 210px;
  flex-wrap: wrap;
}

.replenishment-panel > .replenishment-table {
  display: none;
}

.replenishment-product-table td:nth-child(6),
.replenishment-product-table td:nth-child(11),
.replenishment-product-table td:nth-child(12),
.replenishment-product-table td:nth-child(13),
.replenishment-product-table td:nth-child(14),
.replenishment-table td:nth-child(9) {
  font-weight: 800;
}

.replenishment-table .progress-cell,
.replenishment-product-table .progress-cell {
  min-width: 230px;
}

.replenishment-table .text-cell,
.replenishment-product-table .text-cell {
  max-width: 240px;
  white-space: normal;
  line-height: 1.45;
}

.replenishment-table a {
  color: var(--blue);
  font-weight: 800;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-right: 6px;
  padding: 3px 7px;
  border-radius: 6px;
  color: #475569;
  background: #f1f5f9;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.source-badge.manual {
  color: #2563eb;
  background: #dbeafe;
}

.source-badge.sample {
  color: #9333ea;
  background: #f3e8ff;
}

.mini-btn.danger {
  color: #dc2626;
  border-color: #fecaca;
}

.mini-btn.danger:hover {
  background: #fee2e2;
}

.replenishment-product {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.replenishment-product.compact {
  min-width: 220px;
}

.replenishment-product img,
.replenishment-product-placeholder {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #eef4fb;
  object-fit: cover;
}

.replenishment-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.replenishment-status.linked {
  color: #059669;
  background: #d1fae5;
}

.replenishment-status.unmatched {
  color: #b45309;
  background: #fef3c7;
}

.replenishment-status.missing {
  color: #dc2626;
  background: #fee2e2;
}

.replenishment-progress {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.replenishment-progress.danger {
  color: #dc2626;
  background: #fee2e2;
}

.replenishment-progress.warning {
  color: #b45309;
  background: #fef3c7;
}

.replenishment-progress.info {
  color: #2563eb;
  background: #dbeafe;
}

.replenishment-progress.success {
  color: #059669;
  background: #d1fae5;
}

.replenishment-progress.neutral {
  color: #475569;
  background: #f1f5f9;
}

.replenishment-progress-card {
  display: grid;
  gap: 5px;
  min-width: 220px;
  max-width: 320px;
}

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

.replenishment-progress-head span:last-child {
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.replenishment-track {
  display: grid;
  grid-template-columns: repeat(5, minmax(18px, 1fr));
  gap: 4px;
}

.replenishment-track span {
  height: 5px;
  border-radius: 999px;
  background: #e2e8f0;
}

.replenishment-track.step-1 span:nth-child(-n+1),
.replenishment-track.step-2 span:nth-child(-n+2),
.replenishment-track.step-3 span:nth-child(-n+3),
.replenishment-track.step-4 span:nth-child(-n+4),
.replenishment-track.step-5 span:nth-child(-n+5) {
  background: #2563eb;
}

.replenishment-progress-card.success .replenishment-track span,
.replenishment-progress-card.success .replenishment-track.step-5 span {
  background: #10b981;
}

.replenishment-progress-card.status-problem .replenishment-track span:nth-child(-n+5) {
  background: #ef4444;
}

.replenishment-track-labels {
  display: grid;
  grid-template-columns: repeat(5, minmax(18px, 1fr));
  color: #64748b;
  font-size: 11px;
  line-height: 1.2;
}

.replenishment-track-labels span {
  text-align: center;
}

.replenishment-current {
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.replenishment-next {
  font-weight: 800;
  color: #0f172a;
}

.replenishment-product-row.is-expanded {
  background: #eff6ff;
}

.replenishment-expand-row > td {
  padding: 0;
  background: #f8fbff;
}

.replenishment-detail-panel {
  display: grid;
  gap: 14px;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.replenishment-detail-section {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.replenishment-detail-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 900;
}

.replenishment-detail-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.nested-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.nested-table th,
.nested-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
  vertical-align: middle;
}

.nested-table th {
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}

.nested-table .text-cell {
  max-width: 260px;
  white-space: normal;
  line-height: 1.45;
}

.compact-empty {
  padding: 14px;
}

.replenishment-sku-risk,
.replenishment-suggestion {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.replenishment-sku-risk.danger,
.replenishment-suggestion.danger {
  color: #dc2626;
  background: #fee2e2;
}

.replenishment-sku-risk.warning,
.replenishment-suggestion.warning {
  color: #b45309;
  background: #fef3c7;
}

.replenishment-sku-risk.ok,
.replenishment-suggestion.ok {
  color: #059669;
  background: #d1fae5;
}

.replenishment-sku-risk.neutral,
.replenishment-suggestion.neutral {
  color: #475569;
  background: #f1f5f9;
}

.finance-panel {
  margin-bottom: 16px;
}

.finance-cards {
  padding: 16px 18px 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body[data-view-mode="finance"] #filtersPanel .ad-only-filter {
  display: none;
}

.finance-summary-card {
  min-height: 92px;
  border-top: 4px solid #dbeafe;
}

.finance-summary-card.income {
  border-top-color: #10b981;
}

.finance-summary-card.expense {
  border-top-color: #f59e0b;
}

.finance-summary-card.net {
  border-top-color: #2563eb;
}

.finance-summary-card small {
  display: block;
  margin-top: 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.finance-negative {
  color: #dc2626 !important;
}

.finance-workspace {
  display: grid;
  grid-template-columns: minmax(440px, 1.15fr) minmax(360px, 0.85fr);
  gap: 14px;
  margin: 14px 18px 0;
  align-items: start;
}

.finance-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.finance-entry {
  padding: 14px;
  margin: 0;
}

.finance-entry-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.finance-sources {
  padding: 14px;
  margin: 0;
}

.finance-records {
  margin: 14px 18px 0;
  overflow: hidden;
}

.finance-records .panel-subhead {
  padding: 14px 14px 10px;
}

.finance-record-search {
  width: min(440px, 100%);
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #0f172a;
}

.finance-voucher-hint {
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
}

.finance-voucher-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  color: #2563eb;
  font-weight: 800;
  text-decoration: none;
}

.finance-voucher-link:hover {
  text-decoration: underline;
}

.finance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  align-items: end;
}

.finance-grid label {
  display: grid;
  gap: 5px;
  color: #102a43;
  font-size: 12px;
  font-weight: 800;
}

.finance-grid label.wide {
  grid-column: 1 / -1;
  min-width: 0;
}

.finance-mode-hidden {
  display: none !important;
}

.finance-grid input,
.finance-grid select {
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #0f172a;
  font: inherit;
}

.finance-grid .btn {
  min-height: 38px;
}

.finance-source-list {
  display: grid;
  gap: 10px;
}

.finance-source-item {
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.finance-source-item.income {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.finance-source-item.expense {
  border-color: #fde68a;
  background: #fffbeb;
}

.finance-source-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.finance-source-top strong {
  display: block;
  margin-top: 8px;
  color: #0f172a;
  font-size: 14px;
}

.finance-source-top small {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
}

.finance-source-top b {
  color: #0f172a;
  font-size: 20px;
  white-space: nowrap;
}

.finance-source-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.finance-source-meta span {
  padding: 7px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.78);
  color: #0f172a;
  font-size: 12px;
  line-height: 1.35;
}

.finance-source-meta em {
  display: block;
  margin-bottom: 2px;
  color: #64748b;
  font-size: 11px;
  font-style: normal;
}

.finance-source-item p {
  margin: 10px 0 0;
  color: #475569;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.finance-source-empty {
  padding: 18px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  text-align: center;
}

.finance-table table {
  min-width: 1180px;
}

.finance-table {
  margin: 0;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
}

.finance-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.finance-badge.income {
  color: #047857;
  background: #d1fae5;
}

.finance-badge.expense {
  color: #b45309;
  background: #fef3c7;
}

.finance-source-detail,
.finance-table .text-cell {
  max-width: 260px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

@media (max-width: 1200px) {
  .finance-cards {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

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

  .finance-entry-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .finance-grid,
  .design-image-grid,
  .finance-source-meta {
    grid-template-columns: 1fr;
  }
}

/* 商品表现：人工 Seller Insights 报表，页面只读取当前店铺数据库。 */
.product-performance-panel {
  --pp-blue: #2563eb;
  --pp-blue-soft: #eff6ff;
  --pp-green: #059669;
  --pp-green-soft: #ecfdf5;
  --pp-orange: #d97706;
  --pp-orange-soft: #fff7ed;
  --pp-red: #dc2626;
  --pp-red-soft: #fff1f2;
  --pp-line: #dce6f2;
  --pp-text: #172033;
  --pp-muted: #6b7b91;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--pp-text);
}

.pp-mode-bar {
  display: grid;
  grid-template-columns: minmax(410px, 1.3fr) minmax(270px, .8fr) auto;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 10px;
}
.pp-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--pp-line);
  border-radius: 12px;
  background: #f4f7fb;
}
.pp-mode-switch button {
  display: grid;
  gap: 3px;
  min-height: 54px;
  align-content: center;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #66758a;
  text-align: left;
  cursor: pointer;
}
.pp-mode-switch button b { color: #34435a; font-size: 13px; }
.pp-mode-switch button span { font-size: 10px; line-height: 1.35; }
.pp-mode-switch button.active {
  border-color: #c8d9fb;
  background: #fff;
  color: #41689e;
  box-shadow: 0 2px 8px rgba(37, 72, 122, .08);
}
.pp-mode-switch button.active b { color: var(--pp-blue); }
.pp-coverage {
  display: grid;
  gap: 3px;
  min-height: 64px;
  align-content: center;
  padding: 9px 13px;
  border: 1px solid #dbe5f1;
  border-radius: 12px;
  background: #fff;
}
.pp-coverage b { color: #304159; font-size: 13px; }
.pp-coverage span { overflow: hidden; color: #79879a; font-size: 10px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.pp-coverage.complete { border-color: #a7e7ca; background: #f3fcf8; }
.pp-coverage.complete b { color: #047857; }
.pp-coverage.warning { border-color: #fed7aa; background: #fffaf2; }
.pp-coverage.warning b { color: #b45309; }
.pp-coverage.baseline { border-color: #c9dafb; background: #f6f9ff; }
.pp-coverage.baseline b { color: #275eaf; }
.pp-mode-actions { display: grid; grid-template-rows: 1fr 1fr; gap: 6px; min-width: 122px; }
.pp-mode-actions .btn { width: 100%; min-height: 0; padding: 0 12px; border-radius: 8px; white-space: nowrap; }
.pp-mode-actions span { display: inline-grid; min-width: 18px; height: 18px; place-items: center; margin-left: 3px; border-radius: 9px; background: #eef3f9; color: #50627a; font-size: 10px; }
.pp-mode-actions .primary span { background: rgba(255, 255, 255, .18); color: #fff; }
.pp-import-strip {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(150px, 190px) auto auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 1px solid #c9d9ec;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 7px 20px rgba(38, 64, 99, .05);
}
.pp-import-strip > div { display: grid; gap: 4px; align-self: center; }
.pp-import-strip > div b { color: #26364e; font-size: 13px; }
.pp-import-strip > div span { color: #74839a; font-size: 10px; line-height: 1.45; }
.pp-import-strip label { display: grid; gap: 6px; }
.pp-import-strip label > span { color: #526179; font-size: 10px; font-weight: 800; }
.pp-import-strip input[type="date"] { height: 38px; padding: 0 10px; border: 1px solid #cbd8e8; border-radius: 8px; background: #fff; color: #26344b; font: inherit; }

.pp-toolbar {
  display: grid;
  grid-template-columns: minmax(130px, .8fr) minmax(132px, .7fr) minmax(132px, .7fr) auto minmax(130px, .75fr) minmax(120px, .7fr) minmax(230px, 1.35fr);
  gap: 10px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--pp-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 26px rgba(35, 61, 99, .06);
}
.pp-toolbar label { display: grid; gap: 6px; min-width: 0; }
.pp-toolbar label > span { color: #516078; font-size: 11px; font-weight: 800; }
.pp-toolbar input,
.pp-toolbar select {
  width: 100%;
  height: 38px;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid #cbd8e8;
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: #26344b;
  font: inherit;
}
.pp-toolbar input:focus,
.pp-toolbar select:focus { border-color: #7aa5f6; box-shadow: 0 0 0 3px rgba(37, 99, 235, .10); }
.pp-toolbar select:disabled { opacity: 1; background: #f8fafc; color: #48576e; }
.pp-toolbar input:disabled { cursor: not-allowed; background: #f3f6fa; color: #9aa6b6; }
.pp-quick-dates { display: flex; gap: 4px; height: 38px; padding: 3px; border: 1px solid #d6e0ec; border-radius: 9px; background: #f5f8fc; }
.pp-quick-dates button { min-width: 58px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: #5d6b80; font-weight: 800; cursor: pointer; }
.pp-quick-dates button.active { background: #fff; color: var(--pp-blue); box-shadow: 0 2px 8px rgba(38, 68, 110, .12); }
.pp-quick-dates button:disabled { cursor: not-allowed; color: #a3adba; box-shadow: none; }
.pp-import-btn { height: 38px; padding: 0 18px; border-radius: 8px; white-space: nowrap; }

.pp-status { margin-top: 10px; padding: 10px 13px; border: 1px solid; border-radius: 8px; font-size: 12px; font-weight: 700; line-height: 1.55; }
.pp-status.info { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.pp-status.success { border-color: #a7f3d0; background: #ecfdf5; color: #047857; }
.pp-status.error { border-color: #fecdd3; background: #fff1f2; color: #be123c; }
.pp-status.warning { border-color: #fed7aa; background: #fff8ed; color: #ad5808; }

.pp-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.pp-kpis > div {
  position: relative;
  display: grid;
  min-height: 100px;
  align-content: center;
  padding: 15px 17px 14px;
  overflow: hidden;
  border: 1px solid var(--pp-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(42, 64, 96, .045);
}
.pp-kpis > div::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: #a9b8ca; }
.pp-kpis > div.sales::before { background: var(--pp-green); }
.pp-kpis > div.cancel::before { background: #f59e0b; }
.pp-kpis span { color: #68778d; font-size: 12px; font-weight: 700; }
.pp-kpis b { margin-top: 5px; color: #182237; font-size: 25px; line-height: 1.12; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pp-kpis small { margin-top: 5px; color: #8a97aa; font-size: 10px; line-height: 1.35; }
.pp-kpis .sales b { color: #047857; }
.pp-kpis .cancel b { color: #b45309; }

.pp-overview-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr); gap: 12px; margin-top: 12px; }
.pp-funnel-card,
.pp-priority-card,
.pp-table-card {
  border: 1px solid var(--pp-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 7px 22px rgba(40, 62, 95, .05);
}
.pp-funnel-card,
.pp-priority-card { min-height: 220px; padding: 16px; }
.pp-section-title { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.pp-section-title h3 { margin: 0; color: #1c2940; font-size: 16px; }
.pp-section-title h3 b { margin-left: 4px; color: var(--pp-blue); }
.pp-section-title p { margin: 4px 0 0; color: #78869a; font-size: 11px; line-height: 1.5; }
.pp-section-title > span { padding: 5px 9px; border-radius: 999px; background: #f2f5f9; color: #66758a; font-size: 10px; font-weight: 700; white-space: nowrap; }

.pp-funnel { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; gap: 8px; align-items: center; margin-top: 22px; }
.pp-funnel > div { display: grid; gap: 6px; min-height: 78px; align-content: center; padding: 12px 14px; border: 1px solid; border-radius: 10px; }
.pp-funnel > div span { font-size: 11px; font-weight: 800; }
.pp-funnel > div b { font-size: 22px; line-height: 1; font-variant-numeric: tabular-nums; }
.pp-funnel > i { color: #a2aec0; font-size: 18px; font-style: normal; }
.pp-funnel .visitor { border-color: #bfd3ff; background: #f1f6ff; color: #1d5ed0; }
.pp-funnel .views { border-color: #c6ddff; background: #f5f9ff; color: #3374d5; }
.pp-funnel .carts { border-color: #b9ead2; background: #f0fbf6; color: #07865a; }
.pp-funnel .purchases { border-color: #9fdfc1; background: #eafaf2; color: #05764e; }
.pp-funnel-rates { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 10px; }
.pp-funnel-rates span { padding: 7px 10px; border-radius: 7px; background: #f6f8fb; color: #6f7d91; font-size: 10px; text-align: center; }
.pp-funnel-rates b { margin-left: 4px; color: #27466f; font-size: 12px; }
.pp-funnel-rates .purchase { background: #edf9f4; color: #36735c; }
.pp-funnel-rates .purchase b { color: #087a50; }

.pp-priority-rows { margin-top: 12px; border-top: 1px solid #e7edf5; }
.pp-priority-rows > button { display: grid; grid-template-columns: minmax(0, 1fr) 72px 88px; gap: 10px; width: 100%; padding: 12px 4px; border: 0; border-bottom: 1px solid #edf1f6; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.pp-priority-rows > button:hover { background: #f8faff; }
.pp-priority-rows span { min-width: 0; }
.pp-priority-rows b,
.pp-priority-rows strong,
.pp-priority-rows small { display: block; }
.pp-priority-rows b { overflow: hidden; color: #2a3850; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.pp-priority-rows strong { color: #26364e; font-size: 13px; font-variant-numeric: tabular-nums; }
.pp-priority-rows small { margin-top: 3px; color: #8a97a9; font-size: 9px; }
.pp-priority-rows .rate-good { color: #047857; }
.pp-priority-rows .rate-watch { color: #b45309; }
.pp-priority-rows .rate-poor { color: #c81e3a; }
.pp-priority-rows .empty { padding: 42px 10px; color: #8995a7; font-size: 12px; text-align: center; }

.pp-table-card { margin-top: 12px; overflow: hidden; }
.pp-table-head { display: flex; justify-content: space-between; gap: 14px; align-items: center; min-height: 58px; padding: 0 15px; border-bottom: 1px solid var(--pp-line); }
.pp-tabs { display: flex; align-self: stretch; gap: 4px; align-items: center; }
.pp-tabs button { position: relative; height: 58px; padding: 0 12px; border: 0; background: transparent; color: #627188; font-weight: 800; cursor: pointer; }
.pp-tabs button::after { content: ""; position: absolute; right: 11px; bottom: -1px; left: 11px; height: 2px; border-radius: 2px; background: transparent; }
.pp-tabs button.active { color: var(--pp-blue); }
.pp-tabs button.active::after { background: var(--pp-blue); }
.pp-tabs b { display: inline-flex; min-width: 20px; height: 20px; margin-left: 4px; align-items: center; justify-content: center; border-radius: 10px; background: #f1f4f8; color: #6e7e93; font-size: 10px; }
.pp-tabs button.active b { background: #e7efff; color: #205ed0; }
.pp-table-tools { display: flex; gap: 10px; align-items: center; }
.pp-table-tools > span { color: #8794a7; font-size: 11px; }
.pp-density-toggle { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid #dbe4ef; border-radius: 9px; background: #f4f7fb; }
.pp-density-toggle button { min-width: 46px; height: 28px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: #68778d; font-size: 12px; font-weight: 750; cursor: pointer; }
.pp-density-toggle button:hover { color: #245fc4; }
.pp-density-toggle button.active { background: #fff; color: #1f5fc8; box-shadow: 0 1px 4px rgba(35, 71, 126, .14); }
.pp-table-wrap { max-width: 100%; overflow: auto; }
.pp-table { width: 100%; min-width: 1420px; border-collapse: separate; border-spacing: 0; }
.pp-table th { position: sticky; top: 0; z-index: 2; height: 44px; padding: 0 12px; border-bottom: 1px solid #d9e3ef; background: #f6f8fb; color: #526178; font-size: 12px; font-weight: 800; text-align: left; white-space: nowrap; }
.pp-table td { height: 72px; padding: 10px 12px; border-bottom: 1px solid #e8edf4; background: #fff; color: #2f3c52; font-size: 13px; vertical-align: middle; font-variant-numeric: tabular-nums; }
.pp-table tr:hover td { background: #f9fbff; }
.pp-table th:first-child,
.pp-table td:first-child { position: sticky; left: 0; width: 330px; min-width: 330px; max-width: 330px; }
.pp-table th:first-child { z-index: 4; background: #f6f8fb; box-shadow: 1px 0 0 #dfe6ef; }
.pp-table td:first-child { z-index: 1; background: #fff; box-shadow: 1px 0 0 #edf1f6; }
.pp-table tr:hover td:first-child { background: #f9fbff; }
.pp-table tr.tone-danger td:first-child { box-shadow: inset 3px 0 #ef5a68; }
.pp-table tr.tone-warning td:first-child { box-shadow: inset 3px 0 #f1a23b; }
.pp-product-cell { display: flex; gap: 11px; align-items: center; width: 100%; min-width: 0; }
.pp-image-frame { position: relative; display: grid; width: 48px; height: 48px; flex: 0 0 48px; overflow: hidden; place-items: center; border: 1px solid #dfe6ef; border-radius: 9px; background: #f5f8fc; }
.pp-image-frame img { display: block; width: 48px; height: 48px; object-fit: cover; background: #f5f8fc; }
.pp-image-frame.missing { border-style: dashed; background: #f7f9fc; }
.pp-image-missing { display: grid; width: 100%; height: 100%; place-items: center; color: #8794a7; font-size: 10px; font-weight: 750; }
.pp-image-missing[hidden] { display: none; }
.pp-product-copy { min-width: 0; }
.pp-unified-code { display: block; overflow: hidden; color: #2563c8; font-size: 13px; font-weight: 850; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.pp-unified-code.missing { color: #b56a16; }
.pp-product-name { display: block; overflow: hidden; margin-top: 2px; color: #1f2c41; font-size: 14px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.pp-product-support,
.pp-cell-sub { display: block; margin-top: 4px; color: #8290a4; font-size: 11px; line-height: 1.35; }
.pp-archive-warning { color: #b56a16; }
.pp-id { color: #586980; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.pp-purchase-column { background: #f5fbf8 !important; }
.pp-rate { display: grid; gap: 6px; min-width: 92px; }
.pp-rate b { font-size: 13px; font-weight: 900; }
.pp-rate > span { display: block; width: 100%; height: 5px; overflow: hidden; border-radius: 999px; background: #e4eaf1; }
.pp-rate i { display: block; height: 100%; min-width: 2px; border-radius: inherit; }
.pp-rate.rate-good b { color: #047857; }
.pp-rate.rate-good i { background: #18a874; }
.pp-rate.rate-watch b { color: #b45309; }
.pp-rate.rate-watch i { background: #f59e0b; }
.pp-rate.rate-poor b { color: #c81e3a; }
.pp-rate.rate-poor i { background: #ef5c6c; }
.pp-rate.rate-neutral b { color: #758399; }
.pp-rate.rate-neutral i { background: #aab5c5; }
.pp-diagnosis { display: inline-flex; min-height: 25px; align-items: center; padding: 0 9px; border-radius: 999px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.pp-diagnosis.success { background: #dcf8ea; color: #057a50; }
.pp-diagnosis.info { background: #eaf2ff; color: #245ebd; }
.pp-diagnosis.warning { background: #fff1cf; color: #a45b00; }
.pp-diagnosis.danger { background: #ffe3e6; color: #bd2536; }
.pp-diagnosis.neutral { background: #edf1f6; color: #68778d; }
.pp-row-actions { display: flex; flex-wrap: wrap; gap: 6px; min-width: 142px; }
.pp-row-actions .mini-btn { min-height: 31px; padding-inline: 10px; white-space: nowrap; }
.pp-row-actions .view-product-order-time { border-color: #bfd2f5; background: #f2f7ff; color: #245fc4; }
.pp-row-actions .view-product-order-time:hover { border-color: #8fb0ea; background: #e8f1ff; }

#productPerformancePanel[data-density="compact"] .pp-table th { height: 38px; font-size: 11px; }
#productPerformancePanel[data-density="compact"] .pp-table td { height: 58px; padding-top: 7px; padding-bottom: 7px; font-size: 12px; }
#productPerformancePanel[data-density="compact"] .pp-image-frame,
#productPerformancePanel[data-density="compact"] .pp-image-frame img { width: 38px; height: 38px; }
#productPerformancePanel[data-density="compact"] .pp-image-frame { flex-basis: 38px; border-radius: 7px; }
#productPerformancePanel[data-density="compact"] .pp-unified-code { font-size: 12px; }
#productPerformancePanel[data-density="compact"] .pp-product-name { font-size: 12px; }
#productPerformancePanel[data-density="compact"] .pp-product-support,
#productPerformancePanel[data-density="compact"] .pp-cell-sub { margin-top: 2px; font-size: 10px; }

.pp-drawer-backdrop { position: fixed; inset: 0; z-index: 1710; background: rgba(20, 30, 48, .34); backdrop-filter: blur(2px); }
.pp-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 1720; width: min(760px, 96vw); overflow: auto; border-left: 1px solid #d8e2ef; background: #f7f9fc; box-shadow: -22px 0 55px rgba(25, 38, 60, .17); }
.pp-drawer-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; padding: 19px 20px; border-bottom: 1px solid #dce5f0; background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); }
.pp-drawer-head span { color: var(--pp-blue); font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.pp-drawer-head h3 { margin: 5px 0 0; color: #19253a; font-size: 18px; }
.pp-drawer-head button { width: 34px; height: 34px; flex: 0 0 auto; border: 0; border-radius: 8px; background: #eef2f7; color: #65758b; font-size: 23px; cursor: pointer; }
.pp-drawer-content { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; gap: 12px; padding: 16px; }
.pp-drawer-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.pp-drawer-summary > div { display: grid; min-height: 94px; align-content: center; padding: 13px; border: 1px solid #dde6f1; border-radius: 10px; background: #fff; }
.pp-drawer-summary span { color: #758399; font-size: 10px; font-weight: 700; }
.pp-drawer-summary b { margin-top: 6px; color: #22324a; font-size: 17px; }
.pp-drawer-summary small { margin-top: 5px; color: #8c98aa; font-size: 9px; }
.pp-drawer-summary .rate-good { color: #047857; }
.pp-drawer-summary .rate-watch { color: #b45309; }
.pp-drawer-summary .rate-poor { color: #c81e3a; }
.pp-diagnosis-block,
.pp-drawer-section,
.pp-action-form { padding: 15px; border: 1px solid #dce5f0; border-radius: 10px; background: #fff; }
.pp-diagnosis-block { border-left-width: 4px; }
.pp-diagnosis-block.danger { border-left-color: #e54859; background: #fff9fa; }
.pp-diagnosis-block.warning { border-left-color: #e99a2d; background: #fffaf3; }
.pp-diagnosis-block.success { border-left-color: #10a574; background: #f7fdfa; }
.pp-diagnosis-block.info { border-left-color: #3e78de; background: #f8fbff; }
.pp-diagnosis-block.neutral { border-left-color: #9aa7b9; }
.pp-diagnosis-block header { display: flex; gap: 9px; align-items: center; }
.pp-diagnosis-block header b { color: #25334a; font-size: 14px; }
.pp-diagnosis-block p { margin: 9px 0 0; color: #5f6f85; font-size: 12px; line-height: 1.7; }
.pp-drawer-section h4,
.pp-action-form h4 { margin: 0 0 10px; color: #25334a; font-size: 13px; }
.pp-drawer-section ul,
.pp-drawer-section ol { margin: 0; padding-left: 20px; color: #5d6c81; font-size: 11px; line-height: 1.9; }
.pp-action-form { display: grid; gap: 11px; }
.pp-action-form > div { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.pp-action-form label { display: grid; gap: 6px; color: #5b6b81; font-size: 10px; font-weight: 800; }
.pp-action-form input,
.pp-action-form select,
.pp-action-form textarea { width: 100%; border: 1px solid #cbd8e8; border-radius: 7px; padding: 9px 10px; background: #fff; color: #29374d; font: inherit; }
.pp-action-form input,
.pp-action-form select { height: 38px; }
.pp-action-form textarea { min-height: 92px; resize: vertical; line-height: 1.6; }
.pp-action-form > button { justify-self: start; }
.pp-action-form > small { color: #8995a7; font-size: 9px; }
body.pp-drawer-open { overflow: hidden; }

.pp-order-time-toolbar { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 14px; border: 1px solid #dce5f0; border-radius: 10px; background: #fff; }
.pp-order-time-toolbar > div:first-child { display: grid; gap: 4px; }
.pp-order-time-toolbar b { color: #25334a; font-size: 13px; }
.pp-order-time-toolbar span { color: #7a8799; font-size: 10px; line-height: 1.5; }
.pp-order-time-ranges { display: inline-flex; flex: 0 0 auto; gap: 3px; padding: 3px; border: 1px solid #d7e1ed; border-radius: 9px; background: #f3f6fa; }
.pp-order-time-ranges button { min-width: 58px; height: 30px; padding: 0 9px; border: 0; border-radius: 6px; background: transparent; color: #64748a; font-size: 11px; font-weight: 800; cursor: pointer; }
.pp-order-time-ranges button:hover { color: #245fc4; }
.pp-order-time-ranges button.active { background: #fff; color: #245fc4; box-shadow: 0 1px 5px rgba(35, 71, 126, .15); }
.pp-order-time-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pp-order-time-summary > div { display: grid; min-height: 94px; align-content: center; padding: 12px; border: 1px solid #dce5f0; border-radius: 10px; background: #fff; }
.pp-order-time-summary span { color: #748297; font-size: 10px; font-weight: 750; }
.pp-order-time-summary b { overflow: hidden; margin-top: 6px; color: #25334a; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.pp-order-time-summary b.good { color: #087a55; }
.pp-order-time-summary b.watch { color: #ad6810; }
.pp-order-time-summary b.poor { color: #be3143; }
.pp-order-time-summary small { margin-top: 5px; color: #8b97a8; font-size: 9px; line-height: 1.45; }
.pp-order-time-quality { padding: 12px 14px; border: 1px solid #cfe0f7; border-radius: 10px; background: #f5f9ff; }
.pp-order-time-quality.warning { border-color: #f0d6aa; background: #fff9ef; }
.pp-order-time-quality > div { display: flex; justify-content: space-between; gap: 12px; }
.pp-order-time-quality b { color: #285aa9; font-size: 11px; }
.pp-order-time-quality.warning b { color: #9b5d0c; }
.pp-order-time-quality span { color: #66758a; font-size: 10px; }
.pp-order-time-quality p { margin: 7px 0 0; color: #67768b; font-size: 10px; line-height: 1.6; }
.pp-order-peak-callout { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto; gap: 10px; align-items: center; padding: 12px 14px; border: 1px solid #f2c58f; border-radius: 10px; background: #fff8ee; }
.pp-order-peak-callout > div { display: grid; grid-template-columns: auto 1fr; gap: 2px 9px; align-items: center; min-width: 0; }
.pp-order-peak-callout span { grid-row: 1 / span 2; display: grid; min-width: 56px; height: 30px; place-items: center; padding: 0 9px; border-radius: 7px; color: #fff; font-size: 10px; font-weight: 900; }
.pp-order-peak-callout .primary span { background: #c93434; }
.pp-order-peak-callout .secondary span { background: #e77817; }
.pp-order-peak-callout b { overflow: hidden; color: #5b3220; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.pp-order-peak-callout small { color: #8f6049; font-size: 9px; }
.pp-order-peak-callout p { max-width: 180px; margin: 0; color: #7d5b49; font-size: 10px; line-height: 1.5; }
.pp-order-time-card { min-width: 0; padding: 15px; border: 1px solid #dce5f0; border-radius: 10px; background: #fff; }
.pp-order-time-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.pp-order-time-card h4 { margin: 0; color: #25334a; font-size: 13px; }
.pp-order-time-card header p { margin: 5px 0 0; color: #8490a1; font-size: 10px; line-height: 1.5; }
.pp-order-scale { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 5px 9px; }
.pp-order-scale span { display: inline-flex; align-items: center; gap: 4px; color: #69788c; font-size: 9px; font-weight: 750; }
.pp-order-scale i { width: 12px; height: 12px; border: 1px solid rgba(36, 51, 71, .08); border-radius: 3px; }
.pp-order-scale .heat-none { background: #edf1f5; }
.pp-order-scale .heat-low { background: #49a994; }
.pp-order-scale .heat-medium { background: #efc64b; }
.pp-order-scale .heat-high { background: #ee8c2f; }
.pp-order-scale .heat-peak { background: #cf3f3f; }
.pp-order-hour-scroll { width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; padding: 6px 0 4px; border-radius: 8px; outline: none; }
.pp-order-hour-scroll:focus-visible { box-shadow: 0 0 0 2px rgba(45, 104, 210, .22); }
.pp-order-hour-chart { display: grid; grid-template-columns: repeat(24, minmax(21px, 1fr)); gap: 4px; min-width: 680px; height: 188px; align-items: end; }
.pp-order-hour { display: grid; grid-template-rows: 20px 142px 18px; gap: 4px; height: 100%; min-width: 0; text-align: center; }
.pp-order-hour > strong { color: #607087; font-size: 9px; font-variant-numeric: tabular-nums; }
.pp-order-hour-track { display: flex; min-height: 0; align-items: flex-end; border-radius: 5px 5px 3px 3px; background: #f4f6f8; }
.pp-order-hour-track i { display: block; width: 100%; height: var(--order-bar-height); min-height: 0; border-radius: 5px 5px 2px 2px; background: #edf1f5; }
.pp-order-hour.heat-low .pp-order-hour-track i { background: #49a994; }
.pp-order-hour.heat-medium .pp-order-hour-track i { background: #efc64b; }
.pp-order-hour.heat-high .pp-order-hour-track i { background: #ee8c2f; }
.pp-order-hour.heat-peak .pp-order-hour-track i { background: #cf3f3f; }
.pp-order-hour.heat-peak > strong { color: #b52d35; font-weight: 900; }
.pp-order-hour > span { color: #7f8b9c; font-size: 8px; white-space: nowrap; }
.pp-order-heatmap-scroll { width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; padding-bottom: 5px; border-radius: 8px; outline: none; }
.pp-order-heatmap-scroll:focus-visible { box-shadow: 0 0 0 2px rgba(45, 104, 210, .22); }
.pp-order-heatmap { display: grid; grid-template-columns: 46px repeat(24, minmax(20px, 1fr)); gap: 3px; min-width: 680px; align-items: center; }
.pp-order-heatmap-corner,
.pp-order-heatmap-hour { color: #8b97a7; font-size: 8px; text-align: center; }
.pp-order-heatmap-day { color: #607087; font-size: 10px; font-weight: 800; text-align: left; }
.pp-order-heat-cell { position: relative; display: grid; height: 23px; place-items: center; border: 1px solid rgba(85, 114, 157, .08); border-radius: 4px; background: #edf1f5; }
.pp-order-heat-cell.heat-low { border-color: #a9d7cc; background: #cfe9e2; }
.pp-order-heat-cell.heat-medium { border-color: #dfbd4e; background: #f7df8f; }
.pp-order-heat-cell.heat-high { border-color: #dd7e27; background: #ee963f; }
.pp-order-heat-cell.heat-peak { border-color: #b62e36; background: #cf3f3f; }
.pp-order-heat-cell i { color: #304357; font-size: 8px; font-style: normal; font-weight: 900; font-variant-numeric: tabular-nums; }
.pp-order-heat-cell.heat-high i,
.pp-order-heat-cell.heat-peak i { color: #fff; text-shadow: 0 1px 1px rgba(69, 27, 21, .24); }
.pp-order-peaks { display: grid; gap: 7px; }
.pp-order-peak-row { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; min-height: 54px; padding: 8px 11px; border: 1px solid #e1e8f1; border-radius: 8px; background: #fafbfd; }
.pp-order-peak-row > span { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 7px; background: #eef2f5; color: #5d6a7c; font-size: 10px; font-weight: 900; }
.pp-order-peak-row.rank-1 > span { background: #cf3f3f; color: #fff; }
.pp-order-peak-row.rank-2 > span { background: #ee8c2f; color: #fff; }
.pp-order-peak-row.rank-3 > span { background: #efc64b; color: #473a12; }
.pp-order-peak-row div { display: grid; gap: 4px; }
.pp-order-peak-row b { color: #2b3a51; font-size: 12px; }
.pp-order-peak-row small { color: #7b899c; font-size: 9px; }
.pp-order-peak-row strong { color: #4b5d72; font-size: 13px; font-variant-numeric: tabular-nums; }
.pp-order-time-muted { margin: 0; color: #7f8c9e; font-size: 11px; }
.pp-order-time-empty { display: grid; min-height: 180px; place-content: center; padding: 24px; border: 1px dashed #ccd8e7; border-radius: 10px; background: #fff; text-align: center; }
.pp-order-time-empty b { color: #34445b; font-size: 14px; }
.pp-order-time-empty p { max-width: 360px; margin: 8px 0 0; color: #7a8799; font-size: 11px; line-height: 1.6; }
.pp-order-time-loading { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; padding: 8px 0; }
.pp-order-time-loading i { height: 94px; border-radius: 10px; background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 50%, #eef2f7 75%); background-size: 200% 100%; animation: pp-order-time-shimmer 1.25s ease-in-out infinite; }
.pp-order-time-loading p { grid-column: 1 / -1; margin: 4px 0 0; color: #79879a; font-size: 11px; text-align: center; }
@keyframes pp-order-time-shimmer { to { background-position: -200% 0; } }

@media (max-width: 1500px) {
  .pp-mode-bar { grid-template-columns: minmax(390px, 1fr) minmax(250px, .7fr) auto; }
  .pp-toolbar { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pp-search { grid-column: span 2; }
  .pp-import-btn { width: 100%; }
}

@media (max-width: 1100px) {
  .pp-mode-bar { grid-template-columns: 1fr auto; }
  .pp-coverage { grid-column: 1 / -1; grid-row: 2; }
  .pp-import-strip { grid-template-columns: 1fr 1fr; }
  .pp-import-strip > div { grid-column: 1 / -1; }
  .pp-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pp-overview-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .pp-mode-bar { grid-template-columns: 1fr; }
  .pp-mode-switch { grid-template-columns: 1fr; }
  .pp-coverage { grid-column: auto; grid-row: auto; }
  .pp-mode-actions { grid-template-columns: 1fr 1fr; grid-template-rows: 42px; }
  .pp-import-strip { grid-template-columns: 1fr; }
  .pp-import-strip > div { grid-column: auto; }
  .pp-toolbar { grid-template-columns: 1fr 1fr; padding: 11px; }
  .pp-toolbar label:first-child,
  .pp-search,
  .pp-quick-dates { grid-column: 1 / -1; }
  .pp-quick-dates button { flex: 1; }
  .pp-kpis { grid-template-columns: 1fr 1fr; }
  .pp-kpis > div { min-height: 88px; }
  .pp-kpis .sales { grid-column: 1 / -1; }
  .pp-funnel { grid-template-columns: 1fr; }
  .pp-funnel > i { transform: rotate(90deg); text-align: center; }
  .pp-funnel-rates { grid-template-columns: 1fr; }
  .pp-table-head { align-items: flex-start; flex-direction: column; padding: 10px 12px 0; }
  .pp-tabs { width: 100%; overflow: auto; }
  .pp-tabs button { height: 46px; white-space: nowrap; }
  .pp-drawer-summary { grid-template-columns: 1fr; }
  .pp-order-time-toolbar { align-items: stretch; flex-direction: column; }
  .pp-order-time-ranges { display: grid; grid-template-columns: repeat(3, 1fr); }
  .pp-order-time-summary { grid-template-columns: 1fr 1fr; }
  .pp-order-time-quality > div { align-items: flex-start; flex-direction: column; gap: 4px; }
  .pp-order-peak-callout { grid-template-columns: 1fr; }
  .pp-order-peak-callout p { max-width: none; }
  .pp-order-time-card > header { flex-direction: column; }
  .pp-order-scale { justify-content: flex-start; }
  .pp-action-form > div { grid-template-columns: 1fr; }
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.finance-panel {
  padding-bottom: 18px;
  background: #f8fafc;
}

.finance-panel > .panel-head {
  background: #fff;
}

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

.finance-head-actions .account-info {
  margin-right: 4px;
}

.finance-cards {
  padding: 14px 18px 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.finance-summary-card {
  position: relative;
  min-height: 104px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-top-width: 3px;
  border-radius: 10px;
  box-shadow: none;
}

.finance-summary-card.count {
  border-top-color: #8b5cf6;
}

.finance-summary-card b {
  margin-top: 4px;
  font-size: clamp(22px, 2.1vw, 30px);
}

.finance-overview-grid {
  display: grid;
  grid-template-columns: minmax(440px, 1.05fr) minmax(420px, 0.95fr);
  gap: 14px;
  margin: 14px 18px 0;
}

.finance-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px 10px;
}

.finance-card-head h3,
.finance-ledger-head h3 {
  margin: 0;
  color: #0f172a;
  font-size: 16px;
}

.finance-card-head p,
.finance-ledger-head p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.finance-chart-card,
.finance-sources,
.finance-records {
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.035);
}

.finance-chart-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 4px 16px 16px;
}

.finance-donut-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: 220px;
  height: 220px;
}

#financeExpenseChart {
  display: block;
  width: 220px;
  height: 220px;
}

.finance-donut-center {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 118px;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.finance-donut-center span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.finance-donut-center b {
  display: block;
  margin-top: 5px;
  color: #0f172a;
  font-size: 17px;
  line-height: 1.2;
}

.finance-expense-legend {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
  padding-right: 3px;
}

.finance-legend-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #334155;
  text-align: left;
  cursor: pointer;
}

.finance-legend-item:hover,
.finance-legend-item.active {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.finance-legend-item i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.finance-legend-item span {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-legend-item b {
  color: #0f172a;
  font-size: 12px;
  white-space: nowrap;
}

.finance-source-list {
  gap: 7px;
  padding: 0 14px 14px;
}

.finance-source-item {
  padding: 10px 11px;
  border-radius: 7px;
}

.finance-source-item.pending {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.finance-source-top {
  align-items: center;
}

.finance-source-top strong {
  display: inline;
  margin: 0 0 0 7px;
  font-size: 13px;
}

.finance-source-top small {
  margin: 4px 0 0;
  font-size: 11px;
}

.finance-source-top b {
  font-size: 16px;
}

.finance-source-meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 7px;
}

.finance-source-item p {
  margin-top: 7px;
}

.finance-records {
  margin-top: 14px;
}

.finance-ledger-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 16px 10px;
}

.finance-filter-summary {
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.finance-filter-bar {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) repeat(5, minmax(126px, auto)) auto;
  gap: 8px;
  align-items: center;
  padding: 0 14px 12px;
}

.finance-filter-bar input,
.finance-filter-bar select {
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-size: 12px;
}

.finance-filter-bar input:focus,
.finance-filter-bar select:focus,
.finance-grid input:focus,
.finance-grid select:focus,
.finance-grid textarea:focus {
  outline: 2px solid rgba(37, 99, 235, 0.18);
  border-color: #2563eb;
}

.finance-search-field {
  min-width: 0;
}

.finance-table {
  max-height: min(58vh, 720px);
  overflow: auto;
}

.finance-table table {
  min-width: 1260px;
}

.finance-table thead {
  position: sticky;
  z-index: 3;
  top: 0;
}

.finance-table tbody tr {
  cursor: pointer;
}

.finance-table tbody tr:hover {
  background: #f8fbff;
}

.finance-table tbody tr.finance-row-voided {
  color: #94a3b8;
  background: #f8fafc;
}

.finance-table tbody tr.finance-row-auto {
  background: #fbfdff;
}

.finance-ledger-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.finance-ledger-title strong {
  color: #0f172a;
  font-size: 13px;
}

.finance-ledger-summary {
  max-width: 300px;
  color: #334155;
  font-size: 12px;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
}

.finance-ledger-amount {
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.finance-ledger-amount.income {
  color: #047857;
}

.finance-ledger-amount.expense {
  color: #b45309;
}

.finance-source-mode {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #475569;
  background: #f1f5f9;
  font-size: 11px;
  font-weight: 800;
}

.finance-source-mode.auto {
  color: #1d4ed8;
  background: #dbeafe;
}

.finance-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #475569;
  background: #f1f5f9;
  font-size: 11px;
  font-weight: 800;
}

.finance-status-pill.warning {
  color: #b45309;
  background: #fef3c7;
}

.finance-status-pill.ok {
  color: #047857;
  background: #d1fae5;
}

.finance-row-menu {
  position: relative;
  display: inline-block;
}

.finance-row-menu summary {
  display: grid;
  place-items: center;
  width: 32px;
  min-height: 30px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #334155;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.finance-row-menu summary::-webkit-details-marker {
  display: none;
}

.finance-row-menu-popover {
  position: absolute;
  z-index: 8;
  top: calc(100% + 4px);
  right: 0;
  display: grid;
  min-width: 108px;
  padding: 5px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}

.finance-row-menu-popover button {
  padding: 7px 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #334155;
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.finance-row-menu-popover button:hover {
  background: #f1f5f9;
}

.finance-row-menu-popover button.danger {
  color: #dc2626;
}

.finance-drawer-overlay {
  position: fixed;
  z-index: 1002;
  inset: 0;
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(2px);
}

body.modal-open {
  overflow: hidden;
}

.finance-drawer {
  position: fixed;
  z-index: 1003;
  top: 0;
  right: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(520px, 96vw);
  height: 100vh;
  border-left: 1px solid #dbe3ef;
  background: #fff;
  box-shadow: -20px 0 50px rgba(15, 23, 42, 0.18);
  animation: financeDrawerIn 180ms ease-out;
}

@keyframes financeDrawerIn {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.finance-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid #e2e8f0;
}

.finance-drawer-kicker {
  color: #2563eb;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.finance-drawer-head h2 {
  margin: 5px 0 0;
  color: #0f172a;
  font-size: 22px;
}

.finance-drawer-head p {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 12px;
}

.finance-drawer-close {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  cursor: pointer;
}

.finance-drawer-close img {
  width: 16px;
  height: 16px;
}

.finance-drawer-body {
  overflow: auto;
  padding: 18px 22px;
}

.finance-drawer .finance-grid {
  gap: 13px 12px;
}

.finance-drawer .finance-grid label {
  gap: 6px;
}

.finance-drawer .finance-grid input,
.finance-drawer .finance-grid select,
.finance-drawer .finance-grid textarea {
  min-height: 40px;
  border-radius: 7px;
  resize: vertical;
}

.finance-drawer .finance-grid small {
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
}

.finance-drawer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 13px 22px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

/* Finance entry is a focused, centered task. Detail records remain in the side drawer. */
.finance-entry-modal {
  inset: 20px;
  width: min(640px, calc(100vw - 40px));
  height: max-content;
  max-height: calc(100vh - 40px);
  margin: auto;
  overflow: hidden;
  border: 1px solid #d7e1ed;
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
  transform: none;
  animation: financeEntryModalIn 120ms ease-out;
}

@keyframes financeEntryModalIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.finance-entry-modal .finance-drawer-head {
  align-items: center;
  padding: 18px 24px 15px;
}

.finance-entry-modal .finance-drawer-head h2 {
  margin: 0;
}

.finance-entry-modal .finance-drawer-head p {
  margin-top: 4px;
}

.finance-entry-modal .finance-drawer-body {
  padding: 18px 24px 20px;
  background: #fbfdff;
}

#financeDrawerOverlay {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.finance-data-integrity-note {
  display: flex;
  align-items: baseline;
  gap: 8px;
  width: min(520px, 100%);
  min-height: 42px;
  margin: 0 auto 14px;
  padding: 10px 12px;
  border: 1px solid #ead29f;
  border-radius: 8px;
  background: #fffaf0;
  color: #744210;
  line-height: 1.45;
}

.finance-data-integrity-note b {
  flex: 0 0 auto;
  font-size: 13px;
}

.finance-data-integrity-note span {
  color: #7a5a2a;
  font-size: 12px;
  font-weight: 650;
}

.finance-entry-modal .finance-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 13px;
  align-items: start;
  width: min(520px, 100%);
  margin: 0 auto;
}

.finance-entry-modal .finance-grid > .wide,
.finance-entry-modal .finance-grid > .finance-span-2 {
  grid-column: auto;
}

.finance-entry-modal .finance-grid input,
.finance-entry-modal .finance-grid select,
.finance-entry-modal .finance-grid textarea {
  border-color: #c9d6e5;
  background: #fff;
}

.finance-entry-modal .finance-date-field input {
  min-height: 54px;
}

.finance-entry-modal .finance-entry-summary {
  padding: 9px 11px;
}

.finance-entry-modal .finance-more-details {
  background: #fff;
}

.finance-entry-modal .finance-more-grid {
  grid-template-columns: minmax(0, 1fr);
}

.finance-entry-modal .finance-more-grid label.wide {
  grid-column: auto;
}

.finance-entry-modal .finance-more-details > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 12px;
}

.finance-entry-modal .finance-more-details > summary span {
  color: #31445d;
  font-size: 13px;
}

.finance-entry-modal .finance-more-details > summary small {
  margin-left: 0;
}

.finance-entry-modal .finance-more-details > summary::after {
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-right: 2px solid #65758c;
  border-bottom: 2px solid #65758c;
  content: "";
  transform: rotate(45deg);
  transition: transform 150ms ease;
}

.finance-entry-modal .finance-more-details[open] > summary::after {
  transform: rotate(225deg);
}

.finance-entry-modal .finance-drawer-actions {
  padding: 13px 58px;
}

.finance-detail-list {
  display: grid;
  gap: 0;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  overflow: hidden;
}

.finance-detail-list > div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
  padding: 11px 13px;
  border-bottom: 1px solid #e2e8f0;
}

.finance-detail-list > div:last-child {
  border-bottom: 0;
}

.finance-detail-list span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.finance-detail-list b {
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.finance-change-log {
  margin-top: 16px;
}

.finance-change-log h3 {
  margin: 0 0 8px;
  color: #0f172a;
  font-size: 14px;
}

.finance-change-log-item {
  padding: 9px 0;
  border-bottom: 1px solid #e2e8f0;
  color: #475569;
  font-size: 12px;
  line-height: 1.5;
}

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

  .finance-overview-grid {
    grid-template-columns: 1fr;
  }

  .finance-filter-bar {
    grid-template-columns: minmax(240px, 1fr) repeat(3, minmax(130px, auto));
  }
}

@media (max-width: 760px) {
  .finance-head-actions {
    justify-content: flex-start;
  }

  .finance-head-actions .account-info {
    flex-basis: 100%;
  }

  .finance-cards {
    grid-template-columns: 1fr 1fr;
    padding: 10px 10px 0;
  }

  .finance-summary-card {
    min-height: 92px;
  }

  .finance-overview-grid,
  .finance-records {
    margin-right: 10px;
    margin-left: 10px;
  }

  .finance-chart-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .finance-expense-legend {
    width: 100%;
  }

  .finance-ledger-head {
    display: block;
  }

  .finance-filter-summary {
    margin-top: 8px;
    text-align: left;
  }

  .finance-filter-bar {
    grid-template-columns: 1fr 1fr;
  }

  .finance-search-field,
  .finance-filter-bar #resetFinanceFiltersBtn {
    grid-column: 1 / -1;
  }

  .finance-drawer {
    width: 100vw;
  }

  .finance-entry-modal {
    inset: 10px;
    width: calc(100vw - 20px);
    height: max-content;
    max-height: calc(100vh - 20px);
    margin: auto;
    border: 1px solid #d7e1ed;
    border-radius: 12px;
    transform: none;
  }

  .finance-entry-modal .finance-grid {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .finance-entry-modal .finance-grid > .finance-span-2,
  .finance-entry-modal .finance-grid > .wide {
    grid-column: auto;
  }

  .finance-entry-modal .finance-date-field input {
    min-height: 42px;
  }

  .finance-entry-modal .finance-drawer-close {
    width: 44px;
    height: 44px;
  }

  .finance-drawer-head,
  .finance-drawer-body,
  .finance-drawer-actions {
    padding-right: 16px;
    padding-left: 16px;
  }

  .finance-entry-modal .finance-drawer-head,
  .finance-entry-modal .finance-drawer-body,
  .finance-entry-modal .finance-drawer-actions {
    padding-right: 16px;
    padding-left: 16px;
  }

  .finance-data-integrity-note {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .finance-detail-list > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.robot-broadcast-panel {
  display: block;
}

.broadcast-tabs {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 4px;
  padding: 10px 16px 0;
}

.broadcast-tabs button {
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  color: #64748b;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  padding: 10px 16px;
}

.broadcast-tabs button.active {
  border-bottom-color: #2563eb;
  color: #1d4ed8;
}

.broadcast-tab-panel {
  padding: 0 16px 16px;
}

.broadcast-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1.15fr) minmax(320px, 0.85fr);
  gap: 16px;
  margin-top: 16px;
}

.broadcast-group-layout {
  grid-template-columns: minmax(360px, 0.8fr) minmax(560px, 1.2fr);
}

.broadcast-group-layout .broadcast-channel-box {
  margin-top: 0;
}

.broadcast-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.broadcast-channel-box {
  margin-top: 16px;
}

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

.broadcast-grid label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.broadcast-grid label.wide,
.broadcast-grid .wide {
  grid-column: 1 / -1;
}

.broadcast-grid input,
.broadcast-grid select {
  min-height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  padding: 0 12px;
  color: var(--ink);
  font-size: 14px;
}

.broadcast-toggle {
  grid-template-columns: 18px 1fr;
  align-items: center;
  min-height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 12px;
}

.broadcast-toggle input {
  min-height: 0;
}

.broadcast-fields {
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.broadcast-fields-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  color: #334155;
  font-weight: 900;
}

.broadcast-field-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.broadcast-field-group {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.broadcast-field-group b {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
}

.broadcast-field-group div {
  display: grid;
  gap: 7px;
}

.broadcast-field-group label {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 7px;
  font-weight: 700;
}

.broadcast-field-group input {
  min-height: 0;
}

.broadcast-preview {
  min-height: 280px;
  margin: 0;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px;
  color: #0f172a;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.broadcast-rules-box,
.broadcast-log-box {
  margin-top: 16px;
}

.broadcast-rules-box table {
  min-width: 760px;
}

.broadcast-rules-box th:nth-child(1) { width: 130px; }
.broadcast-rules-box th:nth-child(2) { width: 38%; }
.broadcast-rules-box th:nth-child(3) { width: 34%; }
.broadcast-rules-box th:nth-child(4) { width: 110px; }

.broadcast-rule-channel {
  min-height: 36px;
  width: 100%;
}

.status-badge.active,
.status-badge.paused,
.status-badge.deleted {
  display: inline-flex;
  min-width: 46px;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 900;
}

.status-badge.active {
  background: #dcfce7;
  color: #047857;
}

.status-badge.paused {
  background: #fef3c7;
  color: #92400e;
}

.status-badge.deleted {
  background: #fee2e2;
  color: #b91c1c;
}

@media (max-width: 1100px) {
  .broadcast-layout,
  .broadcast-field-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .product-view-settings-menu {
    position: fixed;
    top: 90px;
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100dvh - 110px);
  }

  .product-view-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .broadcast-grid {
    grid-template-columns: 1fr;
  }
}

.traffic-panel {
  margin-bottom: 16px;
}

.traffic-safe-note {
  display: flex;
  gap: 8px;
  margin: 14px 18px 0;
  padding: 12px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 13px;
  line-height: 1.5;
}

.traffic-settings {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 14px 18px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.traffic-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
}

.traffic-toggle input {
  width: 16px;
  height: 16px;
}

.traffic-entry {
  margin: 14px 18px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.traffic-builder {
  margin: 14px 18px 0;
  padding: 14px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
}

.traffic-plan-grid,
.traffic-rule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  align-items: end;
}

.traffic-plan-grid label,
.traffic-rule-grid label {
  display: grid;
  gap: 5px;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.traffic-plan-grid label.wide,
.traffic-rule-grid label.wide {
  grid-column: span 2;
  min-width: 260px;
}

.traffic-plan-grid input,
.traffic-plan-grid select,
.traffic-plan-grid textarea,
.traffic-rule-grid input,
.traffic-rule-grid select,
.traffic-rule-grid textarea {
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #0f172a;
  font: inherit;
}

.traffic-plan-grid textarea,
.traffic-rule-grid textarea {
  resize: vertical;
}

.traffic-rule-grid .traffic-toggle {
  align-self: end;
  justify-content: center;
  min-height: 34px;
  background: #fff;
}

.traffic-plan-grid .btn,
.traffic-rule-grid .btn {
  min-height: 34px;
}

.traffic-plan-table,
.traffic-rule-table,
.traffic-candidate-table,
.traffic-log-table {
  margin-top: 14px;
}

.traffic-plan-table table {
  min-width: 1280px;
}

.traffic-rule-table table {
  min-width: 1080px;
}

.traffic-candidate-table table {
  min-width: 1180px;
}

.traffic-log-table table {
  min-width: 1120px;
}

.traffic-panel .text-cell {
  max-width: 320px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.btn.danger {
  color: #fff;
  background: #dc2626;
}

.btn.danger:hover {
  background: #b91c1c;
}

.btn.ghost {
  color: #334155;
  background: #fff;
}

@media (max-width: 1400px) {
  .manual-replenishment-grid {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }

  .manual-replenishment-grid label.wide {
    grid-column: span 2;
  }
}

@media (max-width: 760px) {
  .manual-replenishment-title {
    flex-direction: column;
  }

  .manual-replenishment-grid {
    grid-template-columns: 1fr;
  }

  .manual-replenishment-grid label.wide {
    grid-column: auto;
  }

  .traffic-plan-grid,
  .traffic-rule-grid {
    grid-template-columns: 1fr;
  }

  .traffic-plan-grid label.wide,
  .traffic-rule-grid label.wide {
    grid-column: auto;
    min-width: 0;
  }
}



@media (max-height: 760px) and (min-width: 1101px) {
  .external-system-frame {
    height: calc(100dvh - 120px);
    min-height: 480px;
  }

  .topbar {
    margin-bottom: 12px;
  }
}


.product-table-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-x: contain;
  border-right: 1px solid var(--line);
  scrollbar-gutter: stable;
  background: #fff;
}

.product-table-wrap table {
  width: var(--product-table-width, 100%);
  min-width: 0;
  table-layout: fixed;
  font-size: clamp(11px, 0.62vw, 13px);
}

.product-table-wrap th,
.product-table-wrap td {
  padding: clamp(6px, 0.42vw, 10px) clamp(4px, 0.34vw, 8px);
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.product-table-wrap .name {
  max-width: none;
}

.product-table-wrap .sub {
  font-size: clamp(10px, 0.55vw, 12px);
}

.product-table-wrap .manual-spend-cell {
  min-width: 0;
}

.product-table-wrap .manual-spend-editor {
  flex-wrap: wrap;
}

.product-table-wrap .manual-ad-spend-input {
  width: min(86px, 100%);
}

.product-table-wrap th.sortable {
  cursor: pointer;
  position: relative;
  padding-right: 18px;
  user-select: none;
}

.product-table-wrap th.sortable::after {
  color: #94a3b8;
  content: "↕";
  font-size: 10px;
  line-height: 1;
  opacity: 0.75;
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
}

.product-table-wrap th.sortable:hover {
  background: #eff6ff;
  color: var(--primary);
}

.product-table-wrap th.sortable.sorted-asc,
.product-table-wrap th.sortable.sorted-desc {
  color: var(--primary);
}

.product-table-wrap th.sortable.sorted-asc::after {
  color: var(--primary);
  content: "↑";
  opacity: 1;
}

.product-table-wrap th.sortable.sorted-desc::after {
  color: var(--primary);
  content: "↓";
  opacity: 1;
}

.product-table-wrap thead th {
  position: sticky;
  top: var(--product-table-sticky-offset, 0px);
  z-index: 18;
}

#productGroupTable > thead th:first-child,
#productGroupTable > tbody > tr.product-group-row > td:first-child {
  position: sticky;
  left: 0;
  z-index: 12;
  width: 132px;
  min-width: 132px;
  max-width: 132px;
  background: #fff;
  box-shadow: 1px 0 0 var(--line);
}

.product-code-cell {
  font-variant-numeric: tabular-nums;
}

.product-code-copy {
  max-width: 100%;
  border: 0;
  border-radius: 3px;
  padding: 2px 3px;
  background: transparent;
  color: #1d4ed8;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.35;
  white-space: nowrap;
}

.product-code-copy:hover {
  background: #eff6ff;
  color: #1e40af;
  text-decoration: underline;
}

.product-code-copy:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 1px;
}

.product-group-identity {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-width: 0;
}

.product-group-thumb {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: cover;
  background: #f8fafc;
}

.product-group-thumb.placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 10px;
}

.product-group-copy {
  min-width: 0;
}

.product-group-copy b {
  display: block;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

#productGroupTable > tbody > tr.product-group-row > td:nth-child(1),
#productGroupTable > tbody > tr.product-group-row > td:nth-child(3),
#productGroupTable > tbody > tr.product-group-row > td:nth-child(4),
#productHeaderTable > thead th:nth-child(1),
#productHeaderTable > thead th:nth-child(3),
#productHeaderTable > thead th:nth-child(4) {
  overflow-wrap: normal;
  white-space: nowrap;
  word-break: normal;
}

#productGroupTable > tbody > tr.product-group-row > td:nth-child(1),
#productGroupTable > tbody > tr.product-group-row > td:nth-child(3),
#productGroupTable > tbody > tr.product-group-row > td:nth-child(4) {
  font-variant-numeric: tabular-nums;
}

#productGroupTable > tbody > tr.product-group-row > td:nth-child(7) .status {
  min-width: 84px;
  justify-content: center;
  white-space: nowrap;
}

.plan-status-cell .status {
  min-width: 72px;
  justify-content: center;
  white-space: nowrap;
}

.plan-status-cell .sub {
  white-space: nowrap;
}

#productGroupTable > thead th:first-child {
  top: var(--product-table-sticky-offset, 0px);
  z-index: 28;
  background: #f8fafc;
}

#productGroupTable > tbody > tr.product-group-row:hover > td:first-child {
  background: #f8fafc;
}

.product-table-head-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  overscroll-behavior-x: contain;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.product-table-head-wrap table {
  width: var(--product-table-width, 100%);
  min-width: 0;
  table-layout: fixed;
  font-size: clamp(11px, 0.62vw, 13px);
}

.product-table-head-wrap th {
  padding: clamp(6px, 0.42vw, 10px) clamp(4px, 0.34vw, 8px);
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.product-table-head-wrap th.sortable {
  cursor: pointer;
  position: relative;
  padding-right: 18px;
  user-select: none;
}

.product-table-head-wrap th.sortable::after {
  position: absolute;
  right: 5px;
  top: 50%;
  color: #94a3b8;
  content: "\2195";
  font-size: 10px;
  line-height: 1;
  opacity: 0.75;
  transform: translateY(-50%);
}

.product-table-head-wrap th.sortable:hover {
  background: #eff6ff;
  color: var(--primary);
}

.product-table-head-wrap th.sortable.sorted-asc,
.product-table-head-wrap th.sortable.sorted-desc {
  color: var(--primary);
}

.product-table-head-wrap th.sortable.sorted-asc::after {
  color: var(--primary);
  content: "\2191";
  opacity: 1;
}

.product-table-head-wrap th.sortable.sorted-desc::after {
  color: var(--primary);
  content: "\2193";
  opacity: 1;
}

.product-table-wrap thead.product-body-head {
  display: none;
}

#productHeaderTable > thead th:first-child {
  position: sticky;
  left: 0;
  z-index: 28;
  width: 132px;
  min-width: 132px;
  max-width: 132px;
  background: #f8fafc;
  box-shadow: 1px 0 0 var(--line);
}

.product-table-resize-handle {
  position: absolute;
  z-index: 35;
  top: 0;
  right: 0;
  bottom: 0;
  width: 9px;
  cursor: ew-resize;
  background: transparent;
}

.product-table-resize-handle::after {
  position: absolute;
  top: 0;
  right: 3px;
  bottom: 0;
  width: 2px;
  background: rgba(37, 99, 235, 0.18);
  content: "";
  opacity: 0;
}

.product-table-resize-handle:hover::after,
body.product-table-resizing .product-table-resize-handle::after {
  opacity: 1;
}

body.product-table-resizing {
  cursor: ew-resize;
  user-select: none;
}

body.product-table-resizing .product-table-wrap {
  transition: none;
}

.product-archive-panel {
  margin-bottom: 16px;
}

.product-archive-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.product-archive-toolbar {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(150px, 190px) auto;
  gap: 12px;
  align-items: end;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.product-archive-toolbar label {
  display: grid;
  gap: 6px;
}

.product-archive-table-wrap {
  max-height: calc(100vh - 330px);
  overflow: auto;
}

.product-archive-table {
  min-width: 920px;
  table-layout: fixed;
}

.product-archive-table > thead > tr > th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f1f5f9;
}

.product-archive-table > thead > tr > th:nth-child(1) { width: 300px; }
.product-archive-table > thead > tr > th:nth-child(2) { width: 135px; }
.product-archive-table > thead > tr > th:nth-child(3) { width: 125px; }
.product-archive-table > thead > tr > th:nth-child(4) { width: 220px; }
.product-archive-table > thead > tr > th:nth-child(5) { width: 110px; }
.product-archive-table > thead > tr > th:nth-child(6) { width: 72px; }

.product-archive-summary-action {
  width: 100%;
  border: 1px solid var(--line);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.product-archive-summary-action:hover,
.product-archive-summary-action:focus-visible {
  border-color: #93c5fd;
  background: #f8fbff;
  outline: none;
}

.product-archive-summary-action.attention {
  border-color: #fecaca;
  background: #fffafa;
}

.product-archive-summary-action.attention b {
  color: #b91c1c;
}

.product-archive-table th,
.product-archive-table td {
  vertical-align: middle;
}

.product-archive-link-cell {
  display: flex;
  min-height: 32px;
  align-items: center;
}

.product-archive-link-cell .mini-btn,
.product-archive-link-state {
  min-width: 72px;
  min-height: 30px;
}

.product-archive-link-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #cbd5e1;
  border-radius: 7px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.product-archive-link-state.conflict {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #b91c1c;
}

.product-archive-group-row {
  background: #fff;
}

.product-archive-group-row:hover {
  background: #f8fbff;
}

.product-archive-group-row.coupon-gap > td:first-child {
  box-shadow: inset 3px 0 #f59e0b;
}

.product-archive-group-row.product-id-split > td:first-child {
  box-shadow: inset 3px 0 #dc2626;
}

.product-archive-group-row.product-id-split.coupon-gap > td:first-child {
  box-shadow: inset 3px 0 #dc2626, inset 6px 0 #f59e0b;
}

.product-master-product-cell,
.product-master-sku-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.product-master-product-cell .product-archive-name,
.product-master-sku-cell > div {
  min-width: 0;
}

.product-master-sku-cell b {
  display: block;
  overflow-wrap: anywhere;
}

.product-master-spec-summary,
.product-master-metrics,
.product-master-barcode-count,
.product-master-barcode {
  display: grid;
  gap: 4px;
}

.product-master-spec-summary span,
.product-master-metrics span,
.product-master-barcode-count span,
.product-master-barcode span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.product-master-metrics .positive,
.product-master-spec-summary .positive,
.product-master-barcode-count.complete b {
  color: #047857;
}

.product-master-metrics .negative,
.product-master-spec-summary .negative,
.product-master-barcode-count.missing b {
  color: #dc2626;
}

.product-id-cell {
  display: flex;
  min-height: 30px;
  align-items: center;
}

.product-id-copy {
  appearance: none;
  max-width: 100%;
  border: 0;
  padding: 3px 0;
  color: #1d4ed8;
  background: transparent;
  font: inherit;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.product-id-copy:hover,
.product-id-copy:focus-visible {
  color: #1e40af;
  text-decoration: underline;
  outline: none;
}

.product-id-pending {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
}

.product-id-split-badge {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid #fecaca;
  border-radius: 7px;
  padding: 5px 8px;
  color: #b91c1c;
  background: #fff1f2;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  cursor: pointer;
}

.product-id-split-badge:hover,
.product-id-split-badge:focus-visible {
  border-color: #f87171;
  background: #ffe4e6;
  outline: none;
}

.product-master-price-editor {
  display: grid;
  grid-template-columns: minmax(86px, 1fr) 84px auto;
  gap: 6px;
  align-items: center;
}

.product-master-price-editor > div {
  display: grid;
  gap: 2px;
}

.product-master-price-editor > div span {
  color: var(--muted);
  font-size: 11px;
}

.product-master-price-editor .product-group-coupon-discount-input {
  width: 84px;
}

.product-master-status-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.product-archive-thumb {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: #f8fafc;
}

.product-archive-thumb.placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.product-archive-name {
  display: grid;
  gap: 3px;
  max-width: 460px;
}

.product-archive-name b {
  color: var(--text);
  line-height: 1.35;
}

.product-name-heading,
.product-name-editor {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.product-name-heading b {
  min-width: 0;
  overflow-wrap: anywhere;
}

.product-name-display {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}

.product-name-code {
  color: #1d4ed8;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.product-name-text {
  color: var(--text);
}

.product-name-missing {
  color: #dc2626;
  font-weight: 700;
}

.product-name-conflict-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  color: #b45309;
  background: #fef3c7;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.product-display-name-input {
  width: min(300px, 100%);
  height: 34px;
}

.product-name-source-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  color: #047857;
  background: #d1fae5;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.product-name-original-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  color: #1d4ed8;
  background: #dbeafe;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.icon-text-btn {
  appearance: none;
  border: 0;
  padding: 2px 3px;
  color: var(--primary);
  background: transparent;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.icon-text-btn:hover {
  text-decoration: underline;
}

.product-archive-price-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-archive-price-cell.stacked {
  align-items: flex-start;
  flex-direction: column;
  gap: 5px;
}

.product-final-price-input,
.product-current-price-input,
.product-coupon-discount-input,
.product-group-coupon-discount-input {
  width: 132px;
  height: 34px;
}

.product-group-coupon-discount-input {
  width: 128px;
}

.product-archive-coupon {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  max-width: 260px;
  font-size: 12px;
  line-height: 1.35;
}

.product-archive-coupon b {
  color: var(--text);
}

.product-archive-coupon span {
  color: #dc2626;
  font-weight: 800;
}

.product-archive-status {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.product-archive-status.ok {
  color: #047857;
  background: #d1fae5;
}

.product-archive-status.missing {
  color: #b91c1c;
  background: #fee2e2;
}

.product-archive-status.partial {
  color: #92400e;
  background: #fef3c7;
}

.product-archive-status.coupon-gap {
  color: #c2410c;
  background: #ffedd5;
}

.product-archive-group-price {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.product-archive-group-price > span:last-child {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.product-archive-breakeven {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.product-archive-detail-row > td {
  padding: 0;
  background: #f8fafc;
}

.product-archive-sku-detail {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
}

.product-archive-detail-title {
  margin-bottom: 10px;
  font-weight: 800;
  color: var(--text);
}

.product-id-link-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff7f7;
}

.product-id-link-warning > div:first-child {
  display: grid;
  gap: 3px;
}

.product-id-link-warning b {
  color: #991b1b;
}

.product-id-link-warning span {
  color: #7f1d1d;
  font-size: 12px;
  line-height: 1.5;
}

.product-id-link-warning-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.product-id-link-warning-actions a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.product-archive-sku-detail table {
  width: 100%;
  min-width: 1080px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.product-archive-sku-detail th,
.product-archive-sku-detail td {
  padding: 9px 10px;
}

.product-archive-sku-detail th {
  background: #f1f5f9;
}

@media (max-width: 720px) {
  .product-id-link-warning {
    align-items: stretch;
    flex-direction: column;
  }

  .product-id-link-warning-actions {
    justify-content: flex-end;
  }
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.product-review-panel {
  overflow: hidden;
}

.product-review-topline {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 8px 16px;
}

.product-review-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.product-review-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 14px 16px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.product-review-summary > div {
  display: grid;
  min-width: 0;
  gap: 5px;
  padding: 15px 18px;
}

.product-review-summary > div + div {
  border-left: 1px solid var(--line);
}

.product-review-summary span,
.product-review-summary small {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.product-review-summary b {
  color: #0f172a;
  font-size: 25px;
  font-weight: 900;
  line-height: 1.1;
}

.product-review-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 230px) auto;
  align-items: end;
  gap: 12px;
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding: 14px 16px;
}

.product-review-toolbar label,
.product-review-field {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.product-review-toolbar label > span,
.product-review-field > span {
  color: #334155;
  font-size: 12px;
  font-weight: 850;
}

.product-review-table-wrap {
  border-top: 1px solid var(--line);
}

.product-review-table {
  width: 100%;
  min-width: 1030px;
  table-layout: fixed;
}

.product-review-table th:nth-child(1) { width: 240px; }
.product-review-table th:nth-child(2) { width: 130px; }
.product-review-table th:nth-child(3) { width: 115px; }
.product-review-table th:nth-child(4) { width: 100px; }
.product-review-table th:nth-child(5) { width: 120px; }
.product-review-table th:nth-child(6) { width: 120px; }
.product-review-table th:nth-child(7) { width: 95px; }
.product-review-table th:nth-child(8) { width: 110px; }

.product-review-table th,
.product-review-table td {
  padding: 11px 12px;
  vertical-align: middle;
}

.product-review-product-cell,
.product-review-selected-product,
.product-review-record-product {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.product-review-thumb {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #f8fafc;
  object-fit: cover;
}

.product-review-thumb.placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
}

.product-review-product-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.product-review-product-copy b {
  overflow: hidden;
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-review-product-copy span {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.product-review-progress {
  display: grid;
  gap: 7px;
}

.product-review-progress strong {
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
}

.product-review-progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.product-review-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2563eb;
}

.product-review-progress.ready strong {
  color: #059669;
}

.product-review-progress.ready .product-review-progress-track i {
  background: #10b981;
}

.product-review-status {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.product-review-status.pending {
  background: #fff7ed;
  color: #c2410c;
}

.product-review-status.ready {
  background: #dcfce7;
  color: #047857;
}

.product-review-status.continuous {
  background: #dbeafe;
  color: #1d4ed8;
}

.product-review-status.negative {
  background: #fee2e2;
  color: #b91c1c;
}

.product-review-status.paused {
  background: #f1f5f9;
  color: #64748b;
}

.product-review-action {
  height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.product-review-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.product-review-profit,
.product-review-test-sales,
.product-review-order-cost,
.product-review-negative {
  display: grid;
  gap: 4px;
}

.product-review-profit strong,
.product-review-test-sales strong,
.product-review-order-cost strong,
.product-review-negative strong {
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
}

.product-review-profit span,
.product-review-test-sales span,
.product-review-order-cost span,
.product-review-negative span {
  color: #64748b;
  font-size: 11px;
  font-weight: 750;
}

.product-review-profit.profit strong,
.product-review-profit.profit span,
.product-review-negative.clear strong {
  color: #047857;
}

.product-review-profit.loss strong,
.product-review-profit.loss span,
.product-review-negative.pending strong,
.product-review-negative.pending span {
  color: #b91c1c;
}

.product-review-link,
.product-review-link-missing {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.product-review-link {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.product-review-link:hover {
  border-color: #60a5fa;
  background: #dbeafe;
}

.product-review-link-missing {
  border: 1px dashed #cbd5e1;
  color: #94a3b8;
}

.product-review-maintenance-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #dbeafe;
  border-radius: 9px;
  background: #f8fbff;
  padding: 12px;
}

.product-review-maintenance-toggle input {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin-top: 1px;
}

.product-review-maintenance-toggle b,
.product-review-maintenance-toggle small {
  display: block;
}

.product-review-maintenance-toggle b {
  color: #0f172a;
  font-size: 13px;
}

.product-review-maintenance-toggle small {
  margin-top: 3px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.5;
}

.product-review-record-hint {
  grid-column: 1 / -1;
  border: 1px solid #bfdbfe;
  border-radius: 9px;
  background: #eff6ff;
  color: #1e40af;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.6;
}

.product-review-record-type {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 850;
}

.product-review-record-type.order {
  background: #fff7ed;
  color: #c2410c;
}

.product-review-record-type.negative {
  background: #fee2e2;
  color: #b91c1c;
}

.product-review-overlay {
  position: fixed;
  inset: 0;
  z-index: 215;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.52);
}

.product-review-modal {
  width: min(650px, 100%);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
}

.product-review-record-modal {
  width: min(820px, 100%);
}

.product-review-modal-head {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 22px;
}

.product-review-modal-head h2 {
  margin: 0;
  color: #0f172a;
  font-size: 20px;
  font-weight: 900;
}

.product-review-modal-head p {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.product-review-modal-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 20px 22px;
}

.product-review-modal-body .wide {
  grid-column: 1 / -1;
}

.ad-stop-loss-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: #2563eb;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.ad-stop-loss-settings-modal {
  width: min(760px, 100%);
}

.ad-stop-loss-settings-body {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ad-stop-loss-number-field {
  position: relative;
}

.ad-stop-loss-number-field input {
  padding-right: 56px;
  font-size: 16px;
  font-weight: 900;
}

.ad-stop-loss-number-field em {
  position: absolute;
  top: 50%;
  right: 11px;
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  transform: translateY(-50%);
  pointer-events: none;
}

.ad-stop-loss-wechat-toggle {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.ad-stop-loss-rule-summary {
  border: 1px solid #bfdbfe;
  border-radius: 9px;
  background: #f8fbff;
  padding: 13px 14px;
}

.ad-stop-loss-rule-summary strong,
.ad-stop-loss-rule-summary p,
.ad-stop-loss-rule-summary small {
  display: block;
}

.ad-stop-loss-rule-summary strong {
  color: #1e40af;
  font-size: 12px;
}

.ad-stop-loss-rule-summary p {
  margin: 5px 0 0;
  color: #0f172a;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.55;
}

.ad-stop-loss-rule-summary small {
  margin-top: 5px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.6;
}

.ad-stop-loss-safety-note {
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #f8fafc;
  padding: 11px 13px;
}

.ad-stop-loss-safety-note img {
  width: 22px;
  height: 22px;
  opacity: 0.72;
}

.ad-stop-loss-safety-note b,
.ad-stop-loss-safety-note span {
  display: block;
}

.ad-stop-loss-safety-note b {
  color: #334155;
  font-size: 12px;
}

.ad-stop-loss-safety-note span {
  margin-top: 2px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

body[data-view-mode="ads"] .product-group-row.product-loss-pool-row,
body[data-view-mode="ads"] .product-group-row.product-loss-pool-row > td:first-child,
body[data-view-mode="ads"] .product-group-row.product-loss-pool-row > td:last-child,
body[data-view-mode="ads"] .product-group-row.product-loss-pool-row:hover,
body[data-view-mode="ads"] .product-group-row.product-loss-pool-row:hover > td:first-child,
body[data-view-mode="ads"] .product-group-row.product-loss-pool-row:hover > td:last-child {
  background: #fff7f7;
}

body[data-view-mode="ads"] .product-group-row.product-loss-pool-row > td:first-child {
  border-left: 4px solid #dc2626;
}

/* 评价关注池：只保留商品判断与归类，详细执行继续使用员工工作表。 */
.product-review-panel {
  background: #fff;
}

.product-review-topline {
  justify-content: space-between;
  min-height: 72px;
  padding: 12px 18px;
}

.product-review-topline h2 {
  margin: 0;
  color: #0f172a;
  font-size: 18px;
  font-weight: 950;
}

.product-review-topline p {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.product-review-pool-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 18px 0;
}

.product-review-pool-tab {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 108px;
  align-content: start;
  gap: 5px;
  border: 1px solid #dbe3ee;
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
  padding: 15px 17px 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.product-review-pool-tab:hover {
  border-color: #93c5fd;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
}

.product-review-pool-tab > span,
.product-review-pool-tab small {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.product-review-pool-tab > span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #334155;
}

.product-review-pool-tab > span em {
  display: inline-grid;
  width: 25px;
  height: 22px;
  place-items: center;
  border-radius: 7px;
  background: #eaf2ff;
  color: #2563eb;
  font-size: 9px;
  font-style: normal;
  font-weight: 950;
  letter-spacing: 0.04em;
}

.product-review-pool-tab.focus > span em {
  background: #fff3d6;
  color: #b45309;
}

.product-review-pool-tab.long-term > span em {
  background: #dff8ec;
  color: #047857;
}

.product-review-pool-tab small {
  line-height: 1.45;
}

.product-review-pool-tab b {
  color: #0f172a;
  font-size: 25px;
  font-weight: 950;
  line-height: 1;
}

.product-review-pool-tab.active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.08);
}

.product-review-pool-tab.focus.active {
  border-color: #f59e0b;
  background: #fffbeb;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.08);
}

.product-review-pool-tab.long-term.active {
  border-color: #10b981;
  background: #ecfdf5;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.08);
}

.product-review-rule-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 18px 0;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: linear-gradient(90deg, #f7faff 0%, #fbfdff 100%);
  padding: 10px 13px;
  color: #475569;
  font-size: 12px;
  line-height: 1.55;
}

.product-review-rule-note b {
  flex: 0 0 auto;
  color: #1d4ed8;
}

.product-review-toolbar {
  grid-template-columns: minmax(260px, 1fr) auto;
  margin-top: 12px;
  border-top: 0;
  padding: 12px 18px 14px;
}

.product-review-toolbar .account-info {
  align-self: center;
}

.product-review-table {
  min-width: 1640px;
}

.product-review-table th:nth-child(1) { width: 260px; }
.product-review-table th:nth-child(2) { width: 125px; }
.product-review-table th:nth-child(3) { width: 115px; }
.product-review-table th:nth-child(4) { width: 145px; }
.product-review-table th:nth-child(5) { width: 155px; }
.product-review-table th:nth-child(6) { width: 145px; }
.product-review-table th:nth-child(7) { width: 300px; }
.product-review-table th:nth-child(8) { width: 245px; }
.product-review-table th:nth-child(9) { width: 145px; }

.product-review-table th,
.product-review-table td {
  padding: 12px 14px;
}

.product-review-product-copy em {
  width: fit-content;
  border-radius: 999px;
  background: #fee2e2;
  color: #b91c1c;
  padding: 3px 7px;
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
}

.product-review-orders,
.product-review-stock,
.product-review-roi,
.product-review-pool-state {
  display: grid;
  gap: 5px;
}

.product-review-orders strong,
.product-review-stock strong,
.product-review-roi strong {
  color: #0f172a;
  font-size: 16px;
  font-weight: 950;
}

.product-review-orders span,
.product-review-stock span,
.product-review-roi span,
.product-review-pool-state small {
  color: #64748b;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.45;
}

.product-review-stock.empty strong,
.product-review-stock.empty span {
  color: #b91c1c;
}

.product-review-stock.unknown strong,
.product-review-stock.unknown span {
  color: #64748b;
}

.product-review-roi.profit strong,
.product-review-roi.profit span {
  color: #047857;
}

.product-review-roi.loss strong,
.product-review-roi.loss span {
  color: #b91c1c;
}

.product-review-roi.unknown strong,
.product-review-roi.unknown span {
  color: #64748b;
}

.product-review-pool-badge {
  display: inline-flex;
  width: fit-content;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}

.product-review-pool-badge.focus {
  background: #fef3c7;
  color: #b45309;
}

.product-review-pool-badge.long_term {
  background: #d1fae5;
  color: #047857;
}

.product-review-link-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.product-review-link-actions .mini-btn,
.product-review-link-actions .product-review-link {
  min-height: 32px;
}

.product-review-move-select {
  width: 100%;
  min-height: 36px;
  border-color: #cbd5e1;
  background-color: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.product-review-move-select:disabled {
  opacity: 0.58;
  cursor: wait;
}

.product-review-note-cell {
  min-width: 220px;
}

.product-review-rating-plan {
  display: grid;
  justify-items: start;
  gap: 6px;
}

.product-review-rating-plan.empty {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 750;
}

.product-review-rating-plan.empty > strong {
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}

.product-review-rating-plan-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.product-review-rating-plan-head strong {
  color: #ea580c;
  font-size: 15px;
  font-weight: 950;
}

.product-review-rating-plan-head span,
.product-review-rating-plan > small {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 750;
}

.product-review-plan-stage {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  border-radius: 999px;
  background: #eaf2ff;
  color: #1d4ed8;
  padding: 0 8px;
  font-size: 10px;
  font-weight: 900;
}

.product-review-plan-stage.focus {
  background: #fff3d6;
  color: #a85d08;
}

.product-review-plan-stage.long-term {
  background: #dff8ec;
  color: #047857;
}

.product-review-plan-advice {
  color: #0f172a;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.4;
}

.product-review-plan-detail {
  max-width: 285px;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
}

.product-review-rating-plan-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.product-review-rating-plan-targets span {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  gap: 4px;
  border: 1px solid #fed7aa;
  border-radius: 7px;
  background: #fff7ed;
  color: #c2410c;
  padding: 0 6px;
  font-size: 10px;
  font-weight: 850;
}

.product-review-rating-plan-targets span.reached {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #047857;
}

.product-review-rating-plan-targets b {
  font-weight: 950;
}

.product-review-remark {
  display: grid;
  justify-items: start;
  gap: 6px;
}

.product-review-remark p {
  display: -webkit-box;
  max-width: 230px;
  margin: 0;
  overflow: hidden;
  color: #334155;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.product-review-remark small,
.product-review-remark.empty span,
.product-review-remark-counter {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 750;
}

.product-review-remark-editor {
  display: grid;
  gap: 7px;
}

.product-review-remark-editor textarea {
  width: 100%;
  min-height: 74px;
  resize: vertical;
  border: 1px solid #93c5fd;
  border-radius: 9px;
  background: #fff;
  padding: 9px 10px;
  color: #0f172a;
  font: inherit;
  font-size: 12px;
  line-height: 1.5;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.product-review-remark-editor > div {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.product-review-remark-counter {
  margin-right: auto;
}

@media (max-width: 720px) {
  .product-review-pool-tabs {
    grid-template-columns: 1fr;
    margin: 12px 12px 0;
  }

  .product-review-pool-tab {
    grid-template-columns: 1fr auto;
    align-items: center;
    min-height: 0;
  }

  .product-review-pool-tab small {
    grid-column: 1 / -1;
  }

  .product-review-rule-note {
    align-items: flex-start;
    margin: 10px 12px 0;
  }

  .product-review-toolbar {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .product-review-link-actions {
    justify-content: flex-end;
  }

  .product-review-note-cell {
    min-width: 0;
  }

  .product-review-rating-plan {
    justify-items: end;
  }

  .product-review-rating-plan-targets {
    justify-content: flex-end;
  }

  .product-review-remark {
    justify-items: end;
  }

  .product-review-remark p {
    max-width: min(230px, 62vw);
    text-align: right;
  }

  .product-review-remark-editor {
    width: min(270px, 64vw);
    margin-left: auto;
  }
}

@media (max-width: 720px) {
  .ad-stop-loss-settings-body {
    grid-template-columns: 1fr;
  }

  .ad-stop-loss-overlay {
    align-items: flex-end;
    padding: 10px;
  }

  .ad-stop-loss-overlay .product-review-modal {
    max-height: calc(100dvh - 20px);
    border-radius: 14px 14px 10px 10px;
  }
}

.product-review-selected-product {
  grid-column: 1 / -1;
  border: 1px solid #dbeafe;
  border-radius: 9px;
  background: #f8fbff;
  padding: 10px 12px;
}

.product-review-record-product {
  margin: 16px 22px 0;
  border: 1px solid #dbeafe;
  border-radius: 9px;
  background: #f8fbff;
  padding: 12px 14px;
}

.product-review-record-product .product-review-progress {
  width: min(200px, 38%);
  margin-left: auto;
}

.product-review-history {
  margin: 0 22px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  overflow: hidden;
}

.product-review-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  padding: 11px 13px;
}

.product-review-history-head b {
  color: #0f172a;
  font-size: 13px;
}

.product-review-history-head span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.product-review-history table {
  min-width: 680px;
}

.product-review-history th,
.product-review-history td {
  padding: 9px 10px;
  font-size: 12px;
}

.product-review-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 22px 20px;
}

.system-alert-overlay.inventory-warning .system-alert-modal,
.system-alert-overlay.inventory-out .system-alert-modal {
  width: min(520px, 100%);
}

.system-alert-overlay.inventory-warning .system-alert-modal {
  border-top-color: #f59e0b;
}

.system-alert-overlay.inventory-out .system-alert-modal {
  border-top-color: #ef4444;
}

.system-alert-overlay.inventory-warning .system-alert-header {
  background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%);
}

.system-alert-overlay.inventory-out .system-alert-header {
  background: linear-gradient(180deg, #fff1f2 0%, #ffffff 100%);
}

.system-alert-overlay.inventory-warning .system-alert-only-reminder {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
}

.system-alert-overlay.inventory-out .system-alert-only-reminder {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b91c1c;
}

.system-alert-overlay.inventory-warning .system-alert-product {
  border-color: #fde68a;
  background: #fffdf7;
}

.system-alert-overlay.inventory-out .system-alert-product {
  border-color: #fecaca;
  background: #fffafa;
}

.system-alert-overlay.inventory-warning .system-alert-metric:nth-child(2) strong {
  color: #d97706;
}

.system-alert-overlay.inventory-out .system-alert-metric:nth-child(2) strong,
.system-alert-overlay.inventory-out .system-alert-metric:nth-child(3) strong {
  color: #dc2626;
}

.system-alert-overlay.inventory-out .system-alert-message {
  border-color: #fecaca;
  background: #fff1f2;
}

.system-alert-overlay.inventory-out .system-alert-message strong {
  color: #b91c1c;
}

.system-alert-overlay.inventory-out .system-alert-message p {
  color: #991b1b;
}

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

.system-alert-overlay.inventory-out .system-alert-primary {
  border-color: #dc2626;
  background: #dc2626;
  box-shadow: 0 8px 18px rgba(220, 38, 38, 0.2);
}

.system-alert-overlay.inventory-out .system-alert-primary:hover {
  border-color: #b91c1c;
  background: #b91c1c;
}

@media (max-width: 680px) {
  .system-alert-actions.inventory-alert-actions {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.35fr);
  }

  .system-alert-actions.inventory-alert-actions .system-alert-primary {
    grid-column: auto;
  }
}

.system-alert-overlay.review-success .system-alert-modal {
  width: min(410px, 100%);
  border-top-color: #10b981;
}

.system-alert-overlay.review-success .system-alert-header {
  min-height: 62px;
  padding-right: 18px;
  padding-left: 18px;
}

.system-alert-overlay.review-success .system-alert-product,
.system-alert-overlay.review-success .system-alert-metrics,
.system-alert-overlay.review-success .system-alert-message {
  margin-right: 16px;
  margin-left: 16px;
}

.system-alert-overlay.review-success .system-alert-actions {
  padding-right: 16px;
  padding-left: 16px;
}

.system-alert-overlay.review-success .system-alert-warning-icon {
  display: none;
}

.system-alert-overlay.review-success .system-alert-only-reminder {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #047857;
}

.system-alert-overlay.review-success .system-alert-metric strong {
  color: #059669;
}

.system-alert-overlay.review-success .system-alert-metrics {
  grid-template-columns: 1fr;
}

.system-alert-overlay.review-success .system-alert-metric:nth-child(n + 2) {
  display: none;
}

.system-alert-overlay.review-success .system-alert-message {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.system-alert-overlay.review-success .system-alert-message > img {
  display: none;
}

.system-alert-overlay.review-success .system-alert-message {
  grid-template-columns: 1fr;
}

.system-alert-overlay.review-success .system-alert-message strong {
  color: #047857;
}

.system-alert-overlay.review-success .system-alert-message p {
  color: #166534;
}

.system-alert-actions.review-success-actions {
  grid-template-columns: 1fr 1.25fr;
}

@media (max-width: 900px) {
  .product-archive-toolbar {
    grid-template-columns: 1fr;
  }

  .product-archive-actions {
    justify-content: flex-start;
  }

  .product-breakeven-grid,
  .product-breakeven-result {
    grid-template-columns: 1fr;
  }

  .product-breakeven-grid label.wide {
    grid-column: auto;
  }

  .product-roi-cards,
  .product-roi-sections {
    grid-template-columns: 1fr;
  }

  .product-review-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .product-review-toolbar .account-info {
    grid-column: 1 / -1;
  }

  .product-table-wrap {
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: visible;
  }

  .product-table-wrap table {
    min-width: 1100px;
  }

  .product-table-resize-handle {
    display: none;
  }
}

@media (max-width: 720px) {
  body {
    background: #eef5f8;
  }

  .sidebar {
    overscroll-behavior-x: contain;
  }

  .product-review-table-wrap {
    overflow: visible;
    border-top: 0;
    background: #eef5f8;
    padding: 10px;
  }

  .product-review-table-wrap .product-review-table {
    display: block;
    width: 100%;
    min-width: 0;
    table-layout: auto;
  }

  .product-review-table thead {
    display: none;
  }

  .product-review-table tbody {
    display: grid;
    gap: 10px;
  }

  .product-review-table tr {
    display: grid;
    overflow: hidden;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
  }

  .product-review-table td {
    display: grid;
    min-width: 0;
    gap: 5px;
    border-bottom: 1px solid #eef2f7;
    padding: 10px 12px;
    overflow-wrap: anywhere;
  }

  .product-review-table td::before {
    color: #64748b;
    content: attr(data-label);
    font-size: 11px;
    font-weight: 800;
  }

  .product-review-table td:first-child,
  .product-review-table td:last-child {
    grid-column: 1 / -1;
  }

  .product-review-table td:first-child::before,
  .product-review-table td:last-child::before {
    display: none;
  }

  .product-review-table td:nth-child(2n) {
    border-right: 1px solid #eef2f7;
  }

  .product-review-table td:last-child {
    border-right: 0;
    border-bottom: 0;
  }

  .product-review-table .product-review-action {
    flex: 1 1 0;
    min-height: 40px;
  }

  .product-review-action-group {
    width: 100%;
  }

  .brand {
    padding: 10px 12px 6px;
  }

  .brand-title {
    font-size: 17px;
  }

  .brand-sub {
    margin-top: 3px;
  }

  nav {
    gap: 6px;
    padding: 7px 10px 9px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  nav::-webkit-scrollbar {
    display: none;
  }

  .nav-group-title {
    height: 34px;
    font-size: 10px;
  }

  nav a {
    height: 34px;
    padding: 0 10px;
    font-size: 13px;
    white-space: nowrap;
  }

  .main {
    padding: 10px;
  }

  .topbar {
    gap: 10px;
    margin-bottom: 10px;
  }

  .topbar p,
  .panel-head p {
    font-size: 12px;
    line-height: 1.45;
  }

  .top-actions {
    display: grid;
    width: 100%;
    flex-basis: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .top-actions .auth-user {
    grid-column: 1 / -1;
    min-height: 36px;
    justify-content: center;
  }

  .top-actions .btn {
    width: 100%;
    height: 38px;
    padding: 0 10px;
    font-size: 13px;
  }

  .top-actions .install-app-btn {
    grid-column: 1 / -1;
  }

  .product-review-topline {
    align-items: stretch;
    flex-direction: column;
  }

  .product-review-topline .account-info {
    text-align: left;
  }

  .filters {
    gap: 10px;
    margin-bottom: 10px;
    padding: 12px;
  }

  input,
  select,
  textarea {
    min-height: 42px;
  }

  .date-shortcuts {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .date-shortcuts .btn {
    height: 36px;
    padding: 0 4px;
    font-size: 12px;
  }

  .cards,
  .creative-cards,
  .replenishment-cards,
  .finance-cards,
  .product-review-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .product-review-summary {
    margin: 10px;
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .product-review-summary > div {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 11px;
  }

  .product-review-summary > div + div {
    border-left: 1px solid var(--line);
  }

  .product-review-toolbar,
  .product-review-modal-body {
    grid-template-columns: 1fr;
  }

  .product-review-toolbar {
    padding: 12px;
  }

  .product-review-toolbar .account-info,
  .product-review-modal-body .wide {
    grid-column: auto;
  }

  .product-review-head-actions {
    width: 100%;
    justify-content: stretch;
  }

  .product-review-head-actions .btn {
    flex: 1 1 0;
  }

  .product-review-overlay {
    align-items: flex-end;
    padding: 10px;
  }

  .product-review-modal {
    width: 100%;
    max-height: calc(100dvh - 20px);
  }

  .product-review-modal-head,
  .product-review-modal-body,
  .product-review-modal-actions {
    padding-right: 16px;
    padding-left: 16px;
  }

  .product-review-record-product {
    align-items: flex-start;
    flex-wrap: wrap;
    margin-right: 16px;
    margin-left: 16px;
  }

  .product-review-record-product .product-review-progress {
    width: 100%;
    margin-left: 0;
  }

  .product-review-history {
    margin-right: 16px;
    margin-left: 16px;
  }

  .card {
    padding: 10px;
  }

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

  .card b {
    font-size: 20px;
  }

  .panel-head {
    padding: 12px;
  }

  .table-wrap,
  .product-table-wrap,
  .product-archive-table-wrap {
    -webkit-overflow-scrolling: touch;
  }

  .external-system-frame {
    height: calc(100dvh - 150px);
    min-height: 420px;
  }
}

@media (max-width: 420px) {
  .cards,
  .creative-cards,
  .replenishment-cards,
  .finance-cards,
  .product-review-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #fff;
  }

  .product-review-summary > div {
    border: 0;
    border-radius: 0;
    padding: 10px 8px;
  }

  .product-review-summary > div + div {
    border-left: 1px solid var(--line);
  }

  .product-review-summary > div:last-child {
    grid-column: auto;
  }

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

  .product-review-summary > div:nth-child(2n + 1) {
    border-left: 0;
  }

  .product-review-summary > div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
}

/* v91: exact SKU identity shared by replenishment, review and purchase. */
.sku-language-tag {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  margin-left: 6px;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: #f0fdf4;
  padding: 1px 6px;
  color: #15803d;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
}

.sku-language-tag.original {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.replenishment-request-sku-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 10px;
  align-items: center;
  min-width: 0;
  border: 1px solid #dbe5f3;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.replenishment-request-sku-card.missing-specification,
.replenishment-sku-detail-item.missing-specification,
.purchase-approved-sku-row.missing-specification {
  border-color: #fecaca;
  background: #fff7f7;
}

.replenishment-request-sku-copy,
.replenishment-sku-identity,
.purchase-sku-identity {
  display: block;
  min-width: 0;
}

.replenishment-request-sku-copy b,
.replenishment-sku-identity strong,
.purchase-sku-identity strong {
  color: #0f172a;
  font-size: 12px;
  font-weight: 800;
}

.replenishment-request-sku-copy small,
.replenishment-sku-identity span,
.purchase-sku-identity small {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: #64748b;
  font-size: 10px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.replenishment-request-sku-card > input {
  width: 100%;
  height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  padding: 6px 9px;
  text-align: right;
  font-size: 14px;
  font-weight: 800;
}

@media (max-width: 1100px) {
  .replenishment-editor-layout { grid-template-columns: 1fr; }
  .replenishment-editor-aside { position: static; grid-template-columns: minmax(0, 1fr) 240px; align-items: end; }
  .replenishment-editor-actions { grid-column: 1 / -1; }
}

.replenishment-sku-detail-item {
  min-height: 62px;
}

.replenishment-sku-detail-item > .replenishment-sku-identity {
  min-width: 210px;
}

.replenishment-sku-detail-item > div:not(.replenishment-sku-identity) {
  color: #1e293b;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.replenishment-review-sku-name > span,
.purchase-approved-sku-name,
.replenishment-product.compact > div > span,
.manual-replenishment-sku-line-product > div > span,
.manual-replenishment-picker-text > span,
.purchase-sku-identity > span {
  display: flex;
  min-width: 0;
  align-items: center;
}

.replenishment-review-sku-name.archive-changed,
.purchase-approved-sku-row.archive-changed {
  border-left: 3px solid #f59e0b;
  padding-left: 8px;
  background: #fffbeb;
}

.replenishment-review-sku-name .sku-archive-change {
  color: #b45309;
  font-weight: 700;
  white-space: normal;
}

.purchase-approved-sku-row > div {
  min-width: 0;
}

.purchase-approved-sku-row > div > span {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 10px;
}

.purchase-order-sku-edit .purchase-sku-identity {
  grid-column: 1 / -1;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 7px;
}

@media (max-width: 720px) {
  .replenishment-request-editor { padding: 12px; }
  .replenishment-editor-fields,
  .replenishment-editor-aside { grid-template-columns: 1fr; }
  .replenishment-editor-actions { grid-column: auto; grid-template-columns: 1fr 1.5fr; position: sticky; bottom: 0; z-index: 4; background: #f7f9fc; padding: 8px 0; }
  .replenishment-request-sku-grid {
    grid-template-columns: 1fr;
  }

  .replenishment-review-sku-grid-head {
    display: none;
  }

  .replenishment-review-sku-grid-row {
    grid-template-columns: minmax(0, 1fr) 72px;
    gap: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 9px;
  }

  .replenishment-review-sku-grid-row > .requested-sku-quantity::before {
    content: "申请 ";
    color: #64748b;
    font-size: 10px;
  }

  .replenishment-review-sku-grid-row > input {
    grid-column: 1 / 2;
  }

  .replenishment-review-sku-grid-row > .sku-quantity-difference {
    grid-column: 2 / 3;
  }

  .replenishment-request-sku-copy small,
  .replenishment-sku-identity span,
  .purchase-sku-identity small {
    white-space: normal;
  }
}

/* 评价管理：五星好评估算器。计算结果可保存为独立评分方案，不写入评价或财务数据。 */
body.product-review-rating-open {
  overflow: hidden;
}

.calculate-product-review-rating {
  width: fit-content;
  min-height: 27px;
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
  padding: 0 9px;
}

.calculate-product-review-rating:hover {
  border-color: #fb923c;
  background: #ffedd5;
}

.product-review-rating-overlay {
  position: fixed;
  z-index: 1800;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(520px, 620px);
}

.product-review-rating-backdrop {
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(15, 23, 42, 0.46);
  cursor: default;
  backdrop-filter: blur(2px);
}

.product-review-rating-drawer {
  display: grid;
  width: 100%;
  height: 100dvh;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: #f8fafc;
  box-shadow: -24px 0 55px rgba(15, 23, 42, 0.2);
  animation: product-review-rating-enter 0.2s ease-out both;
}

@keyframes product-review-rating-enter {
  from { transform: translateX(28px); }
  to { transform: translateX(0); }
}

.product-review-rating-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
  padding: 22px 24px 18px;
}

.product-review-rating-eyebrow {
  display: block;
  margin-bottom: 5px;
  color: #ea580c;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.1em;
}

.product-review-rating-header h2 {
  margin: 0;
  color: #0f172a;
  font-size: 24px;
  font-weight: 950;
  line-height: 1.2;
}

.product-review-rating-header p {
  max-width: 390px;
  margin: 7px 0 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
}

.product-review-rating-body {
  display: grid;
  align-content: start;
  gap: 14px;
  overflow-y: auto;
  padding: 18px 24px 24px;
  overscroll-behavior: contain;
}

.product-review-rating-product-field {
  display: grid;
  gap: 7px;
}

.product-review-rating-product-field > span,
.product-review-rating-section-head > div > b {
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}

.product-review-rating-product-field select {
  width: 100%;
  min-height: 42px;
  border-color: #cbd5e1;
  background-color: #fff;
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
}

.product-review-rating-product {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #eff6ff;
  padding: 11px 12px;
}

.product-review-rating-product-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.product-review-rating-product-thumb {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 1px solid #dbe3ee;
  border-radius: 9px;
  background: #fff;
  object-fit: cover;
}

.product-review-rating-product-thumb.placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 800;
}

.product-review-rating-product-main > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.product-review-rating-product-main b {
  overflow: hidden;
  color: #0f172a;
  font-size: 13px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-review-rating-product-main span,
.product-review-rating-link-missing {
  color: #64748b;
  font-size: 10px;
  font-weight: 750;
}

.product-review-rating-product > a {
  flex: 0 0 auto;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #fff;
  color: #1d4ed8;
  padding: 7px 9px;
  font-size: 11px;
  font-weight: 850;
  text-decoration: none;
}

.product-review-rating-input-card,
.product-review-rating-result-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  padding: 15px;
}

.product-review-rating-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
}

.product-review-rating-section-head > div {
  display: grid;
  gap: 4px;
}

.product-review-rating-section-head > div > span {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 750;
}

.product-review-rating-section-head > label {
  display: grid;
  width: 126px;
  gap: 5px;
}

.product-review-rating-section-head > label > span {
  color: #475569;
  font-size: 10px;
  font-weight: 850;
}

.product-review-rating-section-head input {
  width: 100%;
  min-height: 39px;
  border-color: #fdba74;
  background: #fffaf5;
  color: #9a3412;
  font-size: 16px;
  font-weight: 950;
  text-align: center;
}

.product-review-rating-percent-list {
  display: grid;
  gap: 7px;
}

.product-review-rating-percent-list > label {
  display: grid;
  min-height: 42px;
  grid-template-columns: minmax(100px, 1fr) 88px 18px;
  align-items: center;
  gap: 8px;
  border-radius: 9px;
  background: #f8fafc;
  padding: 4px 8px 4px 11px;
}

.product-review-rating-percent-list > label > span {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.product-review-rating-percent-list b {
  color: #0f172a;
  font-size: 12px;
  font-weight: 900;
}

.product-review-rating-percent-list small {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 750;
}

.product-review-rating-percent-list input {
  width: 100%;
  min-height: 34px;
  border-color: #dbe3ee;
  background: #fff;
  font-size: 13px;
  font-weight: 900;
  text-align: right;
}

.product-review-rating-percent-list em {
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}

.product-review-rating-percent-list > label:first-child {
  background: #fff7ed;
}

.product-review-rating-percent-list > label:first-child b {
  color: #ea580c;
}

.product-review-rating-percent-list > label:last-child {
  background: #fff1f2;
}

.product-review-rating-percent-list > label:last-child b {
  color: #be123c;
}

.product-review-rating-input-hint {
  margin-top: 10px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #64748b;
  padding: 8px 10px;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.45;
}

.product-review-rating-input-hint.ready {
  background: #ecfdf5;
  color: #047857;
}

.product-review-rating-input-hint.attention {
  background: #fffbeb;
  color: #b45309;
}

.product-review-maintenance-target {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  border: 1px solid #a7f3d0;
  border-radius: 10px;
  background: #ecfdf5;
  padding: 10px 11px;
}

.product-review-maintenance-target > span {
  display: grid;
  gap: 3px;
}

.product-review-maintenance-target b {
  color: #065f46;
  font-size: 11px;
  font-weight: 900;
}

.product-review-maintenance-target small {
  color: #047857;
  font-size: 9px;
  font-weight: 700;
}

.product-review-maintenance-target input {
  width: 100%;
  min-height: 38px;
  border-color: #6ee7b7;
  background: #fff;
  color: #065f46;
  font-size: 14px;
  font-weight: 950;
  text-align: center;
}

.product-review-rating-recommendation {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  border: 1px solid #bfdbfe;
  border-radius: 11px;
  background: #eff6ff;
  padding: 12px 13px;
}

.product-review-rating-recommendation > span {
  color: #2563eb;
  font-size: 10px;
  font-weight: 900;
}

.product-review-rating-recommendation > b {
  color: #0f172a;
  font-size: 14px;
  font-weight: 950;
  line-height: 1.35;
}

.product-review-rating-recommendation > small {
  color: #52627a;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
}

.product-review-rating-recommendation.focus {
  border-color: #fde68a;
  background: #fffbeb;
}

.product-review-rating-recommendation.focus > span { color: #b45309; }

.product-review-rating-recommendation.long-term {
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.product-review-rating-recommendation.long-term > span { color: #047857; }

.product-review-rating-recommendation.needs-target {
  border-color: #fdba74;
  background: #fff7ed;
}

.product-review-rating-recommendation.needs-target > span { color: #c2410c; }

.product-review-rating-current {
  display: grid;
  justify-items: center;
  border-bottom: 1px solid #e2e8f0;
  padding: 2px 0 14px;
  text-align: center;
}

.product-review-rating-current > span {
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
}

.product-review-rating-current > strong {
  margin-top: 3px;
  color: #ea580c;
  font-size: 34px;
  font-weight: 950;
  line-height: 1.1;
}

.product-review-rating-current > small {
  margin-top: 5px;
  color: #64748b;
  font-size: 10px;
  font-weight: 750;
}

.product-review-rating-results {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 13px;
}

.product-review-rating-results article {
  display: grid;
  min-width: 0;
  gap: 6px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #f8fbff;
  padding: 11px 9px;
  text-align: center;
}

.product-review-rating-results span {
  color: #64748b;
  font-size: 10px;
  font-weight: 850;
}

.product-review-rating-results b {
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
}

.product-review-rating-results small {
  color: #64748b;
  font-size: 9px;
  font-weight: 750;
  line-height: 1.4;
}

.product-review-rating-results article.reached {
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.product-review-rating-results article.reached b {
  color: #047857;
}

.product-review-rating-save-meta {
  margin-top: 10px;
  color: #64748b;
  font-size: 10px;
  font-weight: 750;
  text-align: center;
}

.product-review-rating-note {
  display: grid;
  gap: 4px;
  border: 1px solid #fde68a;
  border-radius: 10px;
  background: #fffbeb;
  padding: 10px 12px;
}

.product-review-rating-note b {
  color: #92400e;
  font-size: 11px;
  font-weight: 900;
}

.product-review-rating-note span {
  color: #a16207;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.55;
}

.product-review-rating-actions {
  display: grid;
  grid-template-columns: 0.65fr 0.9fr 1.45fr;
  gap: 10px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
  padding: 14px 24px calc(14px + env(safe-area-inset-bottom));
}

.product-review-rating-actions .btn {
  width: 100%;
  min-height: 42px;
}

@media (max-width: 720px) {
  .product-review-rating-overlay {
    grid-template-columns: 1fr;
  }

  .product-review-rating-backdrop {
    display: none;
  }

  .product-review-rating-drawer {
    grid-column: 1;
  }

  .product-review-rating-header {
    padding: 17px 16px 14px;
  }

  .product-review-rating-header h2 {
    font-size: 21px;
  }

  .product-review-rating-body {
    gap: 11px;
    padding: 14px 14px 18px;
  }

  .product-review-rating-section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .product-review-rating-section-head > label {
    width: 100%;
  }

  .product-review-maintenance-target {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .product-review-rating-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .product-review-rating-results article {
    padding: 10px 5px;
  }

  .product-review-rating-results b {
    font-size: 13px;
  }

  .product-review-rating-product {
    align-items: flex-start;
  }

  .product-review-rating-actions {
    padding-right: 14px;
    padding-left: 14px;
  }
}
/* 客户咨询：数据库队列 + 单条咨询处理 */
.customer-service-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.customer-service-panel.hidden {
  display: none;
}

.customer-service-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 4px 0 0;
}

.customer-service-head h2 {
  margin: 0;
  color: #162033;
  font-size: 22px;
  line-height: 1.3;
}

.customer-service-head p {
  margin: 6px 0 0;
  color: #66758f;
  font-size: 13px;
}

.customer-service-title-row,
.customer-service-head-actions,
.customer-service-detail-name-row,
.customer-service-reply-actions,
.customer-service-settings-section-head,
.customer-service-settings-actions {
  display: flex;
  align-items: center;
}

.customer-service-title-row {
  gap: 10px;
}

.customer-service-head-actions {
  gap: 10px;
}

.customer-service-database-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid #cfe0ff;
  border-radius: 999px;
  background: #eef5ff;
  color: #2867d9;
  font-size: 12px;
  font-weight: 700;
}

.customer-service-database-badge.warning {
  border-color: #ffd79a;
  background: #fff7e8;
  color: #ad6200;
}

.customer-service-auto-status {
  align-self: flex-end;
  padding: 9px 13px;
  border: 1px solid #d9e3f2;
  border-radius: 10px;
  background: #f8fafc;
  color: #5c6b82;
  font-size: 12px;
  font-weight: 600;
}

.customer-service-auto-status.enabled {
  border-color: #bce9cf;
  background: #effbf4;
  color: #13824c;
}

.customer-service-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #dce5f1;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 7px 22px rgba(31, 66, 111, 0.05);
}

.customer-service-summary-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  min-width: 0;
  padding: 17px 20px;
  border: 0;
  border-right: 1px solid #e3eaf3;
  background: #fff;
  color: #1d2a40;
  text-align: left;
  cursor: pointer;
}

.customer-service-summary-card:last-child {
  border-right: 0;
}

.customer-service-summary-card:hover,
.customer-service-summary-card.active {
  background: #f5f9ff;
}

.customer-service-summary-card.active {
  box-shadow: inset 0 -3px 0 #2563eb;
}

.customer-service-summary-card.transferred.active {
  box-shadow: inset 0 -3px 0 #f07a26;
}

.customer-service-summary-card span {
  color: #63718a;
  font-size: 13px;
}

.customer-service-summary-card b {
  grid-row: 1 / 3;
  grid-column: 2;
  color: #172237;
  font-size: 27px;
  line-height: 1.2;
}

.customer-service-summary-card small {
  color: #8793a7;
  font-size: 11px;
}

.customer-service-workspace {
  display: grid;
  grid-template-columns: minmax(360px, 0.78fr) minmax(560px, 1.45fr);
  min-height: 650px;
  overflow: hidden;
  border: 1px solid #dce5f1;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(31, 66, 111, 0.06);
}

.customer-service-queue-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border-right: 1px solid #dfe7f2;
}

.customer-service-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid #dfe7f2;
}

.customer-service-tabs button {
  position: relative;
  min-height: 50px;
  border: 0;
  background: #fff;
  color: #63718a;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.customer-service-tabs button:hover {
  color: #245fd2;
  background: #f8fbff;
}

.customer-service-tabs button.active {
  color: #175fe6;
}

.customer-service-tabs button.active::after {
  position: absolute;
  right: 18px;
  bottom: 0;
  left: 18px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: #2563eb;
  content: "";
}

.customer-service-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid #e8edf4;
  background: #fbfcfe;
}

.customer-service-search-row input,
.customer-service-search-row select,
.customer-service-reply-toolbar select,
.customer-service-setting-field input,
.customer-service-setting-field select,
.customer-service-setting-field textarea,
.customer-service-rule-row select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border: 1px solid #d5dfec;
  border-radius: 8px;
  background: #fff;
  color: #24324a;
  font: inherit;
}

.customer-service-search-row input,
.customer-service-setting-field input {
  padding: 0 12px;
}

.customer-service-search-row select,
.customer-service-reply-toolbar select,
.customer-service-setting-field select,
.customer-service-rule-row select {
  padding: 0 30px 0 10px;
}

.customer-service-search-row input:focus,
.customer-service-search-row select:focus,
.customer-service-reply-toolbar select:focus,
.customer-service-reply-box textarea:focus,
.customer-service-setting-field input:focus,
.customer-service-setting-field select:focus,
.customer-service-setting-field textarea:focus,
.customer-service-template-row textarea:focus {
  border-color: #6ea1ff;
  outline: 3px solid rgba(37, 99, 235, 0.1);
}

.customer-service-queue {
  min-height: 0;
  max-height: 660px;
  overflow-y: auto;
}

.customer-service-queue-item {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 11px;
  width: 100%;
  padding: 13px 12px 13px 16px;
  border: 0;
  border-bottom: 1px solid #e7edf5;
  background: #fff;
  color: #1e2b41;
  text-align: left;
  cursor: pointer;
}

.customer-service-queue-item:hover {
  background: #f7faff;
}

.customer-service-queue-item.active {
  background: #f1f6ff;
}

.customer-service-queue-item.active::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: #2563eb;
  content: "";
}

.customer-service-product-image {
  width: 54px;
  height: 54px;
  border: 1px solid #dce5ef;
  border-radius: 9px;
  background: #f6f8fb;
  object-fit: cover;
}

.customer-service-product-image.large {
  width: 88px;
  height: 88px;
  border-radius: 11px;
}

.customer-service-queue-copy,
.customer-service-queue-title,
.customer-service-queue-badges {
  display: flex;
}

.customer-service-queue-copy {
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.customer-service-queue-title {
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.customer-service-queue-title b {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-service-queue-title em {
  flex: 0 0 auto;
  color: #ef5a42;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.customer-service-queue-code {
  overflow: hidden;
  color: #718097;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-service-queue-preview {
  display: -webkit-box;
  overflow: hidden;
  color: #4f5e75;
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.customer-service-translation-state {
  color: #2870d8;
  font-size: 10px;
  font-weight: 800;
}

.customer-service-queue-badges {
  align-items: flex-end;
  flex-direction: column;
  gap: 6px;
}

.customer-service-status,
.customer-service-risk,
.customer-service-source {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.customer-service-status.status-pending {
  background: #eaf2ff;
  color: #1763df;
}

.customer-service-status.status-transferred,
.customer-service-risk {
  background: #fff0e6;
  color: #c45514;
}

.customer-service-status.status-answered {
  background: #eaf9f1;
  color: #10824a;
}

.customer-service-queue-meta {
  margin-top: auto;
  padding: 10px 14px;
  border-top: 1px solid #e7edf5;
  color: #7d899d;
  font-size: 11px;
  text-align: right;
}

.customer-service-empty,
.customer-service-detail-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 7px;
  min-height: 180px;
  padding: 28px;
  color: #7b879a;
  text-align: center;
}

.customer-service-empty strong,
.customer-service-detail-empty strong {
  color: #2e3b51;
  font-size: 15px;
}

.customer-service-detail-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  background: #fff;
}

.customer-service-detail-product {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid #dfe7f2;
}

.customer-service-detail-product-copy {
  min-width: 0;
}

.customer-service-detail-name-row {
  flex-wrap: wrap;
  gap: 9px;
}

.customer-service-detail-name-row h3 {
  margin: 0;
  color: #162033;
  font-size: 18px;
}

.customer-service-source {
  background: #eef4ff;
  color: #2864cf;
}

.customer-service-detail-product-copy p {
  margin: 7px 0 0;
  color: #62718a;
  font-size: 12px;
}

.customer-service-detail-product-copy p.customer-service-unbound {
  color: #bf4b39;
  font-weight: 700;
}

.customer-service-detail-time {
  color: #78859a;
  font-size: 11px;
  white-space: nowrap;
}

.customer-service-detail-section {
  padding: 17px 18px;
  border-bottom: 1px solid #e4eaf2;
}

.customer-service-section-title {
  margin-bottom: 10px;
  color: #243149;
  font-size: 13px;
  font-weight: 800;
}

.customer-service-question {
  padding: 14px 15px;
  border: 1px solid #d8e1ed;
  border-radius: 9px;
  background: #f8fafc;
  color: #27354c;
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.customer-service-question-meta {
  margin-top: 8px;
  color: #8390a3;
  font-size: 11px;
}

.customer-service-translation-card {
  padding: 14px 15px;
  border: 1px solid #cfe0ff;
  border-radius: 9px;
  background: #f3f7ff;
  color: #263955;
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.customer-service-translation-meta,
.customer-service-ai-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
  color: #76869d;
  font-size: 11px;
}

.customer-service-ai-assistant {
  padding: 17px 18px;
  border-bottom: 1px solid #e4eaf2;
  background: #fbfaff;
}

.customer-service-ai-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 11px;
}

.customer-service-ai-header > div:first-child {
  display: grid;
  gap: 4px;
}

.customer-service-ai-header strong {
  color: #37285f;
  font-size: 14px;
}

.customer-service-ai-header small {
  color: #7d7197;
  font-size: 11px;
}

.customer-service-ai-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.customer-service-ai-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid #d8cef7;
  border-radius: 999px;
  background: #f2efff;
  color: #6546b7;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.customer-service-ai-badge.risk-high {
  border-color: #ffd29c;
  background: #fff5e8;
  color: #ae5d08;
}

.customer-service-ai-draft {
  display: grid;
  gap: 12px;
  padding: 14px 15px;
  border: 1px solid #ded5f7;
  border-radius: 10px;
  background: #fff;
}

.customer-service-ai-draft-block {
  display: grid;
  gap: 6px;
}

.customer-service-ai-draft-block + .customer-service-ai-draft-block {
  padding-top: 12px;
  border-top: 1px solid #ece7f8;
}

.customer-service-ai-draft-block span {
  color: #786b92;
  font-size: 11px;
  font-weight: 800;
}

.customer-service-ai-draft-block p {
  margin: 0;
  color: #29354a;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.customer-service-ai-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border: 1px dashed #d9d1ed;
  border-radius: 9px;
  background: #fff;
  color: #746b85;
  font-size: 12px;
}

.customer-service-ai-warning {
  margin-top: 9px;
  color: #a55b0a;
  font-size: 11px;
  line-height: 1.55;
}

.customer-service-history {
  max-height: 235px;
  overflow-y: auto;
}

.customer-service-history-item + .customer-service-history-item {
  margin-top: 10px;
}

.customer-service-history-item > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.customer-service-history-item b {
  color: #2c3950;
  font-size: 12px;
}

.customer-service-history-item span {
  color: #8390a3;
  font-size: 11px;
}

.customer-service-history-item p {
  margin: 7px 0 0;
  padding: 10px 12px;
  border: 1px solid #e0e7f0;
  border-radius: 8px;
  background: #fbfcfe;
  color: #344157;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.customer-service-history-empty {
  color: #8995a7;
  font-size: 12px;
}

.customer-service-reply-error {
  display: block;
  margin-top: 5px;
  color: #d53b35;
}

.customer-service-reply-box {
  margin-top: auto;
  padding: 16px 18px 18px;
  background: #fbfcfe;
}

.customer-service-reply-box.disabled {
  background: #f6f8fb;
}

.customer-service-reply-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) 1fr;
  align-items: end;
  gap: 14px;
  margin-bottom: 10px;
}

.customer-service-reply-toolbar label {
  display: grid;
  gap: 6px;
}

.customer-service-reply-toolbar label span {
  color: #4d5b72;
  font-size: 12px;
  font-weight: 700;
}

.customer-service-reply-toolbar > span {
  padding-bottom: 8px;
  color: #8190a5;
  font-size: 11px;
  text-align: right;
}

.customer-service-reply-box textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  padding: 12px 14px;
  border: 1px solid #d5dfec;
  border-radius: 9px;
  background: #fff;
  color: #26344b;
  font: inherit;
  line-height: 1.6;
}

.customer-service-reply-actions {
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.customer-service-reply-actions span {
  color: #7e8b9e;
  font-size: 11px;
}

.customer-service-settings-overlay {
  position: fixed;
  z-index: 10040;
  inset: 0;
}

.customer-service-settings-overlay.hidden {
  display: none;
}

.customer-service-settings-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(17, 28, 46, 0.5);
}

.customer-service-settings-drawer {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  width: min(620px, 94vw);
  height: 100%;
  overflow-y: auto;
  flex-direction: column;
  padding: 24px;
  background: #fff;
  box-shadow: -14px 0 40px rgba(20, 36, 62, 0.18);
}

.customer-service-settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e0e7f0;
}

.customer-service-settings-kicker {
  margin-bottom: 5px;
  color: #2463df;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.customer-service-settings-head h2 {
  margin: 0;
  color: #172237;
  font-size: 22px;
}

.customer-service-settings-head p {
  max-width: 470px;
  margin: 7px 0 0;
  color: #65738a;
  font-size: 12px;
  line-height: 1.6;
}

.customer-service-safety-note {
  display: grid;
  gap: 5px;
  margin-top: 16px;
  padding: 13px 14px;
  border: 1px solid #fed9a8;
  border-radius: 10px;
  background: #fff8ed;
}

.customer-service-safety-note strong {
  color: #9e5807;
  font-size: 13px;
}

.customer-service-safety-note span {
  color: #7d6648;
  font-size: 12px;
  line-height: 1.55;
}

.customer-service-setting-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 15px;
  border: 1px solid #d9e3ef;
  border-radius: 10px;
  background: #f9fbfe;
}

.customer-service-setting-toggle > div {
  display: grid;
  gap: 4px;
}

.customer-service-setting-toggle strong {
  color: #26344b;
  font-size: 14px;
}

.customer-service-setting-toggle span {
  color: #75839a;
  font-size: 11px;
}

.customer-service-setting-toggle input {
  width: 20px;
  height: 20px;
}

.customer-service-ai-settings {
  margin-top: 18px;
  padding: 15px;
  border: 1px solid #d9d0f3;
  border-radius: 11px;
  background: #fbfaff;
}

.customer-service-ai-settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.customer-service-ai-settings-head > div {
  display: grid;
  gap: 4px;
}

.customer-service-ai-settings-head strong {
  color: #3b2d63;
  font-size: 14px;
}

.customer-service-ai-settings-head span {
  color: #7c7292;
  font-size: 11px;
  line-height: 1.5;
}

.customer-service-ai-config-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eeeaf8;
  color: #6f5b98;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.customer-service-ai-config-badge.configured {
  background: #eaf9f1;
  color: #13804b;
}

.customer-service-ai-config-badge.missing {
  background: #fff0e8;
  color: #b8521e;
}

.customer-service-setting-toggle.compact {
  margin-top: 12px;
  padding: 12px;
  background: #fff;
}

.customer-service-setting-field {
  display: grid;
  gap: 6px;
  margin-top: 16px;
}

.customer-service-setting-field textarea {
  min-height: 88px;
  resize: vertical;
  padding: 10px 12px;
  line-height: 1.55;
}

.customer-service-setting-field > span {
  color: #334158;
  font-size: 12px;
  font-weight: 800;
}

.customer-service-setting-field small {
  color: #7b889b;
  font-size: 11px;
}

.customer-service-settings-section {
  margin-top: 22px;
}

.customer-service-settings-section-head {
  justify-content: space-between;
  margin-bottom: 10px;
}

.customer-service-settings-section-head > div {
  display: grid;
  gap: 4px;
}

.customer-service-settings-section-head strong {
  color: #26344b;
  font-size: 14px;
}

.customer-service-settings-section-head span {
  color: #7b889b;
  font-size: 11px;
}

.customer-service-rule-rows,
.customer-service-template-rows {
  overflow: hidden;
  border: 1px solid #dce5ef;
  border-radius: 10px;
}

.customer-service-rule-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 190px;
  align-items: center;
  gap: 10px;
  padding: 12px 13px;
  border-bottom: 1px solid #e4eaf2;
  background: #fff;
}

.customer-service-rule-row:last-child {
  border-bottom: 0;
}

.customer-service-rule-row.locked {
  background: #f7f8fa;
  opacity: 0.68;
}

.customer-service-rule-row input {
  width: 17px;
  height: 17px;
}

.customer-service-rule-row > span {
  display: grid;
  gap: 3px;
}

.customer-service-rule-row b {
  color: #2c3950;
  font-size: 12px;
}

.customer-service-rule-row small {
  color: #7f8b9d;
  font-size: 10px;
}

.customer-service-template-row {
  padding: 13px;
  border-bottom: 1px solid #e4eaf2;
}

.customer-service-template-row:last-child {
  border-bottom: 0;
}

.customer-service-template-row > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.customer-service-template-row b {
  color: #2a374d;
  font-size: 12px;
}

.customer-service-template-row span {
  color: #738097;
  font-size: 11px;
}

.customer-service-template-row textarea {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  padding: 10px 11px;
  border: 1px solid #d8e1ed;
  border-radius: 8px;
  color: #2e3c52;
  font: inherit;
  font-size: 12px;
  line-height: 1.55;
}

.customer-service-settings-actions {
  position: sticky;
  bottom: -24px;
  justify-content: space-between;
  gap: 14px;
  margin: 24px -24px -24px;
  padding: 15px 24px;
  border-top: 1px solid #dce5ef;
  background: #fff;
}

.customer-service-settings-actions span {
  color: #7b889b;
  font-size: 11px;
}

body.customer-service-settings-open {
  overflow: hidden;
}

@media (max-width: 1150px) {
  .customer-service-workspace {
    grid-template-columns: minmax(330px, 0.85fr) minmax(480px, 1.15fr);
  }

  .customer-service-summary-card {
    padding: 15px;
  }
}

@media (max-width: 900px) {
  .customer-service-head {
    align-items: stretch;
    flex-direction: column;
  }

  .customer-service-head-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .customer-service-auto-status {
    align-self: stretch;
  }

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

  .customer-service-summary-card:nth-child(2) {
    border-right: 0;
  }

  .customer-service-summary-card:nth-child(-n + 2) {
    border-bottom: 1px solid #e3eaf3;
  }

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

  .customer-service-queue-card {
    border-right: 0;
    border-bottom: 1px solid #dfe7f2;
  }

  .customer-service-queue {
    max-height: 430px;
  }

  .customer-service-detail-card {
    min-height: 590px;
  }
}

@media (max-width: 600px) {
  .customer-service-head h2 {
    font-size: 20px;
  }

  .customer-service-head-actions {
    grid-template-columns: 1fr;
  }

  .customer-service-summary-card {
    padding: 13px;
  }

  .customer-service-summary-card b {
    font-size: 23px;
  }

  .customer-service-tabs {
    overflow-x: auto;
    grid-template-columns: repeat(4, minmax(82px, 1fr));
  }

  .customer-service-search-row {
    grid-template-columns: 1fr;
  }

  .customer-service-queue-item {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .customer-service-product-image {
    width: 48px;
    height: 48px;
  }

  .customer-service-queue-badges {
    grid-column: 2;
    align-items: center;
    flex-direction: row;
  }

  .customer-service-detail-product {
    grid-template-columns: 72px minmax(0, 1fr);
    padding: 14px;
  }

  .customer-service-product-image.large {
    width: 72px;
    height: 72px;
  }

  .customer-service-detail-time {
    grid-column: 1 / -1;
  }

  .customer-service-detail-section,
  .customer-service-ai-assistant,
  .customer-service-reply-box {
    padding: 14px;
  }

  .customer-service-reply-toolbar {
    grid-template-columns: 1fr;
  }

  .customer-service-reply-toolbar > span {
    padding: 0;
    text-align: left;
  }

  .customer-service-ai-header,
  .customer-service-ai-empty,
  .customer-service-ai-settings-head {
    align-items: stretch;
    flex-direction: column;
  }

  .customer-service-ai-header-actions {
    justify-content: space-between;
  }

  .customer-service-reply-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .customer-service-reply-actions .btn {
    width: 100%;
    white-space: nowrap;
  }

  .customer-service-settings-drawer {
    width: 100%;
    padding: 18px;
  }

  .customer-service-rule-row {
    grid-template-columns: 22px minmax(0, 1fr);
  }

  .customer-service-rule-row select {
    grid-column: 2;
  }

  .customer-service-settings-actions {
    bottom: -18px;
    align-items: stretch;
    flex-direction: column;
    margin: 20px -18px -18px;
    padding: 13px 18px;
  }
}
/* Combined advertising overview */
.total-ads-panel {
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.total-ads-panel.is-date-loading { cursor: progress; }
.total-ads-panel.is-date-loading .total-ads-kpis,
.total-ads-panel.is-date-loading .total-ads-channel-strip,
.total-ads-panel.is-date-loading .total-ads-table-card {
  opacity: .58;
  transition: opacity .16s ease;
}
.total-ads-panel:not(.is-date-loading) .total-ads-kpis,
.total-ads-panel:not(.is-date-loading) .total-ads-channel-strip,
.total-ads-panel:not(.is-date-loading) .total-ads-table-card {
  transition: opacity .16s ease;
}

.total-ads-coverage {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 10px;
  border: 1px solid #bfd6f8;
  border-radius: 7px;
  background: #f3f7fe;
  padding: 8px 12px;
  color: #36577f;
  font-size: 12px;
  line-height: 1.45;
}
.total-ads-coverage b { flex: 0 0 auto; color: #245bb6; }
.total-ads-coverage.is-warning { border-color: #f1cf83; background: #fff9ea; color: #8a5a0a; }
.total-ads-coverage.is-warning b { color: #a26500; }

.total-ads-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.total-ads-kpis > div {
  min-height: 88px;
  box-sizing: border-box;
  border: 1px solid #dce5f1;
  border-top: 3px solid #6e8fbd;
  border-radius: 8px;
  background: #fff;
  padding: 12px 14px;
}
.total-ads-kpis > div.sales { border-top-color: #139568; }
.total-ads-kpis > div.roi { border-top-color: #485fc7; }
.total-ads-kpis span,
.total-ads-kpis small { display: block; }
.total-ads-kpis span { color: #5b6b82; font-size: 12px; font-weight: 700; }
.total-ads-kpis b { display: block; margin-top: 5px; color: #172033; font-size: 21px; line-height: 1.15; }
.total-ads-kpis small { margin-top: 5px; color: #8794a8; font-size: 10px; }

.total-ads-channel-strip {
  display: grid;
  grid-template-columns: minmax(180px, .7fr) minmax(320px, 1fr) minmax(260px, 1.5fr);
  gap: 18px;
  align-items: center;
  margin-top: 8px;
  border: 1px solid #dce5f1;
  border-radius: 8px;
  background: #fff;
  padding: 12px 14px;
}
.total-ads-channel-copy b,
.total-ads-channel-copy span { display: block; }
.total-ads-channel-copy b { color: #172033; font-size: 13px; }
.total-ads-channel-copy span { margin-top: 3px; color: #7a889d; font-size: 10px; }
.total-ads-channel-metrics { display: flex; gap: 22px; align-items: center; }
.total-ads-channel-metrics > span { display: grid; grid-template-columns: auto auto auto; gap: 6px; align-items: center; color: #5c6b80; font-size: 11px; }
.total-ads-channel-metrics i { width: 7px; height: 7px; border-radius: 50%; background: #3b6fd8; }
.total-ads-channel-metrics i.onsite { background: #18a374; }
.total-ads-channel-metrics b { color: #26344b; font-size: 12px; }
.total-ads-channel-metrics small { color: #8b97a9; }
.total-ads-share-track { display: flex; width: 100%; height: 8px; overflow: hidden; border-radius: 4px; background: #edf1f6; }
.total-ads-share-track i { height: 100%; transition: width .2s ease; }
.total-ads-share-track i:first-child { background: #3b6fd8; }
.total-ads-share-track i:last-child { background: #18a374; }

.total-ads-table-card { margin-top: 8px; overflow: hidden; border: 1px solid #dce5f1; border-radius: 8px; background: #fff; }
.total-ads-table-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border-bottom: 1px solid #dce5f1; }
.total-ads-table-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; color: #172033; font-size: 16px; }
.total-ads-table-head p { margin: 4px 0 0; color: #718098; font-size: 11px; }
.total-ads-table-head > span { color: #7a889d; font-size: 11px; white-space: nowrap; }
.total-ads-table-wrap { overflow: auto; }
.total-ads-table { width: 100%; min-width: 1080px; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.total-ads-table th { height: 39px; border-bottom: 1px solid #dce5f1; background: #f5f8fc; padding: 0 12px; color: #52627a; font-size: 11px; text-align: left; white-space: nowrap; }
.total-ads-table th:first-child { width: 245px; }
.total-ads-table th:nth-child(2) { width: 128px; }
.total-ads-table th:last-child { width: 128px; }
.total-ads-table th.num,
.total-ads-table td.num { text-align: right; }
.total-ads-table th.center,
.total-ads-table td.center { text-align: center; }
.total-ads-table td { height: 68px; box-sizing: border-box; border-bottom: 1px solid #e8edf4; padding: 8px 12px; color: #28364d; font-size: 12px; vertical-align: middle; }
.total-ads-table tr:last-child td { border-bottom: 0; }
.total-ads-table td b,
.total-ads-table td small { display: block; }
.total-ads-table td small { margin-top: 3px; color: #8996a9; font-size: 9px; }
.total-ads-channel-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.total-ads-channel-badge { display: inline-flex; min-height: 23px; align-items: center; border: 1px solid #bed0f0; border-radius: 5px; background: #f1f6ff; padding: 0 7px; color: #2459b4; font-size: 10px; font-weight: 750; }
.total-ads-channel-badge.onsite { border-color: #bce4d3; background: #effaf5; color: #087a50; }
.total-ads-roi { display: inline-flex; min-width: 54px; height: 28px; align-items: center; justify-content: center; border: 1px solid #a9dcc7; border-radius: 5px; background: #effaf5; color: #087a50; font-weight: 800; }
.total-ads-roi.danger { border-color: #f0b7bb; background: #fff3f4; color: #ca2932; }
.total-ads-roi.pending { border-color: #efd28e; background: #fff9e9; color: #996000; }
.total-ads-decision { display: grid; gap: 2px; }
.total-ads-decision b { color: #28364d; font-size: 11px; }
.total-ads-decision.danger b { color: #c82932; }

body[data-view-mode="total-ads"] #statusFilterLabel { display: none; }
body[data-view-mode="total-ads"] #keywordFilterLabel input { min-width: 240px; }

/* Coupang onsite advertising */
.onsite-ad-panel {
  padding: 0;
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.onsite-toolbar {
  display: grid;
  grid-template-columns: minmax(130px, .75fr) minmax(138px, .8fr) minmax(138px, .8fr) auto minmax(140px, .8fr) minmax(240px, 1.35fr) auto;
  gap: 8px;
  align-items: end;
  padding: 13px 14px;
  border: 1px solid #dce5f1;
  border-radius: 8px;
  background: #fff;
}

.onsite-toolbar label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.onsite-toolbar label > span {
  color: #52627a;
  font-size: 12px;
  font-weight: 700;
}

.onsite-toolbar input,
.onsite-toolbar select {
  width: 100%;
  height: 38px;
  border: 1px solid #ccd8e8;
  border-radius: 6px;
  background: #fff;
  color: #172033;
  padding: 0 11px;
}

.onsite-quick-dates {
  display: flex;
  gap: 5px;
  align-items: center;
  min-height: 38px;
}

.onsite-quick-dates button,
.onsite-detail-tabs button,
.onsite-window-toggle button {
  border: 1px solid #ccd8e8;
  border-radius: 6px;
  background: #fff;
  color: #44536a;
  font-weight: 700;
  cursor: pointer;
}

.onsite-quick-dates button {
  height: 38px;
  padding: 0 12px;
  white-space: nowrap;
}

.onsite-quick-dates button.active,
.onsite-detail-tabs button.active,
.onsite-window-toggle button.active {
  border-color: #2765e7;
  background: #edf4ff;
  color: #174fc7;
}

.onsite-import-btn {
  min-width: 128px;
  height: 38px;
}
.onsite-toolbar-actions { display: flex; gap: 6px; align-items: center; }
.onsite-history-btn { min-width: 104px; height: 38px; white-space: nowrap; }
.onsite-history-btn span { display: inline-flex; min-width: 18px; height: 18px; align-items: center; justify-content: center; margin-left: 3px; border-radius: 9px; background: #eef2f7; color: #607089; font-size: 9px; }

.onsite-coverage {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
  padding: 8px 12px;
  border: 1px solid #c8ddff;
  border-radius: 7px;
  background: #f1f6ff;
  color: #245197;
  font-size: 13px;
}

.onsite-coverage.success { border-color: #b9e8d4; background: #effbf5; color: #087a50; }
.onsite-coverage.warning { border-color: #f2d595; background: #fff9e9; color: #925a00; }
.onsite-coverage.danger { border-color: #f4b9bc; background: #fff2f3; color: #b4232a; }
.onsite-coverage.loading { color: #3c5f91; }

.onsite-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.onsite-kpis > div {
  min-height: 86px;
  padding: 12px 14px;
  border: 1px solid #dce5f1;
  border-top: 3px solid #6e8fbd;
  border-radius: 8px;
  background: #fff;
}

.onsite-kpis > div.sales { border-top-color: #16a36f; }
.onsite-kpis > div.roas { border-top-color: #7154d8; }
.onsite-kpis > div.cpc { border-top-color: #3d78d8; }
.onsite-kpis span,
.onsite-kpis small { display: block; }
.onsite-kpis span { color: #5b6b82; font-size: 12px; font-weight: 700; }
.onsite-kpis b { display: block; margin-top: 5px; color: #172033; font-size: 21px; line-height: 1.15; }
.onsite-kpis small { margin-top: 5px; color: #8794a8; font-size: 10px; }

.onsite-table-card {
  margin-top: 8px;
  border: 1px solid #dce5f1;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.onsite-table-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid #dce5f1;
}

.onsite-table-head h2 { display: flex; gap: 8px; align-items: center; margin: 0; color: #172033; font-size: 16px; }
.onsite-table-head p { margin: 4px 0 0; color: #718098; font-size: 12px; }
.onsite-table-head > span { color: #718098; font-size: 12px; white-space: nowrap; }
.onsite-title-count {
  display: inline-flex;
  height: 22px;
  align-items: center;
  padding: 0 8px;
  border-radius: 11px;
  background: #eef3f9;
  color: #607089;
  font-size: 11px;
  font-weight: 700;
}
.onsite-table-wrap { overflow: auto; }

.onsite-table {
  width: 100%;
  min-width: 1173px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.onsite-table col.product { width: 230px; }
.onsite-table col.method { width: 160px; }
.onsite-table col.impressions { width: 64px; }
.onsite-table col.clicks { width: 58px; }
.onsite-table col.cpc { width: 90px; }
.onsite-table col.spend { width: 95px; }
.onsite-table col.units { width: 110px; }
.onsite-table col.sales { width: 172px; }
.onsite-table col.roas { width: 68px; }
.onsite-table col.note { width: 100px; }
.onsite-table col.action { width: 58px; }

.onsite-table > thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 42px;
  padding: 0 10px;
  border-bottom: 1px solid #d5dfec;
  background: #f5f8fc;
  color: #34445e;
  font-size: 12px;
  text-align: left;
  white-space: nowrap;
}
.onsite-table > thead th.num { text-align: right; }
.onsite-table > thead th.center { text-align: center; }
.onsite-sort-button {
  display: inline-flex;
  min-width: 0;
  height: 30px;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  font: inherit;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.onsite-sort-button.center { justify-content: center; }
.onsite-sort-button::after {
  content: "↕";
  width: 10px;
  color: #a0adbf;
  font-size: 11px;
  line-height: 1;
}
.onsite-sort-button:hover,
.onsite-sort-button:focus-visible { color: #1e5fd8; }
.onsite-sort-button:focus-visible { outline: 2px solid #93b8ff; outline-offset: 3px; border-radius: 3px; }
.onsite-sort-button.active { color: #1e5fd8; }
.onsite-sort-button.active::after { content: "↓"; color: #1e5fd8; }
.onsite-sort-button.active.ascending::after { content: "↑"; }
.onsite-table > thead th:nth-child(n + 3),
.onsite-table > tbody > .onsite-product-row > td:nth-child(n + 3) {
  border-left: 1px solid #edf1f6;
}
.onsite-table > thead th:first-child { left: 0; z-index: 4; }
.onsite-table > thead th:last-child { right: 0; z-index: 4; text-align: center; }

.onsite-table > tbody > tr > td {
  padding: 10px;
  border-bottom: 1px solid #e5ebf3;
  color: #2b3547;
  font-size: 12px;
  vertical-align: middle;
}

.onsite-product-row { transition: background-color .15s ease; }
.onsite-product-row > td:first-child,
.onsite-product-row > td:last-child { position: sticky; z-index: 1; background: #fff; }
.onsite-product-row > td:first-child { left: 0; }
.onsite-product-row > td:last-child { right: 0; text-align: center; }
.onsite-product-row:hover { background: #f9fbfe; }
.onsite-product-row.expanded { background: #f3f7fd; }
.onsite-product-row:hover > td:first-child,
.onsite-product-row:hover > td:last-child { background: #f9fbfe; }
.onsite-product-row.expanded > td:first-child,
.onsite-product-row.expanded > td:last-child { background: #f3f7fd; }
.onsite-table td.num,
.onsite-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.onsite-table td.num b,
.onsite-table td.num small { display: block; }
.onsite-table td.num b { color: #202a3c; }
.onsite-table td.num small { margin-top: 4px; color: #8996aa; font-size: 10px; }
.onsite-cpc-cell b { color: #245da9 !important; }

.onsite-product-cell {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.onsite-product-cell img,
.onsite-product-image {
  width: 46px;
  height: 46px;
  border: 1px solid #dce5f1;
  border-radius: 6px;
  object-fit: cover;
  background: #f5f8fb;
}

.onsite-product-image.empty {
  display: grid;
  place-items: center;
  color: #8794a8;
  font-size: 10px;
}

.onsite-product-cell b,
.onsite-product-cell strong,
.onsite-product-cell small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.onsite-product-cell b { color: #154fc9; font-size: 12px; }
.onsite-product-cell strong { margin-top: 3px; max-width: 155px; color: #202a3c; font-size: 13px; }
.onsite-product-cell small { margin-top: 4px; color: #8a97aa; font-size: 10px; }

.onsite-method-shares { width: 150px; max-width: 100%; min-width: 0; }
.onsite-method-shares > div { display: flex; flex-wrap: wrap; gap: 5px; }
.onsite-method-chip {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  min-height: 22px;
  padding: 2px 6px;
  border: 1px solid;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.onsite-method-chip b { font-size: 11px; }
.onsite-method-chip.search { border-color: #b9d1ff; background: #edf4ff; color: #1657d1; }
.onsite-method-chip.recommendation { border-color: #d9c9ff; background: #f5f0ff; color: #6e40bd; }
.onsite-method-chip.external { border-color: #f1d3a5; background: #fff7e9; color: #a65a00; }
.onsite-method-chip.other { border-color: #d8e0eb; background: #f5f7fa; color: #607088; }
.onsite-share-bar { display: flex; width: 112px; max-width: 100%; height: 4px; margin-top: 6px; overflow: hidden; border-radius: 2px; background: #edf1f6; }
.onsite-share-bar i.search { background: #3778e8; }
.onsite-share-bar i.recommendation { background: #8b64d9; }
.onsite-share-bar i.external { background: #e59a32; }
.onsite-share-bar i.other { background: #8a97aa; }
.onsite-method-shares small { display: block; margin-top: 4px; color: #929db0; font-size: 10px; }
.onsite-no-conversion { color: #8a97aa; }

.onsite-roas {
  display: inline-flex;
  min-width: 60px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border: 1px solid;
  border-radius: 5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.onsite-product-row > td:nth-child(9) { text-align: center; }
.onsite-roas.success { border-color: #b8e6d3; background: #effaf5; color: #087c50; }
.onsite-roas.warning { border-color: #edd18e; background: #fff9e9; color: #956000; }
.onsite-roas.danger { border-color: #f1b3b7; background: #fff1f2; color: #c4262e; }
.onsite-roas.neutral { border-color: #d8e0eb; background: #f5f7fa; color: #76849a; }

.onsite-recommendation {
  display: grid;
  min-width: 0;
  gap: 3px;
  border: 1px solid #d8e0eb;
  border-radius: 5px;
  background: #f8fafc;
  padding: 6px 8px;
  line-height: 1.25;
}
.onsite-recommendation b,
.onsite-recommendation small,
.onsite-recommendation em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.onsite-recommendation b { color: #46566d; font-size: 11px; }
.onsite-recommendation small { color: #7e8ba0; font-size: 9px; font-weight: 600; }
.onsite-recommendation em { color: #95a0b1; font-size: 9px; font-style: normal; }
.onsite-recommendation.scale { border-color: #b7dfcd; background: #eff9f4; }
.onsite-recommendation.scale b { color: #087a50; }
.onsite-recommendation.lower { border-color: #efd18e; background: #fff9e9; }
.onsite-recommendation.lower b { color: #946000; }
.onsite-recommendation.pause { border-color: #efb9bd; background: #fff3f4; }
.onsite-recommendation.pause b { color: #c4262e; }
.onsite-recommendation.hold { border-color: #bfd0e8; background: #f2f6fb; }
.onsite-recommendation.hold b { color: #42638e; }
.onsite-recommendation.observe { border-color: #d6dee9; background: #f8fafc; }
.onsite-recommendation-empty { color: #9aa5b5; font-size: 10px; }
.onsite-recommendation-reason { display: grid; gap: 3px; min-width: 0; }
.onsite-recommendation-reason b,
.onsite-recommendation-reason small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.onsite-recommendation-reason b { color: #3b4b62; font-size: 10px; }
.onsite-recommendation-reason small { color: #8793a5; font-size: 9px; }
.onsite-bid-guide { display: grid; min-width: 0; gap: 2px; line-height: 1.25; }
.onsite-bid-guide span,
.onsite-bid-guide strong,
.onsite-bid-guide small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.onsite-bid-guide span { color: #6f7d91; font-size: 9px; }
.onsite-bid-guide span b { display: inline; color: #34445e; font-size: 10px; font-variant-numeric: tabular-nums; }
.onsite-bid-guide strong { color: #637188; font-size: 11px; font-variant-numeric: tabular-nums; }
.onsite-bid-guide small { color: #929daf; font-size: 8.5px; }
.onsite-bid-guide.qualified strong { color: #087a50; }
.onsite-bid-guide.insufficient strong { color: #956000; }
.onsite-bid-guide.not-suitable strong { color: #c4262e; }

.onsite-attribution-split {
  display: grid;
  gap: 1px;
  justify-items: end;
  margin-top: 4px;
  color: #8a97aa;
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
}
.onsite-kpis .onsite-attribution-split { display: grid; gap: 1px; justify-content: start; justify-items: start; margin-top: 0; }
.onsite-attribution-split .has-indirect,
.onsite-detail-table .indirect-value { color: #9a5d08; font-weight: 800; }

.onsite-price-audit {
  display: flex !important;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 4px;
  color: #718098 !important;
  font-size: 9px !important;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}
.onsite-price-audit span { display: inline !important; color: inherit !important; font: inherit; }
.onsite-price-audit.discounted span:last-child { color: #087a50 !important; }
.onsite-price-audit.pending { color: #9a5d08 !important; }
.onsite-kpis .onsite-price-audit {
  justify-content: flex-start;
  margin-top: 0;
  color: #65748a !important;
}
.onsite-priced-sales { min-width: 0; }

.edit-onsite-note {
  display: block;
  max-width: 150px;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: #8b97a9;
  font-size: 11px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.edit-onsite-note.has-note { color: #34445e; }
.edit-onsite-note.keyword { max-width: 110px; color: #376ac4; }
.onsite-note-editor { display: flex; gap: 4px; align-items: center; min-width: 220px; }
.onsite-note-editor input { min-width: 120px; height: 30px; border: 1px solid #b8c8dc; border-radius: 5px; padding: 0 8px; }
.onsite-note-editor button { height: 30px; border: 0; background: transparent; color: #2863cd; font-size: 11px; font-weight: 700; cursor: pointer; }

.onsite-detail-row > td { padding: 0 !important; background: #f5f8fc; }
.onsite-detail-shell { padding: 10px 14px 14px; border-top: 1px solid #d8e2ef; }
.onsite-detail-toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 10px; }
.onsite-detail-tabs,
.onsite-window-toggle { display: flex; gap: 5px; }
.onsite-detail-tabs button { height: 34px; padding: 0 12px; }
.onsite-detail-tabs b { margin-left: 5px; color: #8794a8; font-size: 10px; }
.onsite-detail-tabs .no-conversion-tab b { color: #a45b0a; }
.onsite-detail-tabs .no-conversion-tab.active { border-color: #e3a74f; background: #fff7e8; color: #8a4b05; }
.onsite-detail-tabs .no-conversion-tab.active b { color: #8a4b05; }
.onsite-detail-actions { display: flex; flex: 0 0 auto; gap: 7px; align-items: center; }
.copy-no-conversion-keywords,
.toggle-no-conversion-rules {
  display: inline-flex;
  height: 32px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #c6d4e6;
  border-radius: 6px;
  background: #fff;
  padding: 0 10px;
  color: #3f4f66;
  font: inherit;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}
.copy-no-conversion-keywords { border-color: #2b67df; background: #2765e7; color: #fff; }
.copy-no-conversion-keywords svg,
.toggle-no-conversion-rules svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.copy-no-conversion-keywords:hover { background: #1d55c9; }
.copy-no-conversion-keywords.success { border-color: #087a50; background: #087a50; }
.copy-no-conversion-keywords.error { border-color: #b4232a; background: #b4232a; }
.copy-no-conversion-keywords:disabled { border-color: #d5deea; background: #eef2f6; color: #8996a8; cursor: not-allowed; }
.toggle-no-conversion-rules:hover,
.toggle-no-conversion-rules.active { border-color: #91afe5; background: #f0f5ff; color: #1d56ba; }
.copy-no-conversion-keywords:focus-visible,
.toggle-no-conversion-rules:focus-visible { outline: 2px solid #86aef5; outline-offset: 2px; }
.onsite-window-toggle button { height: 32px; padding: 0 10px; font-size: 11px; }
.onsite-no-conversion-rules {
  display: grid;
  grid-template-columns: minmax(250px, 1.5fr) repeat(3, minmax(120px, .65fr)) minmax(130px, .7fr) auto;
  gap: 10px;
  align-items: end;
  margin: 0 0 10px;
  border: 1px solid #d6e0ed;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}
.onsite-no-conversion-rules-copy { align-self: center; min-width: 0; }
.onsite-no-conversion-rules-copy strong,
.onsite-no-conversion-rules-copy span { display: block; }
.onsite-no-conversion-rules-copy strong { color: #19283e; font-size: 13px; }
.onsite-no-conversion-rules-copy span { margin-top: 4px; color: #66758a; font-size: 10px; line-height: 1.45; }
.onsite-no-conversion-rules label { display: grid; gap: 5px; min-width: 0; color: #4b5b72; font-size: 10px; font-weight: 750; }
.onsite-no-conversion-rules input,
.onsite-no-conversion-rules select { width: 100%; height: 34px; border: 1px solid #cbd7e6; border-radius: 6px; background: #fff; padding: 0 9px; color: #1e2b40; font: inherit; font-size: 11px; font-variant-numeric: tabular-nums; }
.onsite-no-conversion-rules input:focus,
.onsite-no-conversion-rules select:focus { border-color: #6798ee; outline: 2px solid #d7e5ff; outline-offset: 1px; }
.onsite-no-conversion-rule-actions { display: flex; gap: 6px; }
.onsite-no-conversion-rule-actions button { height: 34px; border: 1px solid #cbd7e6; border-radius: 6px; background: #fff; padding: 0 10px; color: #44536a; font: inherit; font-size: 11px; font-weight: 750; white-space: nowrap; cursor: pointer; }
.onsite-no-conversion-rule-actions .apply-no-conversion-rules { border-color: #2765e7; background: #2765e7; color: #fff; }
.onsite-no-conversion-rule-actions button:focus-visible { outline: 2px solid #86aef5; outline-offset: 2px; }
.onsite-no-conversion-rules > p { grid-column: 2 / -1; margin: -2px 0 0; color: #7b8799; font-size: 9.5px; }
.onsite-detail-table { overflow: auto; border: 1px solid #d8e2ef; border-radius: 6px; background: #fff; }
.onsite-detail-table table { width: 100%; min-width: 1390px; table-layout: fixed; border-collapse: collapse; }
.onsite-detail-table table.campaigns { min-width: 1710px; }
.onsite-detail-table table.keywords { min-width: 1900px; }
.onsite-detail-table table.no-conversion { min-width: 1180px; }
.onsite-detail-table table.conversions { min-width: 1005px; }
.onsite-detail-table col.label-wide { width: 240px; }
.onsite-detail-table col.label { width: 170px; }
.onsite-detail-table col.label-small { width: 92px; }
.onsite-detail-table col.method { width: 74px; }
.onsite-detail-table col.metric { width: 76px; }
.onsite-detail-table col.rate { width: 72px; }
.onsite-detail-table col.money { width: 112px; }
.onsite-detail-table col.split { width: 126px; }
.onsite-detail-table col.split-wide { width: 166px; }
.onsite-detail-table col.roas { width: 74px; }
.onsite-detail-table col.recommendation { width: 142px; }
.onsite-detail-table col.bid-guide { width: 158px; }
.onsite-detail-table col.reason { width: 180px; }
.onsite-detail-table col.note { width: 126px; }
.onsite-detail-table col.action { width: 74px; }
.onsite-detail-table col.campaigns-compact { width: 210px; }
.onsite-detail-table col.conversion-product { width: 230px; }
.onsite-detail-table col.conversion-id { width: 130px; }
.onsite-detail-table col.conversion-number { width: 85px; }
.onsite-detail-table col.conversion-money { width: 130px; }
.onsite-detail-table th { height: 38px; padding: 0 10px; border-bottom: 1px solid #d8e2ef; background: #f7f9fc; color: #52627a; font-size: 11px; text-align: left; white-space: nowrap; }
.onsite-detail-table th.num { text-align: right; }
.onsite-detail-table th.indirect-head { color: #8c5a12; background: #fffaf0; }
.onsite-detail-table td { padding: 9px 10px; border-bottom: 1px solid #e8edf4; color: #334158; font-size: 11px; }
.onsite-detail-table td b,
.onsite-detail-table td small { display: block; }
.onsite-detail-table td small { margin-top: 3px; color: #8b97a9; font-size: 9px; }
.onsite-no-conversion-summary {
  display: grid;
  grid-template-columns: minmax(190px, .65fr) auto auto minmax(260px, 1fr);
  gap: 16px;
  align-items: center;
  min-width: 920px;
  border-bottom: 1px solid #dce4ef;
  background: #fbfcfe;
  padding: 11px 12px;
}
.onsite-no-conversion-summary > div > strong,
.onsite-no-conversion-summary > div > span { display: block; }
.onsite-no-conversion-summary > div > strong { color: #8b4d08; font-size: 14px; }
.onsite-no-conversion-summary > div > span { margin-top: 3px; color: #65748a; font-size: 10px; }
.onsite-no-conversion-summary dl { display: flex; gap: 8px; margin: 0; }
.onsite-no-conversion-summary dl > div { min-width: 108px; border-left: 1px solid #dce4ef; padding-left: 12px; }
.onsite-no-conversion-summary dt { color: #718096; font-size: 9px; font-weight: 700; }
.onsite-no-conversion-summary dd { margin: 3px 0 0; color: #1e2b40; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.onsite-no-conversion-summary dd small { display: inline; margin-left: 5px; color: #7d899b; font-size: 9px; font-weight: 650; }
.onsite-no-conversion-summary > p { margin: 0; color: #64748b; font-size: 10px; line-height: 1.5; }
.onsite-no-conversion-view-toggle { display: inline-flex; align-items: center; gap: 3px; border: 1px solid #d6e0ed; border-radius: 7px; background: #eef3f8; padding: 3px; }
.onsite-no-conversion-view-toggle button { height: 28px; border: 0; border-radius: 5px; background: transparent; padding: 0 9px; color: #64748b; font: inherit; font-size: 10px; font-weight: 750; cursor: pointer; }
.onsite-no-conversion-view-toggle button b { margin-left: 3px; font-size: 9px; }
.onsite-no-conversion-view-toggle button.active { background: #fff; color: #2159bd; box-shadow: 0 1px 3px rgba(31, 52, 80, .13); }
.onsite-no-conversion-view-toggle button:focus-visible { outline: 2px solid #86aef5; outline-offset: 1px; }
.onsite-no-conversion-workflow { display: flex; min-width: 920px; align-items: center; gap: 16px; border-bottom: 1px solid #d7e4f7; background: #f5f8ff; padding: 10px 12px; }
.onsite-no-conversion-workflow > div:first-child { min-width: 260px; }
.onsite-no-conversion-workflow strong,
.onsite-no-conversion-workflow span { display: block; }
.onsite-no-conversion-workflow strong { color: #213451; font-size: 12px; }
.onsite-no-conversion-workflow span { margin-top: 2px; color: #6a7890; font-size: 9.5px; }
.onsite-no-conversion-progress { margin-left: auto; text-align: right; }
.onsite-no-conversion-progress b { color: #245fca; font-size: 12px; font-variant-numeric: tabular-nums; }
.mark-no-conversion-excluded,
.restore-no-conversion-keyword { height: 32px; border: 1px solid #2765e7; border-radius: 6px; background: #2765e7; padding: 0 12px; color: #fff; font: inherit; font-size: 10.5px; font-weight: 750; white-space: nowrap; cursor: pointer; }
.mark-no-conversion-excluded:disabled { border-color: #d2dce9; background: #e8edf4; color: #8794a6; cursor: not-allowed; }
.restore-no-conversion-keyword { border-color: #cbd7e6; background: #fff; color: #476079; }
.restore-no-conversion-keyword:hover { border-color: #8eacd6; color: #245fca; }
.restore-no-conversion-keyword:disabled { opacity: .55; cursor: wait; }
.mark-no-conversion-excluded:focus-visible,
.restore-no-conversion-keyword:focus-visible { outline: 2px solid #86aef5; outline-offset: 2px; }
.onsite-no-conversion-feedback { min-width: 920px; border-bottom: 1px solid #cce8dc; background: #edf9f4; padding: 8px 12px; color: #087a50; font-size: 10.5px; font-weight: 750; }
.onsite-no-conversion-feedback.error { border-color: #f1ccd0; background: #fff2f3; color: #b4232a; }
.onsite-no-conversion-keyword-cell { display: grid; gap: 7px; }
.onsite-no-conversion-keyword-cell .onsite-keyword-copy { width: 100%; margin: 0; }
.onsite-no-conversion-check { display: inline-flex; width: max-content; align-items: center; gap: 6px; color: #64748b; font-size: 9.5px; font-weight: 700; cursor: pointer; }
.onsite-no-conversion-check input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.onsite-no-conversion-check span { display: inline-grid; width: 16px; height: 16px; place-items: center; border: 1px solid #aebdd0; border-radius: 4px; background: #fff; transition: .15s ease; }
.onsite-no-conversion-check span::after { content: ""; width: 7px; height: 4px; border: solid #fff; border-width: 0 0 2px 2px; opacity: 0; transform: rotate(-45deg) translateY(-1px); }
.onsite-no-conversion-check input:checked + span { border-color: #16865d; background: #16865d; }
.onsite-no-conversion-check input:checked + span::after { opacity: 1; }
.onsite-no-conversion-check input:focus-visible + span { outline: 2px solid #86aef5; outline-offset: 2px; }
.onsite-no-conversion-check em { color: inherit; font-style: normal; }
.onsite-detail-metrics.no-conversion tr.is-checked td { background: #f2faf6; }
.onsite-detail-metrics.no-conversion tr.is-checked .onsite-no-conversion-check { color: #087a50; }
.onsite-detail-metrics.no-conversion tr.is-excluded td { background: #f8fafc; color: #718096; }
.onsite-excluded-meta { color: #738196 !important; }
.onsite-no-conversion-spend b { color: #9a5200 !important; }
.onsite-zero-order { display: inline-flex; min-width: 28px; height: 24px; align-items: center; justify-content: center; border-radius: 5px; background: #fff1f2; color: #b4232a; font-weight: 800; font-variant-numeric: tabular-nums; }
.onsite-no-conversion-empty { display: grid; min-height: 150px; place-items: center; align-content: center; gap: 5px; color: #64748b; text-align: center; }
.onsite-no-conversion-empty strong { color: #334155; font-size: 13px; }
.onsite-no-conversion-empty span { font-size: 10px; }
.onsite-keyword-copy {
  display: block;
  width: calc(100% + 12px);
  min-width: 0;
  margin: -5px -6px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  padding: 5px 6px;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: copy;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.onsite-keyword-copy-line {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.onsite-keyword-copy-line > b,
.onsite-keyword-copy > small,
.onsite-keyword-translation-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.onsite-keyword-copy-line > b { min-width: 0; color: #28364b; }
.onsite-keyword-translation {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  color: #42658e;
  font-size: 9.5px;
  line-height: 1.35;
}
.onsite-keyword-translation-label {
  flex: 0 0 auto;
  border-radius: 3px;
  background: #eaf2ff;
  padding: 1px 4px;
  color: #3369ad;
  font-size: 8px;
  font-weight: 800;
  line-height: 1.35;
}
.onsite-keyword-translation-value { min-width: 0; }
.onsite-keyword-translation.is-loading,
.onsite-keyword-translation.is-unavailable { color: #929dab; }
.onsite-keyword-translation.is-loading .onsite-keyword-translation-label,
.onsite-keyword-translation.is-unavailable .onsite-keyword-translation-label {
  background: #f0f3f7;
  color: #8995a5;
}
.onsite-keyword-campaign {
  margin-top: 3px !important;
  color: #9aa5b4 !important;
  font-size: 8.5px !important;
}
.onsite-keyword-copy-feedback {
  flex: 0 0 auto;
  min-width: 34px;
  border-radius: 4px;
  background: #eaf2ff;
  padding: 2px 5px;
  color: #2464cf;
  font-size: 9px;
  font-weight: 750;
  line-height: 1.25;
  text-align: center;
  opacity: 0;
  transform: translateY(1px);
  transition: opacity .15s ease, transform .15s ease, color .15s ease, background-color .15s ease;
}
.onsite-keyword-copy:hover {
  border-color: #c4d7f5;
  background: #f5f9ff;
}
.onsite-keyword-copy:hover .onsite-keyword-copy-feedback,
.onsite-keyword-copy:focus-visible .onsite-keyword-copy-feedback,
.onsite-keyword-copy[data-copy-state="success"] .onsite-keyword-copy-feedback,
.onsite-keyword-copy[data-copy-state="error"] .onsite-keyword-copy-feedback {
  opacity: 1;
  transform: translateY(0);
}
.onsite-keyword-copy:focus-visible {
  border-color: #78a8f5;
  outline: 2px solid #bdd4fb;
  outline-offset: 1px;
  background: #f5f9ff;
}
.onsite-keyword-copy[data-copy-state="success"] {
  border-color: #a9ddc5;
  background: #f1faf6;
}
.onsite-keyword-copy[data-copy-state="success"] .onsite-keyword-copy-feedback {
  background: #dff5e9;
  color: #087a50;
}
.onsite-keyword-copy[data-copy-state="error"] {
  border-color: #efb9bd;
  background: #fff5f5;
}
.onsite-keyword-copy[data-copy-state="error"] .onsite-keyword-copy-feedback {
  min-width: 48px;
  background: #fde7e8;
  color: #c4262e;
}
.onsite-keyword-static { min-width: 0; }
@media (hover: none) {
  .onsite-keyword-copy-feedback { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .onsite-keyword-copy,
  .onsite-keyword-copy-feedback { transition: none; }
}

.onsite-import-overlay {
  position: fixed;
  inset: 0;
  z-index: 1600;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(22, 31, 48, .45);
}
.onsite-import-dialog { width: min(520px, 100%); padding: 20px; border-radius: 8px; background: #fff; box-shadow: 0 20px 55px rgba(20, 34, 58, .22); }
.onsite-import-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.onsite-import-head span { color: #2765e7; font-size: 10px; font-weight: 800; }
.onsite-import-head h2 { margin: 3px 0 0; color: #172033; font-size: 20px; }
.onsite-import-head > button { width: 32px; height: 32px; border: 0; border-radius: 6px; background: #f0f3f8; color: #66758b; font-size: 22px; cursor: pointer; }
.onsite-import-dialog > p { margin: 14px 0; color: #64738a; font-size: 13px; line-height: 1.7; }
.onsite-import-dialog > label { display: grid; gap: 6px; color: #46566f; font-size: 12px; font-weight: 700; }
.onsite-import-dialog input { height: 40px; border: 1px solid #c9d6e7; border-radius: 6px; padding: 0 10px; }
.onsite-file-picker { display: grid; gap: 5px; width: 100%; margin-top: 12px; padding: 14px; border: 1px dashed #9eb9e6; border-radius: 7px; background: #f6f9ff; color: #2158b6; text-align: left; cursor: pointer; }
.onsite-file-picker b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.onsite-file-picker span { color: #7b899d; font-size: 11px; }
.onsite-import-validation {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
  border: 1px solid #dce5f1;
  border-radius: 6px;
  background: #f8fafc;
  overflow: hidden;
}
.onsite-import-validation > div { min-width: 0; padding: 10px 11px; border-right: 1px solid #e4eaf2; }
.onsite-import-validation > div:last-child { border-right: 0; }
.onsite-import-validation span,
.onsite-import-validation b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.onsite-import-validation span { color: #7c899c; font-size: 10px; font-weight: 650; }
.onsite-import-validation b { margin-top: 4px; color: #34445c; font-size: 11px; }
.onsite-import-validation.is-loading { border-color: #a8c5f2; background: #f5f9ff; }
.onsite-import-validation.is-valid { border-color: #9fd9bd; background: #f3fbf7; }
.onsite-import-validation.is-valid b { color: #087a50; }
.onsite-import-validation.is-invalid { border-color: #f3b0b0; background: #fff7f7; }
.onsite-import-validation.is-invalid b { color: #c53535; }
.onsite-import-validation-message { margin-top: 7px; color: #718096; font-size: 11px; line-height: 1.55; }
.onsite-import-validation.is-valid + .onsite-import-validation-message { color: #087a50; }
.onsite-import-validation.is-invalid + .onsite-import-validation-message { color: #c53535; font-weight: 700; }
.onsite-import-rule { display: grid; grid-template-columns: auto 1fr; gap: 9px; margin-top: 12px; padding: 11px; border-radius: 6px; background: #effaf5; color: #2d6250; font-size: 11px; line-height: 1.6; }
.onsite-import-rule b { color: #087a50; }
.onsite-import-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.onsite-history-dialog { width: min(760px, 100%); }
.onsite-history-table-wrap { max-height: min(520px, 65vh); overflow: auto; border: 1px solid #dce5f1; border-radius: 7px; }
.onsite-history-table { width: 100%; min-width: 650px; border-collapse: separate; border-spacing: 0; }
.onsite-history-table th { position: sticky; top: 0; z-index: 1; height: 38px; border-bottom: 1px solid #dce5f1; background: #f5f8fc; padding: 0 10px; color: #52627a; font-size: 11px; text-align: left; }
.onsite-history-table th.num,
.onsite-history-table td.num { text-align: right; }
.onsite-history-table td { height: 54px; border-bottom: 1px solid #e8edf4; padding: 7px 10px; color: #334158; font-size: 11px; }
.onsite-history-table tr:last-child td { border-bottom: 0; }
.onsite-import-file { max-width: 280px; }
.onsite-import-file b,
.onsite-import-file small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.onsite-import-file small { margin-top: 3px; color: #8b97a9; font-size: 9px; }
.delete-onsite-import,
.confirm-delete-onsite-import,
.cancel-delete-onsite-import { min-height: 28px; border-radius: 5px; padding: 0 8px; font-size: 10px; font-weight: 750; cursor: pointer; }
.delete-onsite-import { border: 1px solid #efb8bc; background: #fff; color: #c62c34; }
.confirm-delete-onsite-import { border: 1px solid #cf3038; background: #cf3038; color: #fff; }
.cancel-delete-onsite-import { border: 1px solid #cbd6e4; background: #fff; color: #56657a; }
.onsite-delete-confirm { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.onsite-delete-confirm span { color: #b4232a; font-size: 9px; }
.period-onsite-correction {
  display: block;
  flex: 0 0 100%;
  margin-top: 1px;
  color: #087a50;
  font-size: 8.5px;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
}
.onsite-correction-applied { color: #087a50 !important; }
.onsite-correction-pending { color: #9a6500 !important; }
.onsite-correction-conflict { color: #bd252d !important; font-weight: 700; }

.meta-onsite-correction-bar {
  display: flex;
  min-height: 38px;
  box-sizing: border-box;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  border: 1px solid #a7dfca;
  border-radius: 6px;
  background: #f0fbf6;
  padding: 8px 12px;
  color: #315a4b;
  font-size: 11px;
  line-height: 1.45;
}

.meta-onsite-correction-bar b {
  flex: 0 0 auto;
  color: #087a50;
  font-size: 11.5px;
}

.meta-onsite-correction-bar.is-conflict {
  border-color: #f3c0c3;
  background: #fff5f5;
  color: #8f3940;
}

.meta-onsite-correction-bar.is-conflict b { color: #bd252d; }

@media (max-width: 760px) {
  .meta-onsite-correction-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
}

@media (max-width: 1280px) {
  .total-ads-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .total-ads-channel-strip { grid-template-columns: 1fr 1fr; }
  .total-ads-share-track { grid-column: 1 / -1; }
  .onsite-toolbar { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .onsite-search { grid-column: span 2; }
  .onsite-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .onsite-optimization-bar { align-items: flex-start; flex-direction: column; }
  .onsite-optimization-counts { width: 100%; overflow: auto; }
  .onsite-detail-toolbar { align-items: flex-start; flex-direction: column; }
  .onsite-detail-actions { width: 100%; }
  .onsite-detail-actions .onsite-window-toggle { margin-left: auto; }
  .onsite-no-conversion-rules { grid-template-columns: minmax(240px, 1.2fr) repeat(2, minmax(125px, .7fr)) minmax(130px, .7fr); }
  .onsite-no-conversion-rules-copy { grid-column: 1 / -1; }
  .onsite-no-conversion-rule-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .onsite-no-conversion-rules > p { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .total-ads-coverage { align-items: flex-start; flex-direction: column; gap: 3px; }
  .total-ads-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .total-ads-kpis > div { min-height: 84px; padding: 11px 12px; }
  .total-ads-channel-strip { grid-template-columns: 1fr; gap: 10px; }
  .total-ads-channel-metrics { align-items: flex-start; flex-direction: column; gap: 7px; }
  .total-ads-share-track { grid-column: auto; }
  .total-ads-table-head { align-items: flex-start; flex-direction: column; }
  .onsite-toolbar { grid-template-columns: 1fr 1fr; padding: 12px; }
  .onsite-toolbar label:first-child,
  .onsite-search,
  .onsite-quick-dates { grid-column: 1 / -1; }
  .onsite-quick-dates button { flex: 1; padding: 0 6px; }
  .onsite-import-btn { width: 100%; }
  .onsite-toolbar-actions { grid-column: 1 / -1; }
  .onsite-toolbar-actions .btn { flex: 1; }
  .onsite-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .onsite-kpis > div { min-height: 88px; padding: 12px; }
  .onsite-kpis b { font-size: 19px; }
  .onsite-optimization-bar { padding: 10px; }
  .onsite-table-head { align-items: flex-start; flex-direction: column; }
  .onsite-detail-shell { width: calc(100vw - 44px); min-width: 0; box-sizing: border-box; }
  .onsite-detail-toolbar { align-items: flex-start; flex-direction: column; }
  .onsite-detail-tabs { max-width: 100%; overflow: auto; }
  .onsite-detail-actions { width: 100%; flex-wrap: wrap; }
  .onsite-detail-actions .onsite-window-toggle { margin-left: auto; }
  .onsite-no-conversion-rules { grid-template-columns: 1fr 1fr; }
  .onsite-no-conversion-rules-copy,
  .onsite-no-conversion-rules label:nth-of-type(3),
  .onsite-no-conversion-rules label:nth-of-type(4),
  .onsite-no-conversion-rule-actions,
  .onsite-no-conversion-rules > p { grid-column: 1 / -1; }
  .onsite-no-conversion-rule-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .onsite-no-conversion-rule-actions button { width: 100%; }
  .onsite-method-shares { width: 168px; }
}
.product-archive-table-wrap{border-top:0;background:#fff}
.product-archive-table{width:100%;min-width:1240px;table-layout:fixed}
.product-archive-table col.product-library-col-image{width:72px}
.product-archive-table col.product-library-col-code{width:132px}
.product-archive-table col.product-library-col-name{width:24%}
.product-archive-table col.product-library-col-id{width:150px}
.product-archive-table col.product-library-col-sku{width:118px}
.product-archive-table col.product-library-col-price{width:22%}
.product-archive-table col.product-library-col-link{width:116px}
.product-archive-table col.product-library-col-action{width:82px}
.product-archive-table>thead>tr>th:nth-child(n){width:auto;min-width:0}
.product-archive-table>thead>tr>th{height:42px;padding:0 14px;color:#475467;font-size:12px;font-weight:800;letter-spacing:.01em;white-space:nowrap}
.product-archive-table>tbody>tr.product-archive-group-row>td{height:70px;padding:10px 14px;border-bottom-color:#e8eef5;font-size:13px;line-height:1.4;overflow:hidden}
.product-archive-table>tbody>tr.product-archive-group-row>td:last-child{text-align:center}
.product-library-image-cell{display:flex;align-items:center;justify-content:center;width:48px;min-width:48px}
.product-library-image-cell .product-archive-thumb{width:48px;height:48px;border-radius:10px}
.product-library-code-cell{min-width:0;overflow:hidden;color:#175cd3;font-size:13px;font-weight:800;letter-spacing:.01em;text-overflow:ellipsis;white-space:nowrap}
.product-archive-table .product-archive-name{max-width:none;min-width:0;gap:4px}
.product-archive-table .product-name-heading{display:grid;grid-template-columns:minmax(0,1fr) auto auto;justify-content:start;gap:4px 6px}
.product-archive-table .product-name-heading .product-name-display{min-width:0;overflow:hidden;font-size:13px;text-overflow:ellipsis;white-space:nowrap}
.product-archive-table .product-name-heading .product-name-display span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.product-archive-table .product-archive-name .sub{overflow:hidden;color:#667085;font-size:11px;text-overflow:ellipsis;white-space:nowrap}
.product-archive-table .product-id-cell{min-width:0;overflow:hidden}
.product-archive-table .product-master-spec-summary{gap:3px;white-space:nowrap}
.product-archive-table .product-master-price-auto{min-width:0;gap:5px;overflow:hidden}
.product-archive-table .product-master-price-auto>div:first-child b{font-size:13px;line-height:1.3;white-space:normal}
.product-archive-table .product-master-coupon-line{display:grid;grid-template-columns:minmax(0,auto) auto auto;justify-content:start;gap:3px 6px;min-width:0}
.product-archive-table .product-master-coupon-line>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.product-archive-table .product-archive-link-cell{justify-content:flex-start;min-width:0}
.product-archive-table .product-archive-link-cell .mini-btn{min-width:84px}
.product-archive-table .toggle-product-archive{min-width:54px}
.product-library-expand-all{align-self:end;min-width:150px;height:38px;border-color:#bfd2f5;background:#f8fbff;color:#175cd3;font-weight:800;white-space:nowrap}
.product-library-expand-all:hover:not(:disabled){border-color:#84adf4;background:#eff6ff}
.product-library-expand-all[aria-pressed="true"]{border-color:#a7b6cc;background:#f2f4f7;color:#344054}
.product-library-expand-all:disabled{opacity:.55;cursor:not-allowed}

@media (min-width:901px){
  .product-archive-toolbar{grid-template-columns:minmax(360px,1fr) minmax(170px,200px) minmax(190px,auto) minmax(210px,auto)}
  .product-library-expand-all{justify-self:start}
}
@media(max-width:1280px){.product-archive-table{min-width:1180px}.product-archive-table col.product-library-col-name{width:260px}.product-archive-table col.product-library-col-price{width:230px}}
.product-library-import-overlay{z-index:190}
.product-library-import-modal{width:min(1180px,94vw);max-height:90vh;display:flex;flex-direction:column;overflow:hidden}
.product-library-import-safety{margin:0 22px 14px;padding:14px 16px;border:1px solid #a7f3d0;border-radius:12px;background:#ecfdf5;display:flex;align-items:flex-start;gap:12px;color:#065f46}
.product-library-import-safety b{flex:0 0 auto;font-size:13px}
.product-library-import-safety span{font-size:13px;line-height:1.55}
.product-library-import-dropzone{margin:0 22px 16px;padding:18px;border:1.5px dashed #9db8e9;border-radius:14px;background:#f7faff;display:flex;align-items:center;gap:14px;cursor:pointer;transition:.18s ease}
.product-library-import-dropzone:hover,.product-library-import-dropzone.dragging{border-color:#2563eb;background:#eff6ff;box-shadow:0 0 0 3px rgba(37,99,235,.08)}
.product-library-import-dropzone>div:nth-child(2){display:flex;flex:1;min-width:0;flex-direction:column;gap:4px}
.product-library-import-dropzone b{font-size:14px;color:#172033;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.product-library-import-dropzone span{font-size:12px;color:#667085}
.product-library-import-dropzone[aria-busy="true"]{cursor:wait;border-color:#60a5fa;background:#eff6ff}
.product-library-import-status-message{margin:-4px 22px 16px;padding:11px 14px;border:1px solid #bfdbfe;border-radius:10px;background:#eff6ff;color:#1d4ed8;font-size:13px;line-height:1.55}
.product-library-import-status-message.loading{padding-left:38px;position:relative}
.product-library-import-status-message.loading::before{content:"";position:absolute;left:14px;top:50%;width:14px;height:14px;margin-top:-8px;border:2px solid #bfdbfe;border-top-color:#2563eb;border-radius:50%;animation:product-library-import-spin .8s linear infinite}
.product-library-import-status-message.success{border-color:#bbf7d0;background:#f0fdf4;color:#166534}
.product-library-import-status-message.warning{border-color:#fde68a;background:#fffbeb;color:#92400e}
.product-library-import-status-message.error{border-color:#fecaca;background:#fff7f7;color:#b42318}
@keyframes product-library-import-spin{to{transform:rotate(360deg)}}
.product-library-import-file-icon{width:48px;height:48px;border-radius:12px;background:linear-gradient(145deg,#16a34a,#059669);display:grid;place-items:center;color:#fff;font-size:11px;font-weight:900;box-shadow:0 8px 18px rgba(5,150,105,.2)}
.product-library-import-summary{margin:0 22px 16px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.product-library-import-summary>div{padding:12px 14px;border:1px solid #e2e8f0;border-radius:12px;background:#fff;display:flex;align-items:center;justify-content:space-between}
.product-library-import-summary span{font-size:12px;color:#667085}.product-library-import-summary b{font-size:20px;color:#172033}
.product-library-import-summary .ready{background:#f0fdf4;border-color:#bbf7d0}.product-library-import-summary .ready b{color:#15803d}
.product-library-import-summary .warning{background:#fffbeb;border-color:#fde68a}.product-library-import-summary .warning b{color:#b45309}
.product-library-import-summary .danger{background:#fff7f7;border-color:#fecaca}.product-library-import-summary .danger b{color:#dc2626}
.product-library-import-preview{margin:0 22px;min-height:160px;overflow:hidden;display:flex;flex-direction:column;border:1px solid #e2e8f0;border-radius:12px}
.product-library-import-preview-head{padding:11px 14px;background:#f8fafc;border-bottom:1px solid #e2e8f0;display:flex;align-items:center;justify-content:space-between;gap:16px}
.product-library-import-preview-head b{font-size:13px}.product-library-import-preview-head span{font-size:12px;color:#667085}
.product-library-import-preview .table-wrap{max-height:330px;overflow:auto}.product-library-import-preview table{width:100%;border-collapse:collapse;font-size:12px}
.product-library-import-preview th{position:sticky;top:0;z-index:1;background:#f8fafc;color:#475467;text-align:left;padding:9px 10px;border-bottom:1px solid #e2e8f0;white-space:nowrap}
.product-library-import-preview td{padding:9px 10px;border-bottom:1px solid #eef2f6;vertical-align:top}
.product-library-import-status{display:inline-flex;padding:3px 8px;border-radius:999px;font-size:11px;font-weight:700;white-space:nowrap}
.product-library-import-status.ready{background:#dcfce7;color:#15803d}.product-library-import-status.warning{background:#fef3c7;color:#a16207}.product-library-import-status.danger{background:#fee2e2;color:#b91c1c}
.product-library-import-actions{padding:16px 22px 20px;display:flex;justify-content:flex-end;gap:10px;background:#fff}
@media(max-width:760px){.product-library-import-safety{display:block}.product-library-import-summary{grid-template-columns:repeat(2,1fr)}.product-library-import-dropzone{align-items:flex-start;flex-wrap:wrap}.product-library-import-dropzone .btn{width:100%}}

/* Replenishment request editor v203 — final overrides */
.replenishment-request-editor{padding:20px;border-color:#d7e1ed;background:#f8fafc}
.replenishment-request-overview{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin-top:16px}
.replenishment-request-overview>div{min-height:68px;padding:12px 14px;border:1px solid #dfe7f1;border-radius:10px;background:#fff}
.replenishment-request-overview span{display:block;color:#64748b;font-size:11px;font-weight:700}
.replenishment-request-overview strong{display:block;margin-top:6px;color:#172033;font-size:20px;line-height:1}
.replenishment-request-overview strong.active{color:#1769e0}
.replenishment-editor-layout{display:grid;grid-template-columns:1fr;gap:14px;margin-top:12px}
.replenishment-request-sku-editor{padding:0;overflow:hidden;border:1px solid #dbe5f3;border-radius:10px;background:#fff}
.replenishment-sku-toolbar{display:flex;min-height:58px;align-items:center;justify-content:space-between;gap:16px;padding:10px 14px;border-bottom:1px solid #e2e8f0}
.replenishment-sku-toolbar>div{display:flex;align-items:center;gap:8px}.replenishment-sku-toolbar strong{color:#172033;font-size:14px}.replenishment-sku-toolbar span{color:#64748b;font-size:11px}.replenishment-sku-toolbar .mini-btn{min-height:32px}
.replenishment-request-sku-table{min-width:760px}
.replenishment-request-sku-row{display:grid;grid-template-columns:minmax(260px,1.8fr) minmax(130px,.8fr) 90px 100px 190px;min-height:62px;align-items:center;border-bottom:1px solid #edf1f6;padding:8px 14px;column-gap:18px}
.replenishment-request-sku-row:last-child{border-bottom:0}.replenishment-request-sku-row.heading{min-height:38px;background:#f5f7fb;color:#526175;font-size:11px;font-weight:800}.replenishment-request-sku-row.missing-specification{background:#fff9f7;box-shadow:inset 3px 0 #ef8354}
.replenishment-request-sku-copy b{font-size:13px}.replenishment-request-sku-copy small{white-space:normal}.replenishment-sku-code{color:#2563a9;font-size:12px;font-weight:800}.replenishment-sku-suggested{color:#1769e0}
.replenishment-qty-stepper{display:grid;grid-template-columns:34px 1fr 34px;height:38px;overflow:hidden;border:1px solid #cbd5e1;border-radius:8px;background:#fff}.replenishment-qty-stepper button{border:0;background:#f3f6fa;color:#334155;font-size:18px;cursor:pointer}.replenishment-qty-stepper button:hover{background:#e8f1ff;color:#1769e0}.replenishment-qty-stepper input{width:100%;min-width:62px;border:0;border-right:1px solid #e2e8f0;border-left:1px solid #e2e8f0;text-align:center;color:#172033;font-size:14px;font-weight:800}
.replenishment-editor-bottom{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(360px,.65fr);gap:14px;align-items:stretch}.replenishment-editor-main{display:grid;gap:14px;min-width:0;padding:14px;border:1px solid #dbe5f3;border-radius:10px;background:#fff}.replenishment-request-snapshot{height:100%}.replenishment-snapshot-metrics{grid-template-columns:repeat(3,1fr)}
.replenishment-editor-footer{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:13px 14px;border:1px solid #d5e4f8;border-radius:10px;background:#f3f7fd}.replenishment-request-total{display:flex;align-items:center;gap:12px;border:0;padding:0;background:transparent}.replenishment-request-total input{width:190px;background:#fff}.replenishment-request-total small{color:#b45309}.replenishment-request-total small.is-ready{color:#0f8a5f}.replenishment-editor-actions{display:flex;grid-template-columns:none}.replenishment-editor-actions .btn{min-width:116px}
@media(max-width:1050px){.replenishment-request-overview{grid-template-columns:repeat(3,1fr)}.replenishment-editor-bottom{grid-template-columns:1fr}.replenishment-request-sku-editor{overflow-x:auto}}
@media(max-width:680px){.replenishment-request-editor{padding:12px}.replenishment-request-overview{grid-template-columns:repeat(2,1fr)}.replenishment-sku-toolbar,.replenishment-editor-footer{align-items:stretch;flex-direction:column}.replenishment-sku-toolbar>div:last-child,.replenishment-editor-actions{display:grid;grid-template-columns:1fr 1fr}.replenishment-editor-fields{grid-template-columns:1fr}.replenishment-request-total{display:grid;grid-template-columns:1fr}.replenishment-request-total input{width:100%}}

/* v210: compact hierarchy for store, account, and utility actions. */
@media (min-width: 1101px) {
  .topbar {
    flex-wrap: nowrap;
  }

  .topbar-heading {
    flex: 1 1 auto;
    min-width: 0;
  }

  body[data-view-mode="ads"] .topbar {
    min-height: 72px;
    padding: 11px 22px;
  }

  body[data-view-mode="ads"] .top-actions {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 8px;
  }

  body[data-view-mode="ads"] .store-switcher {
    min-width: 172px;
    height: 40px;
    padding: 0 9px 0 11px;
    border-color: #cbd9ee;
    background: #fff;
    box-shadow: none;
  }

  body[data-view-mode="ads"] .account-actions,
  body[data-view-mode="ads"] .utility-actions {
    height: 40px;
  }

  body[data-view-mode="ads"] .account-actions {
    border-color: #dce4ef;
  }

  body[data-view-mode="ads"] .account-actions .auth-user {
    min-height: 38px;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0 11px;
    box-shadow: none;
    font-size: 12px;
  }

  body[data-view-mode="ads"] .top-actions .account-actions .topbar-quiet-btn {
    width: auto;
    height: 26px;
    min-height: 26px;
    border: 0;
    border-left: 1px solid #e2e8f0;
    border-radius: 0;
    background: transparent;
    padding: 0 10px;
    box-shadow: none;
    color: #64748b;
    font-size: 12px;
  }

  body[data-view-mode="ads"] .top-actions .utility-actions .btn {
    min-height: 38px;
    padding: 0 12px;
    box-shadow: none;
  }

  body[data-view-mode="ads"] .top-actions .utility-actions .topbar-export-btn {
    border-color: #c9d8ee;
    background: #f6f9fd;
    color: #1e3a5f;
  }
}

@media (max-width: 1100px) {
  .top-actions {
    width: 100%;
    flex-wrap: wrap;
  }
}

@media (max-width: 720px) {
  .top-actions,
  body[data-view-mode="ads"] .top-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .top-actions .store-switcher,
  .top-actions .account-actions,
  .top-actions .utility-actions,
  body[data-view-mode="ads"] .top-actions .store-switcher,
  body[data-view-mode="ads"] .top-actions .account-actions,
  body[data-view-mode="ads"] .top-actions .utility-actions {
    grid-column: 1 / -1;
    width: 100%;
  }

  .top-actions .account-actions .auth-user,
  body[data-view-mode="ads"] .top-actions .account-actions .auth-user {
    flex: 1 1 auto;
    min-height: 38px;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0 11px;
    box-shadow: none;
    justify-content: flex-start;
  }

  .top-actions .account-actions .btn,
  body[data-view-mode="ads"] .top-actions .account-actions .btn {
    width: auto;
    height: 26px;
    min-height: 26px;
    border: 0;
    border-left: 1px solid #e2e8f0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .top-actions .utility-actions,
  body[data-view-mode="ads"] .top-actions .utility-actions {
    display: grid;
    height: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .top-actions .utility-actions .btn,
  body[data-view-mode="ads"] .top-actions .utility-actions .btn {
    width: 100%;
    min-height: 38px;
    box-shadow: none;
  }
}

/* 财务系统：Meta 自动，其余手工；总账、趋势、待办和流水按操作顺序呈现。 */
.finance-panel {
  --finance-blue: #2463eb;
  --finance-green: #159965;
  --finance-orange: #ea7a1d;
  --finance-red: #dc3348;
  --finance-border: #dbe4ef;
  --finance-muted: #6b7b91;
  background: #f6f8fb;
}

.finance-policy-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 18px 0;
  padding: 10px 12px;
  border: 1px solid #cddcf3;
  border-radius: 9px;
  background: #f8fbff;
  color: #40536d;
  font-size: 12px;
}

.finance-policy-bar > strong {
  margin-right: 3px;
  color: #26364e;
}

.finance-policy-bar > span {
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 850;
}

.finance-policy-bar > span.auto {
  background: #e8f1ff;
  color: #245ebd;
}

.finance-policy-bar > span.manual {
  background: #eef2f7;
  color: #52647a;
}

.finance-policy-bar > small {
  margin-left: auto;
  color: #738298;
  font-size: 11px;
}

.finance-summary-card {
  border-top-width: 3px;
  background: #fff;
}

.finance-summary-card.income b { color: var(--finance-green); }
.finance-summary-card.expense b { color: var(--finance-orange); }
.finance-summary-card.net b { color: var(--finance-blue); }
.finance-summary-card.net b.finance-negative { color: var(--finance-red) !important; }
.finance-summary-card.count b { color: #5a60db; }

.finance-overview-grid {
  grid-template-columns: minmax(560px, 1.35fr) minmax(330px, .75fr);
}

.finance-trend-card,
.finance-actions-card {
  min-width: 0;
  overflow: hidden;
}

.finance-trend-range {
  padding: 5px 8px;
  border: 1px solid #dce5f0;
  border-radius: 6px;
  background: #f8fafc;
  color: #627188;
  font-size: 11px;
  font-weight: 800;
}

.finance-trend-legend {
  display: flex;
  gap: 7px;
  padding: 0 16px 4px;
}

.finance-trend-legend span {
  padding: 3px 7px;
  border: 1px solid currentColor;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 850;
}

.finance-trend-legend .income { color: var(--finance-green); }
.finance-trend-legend .expense { color: var(--finance-orange); }
.finance-trend-legend .net { color: var(--finance-blue); }

.finance-trend-wrap {
  width: 100%;
  overflow-x: auto;
  padding: 2px 12px 10px 4px;
}

#financeCashflowTrend {
  display: block;
  max-width: none;
}

.finance-action-list {
  display: grid;
  padding: 0 14px 14px;
  border-top: 1px solid transparent;
}

.finance-action-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 76px;
  padding: 13px 0;
  border-bottom: 1px solid #e2e8f0;
}

.finance-action-item:last-child { border-bottom: 0; }

.finance-action-item > div {
  min-width: 0;
  padding-left: 10px;
  border-left: 3px solid #b7c3d3;
}

.finance-action-item.warning > div { border-left-color: #ef8d2d; }
.finance-action-item.ok > div { border-left-color: #39a87a; }

.finance-action-item strong {
  display: block;
  color: #23324a;
  font-size: 13px;
}

.finance-action-item span {
  display: block;
  margin-top: 5px;
  color: #738197;
  font-size: 11px;
  line-height: 1.5;
}

.finance-action-item button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #bcd0fa;
  border-radius: 6px;
  background: #fff;
  color: #245fc5;
  font: inherit;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.finance-action-item button:hover { background: #f1f6ff; }

.finance-store-comparison {
  margin: 14px 18px 0;
  overflow: hidden;
}

.finance-store-table {
  margin: 0 14px 14px;
  border: 1px solid #e0e7f0;
  border-radius: 8px;
}

.finance-store-table table {
  min-width: 820px;
}

.finance-store-table th,
.finance-store-table td {
  height: 38px;
  padding: 7px 12px;
}

.finance-store-table tbody tr.active {
  background: #f4f8ff;
}

.finance-store-table td:first-child strong {
  color: #26364e;
}

.finance-store-table td:first-child small {
  display: inline-block;
  margin-left: 7px;
  color: #2563eb;
  font-size: 10px;
  font-weight: 800;
}

.finance-store-table td.income { color: var(--finance-green); font-weight: 850; }
.finance-store-table td.expense { color: var(--finance-orange); font-weight: 850; }
.finance-store-table td.negative { color: var(--finance-red); font-weight: 850; }
.finance-store-error { color: #b45309; }

.finance-quick-filters {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 0 14px 10px;
}

.finance-quick-filters button {
  min-height: 31px;
  padding: 0 12px;
  border: 1px solid #d6e0ec;
  border-radius: 6px;
  background: #fff;
  color: #596a81;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.finance-quick-filters button:hover { border-color: #a9c2ee; }
.finance-quick-filters button.active { border-color: var(--finance-blue); background: var(--finance-blue); color: #fff; }

.finance-type-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid #d8e2ee;
  border-radius: 9px;
  background: #f1f4f8;
}

.finance-type-switch button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #52637a;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.finance-type-switch button.active {
  border-color: #bfd0ed;
  background: #fff;
  color: var(--finance-blue);
  box-shadow: 0 2px 7px rgba(37, 72, 122, .08);
}

.finance-amount-field input {
  min-height: 54px !important;
  padding: 8px 13px !important;
  color: #18263a;
  font-size: 24px !important;
  font-weight: 850 !important;
}

.finance-entry-summary {
  padding: 10px 12px;
  border: 1px solid #d8e4f4;
  border-radius: 8px;
  background: #f8fbff;
  color: #65758c;
  font-size: 12px;
  line-height: 1.5;
}

.finance-entry-summary b { color: #40536f; }
.finance-entry-summary strong { color: var(--finance-blue); }

.finance-more-details {
  border: 1px solid #dce5ef;
  border-radius: 8px;
  background: #fbfcfe;
}

.finance-more-details > summary {
  padding: 11px 12px;
  color: #3c4d63;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.finance-more-details > summary small {
  margin-left: 5px;
  color: #5f6f84;
  font-weight: 650;
}

@media (prefers-reduced-motion: reduce) {
  .finance-entry-modal {
    animation: none;
  }

  .finance-entry-modal .finance-more-details > summary::after {
    transition: none;
  }
}

.finance-more-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px 12px;
  padding: 4px 12px 12px;
}

.finance-more-grid label {
  display: grid;
  gap: 6px;
  color: #102a43;
  font-size: 12px;
  font-weight: 800;
}

.finance-more-grid label.wide { grid-column: 1 / -1; }

.finance-more-grid input,
.finance-more-grid textarea {
  width: 100%;
  min-height: 40px;
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #0f172a;
  font: inherit;
}

@media (max-width: 1260px) {
  .finance-overview-grid { grid-template-columns: 1fr; }
  .finance-policy-bar > small { flex-basis: 100%; margin-left: 0; }
}

@media (max-width: 760px) {
  .finance-policy-bar { margin-right: 10px; margin-left: 10px; }
  .finance-policy-bar > span { flex: 1 1 150px; text-align: center; }
  .finance-trend-wrap { padding-left: 0; }
  .finance-action-item { grid-template-columns: 1fr; gap: 8px; }
  .finance-action-item button { justify-self: start; margin-left: 13px; }
  .finance-store-comparison { margin-right: 10px; margin-left: 10px; }
  .finance-more-grid { grid-template-columns: 1fr; }
  .finance-more-grid label.wide { grid-column: auto; }
  .finance-drawer-actions { flex-wrap: wrap; }
  .finance-drawer-actions #resetFinanceBtn { margin-right: auto; }
}
