/* ═══════════ HUB 54 — central operacional ═══════════ */
:root {
  --bg: #f3f6fa;
  --panel: #ffffff;
  --panel-2: #f7f9fc;
  --border: #dfe5ee;
  --text: #182235;
  --text-dim: #526176;
  --accent: #2563eb;
  --accent-soft: #eaf1ff;
  --ok: #168a55;
  --warn: #d97706;
  --crit: #d83b4c;
  --info: #1677c8;
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;

  /* Escala de elevação — profundidade consistente em painéis, cartões e modais */
  --shadow-1: 0 1px 2px rgba(30, 42, 64, .06), 0 1px 1px rgba(30, 42, 64, .04);
  --shadow-2: 0 6px 16px rgba(24, 34, 53, .10), 0 2px 5px rgba(24, 34, 53, .06);
  --shadow-3: 0 12px 30px rgba(24, 34, 53, .16), 0 3px 9px rgba(24, 34, 53, .08);
  --shadow-modal: 0 24px 64px rgba(15, 23, 42, .35), 0 8px 20px rgba(15, 23, 42, .16);
}

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

html, body {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  font-size: 14px;
  overflow: hidden;
}

body {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
}
.hidden { display: none !important; }

/* ─────────── Login / cadastro (public/login.html) ─────────── */
.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 380px;
  padding: 32px 28px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.auth-brand img { width: 44px; height: 44px; object-fit: contain; }
.auth-brand strong { display: block; font-size: 17px; }
.auth-brand small { display: block; margin-top: 2px; color: var(--text-dim); font-size: 11px; }
.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  padding: 3px;
  background: var(--panel-2);
  border-radius: 8px;
}
.auth-tab {
  flex: 1;
  padding: 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.auth-tab.active { background: var(--panel); color: var(--text); box-shadow: var(--shadow-1); }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--text-dim); }
.auth-form input {
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  background: var(--panel);
}
.auth-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-form small { font-weight: 500; color: var(--text-dim); }
.auth-submit { margin-top: 4px; width: 100%; padding: 10px; font-size: 14px; }
.auth-error {
  padding: 9px 11px;
  border-radius: 7px;
  background: #fff0f2;
  color: var(--crit);
  font-size: 12px;
  font-weight: 600;
}

/* ─────────── Navegação e barra superior ─────────── */
#sidebar {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 20px 14px 16px;
  background: #161d2b;
  color: #f7f9fc;
  border-right: 1px solid #273247;
}
#app-shell {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
@media (min-width: 901px) {
  #sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: 224px;
    min-height: 100vh;
    min-height: 100dvh;
  }
  #app-shell { grid-column: 2; }
}
#topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  flex-wrap: nowrap;
}

.brand {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 10px;
  padding: 0 7px 18px;
  border-bottom: 1px solid #2a3549;
}
.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  flex: 0 0 42px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { color: #fff; font-size: 13px; letter-spacing: 0; }
.brand-text small { color: #9eabc0; font-size: 10px; margin-top: 4px; }

.topbar-heading { min-width: 188px; display: flex; flex-direction: column; }
.topbar-heading strong { font-size: 19px; line-height: 1.2; }
.topbar-heading span { color: var(--text-dim); font-size: 11.5px; margin-top: 3px; }

.tabs { display: flex; flex-direction: column; gap: 4px; margin-top: 18px; }
.tab-btn {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: #aeb9ca;
  padding: 8px 10px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
}
.tab-btn:hover { background: #202a3c; color: #fff; }
.tab-btn.active { background: #26344d; color: #fff; border-color: #344663; }
.nav-icon,
.shopee-mark {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  color: #8eb4ff;
  background: #202d44;
  font-size: 15px;
  font-weight: 800;
}
.nav-icon-text { font-size: 9px; }
/* Ícones SVG das abas (sub-fase de UI): traço em currentColor, herdando a cor
   do .nav-icon (inclusive o branco no estado ativo). */
.nav-svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.marketplace-subtab .nav-svg { width: 13px; height: 13px; }
.tab-btn.active .nav-icon { color: #fff; background: var(--accent); }
.tab-shopee-btn .shopee-mark { color: #fff; background: #ee4d2d; }
.sidebar-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid #2a3549;
}
.sidebar-user-name {
  min-width: 0;
  overflow: hidden;
  color: #c4cede;
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
  text-overflow: ellipsis;
}
#btn-logout {
  flex: 0 0 auto;
  padding: 5px 10px;
  border: 1px solid #2d394e;
  border-radius: 6px;
  background: #1d2637;
  color: #9eabc0;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}
#btn-logout:hover { color: #fff; border-color: #3d4c68; background: #232f45; }
.sidebar-status {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: 10px;
}
.badge {
  background: #dbe7ff;
  color: #1d4ed8;
  border-radius: 999px;
  min-width: 24px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  margin-left: 0;
  text-align: center;
}
.tab-btn .badge.zero { background: #2c374b; color: #8f9cb1; }
.badge.zero { background: #e9edf3; color: var(--text-dim); }

.controls { display: flex; align-items: center; gap: 7px; margin-left: auto; min-width: 0; flex-wrap: nowrap; }

.office-view-switch {
  display: none;
  align-items: center;
  height: 36px;
  padding: 3px;
  background: #eef2f7;
  border: 1px solid var(--border);
  border-radius: 8px;
}
body[data-active-tab="office"] .office-view-switch { display: inline-flex; }
.office-view-switch button {
  width: 40px;
  height: 28px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.office-view-switch button:hover { color: var(--text); }
.office-view-switch button.active { color: #fff; background: #182235; box-shadow: 0 1px 2px rgba(24, 34, 53, .18); }
.office-view-switch button:disabled { opacity: .55; cursor: wait; }

.link-box { display: flex; gap: 4px; }
.link-box input {
  width: 190px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 7px 10px;
  font-size: 12.5px;
  outline: none;
  transition: width .2s, border-color .2s;
}
.link-box input:focus { width: 260px; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.link-box input::placeholder { color: var(--text-dim); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1d2637;
  border: 1px solid #2d394e;
  color: #9eabc0;
  border-radius: 6px;
  padding: 7px 9px;
  font-size: 10.5px;
  white-space: nowrap;
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--crit); display: inline-block; }
.pill.online .dot { background: var(--ok); }
.pill.online { color: #dce5f2; }
.pill-lan { cursor: pointer; }
.pill-lan:hover { border-color: #5f8ee9; color: #fff; }

.btn {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover:not(:disabled) { border-color: #9aa8bc; background: var(--panel-2); }
.btn:active:not(:disabled) { background: #eef2f7; transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { color: #fff; background: #1d55d5; border-color: #1d55d5; filter: none; }
.btn-primary:active:not(:disabled) { color: #fff; background: #1747b5; border-color: #1747b5; }
.btn-danger { background: #8f2f37; border-color: #c64a55; color: #fff; }
.btn-danger:hover { background: #a33842; border-color: #e05a65; }
.btn.connected { border-color: var(--ok); color: var(--ok); }
.btn-icon-alert {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 38px;
  height: 34px;
  padding: 0;
  font-size: 16px;
}
.btn-icon-alert.has-alert { border-color: var(--accent); }
.btn-icon-alert .badge {
  position: absolute;
  top: -6px;
  right: -7px;
  min-width: 19px;
  height: 18px;
  margin: 0;
  padding: 1px 5px;
  line-height: 16px;
  text-align: center;
}

/* Aba sempre visível para reabrir/pré-visualizar as notificações depois de fechadas */
.notifications-peek {
  position: fixed;
  top: 96px;
  right: 0;
  z-index: 46;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px 8px 7px 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-right: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  box-shadow: var(--shadow-2);
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  opacity: .82;
  transition: opacity .15s ease, transform .15s ease;
}
.notifications-peek:hover,
.notifications-peek:focus-visible,
.notifications-peek.previewing {
  opacity: 1;
  transform: translateX(-2px);
}
.notifications-peek:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.notifications-peek-badge {
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--crit);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}
.notifications-peek-badge.zero { background: #e9edf3; color: var(--text-dim); }

.notifications-panel {
  position: fixed;
  top: 68px;
  right: 14px;
  width: min(480px, calc(100vw - 28px));
  max-height: min(680px, calc(100vh - 84px));
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  z-index: 45;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.notifications-head {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
}
.notifications-head strong {
  display: block;
  font-size: 13.5px;
}
.notifications-head span {
  display: block;
  color: var(--text-dim);
  font-size: 11.5px;
  margin-top: 3px;
  line-height: 1.35;
}
#notifications-close {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
#notifications-close:hover { color: var(--text); border-color: var(--text-dim); }
.shipping-summary {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--border);
  background: #151b24;
}
.shipping-summary > div {
  min-width: 0;
  padding: 10px 8px;
  border-right: 1px solid var(--border);
}
.shipping-summary > div:last-of-type { border-right: 0; }
.shipping-summary span,
.shipping-summary strong { display: block; }
.shipping-summary span {
  color: var(--text-dim);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shipping-summary strong { margin-top: 3px; font-size: 17px; }
.shipping-summary small {
  grid-column: 1 / -1;
  padding: 5px 12px;
  color: var(--warn);
  border-top: 1px solid var(--border);
  font-size: 10px;
}
.notification-filters {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
  padding: 8px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
}
.notification-filters button {
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  padding: 5px 7px;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}
.notification-filters button:hover { color: var(--text); background: var(--panel-2); }
.notification-filters button.active { color: var(--text); background: var(--panel-2); border-color: var(--border); }
.notification-filters button span { color: var(--accent); margin-left: 2px; }
.notifications-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 9px;
}
.notification-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-left: 4px solid var(--info);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
}
.notification-card.warning { border-left-color: var(--warn); }
.notification-card.critical { border-left-color: var(--crit); }
.notification-card.read {
  border-left-color: var(--border);
  opacity: .68;
}
.notification-card.unread .notification-time {
  color: var(--accent);
  font-weight: 800;
}
.notification-card.read .notification-time { color: var(--text-dim); }
.notification-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.notification-kind {
  color: var(--text-dim);
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
}
.notification-time {
  color: var(--text-dim);
  font-size: 11px;
  white-space: nowrap;
}
.notification-title {
  display: block;
  margin-top: 5px;
  font-size: 12.5px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.notification-text {
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 6px;
  overflow-wrap: anywhere;
}
.notification-meta {
  color: var(--info);
  font-size: 10.5px;
  margin-top: 7px;
  overflow-wrap: anywhere;
}
.notification-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 9px;
}
.notification-actions button,
.notification-actions a {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 7px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.notification-actions button:hover,
.notification-actions a:hover { border-color: var(--accent); }
.notification-actions button:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.notifications-empty {
  color: var(--text-dim);
  font-size: 12px;
  padding: 14px;
  text-align: center;
}
.notifications-empty.warning { color: var(--warn); text-align: left; }

/* Central separada entre pendências da conta e operação logística. */
.notifications-panel {
  top: 82px;
  right: 18px;
  width: min(540px, calc(100vw - 36px));
  max-height: min(760px, calc(100vh - 100px));
  background: var(--panel);
  box-shadow: var(--shadow-3);
}
.notifications-head { padding: 15px 16px; background: var(--panel); }
.notifications-head strong { font-size: 15px; }
.shipping-summary { display: block; background: #f8fafc; }
.shipping-summary > .notification-section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px 10px;
  border: 0;
}
.notification-section-title > div strong { font-size: 12.5px; }
.notification-section-title > div span { margin-top: 2px; font-size: 10.5px; }
.notification-section-title > span {
  flex: 0 0 auto;
  color: var(--info);
  background: #e8f3fc;
  border-radius: 5px;
  padding: 4px 7px;
  font-size: 10px;
  font-weight: 750;
}
.shipping-summary > .shipping-channels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 0 16px 12px;
  border: 0;
}
.shipping-channel {
  min-width: 0;
  min-height: 76px;
  padding: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-top: 3px solid var(--info);
  border-radius: 7px;
}
.shipping-channel.full { border-top-color: var(--accent); }
.shipping-channel.supplier { border-top-color: #0f8b7d; }
.shipping-channel.total { border-top-color: #58677d; }
.shipping-channel span { color: var(--text-dim); font-size: 10px; }
.shipping-channel strong { margin-top: 2px; font-size: 20px; line-height: 1; }
.shipping-summary .shipping-channel small {
  padding: 0;
  border: 0;
  color: var(--text-dim);
  font-size: 9.5px;
}
.shipping-summary > .shipping-stages {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 9px 16px;
  border: 0;
  border-top: 1px solid var(--border);
  background: var(--panel);
}
.shipping-stages > div { padding: 1px 9px; border-right: 1px solid var(--border); }
.shipping-stages > div:first-child { padding-left: 0; }
.shipping-stages > div:last-child { padding-right: 0; border-right: 0; }
.shipping-stages span { color: var(--text-dim); font-size: 9.5px; }
.shipping-stages strong { margin-top: 2px; font-size: 15px; }
.shipping-summary > .shipping-unknown {
  display: block;
  padding: 7px 16px;
  border: 0;
  border-top: 1px solid #f2d3a8;
  color: #9a5b09;
  background: #fff8eb;
  font-size: 10px;
}
.notification-filters {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px 12px;
  background: var(--panel);
}
.notification-filter-group {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
}
.notification-filter-group > strong {
  color: var(--text-dim);
  font-size: 9.5px;
  text-transform: uppercase;
}
.notification-filter-group > div { display: flex; gap: 4px; overflow-x: auto; }
.notification-filters button { border-color: var(--border); background: #fff; }
.notification-filters button:hover { background: var(--panel-2); }
.notification-filters button.active { color: #1d4ed8; background: var(--accent-soft); border-color: #b9d0ff; }
.notifications-list { padding: 10px 12px 12px; background: #f8fafc; }
.notification-card {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 7px;
  gap: 10px;
  padding: 11px;
  background: var(--panel);
  border-left-width: 1px;
  box-shadow: 0 1px 2px rgba(30, 42, 64, .04);
}
.notification-card.read { opacity: .64; }
.notification-kind-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--info);
  background: #e8f3fc;
  font-size: 14px;
  font-weight: 850;
}
.notification-card.kind-question .notification-kind-icon { color: #1d4ed8; background: #eaf1ff; }
.notification-card.kind-claim .notification-kind-icon,
.notification-card.critical .notification-kind-icon { color: #b42334; background: #fdecef; }
.notification-card.warning .notification-kind-icon { color: #a75c05; background: #fff4df; }
.notification-card.kind-shipping .notification-kind-icon { color: #08786c; background: #e5f5f2; }
.notification-card-body { min-width: 0; }
.notification-title { color: var(--text); }
.notification-text { color: var(--text-dim); }
.notification-unread-dot {
  width: 7px;
  height: 7px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--accent);
}
.notification-card.read .notification-unread-dot { visibility: hidden; }
.notification-actions button,
.notification-actions a { background: var(--panel); }

.switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .slider {
  width: 34px; height: 18px;
  background: #2c3444;
  border-radius: 999px;
  position: relative;
  transition: background .2s;
}
.switch .slider::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #93a0b4;
  top: 2px; left: 2px;
  transition: transform .2s, background .2s;
}
.switch input:checked + .slider { background: var(--ok); }
.switch input:checked + .slider::after { transform: translateX(16px); background: #fff; }
.switch-label { font-size: 12px; color: var(--text-dim); }

/* ─────────── Painéis / abas ─────────── */
main { flex: 1; min-height: 0; }
.tab-panel { display: none; height: 100%; }
.tab-panel.active { display: flex; }

/* ── Escritório ── */
#tab-office { gap: 10px; padding: 10px; }

#office-stage {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
}
.office-view-screen { width: 100%; height: 100%; }
.office-view-hidden { display: none !important; }

#office-wrap {
  flex: 1;
  min-width: 0;
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#office-wrap canvas { display: block; }
#office-hint {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(14, 17, 22, .65);
  color: var(--text-dim);
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 999px;
  pointer-events: none;
  z-index: 2;
  white-space: nowrap;
}

#office-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 16, .72);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}
#office-overlay.hidden { display: none; }
.overlay-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 18px 26px;
  border-radius: var(--radius);
  font-size: 15px;
  animation: pulse 1.4s infinite;
}
@keyframes pulse { 50% { opacity: .55; } }

/* ── Infográficos do escritório ── */
#office-infographic {
  min-width: 0;
  overflow: auto;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.eyebrow {
  display: block;
  color: #64748b;
  font-size: 10px;
  line-height: 1.2;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}
.ig-head,
.ig-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.ig-official {
  margin-top: 12px;
  padding: 9px 13px;
  border: 1px solid #f1d2a2;
  border-left-width: 4px;
  border-radius: 8px;
  background: #fff8ec;
  color: #6b5215;
  font-size: 12px;
  line-height: 1.45;
}
.ig-official strong { font-weight: 800; }
.ig-head h2 { margin-top: 5px; font-size: 24px; line-height: 1.15; }
.ig-head p { margin-top: 6px; color: var(--text-dim); font-size: 11.5px; }
.ig-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 5px 9px;
  color: #107448;
  background: #eaf8f0;
  border: 1px solid #b8dfca;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}
.ig-live i { width: 7px; height: 7px; border-radius: 50%; background: #16a163; }
.ig-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  margin: 20px 0 14px;
}
.ig-metric {
  min-width: 0;
  min-height: 105px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 15px 16px;
  background: #fafbfd;
  border: 1px solid var(--border);
  border-top: 3px solid #9aa8bc;
  border-radius: 7px;
}
.ig-metric.primary { border-top-color: var(--accent); }
.ig-metric.success { border-top-color: var(--ok); }
.ig-metric.warning { border-top-color: var(--warn); }
.ig-metric.danger { border-top-color: var(--crit); }
.ig-metric > span { color: var(--text-dim); font-size: 11px; }
.ig-metric > strong { margin: 8px 0 5px; font-size: 18px; line-height: 1; white-space: nowrap; }
.ig-metric > small { color: var(--text-dim); font-size: 10px; line-height: 1.35; }
.ig-layout {
  min-height: 310px;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr);
  gap: 12px;
}
.ig-ranking-panel,
.ig-pulse-panel,
.ig-leo-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.ig-ranking-panel,
.ig-pulse-panel { padding: 16px; }
.ig-panel-head { padding-bottom: 12px; border-bottom: 1px solid #edf1f5; }
.ig-panel-head h3 { margin-top: 3px; font-size: 15px; }
.ig-panel-head > span { color: var(--text-dim); font-size: 10.5px; white-space: nowrap; }
.ig-ranking { display: flex; flex-direction: column; }
.ig-rank-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 30px 40px minmax(0, 1fr) 90px;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  border-bottom: 1px solid #edf1f5;
}
.ig-rank-row:last-child { border-bottom: 0; }
.ig-rank-position { color: #94a0b1; font-size: 12px; }
.ig-rank-image {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #59677c;
  background: #eef2f7;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
}
.ig-rank-image img { width: 100%; height: 100%; object-fit: cover; }
.ig-rank-copy,
.ig-rank-sales { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ig-rank-copy strong { overflow: hidden; color: var(--text); font-size: 11.5px; white-space: nowrap; text-overflow: ellipsis; }
.ig-rank-copy span,
.ig-rank-sales span { color: var(--text-dim); font-size: 9.5px; }
.ig-rank-sales { text-align: right; }
.ig-rank-sales strong { color: #0f766e; font-size: 12px; }
.ig-side { min-width: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 12px; }
.ig-pulse { display: flex; flex-direction: column; }
.ig-pulse-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  gap: 12px;
  border-bottom: 1px solid #edf1f5;
}
.ig-pulse-row:last-child { border-bottom: 0; }
.ig-pulse-row > div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ig-pulse-row span { color: var(--text-dim); font-size: 10px; }
.ig-pulse-row strong { font-size: 13px; }
.ig-pulse-row i { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #94a3b8; }
.ig-pulse-row i.positive { background: var(--ok); }
.ig-pulse-row i.negative { background: var(--crit); }
.ig-leo-panel {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px;
  border-left: 3px solid var(--ok);
  background: #f7fbf9;
}
.ig-leo-panel.warning { border-left-color: var(--warn); background: #fffaf2; }
.ig-leo-panel.critical { border-left-color: var(--crit); background: #fff5f6; }
.ig-leo-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #182235;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 850;
}
.ig-leo-panel span { color: #344158; font-size: 10px; font-weight: 800; }
.ig-leo-panel p { margin-top: 4px; color: #58667a; font-size: 10px; line-height: 1.45; }
.ig-empty { padding: 34px 12px; color: var(--text-dim); font-size: 11px; text-align: center; }

/* ── Preparação de pedidos ── */
#tab-orders {
  flex-direction: column;
  gap: 14px;
  overflow: auto;
  padding: 16px;
}
.orders-toolbar,
.orders-filterbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.orders-toolbar h2 { margin-top: 4px; font-size: 20px; }
.orders-toolbar p { margin-top: 5px; color: var(--text-dim); font-size: 11px; }
.orders-actions { display: flex; align-items: center; gap: 7px; }
.orders-dispatch {
  min-height: 158px;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: stretch;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.orders-dispatch-loading {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  color: var(--text-dim);
  font-size: 11px;
}
.orders-dispatch-loading.error { padding: 20px; color: #b42334; background: #fff7f8; text-align: center; }
.dispatch-total {
  min-height: 158px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 26px;
  background: #f8fafc;
  border-right: 1px solid var(--border);
}
.dispatch-total span { color: #526176; font-size: 11px; font-weight: 750; }
.dispatch-total strong { margin: 9px 0 5px; font-size: 32px; line-height: 1; }
.dispatch-total small { color: #526176; font-size: 10.5px; }
.dispatch-channels {
  min-width: 0;
  display: grid;
  grid-auto-rows: minmax(78px, auto);
}
.dispatch-channel {
  min-width: 0;
  min-height: 78px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 15px 20px;
  border-bottom: 1px solid #e8edf3;
}
.dispatch-channel:last-child { border-bottom: 0; }
.dispatch-channel > div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.dispatch-channel span { color: #526176; font-size: 10px; font-weight: 800; line-height: 1.2; }
.dispatch-channel strong { font-size: 12.5px; line-height: 1.35; }
.dispatch-channel small { color: var(--text-dim); font-size: 10px; line-height: 1.35; }
.dispatch-channel b {
  min-width: 34px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0 8px;
  color: #155aa4;
  background: #edf6ff;
  border: 1px solid #b8d3fb;
  border-radius: 999px;
  font-size: 13px;
}
.dispatch-channel.agency b { color: #9a5b09; background: #fff6e8; border-color: #f1d2a2; }
.dispatch-channel.empty { background: #fbfcfd; }
.dispatch-channel.empty b { color: #677489; background: #f0f3f7; border-color: #d6dde7; }
.orders-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}
.orders-summary-card {
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 13px 15px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid #94a3b8;
  border-radius: 7px;
}
.orders-summary-card.warning { border-left-color: var(--warn); }
.orders-summary-card.success { border-left-color: var(--ok); }
.orders-summary-card.danger { border-left-color: var(--crit); }
.orders-summary-card span { color: var(--text-dim); font-size: 10.5px; }
.orders-summary-card strong { margin: 5px 0 3px; font-size: 21px; line-height: 1; }
.orders-summary-card small { color: #8793a4; font-size: 9.5px; }
.orders-filterbar {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.orders-filters { display: flex; gap: 6px; overflow-x: auto; }
.orders-filters button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  color: #556277;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.orders-filters button:hover { border-color: #a8b6c9; }
.orders-filters button.active { color: #1d4ed8; background: var(--accent-soft); border-color: #a9c4fc; }
.orders-filters button span { color: inherit; font-size: 9.5px; }
.orders-full-note { color: var(--text-dim); font-size: 10px; text-align: right; }
.orders-table {
  min-width: 920px;
  flex: 0 0 auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-x: auto;
  overflow-y: visible;
}
.orders-table-head,
.order-row {
  min-width: 920px;
  display: grid;
  grid-template-columns: minmax(380px, 2.15fr) minmax(115px, .7fr) minmax(125px, .8fr) minmax(90px, .55fr) 135px;
  align-items: center;
  gap: 14px;
}
.orders-table-head {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 42px;
  padding: 0 18px;
  color: #7a8799;
  background: #f7f9fc;
  border-bottom: 1px solid var(--border);
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
}
.order-row {
  min-height: 106px;
  padding: 14px 18px;
  border-bottom: 1px solid #e9edf3;
  transition: background-color .14s ease;
}
.order-row:last-child { border-bottom: 0; }
.order-row:hover { background: #fbfcfe; }
.order-row.expanded { background: #fbfcfe; }
.order-row.overdue { box-shadow: inset 3px 0 0 var(--crit); }
.order-product { min-width: 0; display: flex; align-items: center; gap: 12px; }
.order-select,
.order-select-spacer { width: 18px; flex: 0 0 18px; }
.order-select { display: grid; place-items: center; cursor: pointer; }
.order-select input { width: 15px; height: 15px; accent-color: var(--accent); }
.order-product-image {
  width: 62px;
  height: 62px;
  flex: 0 0 62px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #59677c;
  background: #eef2f7;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 800;
}
.order-product-image img { width: 100%; height: 100%; object-fit: cover; }
.order-product-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.order-product-copy strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: 12.5px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  cursor: help;
}
.order-product-copy strong:focus-visible { border-radius: 3px; outline: 2px solid #8fb2fb; outline-offset: 2px; }
.order-product-copy span,
.order-product-copy small { overflow: hidden; color: var(--text-dim); font-size: 10px; line-height: 1.35; white-space: nowrap; text-overflow: ellipsis; }
.order-expand {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  color: #66758a;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
}
.order-expand:hover { color: var(--accent); background: #edf3ff; border-color: #c8d9fb; }
.order-expand:focus-visible { outline: 2px solid #8fb2fb; outline-offset: 2px; }
.order-expand span {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .16s ease;
}
.order-expand[aria-expanded="true"] span { transform: translateY(2px) rotate(225deg); }
.order-deadline,
.order-stage-cell,
.order-value { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.order-deadline strong,
.order-value strong { font-size: 11.5px; }
.order-deadline small,
.order-stage-cell small,
.order-value small { color: var(--text-dim); font-size: 9px; line-height: 1.35; }
.order-deadline em { width: fit-content; color: #b42334; font-size: 8.5px; font-style: normal; font-weight: 800; }
.order-stage {
  width: fit-content;
  min-height: 23px;
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}
.order-stage.marketplace { color: #145ca8; background: #edf6ff; border-color: #bad3f2; }
.order-stage.label { color: #107448; background: #eaf8f0; border-color: #b8dfca; }
.order-stage.waiting { color: #546176; background: #f1f4f8; border-color: #d9e0e9; }
.order-row-action { display: flex; justify-content: flex-end; }
.order-action {
  width: 100%;
  min-height: 34px;
  padding-inline: 8px;
  font-size: 10px;
}
a.order-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.order-waiting-action { color: #8a95a5; font-size: 9.5px; text-align: right; }
.order-expanded {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .85fr);
  gap: 28px;
  margin: 5px -18px -14px;
  padding: 18px 18px 20px 110px;
  background: #f7f9fc;
  border-top: 1px solid #e2e8f0;
}
.order-expanded h3 { margin-bottom: 9px; color: #526176; font-size: 10px; text-transform: uppercase; }
.order-expanded-products { min-width: 0; }
.order-expanded-products > p { color: var(--text-dim); font-size: 10.5px; }
.order-detail-product {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #e5eaf1;
}
.order-detail-product:last-child { border-bottom: 0; }
.order-detail-image {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #59677c;
  background: #fff;
  border: 1px solid #e0e6ee;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 800;
}
.order-detail-image img { width: 100%; height: 100%; object-fit: cover; }
.order-detail-product > div:nth-child(2) { min-width: 0; }
.order-detail-product strong,
.order-detail-product span { display: block; }
.order-detail-product strong { font-size: 10.5px; line-height: 1.35; }
.order-detail-product span { margin-top: 3px; color: var(--text-dim); font-size: 9.5px; }
.order-detail-product b { font-size: 10.5px; white-space: nowrap; }
.order-expanded-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 13px 18px;
}
.order-expanded-facts div { min-width: 0; }
.order-expanded-facts dt { color: #708097; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.order-expanded-facts dd { margin-top: 4px; overflow-wrap: anywhere; color: #273349; font-size: 10.5px; line-height: 1.4; }
.order-hover-card {
  position: fixed;
  z-index: 80;
  width: min(390px, calc(100vw - 24px));
  max-height: min(360px, calc(100vh - 24px));
  overflow: auto;
  padding: 14px 15px;
  color: #243147;
  background: #fff;
  border: 1px solid #d7dee9;
  border-radius: 7px;
  box-shadow: var(--shadow-3);
  pointer-events: none;
}
.order-hover-card[hidden] { display: none; }
.order-hover-card > strong { display: block; margin-bottom: 8px; font-size: 11.5px; }
.order-preview-product { padding: 7px 0; border-bottom: 1px solid #e7ebf1; }
.order-preview-product span { display: block; font-size: 10.5px; font-weight: 650; line-height: 1.4; }
.order-preview-product small { display: block; margin-top: 3px; color: #5e6d82; font-size: 9.5px; }
.order-hover-card footer { margin-top: 9px; color: #64748b; font-size: 9px; line-height: 1.4; }
.orders-empty {
  min-height: 170px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px;
  color: var(--text-dim);
  text-align: center;
}
.orders-empty strong { color: var(--text); font-size: 13px; }
.orders-empty span { max-width: 460px; font-size: 10.5px; line-height: 1.5; }
.orders-empty.error strong { color: var(--crit); }

#feed-panel {
  width: 320px;
  flex-shrink: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#feed-panel h3 {
  padding: 10px 14px;
  font-size: 13px;
  letter-spacing: .4px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
}
#feed-list { flex: 1; min-height: 100px; overflow-y: auto; padding: 8px; }

.feed-item {
  display: flex;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  margin-bottom: 4px;
  background: var(--panel-2);
  border-left: 3px solid transparent;
  animation: slideIn .25s ease;
  font-size: 12.5px;
  line-height: 1.45;
}
@keyframes slideIn { from { opacity: 0; transform: translateY(-6px); } }
.feed-item .who { font-weight: 700; white-space: nowrap; }
.feed-item .when { color: var(--text-dim); font-size: 10.5px; margin-left: auto; white-space: nowrap; padding-left: 6px; }
.feed-item.sev-warning { border-left-color: var(--warn); }
.feed-item.sev-critical { border-left-color: var(--crit); background: #241a1d; }
.feed-item .msg { flex: 1; }

#agent-command-panel {
  flex: 0 0 276px;
  min-height: 0;
  border-top: 1px solid var(--border);
  background: #12161d;
  display: flex;
  flex-direction: column;
}
.agent-command-head {
  min-height: 38px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.agent-command-head strong { font-size: 12.5px; }
.agent-command-head span { color: var(--ok); font-size: 10px; }
#agent-command-log {
  flex: 1;
  min-height: 82px;
  overflow-y: auto;
  padding: 8px 9px 5px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.agent-chat-empty { color: var(--text-dim); font-size: 11px; margin: auto; }
.agent-chat-entry {
  max-width: 90%;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  line-height: 1.35;
  background: var(--panel-2);
  border-left: 3px solid var(--info);
}
.agent-chat-entry.user {
  align-self: flex-end;
  background: #272218;
  border-left-color: var(--accent);
}
.agent-chat-entry strong { display: block; font-size: 10.5px; margin-bottom: 2px; }
.agent-chat-entry time { color: var(--text-dim); font-size: 9px; margin-left: 5px; }
.agent-confirm-card {
  padding: 8px;
  border: 1px solid #8f3c44;
  border-radius: 6px;
  background: #21171b;
  font-size: 10.5px;
}
.agent-confirm-product { display: flex; align-items: center; gap: 7px; }
.agent-confirm-product img { width: 38px; height: 38px; flex: 0 0 38px; object-fit: contain; border-radius: 4px; background: #fff; }
.agent-confirm-product > div { min-width: 0; }
.agent-confirm-product strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-confirm-product span { display: block; margin-top: 2px; color: var(--text-dim); }
.agent-confirm-card p { margin: 7px 0; color: #e5c4c7; line-height: 1.4; }
.agent-confirm-actions { display: flex; justify-content: flex-end; gap: 5px; }
.agent-confirm-actions .btn { min-height: 26px; padding: 4px 7px; font-size: 9.5px; }
.agent-mentions {
  display: flex;
  gap: 4px;
  padding: 5px 8px 2px;
  overflow-x: auto;
}
.agent-mentions button {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--panel-2);
  color: var(--text-dim);
  padding: 3px 6px;
  font-size: 10px;
  cursor: pointer;
}
.agent-mentions button:hover { color: var(--text); border-color: #4a5364; }
#agent-command-form { display: flex; gap: 5px; padding: 6px 8px 9px; }
#agent-command-input {
  min-width: 0;
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 7px 8px;
  font-size: 11.5px;
  outline: none;
}
#agent-command-input:focus { border-color: var(--accent); }
#agent-command-form button {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #17120a;
  font-size: 19px;
  font-weight: 800;
  cursor: pointer;
}
#agent-command-form button:disabled { opacity: .45; cursor: wait; }

/* ── Kanban ── */
#tab-kanban { padding: 12px; flex-direction: column; gap: 10px; }
.kanban-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--text-dim);
}
.filter-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px;
}
.filter-group > span {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  padding: 0 7px;
}
.filter-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.filter-btn:hover { color: var(--text); border-color: var(--border); }
.filter-btn.active {
  background: var(--panel-2);
  color: var(--accent);
  border-color: #4a3a14;
}
#kanban-filter-summary {
  font-size: 12px;
  color: var(--text-dim);
}
/* flex + rolagem horizontal: em qualquer largura de tela dá para alcançar
   todas as colunas (nunca ficam espremidas nem cortadas fora da tela) */
.kanban-board {
  display: flex;
  gap: 12px;
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow-x: auto;
  padding-bottom: 4px;
}
.kanban-col {
  flex: 1 1 0;
  min-width: 265px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.kanban-col h4 {
  padding: 10px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.col-count { color: var(--text-dim); font-size: 12px; font-weight: 600; }
.col-cards { flex: 1; overflow-y: auto; padding: 8px; min-height: 60px; }
.col-cards.drag-over { outline: 2px dashed var(--accent); outline-offset: -6px; border-radius: 8px; }

.kanban-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-left: 4px solid var(--info);
  border-radius: 8px;
  padding: 9px 10px;
  margin-bottom: 8px;
  cursor: grab;
  animation: slideIn .25s ease;
}
.kanban-card:active { cursor: grabbing; }
.kanban-card.sev-warning { border-left-color: var(--warn); }
.kanban-card.sev-critical { border-left-color: var(--crit); }
.kanban-card.dragging { opacity: .4; }
.kanban-card h5 { font-size: 13px; margin-bottom: 4px; line-height: 1.35; overflow-wrap: anywhere; }
.kanban-card .card-listing {
  color: var(--text-dim);
  font-size: 11.5px;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kanban-card .card-desc {
  color: var(--text-dim);
  font-size: 11.5px;
  line-height: 1.45;
  margin-bottom: 7px;
  white-space: pre-line;
  overflow-wrap: anywhere;
  display: none;
}
.kanban-card.expanded .card-desc { display: block; }
.card-edit-row {
  display: none;
  align-items: center;
  gap: 7px;
  margin: 2px 0 8px;
}
.kanban-card.expanded .card-edit-row { display: flex; }
.card-edit-btn {
  border: 1px solid #38537a;
  border-radius: 7px;
  background: #182236;
  color: var(--info);
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.card-edit-btn:hover { border-color: var(--info); color: var(--text); }
.card-proposal-ready { color: var(--ok); font-size: 10.5px; font-weight: 700; }
.card-foot { display: flex; align-items: center; gap: 6px; }
.agent-chip {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  color: #10131a;
}
.card-when { color: var(--text-dim); font-size: 10.5px; }
.card-move { margin-left: auto; display: flex; gap: 2px; }
.card-move button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  padding: 2px 7px;
}
.card-move button:hover { color: var(--text); border-color: var(--text-dim); }
.card-auto { font-size: 10px; color: var(--ok); }

.col-empty { color: var(--text-dim); font-size: 12px; text-align: center; padding: 18px 6px; }

/* ── Editor de alterações aprovadas ── */
.listing-editor-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(7, 10, 15, .82);
}
.listing-editor-dialog {
  width: min(980px, 100%);
  max-height: min(820px, calc(100vh - 36px));
  overflow: auto;
  background: var(--panel);
  border: 1px solid #364158;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
}
.listing-editor-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.listing-editor-head > div { flex: 1; min-width: 0; }
.listing-editor-head span { color: var(--info); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.listing-editor-head h3 { margin-top: 4px; font-size: 18px; }
.listing-editor-head p { margin-top: 5px; color: var(--text-dim); font-size: 12px; overflow-wrap: anywhere; }
.listing-editor-head button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: transparent;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
}
.listing-editor-head button:hover { color: var(--text); border-color: var(--text-dim); }
.listing-editor-modes {
  display: flex;
  gap: 4px;
  padding: 12px 20px 0;
}
.listing-editor-modes button {
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--text-dim);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.listing-editor-modes button.active { color: var(--text); border-color: var(--info); background: #182236; }
.listing-editor-modes button:disabled { opacity: .55; cursor: wait; }
.listing-editor-constraint {
  margin: 12px 20px 0;
  border-left: 3px solid var(--warn);
  background: #241f14;
  color: #f2c76e;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.45;
}
.listing-editor-comparison {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  padding: 16px 20px;
}
.listing-editor-comparison > section { min-width: 0; }
.listing-editor-comparison > section:first-child { padding-right: 18px; border-right: 1px solid var(--border); }
.listing-editor-comparison > section:last-child { padding-left: 18px; }
.listing-editor-comparison h4 { font-size: 12px; margin-bottom: 8px; }
.listing-editor-current,
#listing-editor-value {
  width: 100%;
  min-height: 250px;
  max-height: 430px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text-dim);
  font: 12.5px/1.55 "Segoe UI", sans-serif;
}
#listing-editor-value {
  resize: vertical;
  background: #111722;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  padding: 10px;
  outline: none;
}
#listing-editor-value:focus { border-color: var(--info); }
.listing-editor-dialog.field-title .listing-editor-current,
.listing-editor-dialog.field-title #listing-editor-value { min-height: 92px; max-height: 150px; }
.listing-editor-proposed-head { display: flex; justify-content: space-between; gap: 10px; }
.listing-editor-proposed-head span { color: var(--text-dim); font-size: 11px; }
.listing-editor-approval {
  border-top: 1px solid var(--border);
  padding: 12px 20px;
}
.listing-editor-approval label { display: flex; align-items: flex-start; gap: 8px; color: var(--text); font-size: 12px; cursor: pointer; }
.listing-editor-approval input { margin-top: 2px; accent-color: var(--ok); }
.listing-editor-approval > span { display: block; margin-top: 7px; color: var(--text-dim); font-size: 11px; }
.listing-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px 16px;
}
.listing-editor-actions .btn-primary:disabled { opacity: .45; cursor: not-allowed; }

body.modal-open { overflow: hidden; }
.product-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 1700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(7, 10, 15, .82);
  backdrop-filter: blur(3px);
}
.product-dialog {
  width: min(1120px, 100%);
  max-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid #354055;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
}
.product-dialog-head {
  min-height: 86px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.product-dialog-head > img {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.product-dialog-head > div { flex: 1; min-width: 0; }
.product-dialog-head > div > span { color: var(--info); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.product-dialog-head h3 { margin-top: 4px; font-size: 17px; overflow-wrap: anywhere; }
.product-dialog-head p { margin-top: 5px; color: var(--text-dim); font-size: 11px; }
.product-dialog-head > button {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
}
.product-dialog-head > button:hover { color: var(--text); border-color: var(--text-dim); }
.product-dialog-scroll { min-height: 0; overflow-y: auto; padding: 0 18px 18px; }
.product-section { padding: 16px 0; border-bottom: 1px solid var(--border); }
.product-section:last-child { border-bottom: 0; }
.product-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.product-section-toggle {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.product-section-toggle > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.product-section-head h4 { font-size: 13px; }
.product-section-head span { color: var(--text-dim); font-size: 11px; }
.product-section-chevron {
  flex: 0 0 auto;
  color: var(--text-dim);
  font-size: 18px;
  line-height: 1;
  transition: transform .16s ease;
}
.product-section:not(.collapsed) .product-section-chevron { transform: rotate(90deg); }
.product-section-toggle:hover .product-section-chevron,
.product-section-toggle:focus-visible .product-section-chevron { color: var(--accent); }
.product-section-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.product-section-body { overflow: hidden; }
.product-section.collapsed .product-section-body { display: none; }
.product-facts,
.product-finance-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}
.product-fact {
  min-width: 0;
  min-height: 70px;
  padding: 10px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.product-fact > span { display: flex; align-items: center; gap: 5px; color: var(--text-dim); font-size: 10px; }
.product-fact > strong { display: block; margin-top: 8px; font-size: 13px; overflow-wrap: anywhere; }
.product-result-note,
.product-operation-state {
  margin-top: 10px;
  padding: 9px 10px;
  border-left: 3px solid var(--info);
  background: var(--panel);
  color: var(--text-dim);
  font-size: 11.5px;
  line-height: 1.45;
}
.product-result-note.warning { border-left-color: var(--warn); color: #f4d89d; }
.product-result-note.critical,
.product-operation-state.error { border-left-color: var(--crit); color: #ffb7ba; }
.product-result-note.positive,
.product-operation-state.ok { border-left-color: var(--ok); color: #bce7c5; }
.product-operation-state.readonly { border-left-color: var(--text-dim); }
.product-operation-state.loading { border-left-color: var(--info); }
.product-operation-state.warning { border-left-color: var(--warn); color: #f4d89d; }
.product-content-tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.product-content-tab {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--panel);
  color: var(--text-dim);
  font-size: 11px;
  cursor: pointer;
}
.product-content-tab.active { color: var(--text); border-color: var(--accent); background: #282516; }
#product-content-value {
  width: 100%;
  min-height: 78px;
  resize: vertical;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  line-height: 1.5;
  outline: none;
}
#product-content-value:focus { border-color: var(--info); }
.product-confirm.disabled { opacity: .52; cursor: not-allowed; }
.product-status-button { min-width: 142px; }
.product-stock-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.stock-location { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; background: var(--panel); border: 1px solid var(--border); }
.stock-location span { color: var(--text-dim); font-size: 11px; }
.stock-location input {
  width: 92px;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  text-align: right;
  outline: none;
}
.stock-location input:focus { border-color: var(--info); }
.product-confirm { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0; color: var(--text); font-size: 11.5px; cursor: pointer; }
.product-confirm input { margin-top: 2px; accent-color: var(--ok); }
.product-picture-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.product-picture-current { display: flex; gap: 9px; overflow-x: auto; padding-bottom: 4px; }
.product-picture-item { width: 122px; flex: 0 0 122px; margin: 0; }
.product-picture-item img { width: 122px; height: 104px; display: block; object-fit: contain; background: #fff; border: 1px solid var(--border); }
.product-picture-item figcaption { margin-top: 4px; color: var(--text-dim); font-size: 9px; }
.product-picture-controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin-top: 4px; }
.product-picture-controls button {
  min-width: 0;
  height: 25px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
}
.product-picture-controls button:hover:not(:disabled) { border-color: var(--text-dim); }
.product-picture-controls button.remove { color: #ff9da5; }
.product-picture-controls button:disabled { opacity: .35; cursor: not-allowed; }
.product-picture-actions { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.product-picture-actions > span { color: var(--text-dim); font-size: 11px; overflow-wrap: anywhere; }
.file-picker { position: relative; overflow: hidden; cursor: pointer; }
.file-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.product-picture-preview { display: flex; gap: 9px; margin-top: 10px; overflow-x: auto; }
.product-picture-preview figure { width: 112px; flex: 0 0 112px; margin: 0; }
.product-picture-preview img { width: 112px; height: 96px; display: block; object-fit: contain; background: #fff; border: 1px solid var(--border); }
.product-picture-preview figcaption { margin-top: 4px; color: var(--text-dim); font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.metric-help {
  position: relative;
  width: 17px;
  height: 17px;
  min-width: 17px;
  padding: 0;
  border: 1px solid #718096;
  border-radius: 50%;
  background: transparent;
  color: #526176;
  font-size: 10px;
  font-weight: 800;
  line-height: 15px;
  text-align: center;
  cursor: help;
  vertical-align: middle;
}
.metric-help-tooltip {
  position: fixed;
  z-index: 5000;
  width: max-content;
  max-width: min(300px, calc(100vw - 16px));
  padding: 8px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #263247;
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  white-space: normal;
  box-shadow: 0 8px 24px rgba(24, 34, 53, .24);
  pointer-events: none;
}

/* ── Anúncios ── */
#tab-listings { flex-direction: column; padding: 12px; gap: 10px; }
.listings-toolbar {
  position: relative;
  z-index: 4;
  flex: 0 0 auto;
  color: var(--text-dim);
  font-size: 13px;
  padding: 0 2px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--bg);
}
.listings-toolbar #listings-summary { margin-right: auto; }
.auditor-search {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 1 560px;
}
.auditor-search input {
  flex: 1 1 280px;
  min-width: 220px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 8px 10px;
  font-size: 12.5px;
  outline: none;
}
.auditor-search input:focus { border-color: var(--accent); }
#auditor-search-result { color: var(--text); font-size: 12px; min-height: 18px; }
.listing-filters {
  position: relative;
  z-index: 4;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 2px 2px 10px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  overflow-y: hidden;
  background: var(--bg);
}
.listing-filter {
  min-height: 29px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text-dim);
  font-size: 10.5px;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}
.listing-filter span { min-width: 18px; color: var(--text); text-align: right; }
.listing-filter:hover { color: var(--text); border-color: #455168; }
.listing-filter.active { color: var(--text); border-color: var(--accent); background: #282516; }
.listing-filter:disabled { opacity: .55; cursor: not-allowed; }
#listing-filter-source { margin-left: auto; color: var(--text-dim); font-size: 10.5px; white-space: nowrap; }
.listings-empty { grid-column: 1 / -1; padding: 36px 12px; color: var(--text-dim); font-size: 12px; text-align: center; }
.listings-grid {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 12px;
  overflow-y: auto;
  padding-bottom: 12px;
}
.listing-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: border-color .16s, background .16s;
}
.listing-card:hover,
.listing-card:focus-visible { border-color: #3b465c; }
.listing-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.listing-card.expanded { grid-column: 1 / -1; cursor: default; }
.listing-head { display: flex; gap: 10px; align-items: flex-start; }
.listing-thumb {
  width: 54px;
  height: 54px;
  border-radius: 7px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  flex: 0 0 54px;
  overflow: hidden;
}
.listing-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.listing-title { font-size: 13px; font-weight: 600; line-height: 1.4; flex: 1; }
.listing-refresh {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 19px;
  line-height: 1;
}
.listing-refresh:hover { color: var(--text); border-color: var(--info); }
.listing-refresh:disabled { cursor: wait; opacity: .75; }
.listing-refresh.loading { animation: listing-refresh-spin .8s linear infinite; }
@keyframes listing-refresh-spin { to { transform: rotate(360deg); } }
.overall {
  width: 46px; height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
  border: 3px solid;
}
.overall.good { color: var(--ok); border-color: var(--ok); background: #14231a; }
.overall.mid { color: var(--warn); border-color: var(--warn); background: #262012; }
.overall.bad { color: var(--crit); border-color: var(--crit); background: #2a1517; }
.overall.none { color: var(--text-dim); border-color: var(--border); }
.listing-meta { color: var(--text-dim); font-size: 12px; display: flex; gap: 12px; flex-wrap: wrap; }
.listing-sku { color: var(--info); }
.score-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.score-chip {
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  padding: 3px 8px;
  background: var(--panel-2);
  border: 1px solid var(--border);
}
.score-chip b { font-weight: 800; }
.score-chip.good b { color: var(--ok); }
.score-chip.mid b { color: var(--warn); }
.score-chip.bad b { color: var(--crit); }
.open-tasks-badge {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  color: var(--warn);
  background: #262012;
  border: 1px solid #4a3a14;
  padding: 3px 9px;
  border-radius: 999px;
}
.open-tasks-badge.zero { color: var(--ok); background: #14231a; border-color: #1d4028; }

.listing-detail {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 2px;
  cursor: default;
}
.detail-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 14px;
  align-items: start;
}
.detail-col h5,
.detail-recs h5 {
  font-size: 12px;
  color: var(--text);
  margin-bottom: 6px;
}
.detail-col p {
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.45;
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}
.detail-col b { color: var(--text); font-weight: 650; }
.detail-recs {
  border-top: 1px solid var(--border);
  margin-top: 12px;
  padding-top: 10px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.recommendations {
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.45;
  flex: 1 1 420px;
}
.recommendations ul { padding-left: 16px; }
.detail-link {
  color: var(--info);
  text-decoration: none;
  border: 1px solid #284473;
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}
.detail-link:hover { border-color: var(--info); color: var(--text); }
.detail-updated {
  color: var(--text-dim);
  font-size: 11px;
  align-self: center;
}

/* ---------- Faturamento ---------- */
#tab-finance {
  flex-direction: column;
  padding: 12px;
  gap: 12px;
  overflow: hidden;
}
/* Rentabilidade (ML usa tab-panel; Shopee usa shopee-view — mesmo conteúdo interno).
   O conteúdo flui com altura natural e a PÁGINA rola — flex/overflow internos
   colapsavam a altura e "sumiam" com o ranking ao trocar de sub-aba. */
#tab-rentabilidade-ml {
  flex-direction: column;
  padding: 12px;
  gap: 12px;
  overflow-y: auto;
  overflow-x: hidden;
}
.profitability-root .finance-view { overflow: visible; padding-right: 0; }
.profitability-root .finance-view.active { flex: none; display: flex; }
.profitability-root .finance-panel { flex: none; overflow: visible; min-height: 0; }
.profitability-root .finance-table { overflow: visible; max-height: none; }
.prof-row strong.prof-pos { color: #70cf83; }
.prof-row strong.prof-neg { color: #ff8589; }
.prof-row strong.prof-muted { color: var(--text-dim); font-size: 11.5px; }
.prof-row-negative { border-color: #743337; }
.prof-ads-list { display: flex; flex-direction: column; gap: 10px; padding: 8px; }
.prof-ads-row {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 11px;
}
.prof-ads-row-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.prof-ads-row-head strong {
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prof-ads-row-head span { color: var(--text-dim); font-size: 10.5px; white-space: nowrap; }
.prof-ads-bar {
  display: flex;
  height: 12px;
  margin: 7px 0 5px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--panel);
}
.prof-ads-bar-ads { background: #e6a23c; }
.prof-ads-bar-organic { background: #3fb56a; }
.prof-ads-row-foot { display: flex; justify-content: space-between; gap: 12px; color: var(--text-dim); font-size: 11px; }
.prof-ads-note { color: var(--text-dim); font-size: 11px; padding: 8px 4px 0; line-height: 1.4; }
.prof-rebate-tips {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.prof-rebate-tips strong { font-size: 13px; }
.prof-rebate-tips p { color: var(--text-dim); font-size: 12px; line-height: 1.5; margin-top: 6px; }
.prof-rebate-hint { font-style: italic; }
.prof-rebate-summary { color: var(--text-dim); font-size: 12px; padding: 4px 2px 8px; }
.prof-rebate-list { display: flex; flex-direction: column; gap: 8px; }
.prof-rebate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
}
.prof-rebate-row-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.prof-rebate-row-main strong {
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prof-rebate-row-main span { color: var(--text-dim); font-size: 11px; }
.prof-rebate-price { color: var(--text) !important; font-weight: 700; }
.prof-rebate-badge { flex: none; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.prof-rebate-badge > strong { color: #3fb56a; font-size: 13px; }
.prof-rebate-badge small { color: var(--text-dim); font-size: 10.5px; }
.prof-rebate-safe {
  font-size: 9.5px;
  font-weight: 800;
  color: #107448;
  background: #eaf8f0;
  border-radius: 4px;
  padding: 1px 6px;
}
.finance-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-dim);
  flex-wrap: wrap;
}
.finance-toolbar strong {
  color: var(--text);
  display: block;
  font-size: 15px;
  margin-bottom: 3px;
}
.finance-toolbar span { font-size: 12px; }
.finance-period {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.finance-period label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
}
.date-shell {
  min-width: 112px;
  min-height: 31px;
  position: relative;
  display: inline-flex;
  align-items: center;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  cursor: pointer;
}
.date-shell:hover { border-color: var(--text-dim); }
.date-shell:focus-within { border-color: var(--accent); }
.date-display {
  width: 100%;
  padding: 6px 28px 6px 8px;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
}
.date-shell::after {
  content: "▾";
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 10px;
  pointer-events: none;
}
.finance-period input {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  padding: 6px 8px;
  font-size: 12px;
  outline: none;
}
.date-shell input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
  color-scheme: dark;
}
.finance-period input:focus { border-color: var(--accent); }
.report-download {
  display: inline-flex;
  align-items: stretch;
  min-height: 33px;
}
.report-download select {
  min-width: 60px;
  padding: 6px 22px 6px 8px;
  border: 1px solid var(--border);
  border-right: 0;
  border-radius: 7px 0 0 7px;
  color: var(--text);
  background: var(--panel);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
}
.report-download .btn { border-radius: 0 7px 7px 0; white-space: nowrap; }
.finance-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 10px;
}
.finance-metric {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}
.finance-metric span {
  display: block;
  color: var(--text-dim);
  font-size: 12px;
  margin-bottom: 7px;
}
.finance-metric > span { display: flex; align-items: center; gap: 6px; }
.finance-metric > span .metric-help { margin-left: auto; }
.finance-metric strong {
  display: block;
  color: var(--text);
  font-size: 22px;
  line-height: 1.1;
}
.finance-metric small {
  display: block;
  color: var(--text-dim);
  font-size: 11px;
  margin-top: 8px;
}
.finance-content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-height: 0;
  flex: 1;
}
.finance-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.finance-panel h3 {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
  font-size: 13px;
}
.finance-table {
  overflow-y: auto;
  padding: 8px;
}
.finance-rows { display: flex; flex-direction: column; gap: 7px; }
.finance-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  text-align: left;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 9px 10px;
  cursor: pointer;
}
.finance-row:hover { border-color: var(--accent); }
.finance-title {
  grid-column: 1;
  font-weight: 700;
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.finance-sku {
  grid-column: 1;
  color: var(--text-dim);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.finance-row strong {
  grid-column: 2;
  grid-row: 1;
  color: var(--accent);
  font-size: 13px;
}
.finance-row small {
  grid-column: 2;
  grid-row: 2;
  color: var(--text-dim);
  font-size: 11px;
  text-align: right;
}
.finance-empty {
  color: var(--text-dim);
  font-size: 12px;
  padding: 14px;
}

/* ── Animação global de carregamento (loader.js) ──────────────────────────
   Overlay com o conteúdo ao fundo em blur + "H" da marca preenchido por ondas
   de gráfico e mensagens rotativas do que está sendo calculado. */
.hub-loader {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: rgba(11, 17, 28, .38);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: hub-loader-in .18s ease;
}
.hub-loader.hidden { display: none; }
@keyframes hub-loader-in { from { opacity: 0; } to { opacity: 1; } }
.hub-loader-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 26px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 22px 60px rgba(0, 0, 0, .34);
}
/* O logo da marca (H) pulsando devagar em fade in/out */
.hub-loader-mark {
  width: 72px;
  height: 72px;
  flex: none;
  object-fit: contain;
  border-radius: 12px;
  animation: hub-mark-fade 3.2s ease-in-out infinite;
}
@keyframes hub-mark-fade {
  0%, 100% { opacity: .2; }
  50% { opacity: 1; }
}
.hub-loader-copy { display: flex; flex-direction: column; gap: 5px; min-width: 230px; }
.hub-loader-copy strong { font-size: 14px; }
/* Mensagem: sai em fade out, a próxima entra em fade in (ver cycleMessages) */
.hub-loader-copy span {
  color: var(--text-dim);
  font-size: 12px;
  opacity: 1;
  transition: opacity .7s ease;
}
.hub-loader-copy span.is-out { opacity: 0; }
.hub-loader-dots b {
  display: inline-block;
  font-weight: 900;
  animation: hub-dot 1.1s infinite;
}
.hub-loader-dots b:nth-child(2) { animation-delay: .18s; }
.hub-loader-dots b:nth-child(3) { animation-delay: .36s; }
@keyframes hub-dot {
  0%, 60%, 100% { opacity: .25; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}
@media (prefers-reduced-motion: reduce) {
  .hub-loader-mark { animation: none; opacity: 1; }
  .hub-loader-dots b { animation: none; }
}

/* Gestor Seller: visão consolidada dos marketplaces */
/* CRÍTICO: sem isto o .tab-panel.active (display:flex) empilha o conteúdo na
   horizontal — era o que estourava os cards de conexão e escondia o gráfico. */
#tab-gestor-seller {
  flex-direction: column;
  padding: 12px;
  gap: 12px;
  overflow-y: auto;
  overflow-x: hidden;
}
/* Conteúdo com altura natural: a página rola até as campanhas (flex:1 do
   .finance-content encolhia os painéis e travava o scroll). */
#tab-gestor-seller .gestor-seller-grid { flex: none; }
#tab-gestor-seller .finance-panel { flex: none; overflow: visible; }
/* Na visão consolidada não fazem sentido a fila logística (caminhão) nem a
   aba flutuante de notificações do ML — são controles da operação ML. */
body[data-active-tab="gestor-seller"] #btn-shipping,
body[data-active-tab="gestor-seller"] #notifications-peek { display: none !important; }
.gs-date-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
}
.gs-date-label input[type="date"] {
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 11.5px;
}
.gestor-seller-nav-btn {
  margin-bottom: 4px;
  font-weight: 800;
  border: 1px dashed var(--border);
}
.gs-filter-group {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
}
.gs-filter-btn {
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-right: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.gs-filter-btn:last-child { border-right: 0; }
.gs-filter-btn:hover { color: var(--text); }
.gs-filter-btn.active { background: #253146; color: #cfe0ff; }
.gs-connections {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.gs-connect-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 6px;
  border: 0;
  border-radius: 999px;
  color: #16305c;
  font: inherit;
  cursor: pointer;
  transition: filter .15s ease, transform .08s ease;
}
.gs-connect-btn:hover { filter: brightness(1.04); }
.gs-connect-btn:active { transform: translateY(1px); }
.gs-connect-btn .gs-connect-mark {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 900;
  flex: none;
}
.gs-connect-text { display: flex; align-items: baseline; gap: 6px; line-height: 1.1; text-align: left; }
.gs-connect-text strong { font-size: 12px; font-weight: 800; }
.gs-connect-text small { font-size: 10px; opacity: .8; }
.gs-connect-ml { background: #ffe600; }
.gs-connect-ml .gs-connect-mark { background: #fff; }
.gs-connect-amazon { background: #f3c69c; }
.gs-connect-amazon .gs-connect-mark { background: #fff; color: #16305c; font-size: 13px; }
.gs-connect-shopee { background: #e8897a; }
.gs-connect-shopee .gs-connect-mark { background: #fff; color: #ee4d2d; }
.gs-connect-btn.connected .gs-connect-text small { font-weight: 800; opacity: 1; }
.gs-connect-btn.coming-soon { opacity: .78; cursor: default; }
.gs-connect-btn.coming-soon:hover { filter: none; }
.gs-connect-btn.coming-soon:active { transform: none; }
/* Ações de uma conta já vinculada (reconectar / desvincular). Ficam menores e
   fora do cartão colorido para não competir com o botão principal. */
.gs-connect-actions { display: flex; gap: 6px; margin: -2px 0 2px; }
.gs-connect-action {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}
.gs-connect-danger { color: #ffb4ab; border-color: #713d39; }
.gs-connect-danger:hover { background: #291b1c; }
.gs-connect-action[disabled] { opacity: .6; cursor: default; }
.gestor-seller-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.gs-marketplace-row {
  border: 1px solid var(--border);
  border-left: 4px solid var(--gs-color, var(--accent));
  border-radius: var(--radius);
  background: var(--panel);
  padding: 10px 12px;
}
.gs-marketplace-row-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
}
.gs-marketplace-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gs-color, var(--accent));
  flex: none;
}
.gs-marketplace-empty {
  color: var(--text-dim);
  font-size: 12px;
  padding: 6px 2px;
}
.gs-cards {
  display: grid;
  /* auto-fit: os cards se acomodam sozinhos (6 métricas no ML, 5 na Shopee) sem
     espremer nem deixar buraco — resolve o "mal blocado" dos prints. */
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  align-items: stretch;
  gap: 10px;
}
/* Todos os cards da linha com a mesma altura e texto quebrando de forma decente */
.gs-cards .finance-metric {
  display: flex;
  flex-direction: column;
  min-height: 118px;
  overflow-wrap: anywhere;
}
.gs-cards .finance-metric > span { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.gs-cards .finance-metric strong { margin-top: auto; }
.gs-cards .metric-delta { margin-top: 6px; }
.gs-metric strong { font-size: 19px; }
.metric-delta.neutral { color: var(--text-dim); font-weight: 400; }
/* Valor "como a plataforma mostra" no topo do card, acima do valor do HUB */
.gs-metric.has-platform { display: flex; flex-direction: column; }
.gs-platform-value {
  display: flex !important;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--border);
}
.gs-platform-value em {
  color: var(--text-dim);
  font-size: 9.5px;
  font-weight: 800;
  font-style: normal;
  text-transform: uppercase;
}
.gs-platform-value b { color: var(--text); font-size: 14px; font-weight: 800; }
.gs-hub-tag {
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  font-style: normal;
  text-transform: uppercase;
}
.gs-platform-note {
  margin-top: 6px !important;
  color: var(--text-dim);
  font-size: 10px;
  line-height: 1.35;
}
.gestor-seller-grid { grid-template-columns: 1.4fr 1fr; }
.gestor-seller-chart {
  position: relative;
  flex: none;
  height: 330px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  cursor: crosshair;
}
.gestor-seller-chart svg { display: block; width: 100%; flex: 1 1 auto; min-height: 0; }
.gs-chart-tip {
  position: absolute;
  z-index: 6;
  max-width: 200px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
  font-size: 11px;
  pointer-events: none;
}
.gs-chart-tip strong { display: block; margin-bottom: 4px; font-size: 11.5px; }
.gs-chart-tip span { display: flex; align-items: center; gap: 5px; color: var(--text-dim); }
.gs-chart-tip span b { color: var(--text); }
.gs-chart-tip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.gs-chart-grid { stroke: var(--border); stroke-width: 1; }
.gs-chart-axis-label { fill: var(--text-dim); font-size: 9px; }
.gs-chart-line { fill: none; stroke-width: 2; }
.gs-chart-legend {
  display: flex;
  gap: 14px;
  padding: 6px 4px 0;
  font-size: 11px;
  color: var(--text-dim);
}
.gs-chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.gs-chart-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.gs-chart-zoom-hint {
  color: var(--text-dim);
  font-size: 10.5px;
  text-align: center;
  padding-top: 2px;
}
.gestor-seller-campaigns {
  overflow: visible;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Cancelados + Conversão (duas colunas) ── */
.gs-duo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 12px;
}
.gs-duo .finance-panel { flex: none; overflow: visible; }
.gs-cancellations,
.gs-conversion {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px;
}
.gs-cancel-row,
.gs-conv-row {
  border: 1px solid var(--border);
  border-left: 4px solid var(--gs-color, var(--accent));
  border-radius: 9px;
  background: var(--panel-2);
  padding: 10px 12px;
}
.gs-cancel-head { display: flex; align-items: center; gap: 7px; font-size: 12.5px; }
.gs-cancel-share,
.gs-conv-rate { margin-left: auto; color: var(--text-dim); font-size: 11px; font-weight: 800; }
.gs-conv-rate { color: var(--text); font-size: 15px; }
.gs-cancel-main { display: flex; align-items: baseline; gap: 7px; margin-top: 7px; }
.gs-cancel-main strong { font-size: 24px; line-height: 1; }
.gs-cancel-main span { color: var(--text-dim); font-size: 11.5px; }
.gs-cancel-money { display: block; margin-top: 4px; font-size: 12px; font-weight: 700; }
.gs-cancel-money.muted { color: var(--text-dim); font-weight: 400; font-style: italic; }
.gs-cancel-delta { display: flex; align-items: baseline; gap: 6px; margin-top: 7px; font-size: 12px; font-weight: 800; }
.gs-cancel-delta em { color: var(--text-dim); font-size: 10.5px; font-weight: 400; font-style: normal; }
/* cancelamento caindo = bom (verde); subindo = ruim (vermelho) */
.gs-cancel-delta.up { color: #3fb56a; }
.gs-cancel-delta.down { color: #ff8589; }
.gs-cancel-delta.neutral { color: var(--text-dim); font-weight: 400; }
.gs-cancel-note {
  display: block;
  margin-top: 7px;
  color: var(--text-dim);
  font-size: 10.5px;
  line-height: 1.4;
}
.gs-conv-kind { display: flex; align-items: center; gap: 5px; margin-top: 4px; color: var(--text-dim); font-size: 11px; }
.gs-conv-unavailable { margin-top: 8px; color: var(--text-dim); font-size: 15px; font-weight: 700; }
/* Funil: barra proporcional a cada etapa real */
.gs-funnel { display: flex; flex-direction: column; gap: 7px; margin-top: 9px; }
.gs-funnel-step { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 10px; }
.gs-funnel-step i {
  grid-column: 1 / -1;
  display: block;
  height: 9px;
  min-width: 3px;
  border-radius: 3px;
  background: var(--gs-color, var(--accent));
  opacity: .85;
}
.gs-funnel-step span { color: var(--text-dim); font-size: 11px; }
.gs-funnel-step b { font-size: 12.5px; }

/* ── Tabela "Todos os produtos" ── */
.gs-products-panel { flex: none; overflow: visible; }
.gs-products-head { flex-wrap: wrap; gap: 10px; }
.gs-products-marketplace { display: inline-flex; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.gs-products-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.gs-filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text-dim);
  font-size: 10.5px;
  font-weight: 700;
}
.gs-filter-field input,
.gs-filter-field select {
  min-height: 31px;
  min-width: 132px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 11.5px;
  font-weight: 400;
}
.gs-filter-search input { min-width: 230px; }
.gs-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
}
.gs-products-table-wrap { overflow-x: auto; max-height: 620px; overflow-y: auto; }
.gs-products-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.gs-products-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text-dim);
  font-size: 10.5px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}
.gs-products-table th.gs-sortable { cursor: pointer; user-select: none; }
.gs-products-table th.gs-sortable:hover { color: var(--text); }
.gs-products-table th.center, .gs-products-table td.center { text-align: center; }
.gs-products-table th.gs-col-title, .gs-products-table td.gs-col-title { text-align: left; }
.gs-products-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
}
.gs-products-table tbody tr:hover { background: var(--panel-2); }
.gs-col-title { min-width: 280px; max-width: 340px; }
.gs-prod-cell { display: flex; align-items: center; gap: 9px; }
.gs-prod-cell img, .gs-prod-thumb-empty {
  width: 38px; height: 38px; flex: none;
  border-radius: 7px; object-fit: cover;
  background: var(--panel-2); border: 1px solid var(--border);
}
.gs-prod-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gs-prod-info strong { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-prod-info a { color: inherit; text-decoration: none; }
.gs-prod-info a:hover { color: var(--accent); text-decoration: underline; }
.gs-prod-info small { color: var(--text-dim); font-size: 10px; }
.gs-prod-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.gs-tag {
  font-size: 9px; font-weight: 800; font-style: normal;
  padding: 1px 5px; border-radius: 4px;
}
.gs-tag-full { color: #0a6b3d; background: #e6f7ee; }
.gs-tag-catalog { color: #1d4ed8; background: #e8f0ff; }
.gs-tag-ads { color: #8a5a00; background: #fff4e0; }
.gs-tag-nocost { color: #a13a45; background: #ffeaec; }
.gs-curve {
  display: inline-grid; place-items: center;
  width: 21px; height: 21px; border-radius: 50%;
  font-size: 10px; font-weight: 800;
}
.gs-curve-A { color: #0a6b3d; background: #e6f7ee; }
.gs-curve-B { color: #8a5a00; background: #fff4e0; }
.gs-curve-C { color: var(--text-dim); background: var(--panel-2); }
.gs-na { color: var(--text-dim); font-style: normal; font-size: 10.5px; }
.gs-products-msg { padding: 20px; color: var(--text-dim); font-size: 12px; text-align: center; }
.gs-campaign-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
}
.gs-campaign-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 5px;
  white-space: nowrap;
}
.gs-campaign-thumb {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--panel);
}
.gs-campaign-thumb-empty { background: var(--panel); border: 1px dashed var(--border); }
.gs-campaign-info { min-width: 0; }
.gs-campaign-info strong {
  display: block;
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gs-campaign-info small { color: var(--text-dim); font-size: 11px; }
.gs-campaign-growth {
  font-weight: 800;
  font-size: 13px;
  color: #70cf83;
  white-space: nowrap;
}

/* Financeiro operacional */
.finance-heading { min-width: 220px; }
.finance-heading strong { font-size: 17px; }
.period-presets {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
}
.period-btn {
  min-height: 30px;
  padding: 0 9px;
  border: 0;
  border-right: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.period-btn:last-child { border-right: 0; }
.period-btn:hover { color: var(--text); }
.period-btn.active { background: #253146; color: #cfe0ff; }
.finance-subtabs {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  flex: 0 0 auto;
}
.finance-subtab {
  position: relative;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.finance-subtab:hover { color: var(--text); }
.finance-subtab.active { color: var(--text); }
.finance-subtab.active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
}
.finance-loading,
.finance-error {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  border-radius: 7px;
  color: var(--text-dim);
  font-size: 12px;
}
.finance-loading span {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--info);
  animation: pulse 1s infinite alternate;
}
.finance-error { border-color: #6d3034; color: #ffb7ba; }
.finance-view {
  display: none;
  min-height: 0;
  overflow-y: auto;
  flex-direction: column;
  gap: 12px;
  padding-right: 2px;
}
.finance-view.active { display: flex; }
.external-cost-head {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 18px;
  border: 1px solid #b9dec9;
  border-left: 4px solid var(--ok);
  border-radius: 7px;
  background: #f3fbf6;
}
.external-cost-head > div { min-width: 0; }
.external-cost-head span,
.external-cost-head strong,
.external-cost-head small { display: block; }
.external-cost-head span { color: #4c6659; font-size: 10px; font-weight: 750; }
.external-cost-head strong { margin-top: 4px; color: #116d45; font-size: 24px; }
.external-cost-head small { margin-top: 4px; color: #567065; font-size: 10px; }
.external-cost-add {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border: 1px solid #0f7a49;
  border-radius: 50%;
  color: #fff;
  background: var(--ok);
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
}
.external-cost-add:hover { color: #fff; background: #0f7044; border-color: #0b5e39; }
.external-cost-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 160px 160px auto;
  align-items: end;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
}
.external-cost-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 700;
}
.external-cost-form input {
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: var(--panel);
  font: inherit;
  outline: none;
}
.external-cost-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.external-cost-form-actions { display: flex; gap: 7px; }
.external-cost-panel { min-height: 220px; }
.external-cost-list { min-height: 120px; overflow-y: auto; }
.external-cost-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) 120px 34px;
  align-items: center;
  gap: 12px;
  padding: 9px 13px;
  border-bottom: 1px solid var(--border);
}
.external-cost-row:last-child { border-bottom: 0; }
.external-cost-row:hover { background: var(--panel-2); }
.external-cost-row time { color: var(--text-dim); font-size: 11px; }
.external-cost-row strong,
.external-cost-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.external-cost-row strong { font-size: 12px; }
.external-cost-row small { margin-top: 3px; color: var(--text-dim); font-size: 9px; }
.external-cost-row b { text-align: right; font-size: 12px; }
.external-cost-row button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  background: var(--panel);
  cursor: pointer;
}
.external-cost-row button:hover { color: var(--crit); border-color: #efb2ba; background: #fff4f5; }
.finance-summary-wide { grid-template-columns: repeat(5, minmax(150px, 1fr)); }
#ads-summary { grid-template-columns: repeat(5, minmax(150px, 1fr)); }
.finance-metric { min-height: 105px; }
.finance-metric.positive { border-color: #285e3b; }
.finance-metric.negative { border-color: #743337; }
.finance-metric.warning { border-color: #73551f; }
.finance-metric .metric-delta { font-weight: 700; }
.finance-metric .metric-delta.up { color: #70cf83; }
.finance-metric .metric-delta.down { color: #ff8589; }
.finance-alerts-section {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
.section-title,
.panel-head,
.costs-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.section-title > div,
.panel-head > div,
.costs-toolbar > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.section-title strong,
.costs-toolbar strong { font-size: 13px; }
.section-title span,
.panel-head span,
.costs-toolbar span { color: var(--text-dim); font-size: 11px; }
.alert-count {
  min-width: 26px;
  padding: 3px 7px;
  border: 1px solid #73551f;
  border-radius: 6px;
  color: var(--warn) !important;
  text-align: center;
  font-weight: 800;
}
.finance-alerts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 9px; }
.finance-alert {
  display: grid;
  grid-template-columns: 5px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 8px 9px;
  color: var(--text);
  text-align: left;
  cursor: default;
}
.finance-alert.clickable { cursor: pointer; }
.finance-alert.clickable:hover { border-color: var(--text-dim); }
.finance-alert::before { content: ""; width: 4px; height: 100%; min-height: 34px; background: var(--warn); }
.finance-alert.critical::before { background: var(--crit); }
.finance-alert.info::before { background: var(--info); }
.finance-alert div { min-width: 0; }
.finance-alert strong,
.finance-alert small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finance-alert strong { font-size: 12px; }
.finance-alert small { color: var(--text-dim); font-size: 11px; margin-top: 3px; }
.finance-alert em { color: var(--text-dim); font-size: 10px; font-style: normal; }
.finance-overview-grid,
.ads-layout { overflow: visible; flex: 0 0 auto; }
.finance-panel-wide { grid-column: 1 / -1; }
.finance-panel .panel-head {
  flex: 0 0 auto;
  min-height: 48px;
  padding: 8px 11px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
}
.finance-panel .panel-head h3 {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 13px;
}
.comparison-chart { min-height: 190px; padding: 13px; display: flex; flex-direction: column; gap: 13px; }
.compare-legend { display: flex; gap: 14px; color: var(--text-dim); font-size: 10px; }
.compare-legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 5px; background: var(--info); }
.compare-legend span:last-child::before { background: #586174; }
.compare-group { display: grid; grid-template-columns: 105px minmax(120px, 1fr) 86px; gap: 9px; align-items: center; }
.compare-group > span { color: var(--text-dim); font-size: 11px; }
.compare-group > strong { font-size: 11px; text-align: right; }
.compare-group > div:last-child { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.compare-bars { display: flex; flex-direction: column; gap: 4px; }
.compare-track { height: 8px; background: #11151c; overflow: hidden; }
.compare-bar { display: block; height: 100%; min-width: 2px; background: var(--info); }
.compare-bar.previous { background: #586174; }
.compare-delta { font-size: 10px !important; text-align: right; }
.compare-delta.up { color: #70cf83; }
.compare-delta.down { color: #ff8589; }
.waterfall { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.waterfall-row { display: grid; grid-template-columns: 150px minmax(120px, 1fr) 110px; gap: 10px; align-items: center; }
.waterfall-row span { color: var(--text-dim); font-size: 11px; }
.waterfall-row strong { font-size: 11px; text-align: right; }
.waterfall-track { height: 10px; background: #11151c; overflow: hidden; }
.waterfall-fill { height: 100%; background: var(--info); }
.waterfall-fill.expense { background: var(--warn); }
.waterfall-fill.result { background: var(--ok); }
.waterfall-fill.loss { background: var(--crit); }
.sales-timeline-panel { min-height: 250px; flex: 0 0 auto; }
.sales-timeline {
  height: 205px;
  display: flex;
  align-items: stretch;
  gap: 5px;
  padding: 12px 12px 8px;
  overflow-x: auto;
}
.timeline-day { min-width: 30px; flex: 1 0 30px; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.timeline-value { height: 158px; width: 100%; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--border); }
.timeline-bar { width: min(22px, 70%); min-height: 2px; background: var(--info); }
.timeline-day strong { font-size: 9px; font-weight: 700; }
.timeline-day small { color: var(--text-dim); font-size: 9px; }
.ads-product-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(4, minmax(82px, 110px));
  gap: 10px;
  align-items: center;
  min-height: 50px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--border);
}
.ads-product-row:last-child { border-bottom: 0; }
.ads-product-row.clickable { cursor: pointer; }
.ads-product-row.clickable:hover { background: var(--panel-2); }
.ads-product-title { min-width: 0; }
.ads-product-title strong,
.ads-product-title small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ads-product-title strong { font-size: 12px; }
.ads-product-title small { color: var(--text-dim); font-size: 10px; margin-top: 3px; }
.ads-stat { text-align: right; }
.ads-stat span { display: block; color: var(--text-dim); font-size: 9px; }
.ads-stat strong { display: block; margin-top: 3px; font-size: 11px; }
.costs-toolbar {
  flex: 0 0 auto;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.costs-actions { display: flex; align-items: center; gap: 10px; }
.costs-actions input {
  width: 280px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  padding: 7px 9px;
  outline: none;
}
.costs-actions input:focus { border-color: var(--accent); }
.cost-products { min-height: 0; overflow-y: auto; border: 1px solid var(--border); }
.cost-product-row {
  display: grid;
  grid-template-columns: 42px minmax(220px, 1fr) 100px 145px 132px 78px;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.cost-product-row:last-child { border-bottom: 0; }
.cost-product-row { transition: background .16s ease, box-shadow .16s ease; }
.cost-product-row:hover { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--accent); }
.cost-thumb { width: 42px; height: 42px; object-fit: contain; background: #fff; border: 1px solid var(--border); }
.cost-product-title { min-width: 0; }
.cost-product-title strong,
.cost-product-title small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cost-product-title strong { font-size: 12px; }
.cost-product-title small { color: var(--text-dim); font-size: 10px; margin-top: 3px; }
.cost-price { text-align: right; }
.cost-price span { display: block; color: var(--text-dim); font-size: 9px; }
.cost-price strong { display: block; font-size: 11px; margin-top: 3px; }
.cost-input-wrap { position: relative; }
.cost-input-wrap::before { content: "R$"; position: absolute; left: 8px; top: 50%; transform: translateY(-50%); color: var(--text-dim); font-size: 10px; }
.cost-field > span { display: block; margin-bottom: 4px; color: var(--text-dim); font-size: 9px; }
.margin-input-wrap { position: relative; }
.margin-input-wrap::after { content: "%"; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: var(--text-dim); font-size: 10px; }
.cost-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 7px 8px 7px 28px;
  text-align: right;
  outline: none;
}
.cost-input:focus { border-color: var(--accent); }
.target-margin-input {
  width: 100%;
  padding: 7px 24px 7px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  text-align: right;
  outline: none;
}
.target-margin-input:focus { border-color: var(--accent); }
.cost-save { padding: 6px 9px; }
.billing-note {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-left: 3px solid var(--info);
  background: #151c28;
  color: var(--text-dim);
  font-size: 11px;
}
.billing-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 12px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
}
.billing-row:last-child { border-bottom: 0; }
.billing-row strong { font-size: 12px; }
.billing-row span { color: var(--text-dim); font-size: 10px; }
.billing-row b { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--accent); font-size: 12px; }

/* ---------- Workspace Shopee ---------- */
.shopee-mark,
.shopee-brand {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  background: #ee4d2d;
  color: #fff;
  border-radius: 5px;
  font-weight: 900;
  line-height: 1;
}
.shopee-mark { width: 20px; height: 20px; margin-right: 5px; font-size: 12px; }
.tab-shopee-btn { display: inline-flex; align-items: center; }
#tab-shopee {
  --shopee: #ee4d2d;
  --shopee-soft: #ff6f52;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  overflow: hidden;
}
.shopee-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.shopee-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.shopee-brand { width: 38px; height: 38px; font-size: 20px; }
.shopee-title strong,
.shopee-title span { display: block; }
.shopee-title strong { font-size: 16px; }
.shopee-title span { margin-top: 3px; color: var(--text-dim); font-size: 11px; }
.shopee-title .shopee-brand { display: inline-grid; margin-top: 0; color: #fff; font-size: 20px; }
.shopee-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.shopee-connection {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
}
.shopee-connection i { width: 8px; height: 8px; border-radius: 50%; background: var(--crit); }
.shopee-connection.configured { color: var(--warn); }
.shopee-connection.configured i { background: var(--warn); }
.shopee-connection.online { color: var(--ok); border-color: #2b6237; }
.shopee-connection.online i { background: var(--ok); }
.shopee-primary { background: var(--shopee); border-color: var(--shopee); color: #fff; }
.shopee-primary:hover { border-color: #ff8068; filter: brightness(1.06); }
.shopee-sync { border-color: #6f352d; }
.shopee-loading,
.shopee-error {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 9px 11px;
  font-size: 12px;
}
.shopee-loading { color: var(--text-dim); background: #161b24; }
.shopee-loading span {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 7px;
  border: 2px solid #4b5361;
  border-top-color: var(--shopee);
  border-radius: 50%;
  animation: shopee-spin .8s linear infinite;
}
@keyframes shopee-spin { to { transform: rotate(360deg); } }
.shopee-error { color: #ffb4ab; border-color: #713d39; background: #291b1c; }
.shopee-setup {
  width: min(900px, 100%);
  margin: 18px auto auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-top: 3px solid var(--shopee);
  border-radius: 8px;
  overflow: auto;
}
.shopee-setup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
}
.shopee-setup-head strong,
.shopee-setup-head span { display: block; }
.shopee-setup-head strong { font-size: 14px; }
.shopee-setup-head span { margin-top: 3px; color: var(--text-dim); font-size: 11px; }
.shopee-setup-head a { color: var(--shopee-soft); font-size: 12px; font-weight: 700; text-decoration: none; }
.shopee-setup-head a:hover { text-decoration: underline; }
.shopee-config-form {
  display: grid;
  grid-template-columns: 180px minmax(260px, 1fr);
  gap: 13px;
  padding: 16px;
}
/* Seller comum: o app da Shopee já vem configurado pelo HUB (appManaged), então
   toda a parte de Partner ID/Key/domínio sai de cena e sobra só o botão de
   autorizar. O dono do HUB, que precisa dos campos, vê o formulário normal. */
.shopee-managed-intro { display: none; }
#shopee-setup.app-managed .shopee-managed-intro {
  display: block;
  padding: 18px 16px 4px;
}
#shopee-setup.app-managed .shopee-managed-intro strong { display: block; font-size: 15px; }
#shopee-setup.app-managed .shopee-managed-intro span {
  display: block;
  margin-top: 5px;
  max-width: 62ch;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.5;
}
#shopee-setup.app-managed .shopee-setup-head,
#shopee-setup.app-managed .shopee-config-form label,
#shopee-setup.app-managed .shopee-domain-guide,
#shopee-setup.app-managed .shopee-config-note,
#shopee-setup.app-managed #shopee-save { display: none; }
#shopee-setup.app-managed .shopee-config-form { grid-template-columns: 1fr; }
.shopee-config-form label { display: flex; flex-direction: column; gap: 6px; color: var(--text-dim); font-size: 11px; font-weight: 700; }
.shopee-config-form input,
.shopee-finish input,
.shopee-period-bar input {
  width: 100%;
  min-height: 34px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  padding: 7px 9px;
  outline: none;
  color-scheme: dark;
}
.shopee-config-form input:focus,
.shopee-finish input:focus,
.shopee-period-bar input:focus { border-color: var(--shopee); }
.shopee-redirect-field,
.shopee-domain-guide,
.shopee-config-note,
.shopee-config-actions { grid-column: 1 / -1; }
.shopee-domain-guide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid #5d382f;
  border-radius: 7px;
  background: #211a1b;
}
.shopee-domain-guide > span { color: var(--text); font-size: 11px; line-height: 1.4; }
.shopee-domain-guide > div { display: flex; align-items: center; gap: 8px; }
.shopee-domain-guide code {
  min-width: 180px;
  padding: 7px 9px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--shopee-soft);
  font-size: 11px;
  font-weight: 700;
}
.shopee-domain-guide small { grid-column: 1 / -1; color: var(--text-dim); font-size: 10px; }
.shopee-domain-guide small code { min-width: 0; padding: 0; border: 0; background: transparent; color: var(--text-dim); font-weight: 400; }
.shopee-config-note {
  padding: 9px 10px;
  border-left: 3px solid var(--info);
  background: #151c28;
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.5;
}
.shopee-config-note code { color: var(--text); }
.shopee-config-actions { display: flex; justify-content: flex-end; gap: 8px; }
.shopee-finish {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 9px;
  align-items: end;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: #171b23;
}
.shopee-finish > div { grid-column: 1 / -1; }
.shopee-finish strong,
.shopee-finish span { display: block; }
.shopee-finish span { margin-top: 3px; color: var(--text-dim); font-size: 11px; }
.shopee-dashboard {
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}
/* Rentabilidade da Shopee: conteúdo longo (ranking de produtos) precisa rolar
   com a PÁGINA inteira, não numa janelinha interna de ~500px que o usuário
   nem percebe que existe. */
body[data-shopee-view="profitability"] .shopee-dashboard {
  overflow-y: visible;
  min-height: auto;
}
.shopee-period-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.shopee-period-bar label { display: flex; align-items: center; gap: 5px; color: var(--text-dim); font-size: 11px; font-weight: 700; }
.shopee-period-bar input { width: 132px; min-height: 31px; padding: 5px 7px; }
.shopee-presets { display: inline-flex; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.shopee-presets button {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-right: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.shopee-presets button:last-child { border-right: 0; }
.shopee-presets button.active { background: var(--shopee); color: #fff; }
.shopee-summary { display: grid; grid-template-columns: repeat(5, minmax(145px, 1fr)); gap: 9px; }
.shopee-metric {
  min-height: 92px;
  padding: 11px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.shopee-metric.warning { border-bottom-color: var(--warn); }
.shopee-metric.danger { border-bottom-color: var(--crit); }
.shopee-metric span,
.shopee-metric strong,
.shopee-metric small { display: block; }
.shopee-metric span { color: var(--text-dim); font-size: 11px; }
.shopee-metric span.shopee-metric-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.shopee-metric strong { margin-top: 8px; font-size: 21px; line-height: 1.1; }
.shopee-metric small { margin-top: 7px; color: var(--text-dim); font-size: 10px; }
.shopee-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.shopee-panel {
  min-height: 230px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.shopee-panel-wide { grid-column: 1 / -1; min-height: 210px; }
.shopee-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 49px;
  padding: 9px 11px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
}
.shopee-panel-head strong,
.shopee-panel-head span { display: block; }
.shopee-panel-head strong { font-size: 12.5px; }
.shopee-panel-head span { margin-top: 3px; color: var(--text-dim); font-size: 10px; }
.shopee-timeline { display: grid; gap: 7px; max-height: 280px; padding: 10px; overflow-y: auto; }
.shopee-timeline-row { display: grid; grid-template-columns: 52px minmax(80px, 1fr) 105px; gap: 9px; align-items: center; min-height: 22px; }
.shopee-timeline-row > span { color: var(--text-dim); font-size: 10px; }
.shopee-timeline-row > strong { font-size: 10.5px; text-align: right; }
.shopee-timeline-track { height: 8px; background: #10141a; overflow: hidden; }
.shopee-timeline-track i { display: block; height: 100%; background: var(--shopee); }
.shopee-status-list,
.shopee-table { max-height: 330px; overflow-y: auto; }
.shopee-status-list { padding: 9px; }
.shopee-status-row { display: grid; grid-template-columns: minmax(115px, 1fr) minmax(70px, 1fr) 42px; gap: 9px; align-items: center; min-height: 32px; }
.shopee-status-row span { color: var(--text-dim); font-size: 10.5px; }
.shopee-status-row > div { height: 6px; background: #10141a; overflow: hidden; }
.shopee-status-row i { display: block; height: 100%; background: #6c7a91; }
.shopee-status-row strong { text-align: right; font-size: 11px; }
.shopee-product-row,
.shopee-stock-row,
.shopee-order-row,
.shopee-listing-row {
  display: grid;
  align-items: center;
  gap: 9px;
  min-height: 54px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}
.shopee-product-row { grid-template-columns: 38px minmax(0, 1fr) auto; }
.shopee-stock-row,
.shopee-order-row { grid-template-columns: minmax(0, 1fr) auto; }
.shopee-listing-row { grid-template-columns: 38px minmax(180px, 1fr) 90px 95px 85px; }
.shopee-product-row:last-child,
.shopee-stock-row:last-child,
.shopee-order-row:last-child { border-bottom: 0; }
.shopee-listing-row:last-child { border-bottom: 0; }
.shopee-stock-row:hover { background: var(--panel-2); }
.shopee-listing-row:hover { background: var(--panel-2); }
.shopee-product-thumb { width: 38px; height: 38px; background: #fff; border: 1px solid var(--border); }
.shopee-product-thumb img { width: 100%; height: 100%; object-fit: contain; }
.shopee-product-row > div:nth-child(2),
.shopee-stock-row > div:first-child,
.shopee-order-row > div:first-child { min-width: 0; }
.shopee-listing-row > div:nth-child(2) { min-width: 0; }
.shopee-product-row strong,
.shopee-product-row span,
.shopee-stock-row strong,
.shopee-stock-row span,
.shopee-order-row strong,
.shopee-order-row span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shopee-listing-row > div:nth-child(2) strong,
.shopee-listing-row > div:nth-child(2) span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shopee-product-row strong,
.shopee-stock-row strong,
.shopee-order-row strong { font-size: 11.5px; }
.shopee-listing-row > div:nth-child(2) strong { font-size: 11.5px; }
.shopee-product-row span,
.shopee-stock-row span,
.shopee-order-row span { margin-top: 3px; color: var(--text-dim); font-size: 9.5px; }
.shopee-listing-row > div:nth-child(2) span { margin-top: 3px; color: var(--text-dim); font-size: 9.5px; }
.shopee-listing-price { text-align: right; font-size: 11px; }
.shopee-listing-stock { color: var(--text-dim); font-size: 10px; text-align: right; }
.shopee-listing-stock.zero { color: var(--crit); font-weight: 800; }
.shopee-listing-status { color: var(--text-dim); font-size: 9px; font-weight: 800; text-align: center; text-transform: uppercase; }
.shopee-listing-status.active { color: var(--ok); }
.shopee-stock-row b { color: var(--crit); font-size: 11px; }
.shopee-row-value { text-align: right; }
.shopee-row-value strong { color: var(--shopee-soft); }
.shopee-empty { padding: 18px 10px; color: var(--text-dim); font-size: 11px; text-align: center; }
.shopee-unavailable {
  margin-top: 10px;
  padding: 11px;
  border: 1px solid var(--border);
  border-left: 3px solid #66758d;
  background: #151a22;
  border-radius: 7px;
}
.shopee-unavailable > strong { display: block; margin-bottom: 8px; font-size: 12px; }
#shopee-unavailable-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
#shopee-unavailable-list > div { padding-right: 8px; border-right: 1px solid var(--border); }
#shopee-unavailable-list > div:last-child { border-right: 0; }
#shopee-unavailable-list span { display: block; color: var(--text); font-size: 10.5px; font-weight: 700; }
#shopee-unavailable-list p { margin-top: 3px; color: var(--text-dim); font-size: 9.5px; line-height: 1.4; }

/* ─────────── Conclusão da conexão ML ─────────── */
#ml-finish {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 14, .6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
#ml-finish.hidden { display: none; }
.ml-finish-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  max-width: 560px;
  width: calc(100% - 40px);
  box-shadow: var(--shadow-modal);
}
.ml-finish-card h4 { margin-bottom: 10px; font-size: 16px; }
.ml-finish-card p { color: var(--text-dim); font-size: 13px; line-height: 1.55; margin-bottom: 14px; }
.ml-finish-card code { background: var(--panel); padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.ml-finish-card form { display: flex; gap: 8px; flex-wrap: wrap; }
.ml-finish-card input {
  flex: 1 1 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 13px;
  outline: none;
}
.ml-finish-card input:focus { border-color: var(--accent); }

/* ─────────── Toast ─────────── */
#toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 13px;
  z-index: 99;
  animation: slideIn .2s ease;
}

/* ─────────── Responsivo ─────────── */
@media (max-width: 1100px) {
  #tab-office { flex-direction: column; overflow-y: auto; }
  #office-stage { flex: 0 0 560px; min-height: 560px; }
  #feed-panel { width: 100%; height: 330px; }
  #feed-list { min-height: 50px; }
  #agent-command-panel { flex-basis: 230px; }
  .ig-metrics { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .ig-layout { grid-template-columns: 1fr; }
  .orders-summary { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .detail-row { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .finance-summary { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
  .finance-content { grid-template-columns: 1fr; }
  .finance-panel-wide { grid-column: 1; }
  .finance-alerts { grid-template-columns: 1fr; }
  .cost-product-row { grid-template-columns: 42px minmax(180px, 1fr) 140px 125px 76px; }
  .cost-product-row .cost-price { display: none; }
  .product-facts,
  .product-finance-grid { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
  .shopee-summary { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
}

@media (max-width: 700px) {
  .notifications-panel {
    inset: 8px;
    width: auto;
    max-height: none;
  }
  #office-stage { flex-basis: auto; min-height: 0; }
  #office-wrap { flex: 0 0 auto; width: 100%; height: auto; aspect-ratio: 4 / 3; }
  #office-infographic { height: auto; min-height: 560px; padding: 15px; }
  .ig-head h2 { font-size: 20px; }
  .ig-metrics { grid-template-columns: 1fr 1fr; }
  .ig-metric { min-height: 92px; padding: 12px; }
  .ig-metric > strong { font-size: 17px; }
  .orders-toolbar,
  .orders-filterbar { align-items: flex-start; flex-direction: column; }
  .orders-dispatch { min-height: 0; grid-template-columns: 1fr; }
  .dispatch-total { min-height: 112px; padding: 18px 20px; border-right: 0; border-bottom: 1px solid var(--border); }
  .dispatch-channel { padding: 12px 14px; }
  .dispatch-channel strong { white-space: normal; }
  .orders-actions,
  .orders-filters { width: 100%; }
  .orders-filters { display: grid; grid-template-columns: 1fr 1fr; overflow: visible; }
  .orders-filters button { justify-content: center; width: 100%; }
  .orders-actions .btn { flex: 1; }
  .orders-full-note { text-align: left; }
  .orders-table { min-width: 0; overflow: visible; }
  .orders-table-head { display: none; }
  .order-row {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 13px 16px;
    padding: 14px;
  }
  .order-product { grid-column: 1 / -1; }
  .order-product-image { width: 56px; height: 56px; flex-basis: 56px; }
  .order-row-action { align-self: end; justify-content: flex-start; }
  .order-waiting-action { text-align: left; }
  .order-expanded {
    grid-template-columns: 1fr;
    gap: 18px;
    margin: 2px -14px -14px;
    padding: 15px 14px 18px;
  }
  .order-expanded-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #feed-panel { height: auto; min-height: 330px; flex: 1 1 auto; }
  #office-hint { display: none; }
  #topbar { gap: 5px; padding: 6px 8px; }
  .brand { min-height: 30px; }
  .brand-logo { font-size: 20px; }
  .brand-text strong { font-size: 13px; }
  .brand-text small { font-size: 9px; }
  .tabs { order: 2; width: 100%; overflow-x: auto; padding-bottom: 1px; }
  .tab-btn { flex: 0 0 auto; padding: 6px 10px; font-size: 12px; white-space: nowrap; }
  .controls { order: 3; width: 100%; margin-left: 0; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .controls > * { flex: 0 0 auto; }
  .controls .link-box,
  #pill-marketplace,
  #pill-viewers,
  #pill-lan { display: none; }
  .controls .btn { padding: 6px 10px; font-size: 11px; white-space: nowrap; }
  .pill { padding: 5px 8px; font-size: 10px; }
  .listings-grid { grid-template-columns: 1fr; }
  .auditor-search { flex: 1 1 100%; }
  .auditor-search input { min-width: 0; }
  #listing-filter-source { display: none; }
  .detail-row { grid-template-columns: 1fr; }
  .finance-summary { grid-template-columns: 1fr; }
  #ads-summary { grid-template-columns: 1fr; }
  .finance-period { justify-content: flex-start; width: 100%; }
  .finance-period label { flex: 1 1 140px; }
  .finance-period input { width: 100%; }
  .finance-toolbar { display: block; }
  .finance-period { margin-top: 9px; }
  .period-presets { width: 100%; }
  .period-btn { flex: 1; }
  .finance-subtabs { margin: 0 -12px; padding: 0 8px; }
  .finance-alert { grid-template-columns: 4px minmax(0, 1fr); }
  .finance-alert em { display: none; }
  .compare-group { grid-template-columns: 82px minmax(100px, 1fr) 60px; }
  .waterfall-row { grid-template-columns: 100px minmax(90px, 1fr) 85px; }
  .ads-product-row { grid-template-columns: minmax(180px, 1fr) repeat(2, 74px); }
  .ads-product-row .ads-stat:nth-child(4),
  .ads-product-row .ads-stat:nth-child(5) { display: none; }
  .costs-toolbar { align-items: flex-start; flex-direction: column; }
  .costs-actions { width: 100%; flex-wrap: wrap; }
  .costs-actions input { width: 100%; }
  .cost-product-row { grid-template-columns: 38px minmax(0, 1fr) 72px; }
  .cost-product-row .cost-price { display: none; }
  .cost-product-row .cost-thumb { grid-column: 1; grid-row: 1; }
  .cost-product-row .cost-product-title { grid-column: 2 / -1; grid-row: 1; }
  .cost-product-row .cost-field:nth-of-type(1) { grid-column: 2; grid-row: 2; }
  .cost-product-row .cost-field:nth-of-type(2) { grid-column: 2; grid-row: 3; }
  .cost-product-row .cost-save { grid-column: 3; grid-row: 2 / 4; align-self: stretch; }
  .cost-thumb { width: 38px; height: 38px; }
  .filter-group { width: 100%; flex-wrap: wrap; }
  .listing-editor-overlay { padding: 8px; }
  .listing-editor-dialog { max-height: calc(100vh - 16px); }
  .listing-editor-head { padding: 14px; }
  .listing-editor-modes { padding: 10px 14px 0; overflow-x: auto; }
  .listing-editor-modes button { flex: 0 0 auto; }
  .listing-editor-constraint { margin: 10px 14px 0; }
  .listing-editor-comparison { grid-template-columns: 1fr; padding: 14px; }
  .listing-editor-comparison > section:first-child { padding: 0 0 14px; border-right: 0; border-bottom: 1px solid var(--border); }
  .listing-editor-comparison > section:last-child { padding: 14px 0 0; }
  .listing-editor-current, #listing-editor-value { min-height: 180px; max-height: 280px; }
  .listing-editor-approval { padding: 12px 14px; }
  .listing-editor-actions { padding: 10px 14px 14px; flex-wrap: wrap; }
  .product-dialog-overlay { padding: 8px; }
  .product-dialog { max-height: calc(100vh - 16px); }
  .product-dialog-head { padding: 11px; align-items: flex-start; }
  .product-dialog-head > img { width: 48px; height: 48px; flex-basis: 48px; }
  .product-dialog-head h3 { font-size: 14px; }
  .product-dialog-scroll { padding: 0 12px 12px; }
  .product-section-head { align-items: flex-start; }
  .product-facts,
  .product-finance-grid { grid-template-columns: 1fr 1fr; }
  .product-fact { min-height: 64px; }
  #tab-shopee { padding: 9px; }
  .shopee-toolbar { align-items: flex-start; }
  .shopee-actions { width: 100%; }
  .shopee-config-form { grid-template-columns: 1fr; }
  .shopee-config-form > * { grid-column: 1; }
  .shopee-domain-guide { grid-template-columns: 1fr; }
  .shopee-domain-guide > div { flex-wrap: wrap; }
  .shopee-domain-guide small { grid-column: 1; }
  .shopee-finish { grid-template-columns: 1fr; }
  .shopee-finish > * { grid-column: 1; }
  .shopee-period-bar { justify-content: flex-start; }
  .shopee-presets { width: 100%; }
  .shopee-presets button { flex: 1; }
  .shopee-period-bar label { flex: 1 1 130px; }
  .shopee-period-bar input { width: 100%; }
  .shopee-summary { grid-template-columns: 1fr 1fr; }
  .shopee-grid { grid-template-columns: 1fr; }
  .shopee-panel-wide { grid-column: 1; }
  .shopee-listing-row { grid-template-columns: 34px minmax(0, 1fr) 72px; }
  .shopee-listing-row .shopee-listing-stock,
  .shopee-listing-row .shopee-listing-status { display: none; }
  #shopee-unavailable-list { grid-template-columns: 1fr; }
  #shopee-unavailable-list > div { padding: 0 0 7px; border-right: 0; border-bottom: 1px solid var(--border); }
  #shopee-unavailable-list > div:last-child { padding-bottom: 0; border-bottom: 0; }
}

/* Saúde consolidada dos marketplaces */
.ecommerce-health {
  min-width: 0;
  overflow: visible;
}
.health-chart-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: 276px;
}
.health-card {
  min-width: 0;
  padding: 16px 17px 18px;
  border-right: 1px solid var(--border);
  background: var(--panel);
}
.health-card:last-child { border-right: 0; }
.health-card > header {
  min-height: 45px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.health-card h4 {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.3;
}
.health-card header span {
  display: block;
  margin-top: 4px;
  color: var(--text-dim);
  font-size: 9px;
}
.health-donut-layout {
  min-height: 185px;
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}
.health-donut {
  width: 116px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--ok) 0 var(--health-share), #e9edf3 var(--health-share) 100%);
  position: relative;
}
.health-donut::after {
  content: '';
  position: absolute;
  width: 76px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--panel);
}
.health-donut > div {
  position: relative;
  z-index: 1;
  display: grid;
  text-align: center;
}
.health-donut strong { font-size: 21px; line-height: 1; }
.health-donut span { margin-top: 5px; color: var(--text-dim); font-size: 9px; }
.health-legend { display: grid; gap: 11px; }
.health-legend-row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  color: var(--text-dim);
  font-size: 9px;
}
.health-legend-row i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}
.health-legend-row i.good { background: var(--ok); }
.health-legend-row i.bad { background: var(--crit); }
.health-legend-row strong { color: var(--text); font-size: 10px; }
.health-bars { display: grid; gap: 10px; padding-top: 7px; }
.health-bar-row { display: grid; gap: 5px; }
.health-bar-row > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-dim);
  font-size: 9px;
}
.health-bar-row strong { color: var(--text); font-size: 10px; }
.health-bar-row.unavailable strong { color: #8d98aa; font-size: 8px; font-weight: 650; }
.health-bar-track {
  height: 7px;
  overflow: hidden;
  border-radius: 2px;
  background: #edf1f6;
}
.health-bar-track i { display: block; height: 100%; border-radius: inherit; }
.health-bar-track i.neutral { background: #4776d9; }
.health-bar-track i.good { background: var(--ok); }
.health-bar-track i.bad { background: var(--crit); }
.health-bar-track i.warning { background: var(--warn); }
.health-bar-row.unavailable .health-bar-track {
  background: repeating-linear-gradient(90deg, #e8edf4 0 5px, transparent 5px 9px);
}
.health-refund {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.health-refund span { color: var(--text-dim); font-size: 9px; }
.health-refund strong { color: var(--crit); font-size: 13px; }
.health-refund.unavailable strong { color: #8d98aa; font-size: 9px; }
.health-ladder { display: grid; gap: 10px; padding-top: 10px; }
.health-ladder-row {
  width: var(--ladder-width);
  min-height: 39px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-left: 4px solid;
  background: #f5f7fa;
}
.health-ladder-row span { min-width: 0; color: var(--text-dim); font-size: 9px; }
.health-ladder-row strong { flex: 0 0 auto; font-size: 10px; }
.health-ladder-row.good { border-color: var(--ok); background: #edf8f2; }
.health-ladder-row.bad { border-color: var(--crit); background: #fff1f3; }
.health-ladder-row.unknown { border-color: #8794a8; }
.health-ladder p { color: var(--text-dim); font-size: 8.5px; line-height: 1.45; }
.health-ads { min-height: 190px; display: flex; flex-direction: column; justify-content: center; gap: 20px; }
.health-ads-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.health-ads-values > div:last-child { grid-column: 1 / -1; }
.health-ads-values span { display: block; color: var(--text-dim); font-size: 9px; }
.health-ads-values strong { display: block; margin-top: 4px; font-size: 16px; }
.health-ads-values > div:last-child strong { color: var(--info); font-size: 20px; }
.health-ads-bars { display: grid; gap: 7px; }
.health-ads-bars i { display: block; height: 9px; min-width: 2px; border-radius: 2px; }
.health-ads-bars .spend { background: var(--warn); }
.health-ads-bars .revenue { background: var(--ok); }
.health-unavailable-state {
  display: grid;
  min-height: 150px;
  place-items: center;
  color: var(--text-dim);
  font-size: 10px;
  text-align: center;
}
.health-warnings {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 9px 16px;
  border-top: 1px solid var(--border);
  background: #fff8ed;
  color: #8a5508;
  font-size: 8.5px;
}

@media (max-width: 1450px) {
  .health-chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .health-card { border-bottom: 1px solid var(--border); }
  .health-card:nth-child(2n) { border-right: 0; }
  .health-card:nth-last-child(-n + 2) { border-bottom: 0; }
}

@media (max-width: 760px) {
  .health-chart-grid { grid-template-columns: minmax(0, 1fr); }
  .health-card,
  .health-card:nth-child(2n) { border-right: 0; border-bottom: 1px solid var(--border); }
  .health-card:last-child { border-bottom: 0; }
  .health-donut-layout { grid-template-columns: 105px minmax(0, 1fr); }
  .health-donut { width: 104px; }
  .health-donut::after { width: 68px; }
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #2c3444; border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 1450px) and (min-width: 701px) {
  .notifications-panel { top: 112px; max-height: calc(100vh - 126px); }
  #topbar { gap: 10px; }
  #pill-marketplace,
  #pill-viewers { display: none; }
  .controls { width: 100%; margin-left: 0; flex-wrap: nowrap; }
  .controls > * { flex: 0 0 auto; }
  .controls .link-box { flex: 1 1 210px; max-width: 260px; }
  .controls .link-box input { width: 100%; }
  .controls .link-box input:focus { width: 100%; }
}

/* ─────────── Refinamento visual claro e profissional ─────────── */
main { background: var(--bg); }
input,
textarea,
select { color-scheme: light; }

#tab-office,
#tab-orders,
#tab-kanban,
#tab-listings,
#tab-finance,
#tab-shopee { padding: 16px; }

#feed-panel,
.kanban-col,
.listing-card,
.finance-panel,
.finance-metric,
.shopee-panel,
.shopee-metric,
.audit-table-shell,
.escalia-table,
.ig-ranking-panel,
.ig-pulse-panel,
.ig-leo-panel {
  box-shadow: var(--shadow-1);
}
#feed-panel h3,
.kanban-col h4,
.finance-panel h3,
.shopee-panel-head { background: var(--panel); }
.feed-item { background: #f8fafc; }
.feed-item.sev-critical { background: #fff1f3; }
#agent-command-panel { background: var(--panel); }
.agent-command-head { background: var(--panel-2); }
.agent-chat-entry.user { background: #fff6e8; }
.agent-confirm-card { background: #fff7ed; border-color: #f2c98e; }
.agent-confirm-card p { color: #864d17; }
#agent-command-input { background: var(--panel-2); color: var(--text); }
#agent-command-form button { color: #fff; }

.filter-btn.active {
  color: #1d4ed8;
  background: var(--accent-soft);
  border-color: #b9d0ff;
}
.kanban-col { border-top: 3px solid var(--info); }
.kanban-col[data-status="todo"] { border-top-color: var(--warn); }
.kanban-col[data-status="doing"] { border-top-color: var(--crit); }
.kanban-col[data-status="done"] { border-top-color: var(--ok); }
.kanban-col h4 { padding: 12px 14px; }
.kanban-card { background: var(--panel); box-shadow: var(--shadow-1); transition: box-shadow .16s ease, transform .16s ease; }
.kanban-card:hover:not(.dragging) { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.card-edit-btn { border-color: #bad3f2; background: #edf6fd; color: #1769aa; }

.listing-filters,
.listings-toolbar { background: var(--bg); }
.listing-filter.active { color: #1d4ed8; border-color: #9fbdff; background: var(--accent-soft); }
.listing-filter:hover { border-color: #9aa8bc; }
.listing-card { transition: border-color .16s, box-shadow .16s, background .16s; }
.listing-card:hover,
.listing-card:focus-visible { border-color: #a9bddb; box-shadow: var(--shadow-2); }
.listing-title-wrap {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.listing-title { width: 100%; }
.listing-full-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 3px 7px;
  border: 1px solid #b8d3fb;
  border-radius: 5px;
  color: #155aa4;
  background: #edf6ff;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
}
.listing-full-badge span { font-size: 12px; }
.tabs .tab-shopee-btn { display: grid; }
.tabs .tab-shopee-btn .shopee-mark { width: 26px; height: 26px; margin-right: 0; }
.overall.good { background: #eaf8f0; }
.overall.mid { background: #fff6e8; }
.overall.bad { background: #fff0f2; }
.open-tasks-badge { color: #9a5b09; background: #fff6e8; border-color: #f1d2a2; }
.open-tasks-badge.zero { color: #107448; background: #eaf8f0; border-color: #b8dfca; }
.detail-link { border-color: #b8d3fb; background: #edf6ff; }

.period-btn.active { background: var(--accent-soft); color: #1d4ed8; }
.finance-error { border-color: #efb5bd; color: #b42334; background: #fff1f3; }
.finance-metric.positive { border-color: #b8dfca; }
.finance-metric.negative { border-color: #efb5bd; }
.finance-metric.warning { border-color: #f1d2a2; }
.finance-metric .metric-delta.up,
.compare-delta.up { color: #168a55; }
.finance-metric .metric-delta.down,
.compare-delta.down { color: #d83b4c; }
.gs-filter-btn.active { background: var(--accent-soft); color: #1d4ed8; }
.gs-campaign-growth { color: #168a55; }
.compare-track,
.waterfall-track,
.shopee-timeline-track,
.shopee-status-row > div { background: #edf1f6; }
.billing-note,
.shopee-config-note { background: #edf6ff; }
.shopee-loading { background: var(--panel-2); }
.shopee-error { color: #b42334; border-color: #efb5bd; background: #fff1f3; }
.shopee-domain-guide { border-color: #f2b9ac; background: #fff4f1; }
.shopee-finish { background: var(--panel-2); }
.shopee-config-form input,
.shopee-finish input,
.shopee-period-bar input { color-scheme: light; }
.product-operation-state.error { color: #b42334; background: #fff1f3; }
.product-operation-state.ok { color: #107448; background: #eaf8f0; }
.product-operation-state.warning { color: #9a5b09; background: #fff6e8; }
.listing-editor-current,
#listing-editor-value,
.product-content-tab.active { background: var(--panel-2); }
.metric-help-tooltip,
.metric-help-popover { background: #fff; color: #263247; border-color: #cbd5e1; box-shadow: var(--shadow-3); }
::-webkit-scrollbar-thumb { background: #c3ccd9; }

@media (max-width: 1450px) and (min-width: 901px) {
  #topbar { gap: 12px; flex-wrap: nowrap; }
  .controls { width: auto; margin-left: auto; flex-wrap: nowrap; }
  .controls .link-box { display: none; }
  .notifications-panel { top: 82px; max-height: calc(100vh - 100px); }
}

@media (max-width: 900px) {
  body {
    grid-template-columns: 1fr;
    grid-template-rows: 66px minmax(0, 1fr);
  }
  #sidebar {
    min-width: 0;
    min-height: 66px;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-right: 0;
    border-bottom: 1px solid #273247;
  }
  .brand {
    min-height: 48px;
    flex: 0 0 auto;
    padding: 0 10px 0 2px;
    border-right: 1px solid #2a3549;
    border-bottom: 0;
  }
  .brand-logo { width: 38px; height: 38px; flex-basis: 38px; }
  .brand-text strong { font-size: 11px; }
  .brand-text small { display: none; }
  .tabs {
    min-width: 0;
    flex: 1;
    flex-direction: row;
    gap: 4px;
    margin-top: 0;
    overflow-x: auto;
  }
  .tab-btn {
    width: auto;
    min-width: 48px;
    min-height: 46px;
    grid-template-columns: 26px auto auto;
    flex: 0 0 auto;
    padding: 6px 8px;
    white-space: nowrap;
  }
  .sidebar-status { display: none; }
  #topbar { min-height: 62px; padding: 8px 12px; gap: 8px; }
  .topbar-heading { min-width: 130px; }
  .topbar-heading strong { font-size: 16px; }
  .topbar-heading span { display: none; }
  .controls { width: auto; margin-left: auto; flex-wrap: nowrap; overflow-x: auto; }
  .controls .link-box,
  #btn-ml { display: none; }
  #btn-sync,
  #btn-analyze {
    width: 36px;
    height: 34px;
    padding: 0;
    font-size: 0;
  }
  #btn-sync::before { content: "↻"; font-size: 17px; }
  #btn-analyze::before { content: "▶"; font-size: 12px; }
  .switch-label { display: none; }
  #tab-office,
  #tab-orders,
  #tab-kanban,
  #tab-listings,
  #tab-finance,
  #tab-shopee { padding: 10px; }
  .notifications-panel { top: 136px; right: 8px; width: calc(100vw - 16px); max-height: calc(100vh - 144px); }
}

@media (max-width: 620px) {
  body { grid-template-rows: 62px minmax(0, 1fr); }
  #sidebar { min-height: 62px; }
  .brand-text { display: none; }
  .brand { padding-right: 6px; }
  .tab-btn { position: relative; grid-template-columns: 26px auto; }
  .tab-btn > span:nth-child(2) { display: none; }
  .tab-btn .badge { position: absolute; top: 1px; right: 1px; min-width: 18px; padding: 1px 4px; }
  .topbar-heading { min-width: 105px; }
  .topbar-heading strong { font-size: 14px; }
  .notification-filter-group { grid-template-columns: 1fr; gap: 4px; }
  .shipping-summary > .shipping-channels { grid-template-columns: repeat(3, minmax(92px, 1fr)); overflow-x: auto; }
  .shipping-summary > .shipping-stages { grid-template-columns: repeat(4, minmax(76px, 1fr)); overflow-x: auto; }
  .notifications-panel { top: 130px; max-height: calc(100vh - 138px); }
}

/* Listas operacionais empilhadas */
.listings-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
  overflow-x: hidden;
}
.listing-card {
  flex: 0 0 auto;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 11px 13px;
}
.listing-card:last-child { border-bottom: 0; }
.listing-card:hover,
.listing-card:focus-visible { background: var(--panel-2); }
.listing-card.expanded { background: var(--panel); }
.detail-row { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.audit-chip {
  padding: 3px 7px;
  border: 1px solid #b8c5d8;
  border-radius: 5px;
  color: #42526a;
  background: #edf2f8;
  font-size: 9px;
  font-weight: 800;
}

.shopee-products,
.shopee-stock-table {
  padding: 0;
}
.shopee-product-stack {
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.shopee-product-stack:last-child { border-bottom: 0; }
.shopee-product-stack.expanded { border-left: 3px solid #ee4d2d; }
.shopee-listing-row {
  min-width: 1040px;
  grid-template-columns: 42px minmax(280px, 1.6fr) 100px 110px 90px 100px 82px 24px;
  gap: 10px;
  cursor: pointer;
}
.shopee-listing-row:hover { background: #f8fafc; }
.shopee-listing-row:focus {
  outline: 2px solid #ee806a;
  outline-offset: -2px;
}
.shopee-listing-title,
.shopee-listing-title strong,
.shopee-listing-title span {
  min-width: 0;
  display: block;
}
.shopee-listing-title strong {
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shopee-listing-title span {
  margin-top: 3px;
  overflow: hidden;
  color: var(--text-dim);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shopee-listing-price,
.shopee-listing-sales,
.shopee-listing-stock,
.shopee-listing-quality,
.shopee-listing-status {
  font-size: 10px;
  text-align: right;
}
.shopee-listing-sales,
.shopee-listing-stock { color: var(--text-dim); }
.shopee-listing-stock.zero,
.shopee-listing-quality.bad { color: var(--crit); font-weight: 800; }
.shopee-listing-quality.good { color: var(--ok); font-weight: 800; }
.shopee-listing-quality.mid { color: #9a5b09; font-weight: 800; }
.shopee-row-chevron {
  color: #6b778c;
  font-size: 16px;
  text-align: center;
}
.shopee-product-detail {
  padding: 0 13px 14px 65px;
  background: #fbfcfe;
}
.shopee-product-facts {
  display: grid;
  grid-template-columns: repeat(5, minmax(135px, 1fr));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.shopee-product-facts > div {
  min-height: 86px;
  padding: 13px 14px;
  border-right: 1px solid var(--border);
}
.shopee-product-facts > div:last-child { border-right: 0; }
.shopee-product-facts span,
.shopee-product-facts strong,
.shopee-product-facts small { display: block; }
.shopee-product-facts span { color: var(--text-dim); font-size: 9px; }
.shopee-product-facts strong { margin-top: 7px; font-size: 15px; }
.shopee-product-facts small { margin-top: 4px; color: var(--text-dim); font-size: 8px; line-height: 1.35; }
.shopee-detail-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  padding-top: 11px;
}
.shopee-detail-actions > span {
  flex: 1 1 auto;
  color: var(--text-dim);
  font-size: 9px;
}
.shopee-inline-editor {
  flex: 1 0 100%;
  min-width: 0;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.shopee-editor-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.2fr) minmax(230px, .8fr) minmax(230px, .8fr);
}
.shopee-editor-grid > section {
  min-width: 0;
  padding: 0 14px;
  border-right: 1px solid var(--border);
}
.shopee-editor-grid > section:first-child { padding-left: 0; }
.shopee-editor-grid > section:last-child { border-right: 0; padding-right: 0; }
.shopee-editor-head { margin-bottom: 9px; }
.shopee-editor-head strong,
.shopee-editor-head span { display: block; }
.shopee-editor-head strong { font-size: 11px; }
.shopee-editor-head span { margin-top: 2px; color: var(--text-dim); font-size: 8.5px; }
.shopee-editor-grid label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-dim);
  font-size: 8.5px;
  font-weight: 750;
}
.shopee-editor-grid input,
.shopee-editor-grid textarea {
  width: 100%;
  margin-top: 4px;
  padding: 8px 9px;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  background: #fff;
  font: inherit;
  outline: none;
}
.shopee-editor-grid input:focus,
.shopee-editor-grid textarea:focus { border-color: #ee806a; }
.shopee-editor-grid textarea { min-height: 112px; resize: vertical; line-height: 1.45; }
.shopee-model-stock {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 82px;
  align-items: center;
  gap: 8px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border);
}
.shopee-model-stock span,
.shopee-model-stock strong,
.shopee-model-stock small { display: block; min-width: 0; }
.shopee-model-stock strong {
  overflow: hidden;
  color: var(--text);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shopee-model-stock small { margin-top: 2px; color: var(--text-dim); font-size: 8px; }
.shopee-current-images {
  display: grid;
  grid-template-columns: repeat(5, 42px);
  gap: 5px;
  margin-bottom: 9px;
}
.shopee-current-images img {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 4px;
  object-fit: cover;
}
.shopee-photo-input {
  padding: 9px;
  border: 1px dashed #b9c3d2;
  border-radius: 5px;
  background: #f8fafc;
}
.shopee-photo-input input { padding: 0; border: 0; background: transparent; }
.shopee-listing-row.stock-context {
  min-width: 0;
  grid-template-columns: 42px minmax(180px, 1fr) 82px 24px;
}
.shopee-listing-row.stock-context .shopee-listing-price,
.shopee-listing-row.stock-context .shopee-listing-sales,
.shopee-listing-row.stock-context .shopee-listing-quality,
.shopee-listing-row.stock-context .shopee-listing-status { display: none; }
.shopee-stock-layout.active { grid-template-columns: 1fr; }
.shopee-stock-layout .shopee-panel { grid-column: 1; }
.shopee-stock-layout .shopee-product-detail { padding-left: 13px; }
.shopee-order-tabs {
  display: flex;
  gap: 5px;
  overflow-x: auto;
}
.shopee-order-tabs button {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-dim);
  background: var(--panel);
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
}
.shopee-order-tabs button.active {
  border-color: #ee4d2d;
  color: #a9321c;
  background: #fff5f2;
}
.shopee-order-tabs button span {
  margin-left: 4px;
  padding: 2px 5px;
  border-radius: 999px;
  background: #e9eef5;
}
.shopee-order-products { min-width: 0; }
.shopee-order-items {
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}
.shopee-order-items > div { margin-top: 3px; }
.shopee-order-items span,
.shopee-order-items small { display: block; }
.shopee-order-items span { font-size: 9px; }
.shopee-order-items small { margin-top: 1px; color: var(--text-dim); font-size: 8px; }
.shopee-order-actions { margin-top: 7px; }
.shopee-invoice-link { min-height: 30px; padding: 5px 8px; font-size: 9px; }
.create-listing-page {
  flex-direction: column;
  gap: 14px;
  padding: 24px;
}
.create-listing-page > header { max-width: 760px; }
.create-listing-page > header > span {
  color: var(--ok);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}
.create-listing-page h2 { margin-top: 5px; font-size: 24px; }
.create-listing-page p { margin-top: 7px; color: var(--text-dim); font-size: 11px; line-height: 1.55; }
.create-listing-workspace {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 940px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.create-listing-workspace strong { font-size: 14px; }
.create-listing-checks {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 1px;
  max-width: 940px;
  border: 1px solid var(--border);
  background: var(--border);
}
.create-listing-checks span {
  min-height: 54px;
  display: flex;
  align-items: center;
  padding: 10px;
  color: var(--text-dim);
  background: var(--panel);
  font-size: 9px;
  font-weight: 750;
}
.shopee-create-page { padding: 14px 2px; }

@media (max-width: 1180px) {
  .shopee-product-facts { grid-template-columns: repeat(3, minmax(135px, 1fr)); }
  .shopee-product-facts > div:nth-child(3) { border-right: 0; }
  .shopee-editor-grid { grid-template-columns: 1fr 1fr; row-gap: 18px; }
  .shopee-editor-grid > section:nth-child(2) { border-right: 0; }
  .shopee-editor-grid > section:last-child { grid-column: 1 / -1; padding-left: 0; }
}

@media (max-width: 700px) {
  .listings-grid { border-left: 0; border-right: 0; border-radius: 0; }
  .listing-card { padding: 10px; }
  .shopee-product-detail { padding: 0 9px 12px; }
  .shopee-product-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shopee-product-facts > div { min-height: 78px; padding: 10px; }
  .shopee-product-facts > div:nth-child(2n) { border-right: 0; }
  .shopee-editor-grid { grid-template-columns: 1fr; }
  .shopee-editor-grid > section,
  .shopee-editor-grid > section:first-child,
  .shopee-editor-grid > section:last-child {
    grid-column: 1;
    padding: 12px 0;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .shopee-listing-row {
    min-width: 680px;
    grid-template-columns: 36px minmax(210px, 1fr) 86px 86px 76px 24px;
  }
  .shopee-listing-row .shopee-listing-sales,
  .shopee-listing-row .shopee-listing-quality { display: none; }
  .shopee-listing-row.stock-context { min-width: 0; }
  .create-listing-page { padding: 16px 10px; }
  .create-listing-workspace { align-items: flex-start; flex-direction: column; }
  .create-listing-checks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Auditoria unificada por marketplace */
#tab-audit {
  min-height: 0;
  flex-direction: column;
  overflow: auto;
}
.audit-page {
  width: 100%;
  min-height: 100%;
  padding: 18px;
}
.audit-page-shopee { padding: 4px 0 20px; }

/* ── Dashboard de pontuação (Conteúdo + Operações) no topo da Auditoria ── */
.audit-scoreboard {
  display: grid;
  grid-template-columns: auto 220px 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
}
.audit-scoreboard-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  padding: 10px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
}
.audit-scoreboard-score strong { font-size: 32px; line-height: 1; }
.audit-scoreboard-score span { margin-top: 1px; font-size: 10px; color: var(--text-dim); }
.audit-scoreboard-score small { margin-top: 5px; font-size: 9.5px; font-weight: 800; text-transform: uppercase; }
.audit-scoreboard-score.good { border-color: var(--ok); }
.audit-scoreboard-score.good strong { color: var(--ok); }
.audit-scoreboard-score.mid { border-color: var(--warn); }
.audit-scoreboard-score.mid strong { color: var(--warn); }
.audit-scoreboard-score.bad { border-color: var(--crit); }
.audit-scoreboard-score.bad strong { color: var(--crit); }
.audit-scoreboard-score.muted strong { color: var(--text-dim); }
.audit-scoreboard-bars { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.audit-scoreboard-bar { display: grid; grid-template-columns: 62px 1fr 26px; align-items: center; gap: 8px; }
.audit-scoreboard-bar span { color: var(--text-dim); font-size: 10.5px; }
.audit-scoreboard-bar strong { font-size: 11.5px; text-align: right; }
.audit-scoreboard-track { height: 8px; background: var(--panel-2); border-radius: 999px; overflow: hidden; }
.audit-scoreboard-track i { display: block; height: 100%; border-radius: inherit; }
.audit-scoreboard-track i.good { background: var(--ok); }
.audit-scoreboard-track i.mid { background: var(--warn); }
.audit-scoreboard-track i.bad { background: var(--crit); }
.audit-scoreboard-track i.muted { background: var(--border); }
.audit-scoreboard-counts {
  grid-column: 1 / span 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 10px;
  font-weight: 700;
}
.audit-scoreboard-counts .bad { color: var(--crit); }
.audit-scoreboard-counts .mid { color: var(--warn); }
.audit-scoreboard-counts .good { color: var(--ok); }
.audit-scoreboard-counts .muted { color: var(--text-dim); }
.audit-scoreboard-alerts { grid-column: 3; grid-row: 1 / span 2; min-width: 0; }
.audit-scoreboard-alerts > strong { display: block; margin-bottom: 8px; font-size: 12px; }
.audit-alerts-list { display: flex; flex-direction: column; gap: 6px; max-height: 168px; overflow-y: auto; }
.audit-alerts-empty { color: var(--text-dim); font-size: 11px; }
.audit-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: 6px;
  background: var(--panel-2);
  text-align: left;
  cursor: pointer;
}
.audit-alert:hover { border-color: #aab7ca; background: var(--panel); }
.audit-alert.critical { border-left-color: var(--crit); }
.audit-alert.warning { border-left-color: var(--warn); }
.audit-alert strong { display: block; font-size: 11px; }
.audit-alert small { display: block; margin-top: 2px; color: var(--text-dim); font-size: 10px; line-height: 1.4; }
.audit-alert-action { flex: 0 0 auto; color: var(--accent); font-size: 9px; font-weight: 700; text-align: right; white-space: nowrap; }
.audit-score-cell { justify-content: center; }
.audit-score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 26px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}
.audit-score-badge.good { color: var(--ok); background: #eaf8f0; }
.audit-score-badge.mid { color: var(--warn); background: #fff6e8; }
.audit-score-badge.bad { color: var(--crit); background: #fff0f2; }
.audit-score-badge.muted { color: var(--text-dim); background: var(--panel-2); }
@media (max-width: 900px) {
  .audit-scoreboard { grid-template-columns: 1fr; }
  .audit-scoreboard-alerts { grid-column: 1; grid-row: auto; }
}

.audit-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}
.audit-page-head h2 { margin-top: 4px; font-size: 22px; }
.audit-page-head p {
  margin-top: 5px;
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.45;
}
.audit-period {
  min-height: 54px;
  display: flex;
  align-items: end;
  gap: 10px;
  margin-bottom: 12px;
  padding: 9px 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.audit-period-presets { display: flex; align-items: center; gap: 1px; }
.audit-period-presets button {
  height: 36px;
  padding: 0 11px;
  color: var(--text-dim);
  background: #f7f9fc;
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 9px;
  font-weight: 750;
}
.audit-period-presets button:first-child { border-radius: 6px 0 0 6px; }
.audit-period-presets button:last-child { border-radius: 0 6px 6px 0; }
.audit-period-presets button:hover { color: var(--text); background: #eef3fb; }
.audit-period-presets button.active { color: #fff; background: var(--accent); border-color: var(--accent); }
.audit-period > label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text-dim);
  font-size: 8px;
  font-weight: 750;
}
.audit-period input {
  width: 140px;
  height: 36px;
  padding: 0 9px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  font-size: 9px;
}
.audit-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  overflow: hidden;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  gap: 1px;
}
.audit-metric {
  min-height: 104px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 14px;
  background: var(--panel);
}
.audit-metric > span {
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 700;
}
.audit-metric > strong { margin-top: 5px; font-size: 22px; line-height: 1; }
.audit-metric > small {
  margin-top: 7px;
  color: #6b788b;
  font-size: 9px;
  line-height: 1.35;
}
.audit-ads-strip {
  min-height: 66px;
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 180px)) minmax(220px, 1fr);
  align-items: center;
  gap: 18px;
  margin-top: 12px;
  padding: 11px 14px;
  background: #f0f8f4;
  border: 1px solid #b9dfcc;
  border-left: 4px solid var(--ok);
  border-radius: var(--radius);
}
.audit-ads-strip > div { display: flex; flex-direction: column; gap: 3px; }
.audit-ads-strip span { color: #4f675c; font-size: 9px; font-weight: 750; text-transform: uppercase; }
.audit-ads-strip strong { font-size: 15px; }
.audit-ads-strip p { color: #526b60; font-size: 10px; line-height: 1.45; }
.audit-ads-strip.unavailable {
  grid-template-columns: minmax(200px, 320px) 1fr;
  background: #fff8ed;
  border-color: #f1d5a7;
  border-left-color: var(--warn);
}
.audit-ads-strip.unavailable span,
.audit-ads-strip.unavailable p { color: #76592e; }
.audit-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 14px 0 10px;
}
.audit-search {
  width: min(380px, 100%);
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--text-dim);
  font-size: 9px;
  font-weight: 750;
}
.audit-search input,
.audit-cost-editor input {
  min-width: 0;
  height: 38px;
  padding: 0 11px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 7px;
  outline: none;
}
.audit-search input:focus,
.audit-cost-editor input:focus {
  border-color: #7ea5f5;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}
.audit-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  overflow: visible;
  padding: 1px;
}
.audit-filters button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  white-space: nowrap;
  color: var(--text-dim);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
}
.audit-filters button:hover { color: var(--text); border-color: #aab7ca; }
.audit-filters button.active { color: #174fb9; background: var(--accent-soft); border-color: #8fb1f4; }
.audit-filters button span {
  min-width: 19px;
  padding: 2px 5px;
  color: inherit;
  background: rgba(82, 97, 118, .09);
  border-radius: 10px;
  text-align: center;
}
.audit-table-shell {
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.audit-table-head {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 14px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
}
.audit-table-head > div { display: flex; flex-direction: column; gap: 3px; }
.audit-table-head strong { font-size: 12px; }
.audit-table-head span { color: var(--text-dim); font-size: 9px; line-height: 1.4; }
.audit-table { overflow: auto; }
.audit-columns,
.audit-row-main {
  min-width: 960px;
  display: grid;
  grid-template-columns: minmax(260px, 1.65fr) 64px 110px 110px 140px 130px 24px;
  align-items: center;
  gap: 12px;
}
.audit-columns {
  min-height: 34px;
  padding: 0 14px;
  color: #69778b;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}
.audit-row { min-width: 900px; border-bottom: 1px solid var(--border); }
.audit-row:last-child { border-bottom: 0; }
.audit-row-main {
  width: 100%;
  min-height: 96px;
  position: relative;
  padding: 10px 14px;
  color: var(--text);
  background: var(--panel);
  border: 0;
  cursor: pointer;
  text-align: left;
}
.audit-row-main:hover { background: #f8fafc; }
.audit-row.expanded .audit-row-main { background: #f5f8fd; }
.audit-product {
  min-width: 0;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}
.audit-product img,
.audit-product-placeholder {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.audit-product > span:last-child { min-width: 0; }
.audit-product strong {
  display: block;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.audit-row.has-ads .audit-product strong::before {
  content: "\26A1";
  display: inline-block;
  margin-right: 5px;
  color: #e79b00;
  font-size: 13px;
  vertical-align: -1px;
}
.audit-product small,
.audit-cell small {
  display: block;
  margin-top: 4px;
  color: var(--text-dim);
  font-size: 8.5px;
  line-height: 1.35;
}
.audit-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.audit-flag {
  padding: 2px 6px;
  color: #5c6574;
  background: #eef1f5;
  border-radius: 4px;
  font-size: 7.5px;
  font-weight: 750;
}
.audit-flag.flag-ads_loss,
.audit-flag.flag-low_margin { color: #a52738; background: #fdebed; }
.audit-flag.flag-zero_stock_two_months { color: #9a5500; background: #fff1dc; }
.audit-cell { min-width: 0; }
.audit-cell > strong { display: block; font-size: 11px; line-height: 1.3; }
.audit-cell .negative,
.negative { color: var(--crit); }
.audit-cell .positive,
.positive { color: var(--ok); }
.audit-cell .muted,
.muted { color: #7a8799; }
.audit-expand { color: #69778b; font-size: 16px; text-align: center; }
.audit-details { padding: 0 16px 18px; background: #f5f8fd; }
.audit-details-header {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 2px;
}
.audit-details-header p,
.audit-link-unavailable { color: var(--text-dim); font-size: 9px; }
.audit-product-link {
  flex: 0 0 auto;
  color: #0b58d8;
  font-size: 9px;
  font-weight: 700;
  text-decoration: none;
}
.audit-product-link:hover { text-decoration: underline; }
.audit-breakdown {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  overflow: hidden;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 7px;
  gap: 1px;
}
.audit-breakdown-mercadolivre { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
.audit-breakdown > div {
  min-height: 68px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px;
  background: var(--panel);
}
.audit-breakdown span { color: var(--text-dim); font-size: 8px; }
.audit-label-help {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.audit-label-help .metric-help {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  font-size: 9px;
}
.audit-breakdown strong { margin-top: 5px; font-size: 11px; }
.audit-breakdown-total { grid-column: 1 / -1; border-top: 3px solid var(--accent); }
.audit-evidence { padding: 11px 2px 5px; }
.audit-evidence p { color: var(--text-dim); font-size: 9.5px; line-height: 1.5; }
.audit-evidence p + p { margin-top: 3px; }
.audit-evidence strong { color: var(--text); }
.audit-evidence .audit-loss-note { color: #9e2938; }
.audit-profitability-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  margin-bottom: 10px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 7px;
  gap: 1px;
}
.audit-profitability-summary > div {
  min-height: 68px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 12px;
  background: var(--panel);
}
.audit-profitability-summary span { color: var(--text-dim); font-size: 8px; }
.audit-profitability-summary strong { margin-top: 5px; font-size: 12px; }
.audit-profitability-summary small { margin-top: 3px; color: var(--text-dim); font-size: 8px; }
.audit-payout-panel {
  margin-bottom: 10px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #c9d6e8;
  border-radius: 7px;
}
.audit-payout-panel > header {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.audit-payout-panel > header > div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.audit-payout-panel > header strong { font-size: 11px; }
.audit-payout-panel > header small { color: var(--text-dim); font-size: 8px; line-height: 1.45; }
.audit-local-toggle {
  min-width: 176px;
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 9px;
  color: var(--text);
  cursor: pointer;
}
.audit-local-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.audit-local-toggle > span {
  width: 38px;
  height: 22px;
  position: relative;
  display: block;
  background: #94a3b8;
  border-radius: 11px;
  transition: background .16s ease;
}
.audit-local-toggle > span::after {
  content: '';
  width: 16px;
  height: 16px;
  position: absolute;
  top: 3px;
  left: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .25);
  transition: transform .16s ease;
}
.audit-local-toggle input:checked + span { background: var(--ok); }
.audit-local-toggle input:checked + span::after { transform: translateX(16px); }
.audit-local-toggle input:focus-visible + span { outline: 2px solid #1d4ed8; outline-offset: 2px; }
.audit-local-toggle > strong { font-size: 9px; white-space: nowrap; }
.audit-local-controls {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(160px, 220px) minmax(180px, 1fr);
  gap: 10px;
  padding: 12px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}
.audit-local-controls label {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text-dim);
  font-size: 8px;
  font-weight: 750;
}
.audit-local-controls input,
.audit-cost-editor input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  color: var(--text);
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
}
.audit-local-controls input:focus,
.audit-cost-editor input:focus { border-color: var(--accent); outline: 2px solid rgba(37, 99, 235, .12); }
.audit-local-controls label small { color: #6b7789; font-size: 7px; font-weight: 500; }
.audit-local-cost-used {
  min-height: 51px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 7px 11px;
  background: #eef6ff;
  border: 1px solid #c9dcf7;
  border-radius: 7px;
}
.audit-local-cost-used span,
.audit-local-cost-used small { color: #526a8c; font-size: 7.5px; }
.audit-local-cost-used strong { margin: 3px 0; color: #175fc1; font-size: 12px; }
.audit-payout-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--border);
  gap: 1px;
}
.audit-payout-metrics > div {
  min-height: 76px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 12px;
  background: #fff;
  border-top: 3px solid transparent;
}
.audit-payout-metrics .platform { border-top-color: #3478e5; }
.audit-payout-metrics .local { border-top-color: var(--ok); }
.audit-payout-metrics span { color: var(--text-dim); font-size: 8px; }
.audit-payout-metrics strong { margin-top: 5px; font-size: 14px; }
.audit-payout-metrics .platform strong,
.audit-platform-value strong,
.audit-performance-metrics .platform strong { color: #1769d2; }
.audit-payout-metrics .local.positive strong { color: var(--ok); }
.audit-payout-metrics .local.negative { border-top-color: var(--crit); }
.audit-payout-metrics .local.negative strong { color: var(--crit); }
.audit-payout-metrics small { margin-top: 4px; color: var(--text-dim); font-size: 7.5px; }
.audit-calculator {
  margin-top: 12px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid #c9d6e8;
  border-left: 4px solid var(--accent);
  border-radius: 7px;
}
.audit-calculator > header {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.audit-calculator > header > div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.audit-calculator > header strong { font-size: 11px; }
.audit-calculator > header span { color: var(--text-dim); font-size: 8.5px; line-height: 1.4; }
.audit-calculator > header small { color: var(--text-dim); font-size: 8.5px; line-height: 1.4; }
.audit-calculator-fields {
  display: grid;
  grid-template-columns: repeat(6, minmax(105px, 1fr));
  gap: 10px;
  padding: 12px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}
.audit-calculator-fields label {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text-dim);
  font-size: 8px;
  font-weight: 700;
}
.audit-calculator input {
  width: 100%;
  height: 36px;
  padding: 0 9px;
  color: var(--text);
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
}
.audit-calculator input:focus { border-color: var(--accent); outline: 2px solid rgba(37, 99, 235, .12); }
.audit-calculator input[readonly] { color: #56657a; background: #eef2f7; cursor: not-allowed; }
.audit-calculator-observed,
.audit-calculator-result {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--border);
  gap: 1px;
}
.audit-calculator-observed { grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.audit-calculator-observed > div,
.audit-calculator-result > div {
  min-height: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 12px;
  background: #fff;
}
.audit-calculator-observed span,
.audit-calculator-result span { color: var(--text-dim); font-size: 8px; line-height: 1.35; }
.audit-calculator-observed small { margin-top: 3px; color: #68778c; font-size: 7.5px; }
.audit-calculator-observed strong,
.audit-calculator-result strong { margin-top: 4px; font-size: 11px; }
.audit-calculator-result .negative strong { color: var(--crit); }
.audit-calculator-result .positive strong { color: var(--ok); }
.audit-calculator-source {
  padding: 9px 12px;
  color: #526176;
  background: #f3f7fc;
  font-size: 8.5px;
  line-height: 1.5;
}
.audit-calculator-source strong { color: var(--text); }
.audit-performance {
  margin-top: 12px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid #c9d6e8;
  border-left: 4px solid var(--accent);
  border-radius: 7px;
}
.audit-performance > header {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.audit-performance > header > div { display: flex; flex-direction: column; gap: 3px; }
.audit-performance > header strong { font-size: 11px; }
.audit-performance > header small,
.audit-performance-source { color: var(--text-dim); font-size: 8px; }
.audit-performance-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--border);
  gap: 1px;
}
.audit-performance-metrics > div {
  min-height: 82px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 12px;
  background: #fff;
}
.audit-performance-metrics span { color: var(--text-dim); font-size: 8px; }
.audit-performance-metrics strong { margin-top: 5px; font-size: 14px; }
.audit-trend { margin-top: 6px; font-size: 8px; font-weight: 700; }
.audit-trend.up { color: var(--ok); }
.audit-trend.down { color: var(--crit); }
.audit-trend.neutral { color: var(--text-dim); font-weight: 500; }
.audit-daily-chart { padding: 12px; background: #f8fafc; border-top: 1px solid var(--border); }
.audit-daily-bar {
  min-height: 23px;
  display: grid;
  grid-template-columns: 42px minmax(100px, 1.3fr) minmax(100px, 1fr) 82px;
  align-items: center;
  gap: 8px;
}
.audit-daily-bar > span { color: var(--text-dim); font-size: 8px; }
.audit-daily-bar > div { height: 6px; overflow: hidden; background: #e8edf5; border-radius: 2px; }
.audit-daily-bar i { height: 100%; display: block; border-radius: inherit; }
.audit-daily-bar .revenue,
.audit-chart-legend .revenue,
.audit-daily-bar .platform-payout,
.audit-chart-legend .platform-payout { background: #4c7ee8; }
.audit-daily-bar .profit,
.audit-chart-legend .profit { background: var(--ok); }
.audit-daily-bar .loss,
.audit-chart-legend .loss { background: var(--crit); }
.audit-daily-bar > strong { font-size: 8.5px; text-align: right; }
.audit-chart-legend { display: flex; gap: 14px; margin-top: 7px; padding-left: 50px; }
.audit-chart-legend span { display: inline-flex; align-items: center; gap: 5px; color: var(--text-dim); font-size: 7.5px; }
.audit-chart-legend i { width: 12px; height: 4px; display: block; border-radius: 1px; }
.audit-daily-table-wrap { max-height: 320px; overflow: auto; border-top: 1px solid var(--border); }
.audit-daily-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.audit-daily-table th,
.audit-daily-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); font-size: 8px; text-align: right; white-space: nowrap; }
.audit-daily-table th { position: sticky; z-index: 1; top: 0; color: #66748a; background: #f5f7fb; font-weight: 800; text-transform: uppercase; }
.audit-daily-table th:first-child,
.audit-daily-table td:first-child { text-align: left; }
.audit-performance-note { padding: 9px 12px; color: #55677e; background: #f3f7fc; border-top: 1px solid var(--border); font-size: 8.5px; line-height: 1.5; }
.audit-cost-editor {
  margin-top: 9px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 7px;
}
.audit-cost-editor > header {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.audit-cost-editor header > div { display: flex; flex-direction: column; gap: 3px; }
.audit-cost-editor header strong { font-size: 11px; }
.audit-cost-editor header span { color: var(--text-dim); font-size: 8.5px; }
.audit-add-component {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  color: #fff;
  background: var(--ok);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}
.audit-add-component:hover { background: #117344; }
.audit-cost-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 180px)) minmax(150px, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
}
.audit-cost-fields label,
.audit-component label {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text-dim);
  font-size: 8px;
  font-weight: 700;
}
.audit-component label small {
  min-height: 12px;
  color: #63738b;
  font-size: 7px;
  font-weight: 500;
  line-height: 1.3;
}
.audit-effective-cost {
  height: 38px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 10px;
  background: #eff8f3;
  border: 1px solid #c9e4d5;
  border-radius: 7px;
}
.audit-effective-cost span { color: #567065; font-size: 7.5px; }
.audit-effective-cost strong { margin-top: 2px; font-size: 11px; }
.audit-components { padding: 0 12px 12px; }
.audit-components.empty > p { padding: 8px 0; color: var(--text-dim); font-size: 9px; }
.audit-component {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 110px 130px 100px 34px 34px;
  align-items: end;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}
.audit-component > strong { align-self: center; font-size: 10px; text-align: right; }
.audit-component .btn-icon { width: 34px; height: 34px; padding: 0; }
.audit-component .danger { color: var(--crit); }
.audit-component-new { grid-template-columns: minmax(150px, 1fr) 110px 130px 1fr auto; }
.audit-empty {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
}
.audit-empty strong { font-size: 13px; }
.audit-empty span { max-width: 520px; color: var(--text-dim); font-size: 10px; line-height: 1.5; }

/* Avisos superiores: um fluxo visual, identificado por marketplace */
.activity-stack {
  position: fixed;
  z-index: 160;
  top: 10px;
  left: calc(50% + 112px);
  width: min(560px, calc(100vw - 260px));
  display: flex;
  flex-direction: column;
  gap: 7px;
  transform: translateX(-50%);
  pointer-events: none;
}
.activity-popup {
  min-height: 48px;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 36px;
  align-items: start;
  gap: 10px;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(255, 255, 255, .98);
  border: 1px solid #cfd8e6;
  border-left: 4px solid #f2b705;
  border-radius: 7px;
  box-shadow: var(--shadow-3);
  pointer-events: auto;
  animation: activityDrop .24s ease-out;
}
.activity-popup.activity-shopee { border-left-color: #ee4d2d; }
.activity-popup.sev-critical { border-color: #ebb9c0; border-left-color: var(--crit); }
.activity-popup.leaving { opacity: 0; transform: translateY(-8px); transition: .2s ease; }
.activity-source {
  padding-top: 2px;
  color: #745b0a;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}
.activity-shopee .activity-source { color: #b33a24; }
.activity-message {
  max-height: 2.8em;
  overflow: hidden;
  font-size: 10.5px;
  line-height: 1.4;
}
.activity-popup.expanded .activity-message { max-height: 180px; overflow: auto; }
.activity-time { padding-top: 2px; color: var(--text-dim); font-size: 8px; text-align: right; }
@keyframes activityDrop {
  from { opacity: 0; transform: translateY(-14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1280px) {
  .audit-summary { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
  .audit-toolbar { align-items: stretch; flex-direction: column; }
  .audit-search { width: 100%; }
  .audit-filters { justify-content: flex-start; }
  .audit-cost-fields { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
  .audit-local-controls { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
  .audit-local-cost-used { grid-column: 1 / -1; }
  .audit-effective-cost { grid-column: span 2; }
  .audit-calculator-fields { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
  .audit-period { align-items: stretch; flex-wrap: wrap; }
}

@media (max-width: 900px) {
  .audit-page { padding: 12px; }
  .audit-page-shopee { padding: 2px 0 16px; }
  .audit-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .audit-ads-strip,
  .audit-ads-strip.unavailable { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .audit-ads-strip p { grid-column: 1 / -1; }
  .audit-profitability-summary,
  .audit-payout-metrics,
  .audit-calculator-observed,
  .audit-calculator-result { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .audit-performance-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .activity-stack {
    left: 50%;
    width: min(560px, calc(100vw - 24px));
  }
}

@media (max-width: 700px) {
  .audit-page-head { align-items: stretch; flex-direction: column; }
  .audit-page-head .btn { width: 100%; }
  .audit-summary { grid-template-columns: 1fr 1fr; }
  .audit-metric { min-height: 96px; padding: 11px; }
  .audit-ads-strip,
  .audit-ads-strip.unavailable { grid-template-columns: 1fr; }
  .audit-ads-strip p { grid-column: 1; }
  .audit-table-head { align-items: flex-start; flex-direction: column; }
  .audit-period { flex-direction: column; }
  .audit-period-presets { overflow-x: auto; }
  .audit-period-presets button { flex: 0 0 auto; }
  .audit-period > label,
  .audit-period input,
  .audit-period > .btn { width: 100%; }
  .audit-columns { display: none; }
  .audit-row { min-width: 0; }
  .audit-row-main {
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px;
  }
  .audit-product { grid-column: 1 / -1; padding-right: 28px; }
  .audit-expand { position: absolute; right: 22px; }
  .audit-breakdown { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .audit-payout-panel > header { align-items: flex-start; flex-direction: column; }
  .audit-local-controls { grid-template-columns: 1fr; }
  .audit-local-cost-used { grid-column: 1; }
  .audit-calculator > header { align-items: stretch; flex-direction: column; }
  .audit-calculator > header .btn { width: 100%; }
  .audit-calculator-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .audit-performance > header { align-items: flex-start; flex-direction: column; }
  .audit-daily-bar { grid-template-columns: 38px minmax(80px, 1.2fr) minmax(80px, 1fr) 74px; }
  .audit-cost-fields { grid-template-columns: 1fr; }
  .audit-effective-cost { grid-column: 1; }
  .audit-component,
  .audit-component-new {
    grid-template-columns: 1fr 1fr;
    align-items: end;
  }
  .audit-component > strong { text-align: left; }
  .activity-popup { grid-template-columns: 74px minmax(0, 1fr); }
  .activity-time { display: none; }
}

/* ESCAL-IA */
#tab-escalia {
  min-height: 0;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px 12px;
  overflow: hidden;
}
.escalia-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.escalia-header h2 { margin-top: 2px; font-size: 23px; line-height: 1.15; }
.escalia-header p { margin-top: 4px; color: var(--text-dim); font-size: 11.5px; }
.escalia-kicker { color: #168a55; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.escalia-global-control {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 18px;
  border-left: 1px solid var(--border);
}
.escalia-global-control > div { display: flex; flex-direction: column; align-items: flex-end; }
.escalia-global-control > div span { color: var(--text-dim); font-size: 10px; }
.escalia-global-control > div strong { font-size: 12px; }
.escalia-global-control > div strong.is-on { color: var(--ok); }
.escal-switch .slider { width: 36px; height: 20px; }
.escal-switch .slider::after { width: 14px; height: 14px; top: 3px; left: 3px; }
.escal-switch input:checked + .slider::after { transform: translateX(16px); }

.escalia-observation {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  color: #7a4b0b;
  background: #fff8e8;
  border: 1px solid #efd7a4;
  border-left: 4px solid #d99614;
  border-radius: 6px;
}
.escalia-observation strong { flex: 0 0 auto; font-size: 11px; text-transform: uppercase; }
.escalia-observation span { color: #695b46; font-size: 11px; }
.escalia-observation.executor-on { color: #0d6840; background: #edf9f2; border-color: #b8dfca; border-left-color: var(--ok); }
.escalia-observation.executor-on span { color: #38614f; }

.escalia-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.escalia-metrics > div {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
  gap: 2px 12px;
  padding: 12px 15px;
  border-right: 1px solid var(--border);
}
.escalia-metrics > div:last-child { border-right: 0; }
.escalia-metrics span { color: var(--text-dim); font-size: 10.5px; }
.escalia-metrics strong { grid-row: 1 / 3; grid-column: 2; align-self: center; font-size: 25px; }
.escalia-metrics small { color: #8490a2; font-size: 9.5px; }

.escalia-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.escalia-add-search { position: relative; min-width: 310px; display: flex; align-items: flex-end; gap: 9px; }
.escalia-add-search > div { position: relative; min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.escalia-add-search label { color: var(--text-dim); font-size: 10px; font-weight: 700; }
.escalia-add-search input {
  width: 100%; height: 38px; padding: 0 12px;
  color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: 6px;
}
.escalia-add-search input:focus { outline: 2px solid #bfd1ff; border-color: #7da4f5; }
.escalia-add-button,
.escalia-inline-add {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: var(--ok);
  border: 1px solid #0e7244;
  border-radius: 50%;
  cursor: pointer;
  font-weight: 500;
}
.escalia-add-button { width: 38px; height: 38px; font-size: 25px; }
.escalia-inline-add { width: 27px; height: 27px; font-size: 20px; }
.escalia-add-button:hover,
.escalia-inline-add:hover { background: #0f7749; }
.escalia-search-results {
  position: absolute;
  z-index: 35;
  top: calc(100% + 5px);
  left: 0;
  width: min(520px, calc(100vw - 280px));
  max-height: 360px;
  overflow-y: auto;
  padding: 5px;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  box-shadow: var(--shadow-3);
}
.escalia-search-results button {
  width: 100%; min-height: 50px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center; gap: 9px; padding: 6px; color: var(--text); background: transparent;
  border: 0; border-bottom: 1px solid #edf1f6; text-align: left; cursor: pointer;
}
.escalia-search-results button:hover { background: #f4f7fb; }
.escalia-search-results button > span:first-child { width: 36px; height: 36px; display: grid; place-items: center; color: #64748b; background: #eef2f7; border-radius: 5px; font-size: 9px; }
.escalia-search-results img { width: 36px; height: 36px; object-fit: contain; border-radius: 4px; }
.escalia-search-results button > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.escalia-search-results strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.escalia-search-results small { color: var(--text-dim); font-size: 9.5px; }
.escalia-search-results i { color: var(--ok); font-size: 11px; font-style: normal; font-weight: 800; }
.escalia-search-results p { padding: 16px; color: var(--text-dim); text-align: center; font-size: 11px; }
.escalia-filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.escalia-filters button {
  min-height: 34px; padding: 6px 11px; color: var(--text-dim); background: var(--panel);
  border: 1px solid var(--border); border-radius: 6px; cursor: pointer; font-size: 10.5px; font-weight: 700;
}
.escalia-filters button.active { color: #1d4ed8; background: var(--accent-soft); border-color: #a9c4ff; }
.escalia-filters button:hover:not(.active) { color: #334155; background: #eef2f7; border-color: #c8d2df; }
.escalia-filters button:active { background: #e3e9f1; }

.escalia-table {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: auto;
}
.escalia-table-head,
.escalia-row-grid {
  display: grid;
  min-width: 1370px;
  grid-template-columns:
    minmax(300px, 1.8fr)
    minmax(95px, .52fr)
    minmax(105px, .58fr)
    minmax(100px, .54fr)
    minmax(115px, .62fr)
    minmax(125px, .7fr)
    minmax(145px, .8fr)
    minmax(145px, .78fr);
  align-items: center;
}
.escalia-table-head {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 36px;
  padding: 0 14px;
  color: #69778d;
  background: #f5f7fa;
  border-bottom: 1px solid var(--border);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}
.escalia-list { min-width: 1370px; min-height: 0; }
.escalia-loading,
.escalia-empty { padding: 32px; color: var(--text-dim); text-align: center; font-size: 11px; }
.escalia-loading.error { color: var(--crit); background: #fff3f4; }
.escalia-empty { display: flex; flex-direction: column; gap: 6px; }
.escalia-empty small { color: #7a8799; font-size: 9.5px; }
.escalia-empty.error { color: var(--crit); background: #fff3f4; }
.escalia-row { border-bottom: 1px solid var(--border); border-left: 3px solid transparent; }
.escalia-row:last-child { border-bottom: 0; }
.escalia-row:hover { background: #fafcff; }
.escalia-row.active { border-left-color: var(--ok); }
.escalia-row.blocked:not(.active) { border-left-color: #d8a13c; }
.escalia-row-grid { min-height: 74px; padding: 8px 11px; }
.escalia-product {
  min-width: 0; display: grid; grid-template-columns: 50px minmax(0, 1fr); align-items: center;
  gap: 10px; padding-right: 14px; color: var(--text); background: transparent; border: 0; text-align: left; cursor: pointer;
}
.escalia-product img,
.escalia-image-empty { width: 48px; height: 48px; object-fit: contain; border: 1px solid #e3e8f0; border-radius: 5px; background: #fff; }
.escalia-image-empty { display: grid; place-items: center; color: #7b8799; background: #f3f6fa; font-size: 10px; font-weight: 800; }
.escalia-product > span:last-child { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.escalia-product strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; line-height: 1.25; }
.escalia-product small { overflow: hidden; color: var(--text-dim); text-overflow: ellipsis; white-space: nowrap; font-size: 9.5px; }
.escalia-cell { min-width: 0; display: flex; flex-direction: column; gap: 3px; padding-right: 10px; }
.escalia-cell > span { color: #7d899a; font-size: 9px; }
.escalia-cell strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.escalia-cell strong.danger,
.escalia-detail-grid strong.negative { color: var(--crit); }
.escalia-cell small { overflow: hidden; color: var(--text-dim); text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.escalia-situation strong { display: flex; align-items: center; gap: 6px; }
.escalia-situation strong::before {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  content: "";
  border-radius: 50%;
  background: #94a3b8;
}
.escalia-situation.positive strong { color: #107448; }
.escalia-situation.positive strong::before { background: #16a163; }
.escalia-situation.info strong { color: #145ca8; }
.escalia-situation.info strong::before { background: #2e79db; }
.escalia-situation.warning strong { color: #9a5b09; }
.escalia-situation.warning strong::before { background: #d99614; }
.escalia-situation.danger strong { color: #b42334; }
.escalia-situation.danger strong::before { background: #d83b4c; }
.escalia-row-actions { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px 8px; }
.escalia-row-actions > div { grid-column: 1 / 3; display: flex; gap: 4px; }
.escalia-state { overflow: hidden; color: #68758a; text-overflow: ellipsis; white-space: nowrap; font-size: 9.5px; font-weight: 700; }
.escalia-state.on { color: var(--ok); }
.escalia-icon-button {
  width: 27px; height: 26px; display: grid; place-items: center; color: #526176; background: #f7f9fc;
  border: 1px solid #dfe5ee; border-radius: 5px; cursor: pointer; font-size: 12px;
}
.escalia-icon-button:hover { color: #1d4ed8; background: #eaf1ff; border-color: #a9c4ff; }
.escalia-icon-button:active { color: #1747b5; background: #dbe7ff; }
.escalia-row-detail { padding: 12px 14px 14px 74px; background: #f8fafc; border-top: 1px solid #e8edf3; }
.escalia-detail-empty { display: flex; flex-direction: column; gap: 4px; color: var(--text-dim); font-size: 10.5px; }
.escalia-detail-grid { display: grid; grid-template-columns: repeat(6, minmax(90px, 1fr)); border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.escalia-detail-grid > div { display: flex; flex-direction: column; gap: 4px; padding: 10px; border-right: 1px solid var(--border); }
.escalia-detail-grid > div:last-child { border-right: 0; }
.escalia-detail-grid span { color: var(--text-dim); font-size: 9px; }
.escalia-detail-grid strong { font-size: 11px; }
.escalia-recommendation { display: flex; gap: 10px; margin-top: 9px; padding: 9px 10px; color: #244a69; background: #edf6ff; border-left: 3px solid var(--info); font-size: 10px; }
.escalia-recommendation strong { flex: 0 0 auto; }
.escalia-notes { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 4px 10px; margin-top: 8px; color: #6d531e; font-size: 9.5px; }
.escalia-notes strong { grid-row: 1 / span 8; }
.escalia-notes span::before { content: "• "; }
.escalia-notes.danger { color: #a42d3b; }
.escalia-promotions { margin-top: 10px; }
.escalia-promotions > strong { display: block; margin-bottom: 5px; font-size: 10px; }
.escalia-promotion { display: grid; grid-template-columns: 140px 130px minmax(180px, 1fr) auto; align-items: center; gap: 10px; padding: 7px 9px; background: #fff; border: 1px solid var(--border); border-radius: 5px; font-size: 9.5px; }
.escalia-promotion + .escalia-promotion { margin-top: 4px; }
.escalia-promotion.safe { border-color: #a9ddc0; background: #f3fbf6; }
.escalia-promotion > span { display: flex; flex-direction: column; gap: 2px; }
.escalia-promotion small { color: var(--text-dim); }
.escalia-promotion .btn { min-height: 27px; padding: 4px 8px; color: #0e7044; border-color: #9dd4b6; background: #eefaf3; font-size: 9.5px; }
.escalia-detail-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.escalia-detail-actions .btn { min-height: 28px; padding: 4px 8px; font-size: 9.5px; }
.escalia-detail-actions span { color: var(--text-dim); font-size: 9px; }

.escalia-editor-overlay {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(21, 29, 43, .52);
}
.escalia-editor {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  color: var(--text);
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
}
.escalia-editor > header { display: flex; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.escalia-editor > header span { color: var(--ok); font-size: 9.5px; font-weight: 800; text-transform: uppercase; }
.escalia-editor > header h3 { margin-top: 4px; font-size: 16px; }
.escalia-editor > header p { max-width: 640px; margin-top: 4px; overflow: hidden; color: var(--text-dim); text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.escalia-editor > header button { width: 30px; height: 30px; flex: 0 0 auto; color: #536176; background: #f5f7fa; border: 1px solid var(--border); border-radius: 5px; cursor: pointer; font-size: 18px; }
.escalia-editor form { padding: 16px 18px; }
.escalia-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px 14px; }
.escalia-form-grid > label { display: flex; flex-direction: column; gap: 5px; color: #46546a; font-size: 10px; font-weight: 700; }
.escalia-form-grid label small { color: #8994a5; font-weight: 500; }
.field-with-prefix,
.field-with-suffix { height: 36px; display: flex; align-items: center; overflow: hidden; background: #fff; border: 1px solid #cfd7e2; border-radius: 6px; }
.field-with-prefix i,
.field-with-suffix i { padding: 0 9px; color: #68758a; font-size: 10px; font-style: normal; }
.field-with-prefix input,
.field-with-suffix input { width: 100%; height: 100%; min-width: 0; padding: 0 9px; color: var(--text); background: transparent; border: 0; outline: 0; }
.field-with-prefix input { padding-left: 0; }
.field-with-suffix input { padding-right: 0; }
.field-with-prefix:focus-within,
.field-with-suffix:focus-within { border-color: #7da4f5; box-shadow: 0 0 0 2px #dbe7ff; }
.escalia-segment-field { margin-top: 14px; padding: 0; border: 0; }
.escalia-segment-field legend { margin-bottom: 6px; color: #46546a; font-size: 10px; font-weight: 700; }
.escalia-segments { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #cfd7e2; border-radius: 6px; overflow: hidden; }
.escalia-segments label { cursor: pointer; }
.escalia-segments label + label { border-left: 1px solid #cfd7e2; }
.escalia-segments input { position: absolute; opacity: 0; pointer-events: none; }
.escalia-segments span { min-height: 35px; display: grid; place-items: center; color: #5b687c; background: #fff; font-size: 10px; font-weight: 700; }
.escalia-segments input:checked + span { color: #1d4ed8; background: var(--accent-soft); }
.escalia-ads-row { display: grid; grid-template-columns: 1fr 190px; gap: 12px; }
.escalia-ads-row select { min-width: 0; height: 36px; padding: 0 10px; color: var(--text); background: #fff; border: 1px solid #cfd7e2; border-radius: 6px; }
.escalia-ads-row label { display: grid; grid-template-columns: auto 100px; align-items: center; gap: 8px; color: #68758a; font-size: 9.5px; }
.escalia-check { display: flex; align-items: flex-start; gap: 9px; margin-top: 14px; padding: 10px; background: #f6f8fb; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }
.escalia-check input { margin-top: 2px; accent-color: var(--ok); }
.escalia-check > span { display: flex; flex-direction: column; gap: 3px; }
.escalia-check strong { font-size: 10.5px; }
.escalia-check small { color: var(--text-dim); font-size: 9px; }
.escalia-calculation { display: flex; gap: 18px; margin-top: 14px; padding: 10px; color: #425168; background: #edf6ff; border-left: 3px solid var(--info); font-size: 9.5px; }
.escalia-calculation > span { display: flex; flex-direction: column; gap: 3px; }
.escalia-calculation small { color: var(--text-dim); }
.escalia-calculation strong { font-size: 12px; }
.escalia-editor-error { margin-top: 10px; padding: 9px; color: #a52536; background: #fff1f3; border: 1px solid #efb5bd; border-radius: 5px; font-size: 10px; }
.escalia-editor footer { display: flex; justify-content: flex-end; gap: 7px; margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--border); }

@media (max-width: 1250px) {
  .escalia-detail-grid { grid-template-columns: repeat(3, 1fr); }
  .escalia-detail-grid > div:nth-child(3) { border-right: 0; }
  .escalia-detail-grid > div:nth-child(-n+3) { border-bottom: 1px solid var(--border); }
}

@media (max-width: 900px) {
  #tab-escalia { padding: 10px; }
  .escalia-header { align-items: flex-start; }
  .escalia-header p { max-width: 430px; }
  .escalia-global-control > div { display: none; }
  .escalia-metrics { grid-template-columns: repeat(5, minmax(110px, 1fr)); overflow-x: auto; }
  .escalia-metrics > div { min-width: 120px; }
  .escalia-toolbar { align-items: stretch; flex-direction: column; gap: 8px; }
  .escalia-add-search { width: 100%; }
  .escalia-search-results { width: calc(100vw - 76px); }
  .escalia-filters { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; }
  .escalia-table { overflow-x: hidden; overflow-y: auto; }
  .escalia-table-head { display: none; }
  .escalia-list,
  .escalia-row-grid { min-width: 0; }
  .escalia-row-grid { grid-template-columns: minmax(230px, 1.4fr) minmax(130px, .65fr) 135px; }
  .escalia-row-grid > :nth-child(n+2):nth-child(-n+6) { display: none; }
  .escalia-row-detail { padding-left: 14px; }
}

@media (max-width: 620px) {
  .escalia-header { flex-direction: column; gap: 8px; }
  .escalia-global-control { width: 100%; justify-content: space-between; padding: 8px 0 0; border-top: 1px solid var(--border); border-left: 0; }
  .escalia-global-control > div { display: flex; align-items: flex-start; }
  .escalia-observation { align-items: flex-start; flex-direction: column; gap: 3px; }
  .escalia-row-grid { grid-template-columns: minmax(0, 1fr) 96px; min-height: 118px; align-items: start; }
  .escalia-row-grid > :nth-child(n+2):nth-child(-n+7) { display: none; }
  .escalia-row-actions { align-content: start; }
  .escalia-product { grid-template-columns: 44px minmax(0, 1fr); align-items: start; }
  .escalia-product img,
  .escalia-image-empty { width: 42px; height: 42px; }
  .escalia-detail-grid { grid-template-columns: 1fr 1fr; }
  .escalia-detail-grid > div { border-bottom: 1px solid var(--border); }
  .escalia-detail-grid > div:nth-child(even) { border-right: 0; }
  .escalia-detail-grid > div:nth-last-child(-n+2) { border-bottom: 0; }
  .escalia-notes { grid-template-columns: 1fr; }
  .escalia-notes strong { grid-row: auto; }
  .escalia-promotion { grid-template-columns: 1fr 1fr; }
  .escalia-promotion > span:nth-child(3) { grid-column: 1 / 3; }
  .escalia-detail-actions { align-items: flex-start; flex-direction: column; gap: 6px; }
  .escalia-form-grid { grid-template-columns: 1fr; }
  .escalia-ads-row { grid-template-columns: 1fr; }
  .escalia-segments { grid-template-columns: 1fr; }
  .escalia-segments label + label { border-top: 1px solid #cfd7e2; border-left: 0; }
}

/* Navegação por marketplace */
.tabs {
  gap: 12px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.marketplace-nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.marketplace-nav-row {
  display: flex;
  align-items: stretch;
  gap: 4px;
}
.marketplace-nav-trigger {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #c4cede;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.marketplace-nav-trigger:hover,
.marketplace-nav-trigger.active {
  color: #fff;
  background: #202a3c;
  border-color: #2c3950;
}
.marketplace-nav-trigger:focus-visible,
.marketplace-group-toggle:focus-visible,
.marketplace-subtab:focus-visible {
  outline: 2px solid #8fb2fb;
  outline-offset: 2px;
}
.marketplace-group-toggle {
  flex: 0 0 30px;
  width: 30px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
}
.marketplace-group-toggle:hover {
  background: #202a3c;
  border-color: #2c3950;
}
.marketplace-mark {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 900;
}
.marketplace-mark.ml-mark {
  color: #2f2f2f;
  background: #ffe600;
}
.marketplace-mark.shopee-mark {
  width: 30px;
  height: 30px;
  margin: 0;
  color: #fff;
  background: #ee4d2d;
  font-size: 15px;
}
.marketplace-nav-label {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.marketplace-nav-label strong {
  overflow: hidden;
  font-size: 12.5px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.marketplace-nav-label small {
  margin-top: 3px;
  overflow: hidden;
  color: #8f9cb1;
  font-size: 9px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.marketplace-chevron {
  color: #7f8da4;
  font-size: 20px;
  line-height: 1;
  transition: transform .16s ease;
}
.marketplace-nav-group.open .marketplace-chevron { transform: rotate(90deg); }
.marketplace-subnav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-left: 15px;
  padding-left: 11px;
  border-left: 1px solid #2d3950;
  overflow: hidden;
  max-height: 240px;
  opacity: 1;
  transition: max-height .22s ease, opacity .18s ease, margin-left .22s ease, padding-left .22s ease;
}
.marketplace-subnav.hidden {
  display: flex !important;
  max-height: 0;
  opacity: 0;
  margin-left: 0;
  padding-left: 0;
  border-left-color: transparent;
  pointer-events: none;
}
.marketplace-subtab,
.tabs .marketplace-subtab {
  width: 100%;
  min-height: 36px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 5px 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #aeb9ca;
  background: transparent;
  font: inherit;
  font-size: 11.5px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}
.marketplace-subtab:hover {
  color: #fff;
  background: #1f293a;
}
.marketplace-subtab.active {
  color: #fff;
  background: #293750;
  border-color: #354663;
}
.marketplace-subtab .nav-icon {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  font-size: 8px;
}
.marketplace-subtab.active .nav-icon {
  color: #fff;
  background: var(--accent);
}
.marketplace-nav-group[data-marketplace-group="shopee"] .marketplace-subtab.active .nav-icon {
  background: #ee4d2d;
}
.marketplace-subtab .badge {
  min-width: 21px;
  padding: 1px 5px;
  font-size: 9px;
}
body[data-active-tab="shopee"] .ml-context-control { display: none !important; }

/* Shopee: áreas operacionais alinhadas ao dashboard do Mercado Livre */
#tab-shopee {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}
.shopee-dashboard {
  display: grid;
  gap: 12px;
}
.shopee-view-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.shopee-view-heading > div > span {
  color: #d94a2d;
  font-size: 9px;
  font-weight: 850;
}
.shopee-view-heading h2 {
  margin-top: 3px;
  font-size: 22px;
  line-height: 1.15;
}
.shopee-view-heading p {
  margin-top: 4px;
  color: var(--text-dim);
  font-size: 11px;
}
.shopee-period-bar {
  justify-content: flex-start;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
}
.shopee-period-bar.context-hidden { display: none; }
.shopee-view { display: none; }
.shopee-view.active {
  min-width: 0;
  display: grid;
  gap: 10px;
}
.shopee-finance-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.shopee-finance-subtabs { display: flex; gap: 4px; }
.shopee-finance-subtabs button {
  min-height: 34px;
  padding: 7px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}
.shopee-finance-subtabs button:hover { color: var(--text); background: #fff5f2; }
.shopee-finance-subtabs button.active { color: #c83f24; border-bottom-color: #ee4d2d; }
.shopee-finance-inner { display: none; min-width: 0; }
.shopee-finance-inner.active { display: grid; gap: 10px; }
.shopee-external-head { border-color: #f1c8bf; border-left-color: #ee4d2d; background: #fff7f5; }
.shopee-external-head strong { color: #c83f24; }
.shopee-overview-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}
.shopee-overview-grid .shopee-panel-wide { grid-column: 1 / -1; }
.shopee-summary {
  grid-template-columns: repeat(5, minmax(128px, 1fr));
}
.shopee-summary-four {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}
.shopee-summary.shopee-ads-summary {
  grid-template-columns: repeat(6, minmax(135px, 1fr));
}
.shopee-finance-breakdown {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  margin-top: 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
  overflow: hidden;
}
.shopee-finance-breakdown-item {
  min-width: 0;
  padding: 10px 12px;
  border-right: 1px solid var(--border);
}
.shopee-finance-breakdown-item:last-child { border-right: 0; }
.shopee-finance-breakdown-item span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: var(--text-dim);
  font-size: 9.5px;
}
.shopee-finance-breakdown-item strong {
  display: block;
  margin-top: 6px;
  font-size: 14px;
}
.shopee-finance-breakdown-item.positive strong { color: var(--ok); }
.shopee-finance-breakdown-item.negative strong { color: var(--crit); }
.marketplace-reconciliation {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
  overflow: hidden;
}
.reconciliation-item {
  min-width: 0;
  padding: 10px 12px;
  border-right: 1px solid var(--border);
}
.reconciliation-item:last-child { border-right: 0; }
.reconciliation-item > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  color: var(--text-dim);
  font-size: 8.5px;
}
.reconciliation-item > strong {
  display: block;
  margin-top: 5px;
  font-size: 13px;
}
.reconciliation-item.negative > strong { color: var(--crit); }
.reconciliation-item.positive > strong { color: var(--ok); }
.sales-ledger {
  max-height: 380px;
  overflow: auto;
  border-top: 1px solid var(--border);
}
.sales-ledger-table {
  display: grid;
  min-width: 1120px;
  align-items: stretch;
}
.sales-ledger-table.ml-ledger-table {
  grid-template-columns: 125px minmax(250px, 1.7fr) repeat(6, minmax(105px, .7fr));
}
.sales-ledger-table.shopee-ledger-table {
  grid-template-columns: 130px minmax(250px, 1.7fr) repeat(7, minmax(105px, .7fr));
}
.sales-ledger-head,
.sales-ledger-cell {
  min-width: 0;
  padding: 9px 10px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  white-space: pre-line;
}
.sales-ledger-head {
  position: sticky;
  top: 0;
  z-index: 2;
  color: #54647c;
  background: #f4f7fb;
  font-size: 8px;
  text-transform: uppercase;
}
.sales-ledger-cell {
  color: var(--text);
  background: var(--panel);
  font-size: 8.5px;
  line-height: 1.45;
}
.sales-ledger-cell.negative { color: var(--crit); font-weight: 750; }
.shopee-ads-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(270px, .55fr);
  gap: 10px;
}
.shopee-ads-timeline {
  min-height: 210px;
  max-height: 340px;
  padding: 12px 14px;
  overflow: auto;
}
.shopee-ads-day {
  display: grid;
  grid-template-columns: 58px minmax(120px, 1fr) 180px;
  align-items: center;
  gap: 10px;
  min-height: 34px;
}
.shopee-ads-day > strong { font-size: 10px; }
.shopee-ads-day > span { color: var(--text-dim); font-size: 9px; text-align: right; }
.shopee-ads-day-bars { display: grid; gap: 4px; }
.shopee-ads-day-bars i { display: block; height: 6px; min-width: 2px; }
.shopee-ads-day-bars .spend { background: #ee4d2d; }
.shopee-ads-day-bars .revenue { background: #15966a; }
.shopee-ads-coverage { display: grid; padding: 10px 14px; }
.shopee-ads-coverage > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  border-bottom: 1px solid var(--border);
}
.shopee-ads-coverage span { color: var(--text-dim); font-size: 10px; }
.shopee-ads-coverage strong { font-size: 12px; }
.shopee-ads-coverage p {
  margin: 10px 0 0;
  padding: 9px 10px;
  border-left: 3px solid var(--warn);
  color: #7a5a14;
  background: #fff9e8;
  font-size: 9px;
  line-height: 1.5;
}
.shopee-ads-products { max-height: 440px; overflow: auto; }
.shopee-ads-table {
  display: grid;
  grid-template-columns: minmax(270px, 1.7fr) 85px repeat(3, minmax(115px, .72fr)) 80px 85px 85px;
  min-width: 1120px;
}
.shopee-ads-table > strong,
.shopee-ads-cell {
  min-width: 0;
  padding: 10px 11px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.shopee-ads-table > strong {
  position: sticky;
  top: 0;
  z-index: 2;
  color: #54647c;
  background: #f4f7fb;
  font-size: 8px;
  text-transform: uppercase;
}
.shopee-ads-cell {
  color: var(--text);
  background: var(--panel);
  font-size: 9px;
  line-height: 1.45;
  white-space: pre-line;
}
a.shopee-ads-cell { color: var(--text); text-decoration: none; font-weight: 700; }
a.shopee-ads-cell:hover { color: #c83f24; text-decoration: underline; }
.shopee-ads-cell.negative { color: var(--crit); }
@media (max-width: 1180px) {
  .marketplace-reconciliation { grid-template-columns: repeat(3, minmax(135px, 1fr)); }
  .shopee-summary.shopee-ads-summary { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
  .shopee-ads-grid { grid-template-columns: 1fr; }
  .reconciliation-item:nth-child(3) { border-right: 0; }
  .reconciliation-item:nth-child(n + 4) { border-top: 1px solid var(--border); }
}
@media (max-width: 620px) {
  .marketplace-reconciliation { grid-template-columns: 1fr 1fr; }
  .shopee-summary.shopee-ads-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shopee-ads-day {
    grid-template-columns: 44px minmax(70px, 1fr) 112px;
    gap: 6px;
  }
  .shopee-ads-day > span { font-size: 8px; }
  .reconciliation-item:nth-child(3) { border-right: 1px solid var(--border); }
  .reconciliation-item:nth-child(2n) { border-right: 0; }
  .reconciliation-item:nth-child(n + 3) { border-top: 1px solid var(--border); }
}
.shopee-metric {
  min-height: 92px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-top: 3px solid #8290a4;
  border-radius: 7px;
}
.shopee-metric.warning { border-top-color: var(--warn); border-bottom-color: var(--border); }
.shopee-metric.danger { border-top-color: var(--crit); border-bottom-color: var(--border); }
.shopee-metric strong {
  margin-top: 7px;
  font-size: 20px;
}
.shopee-panel {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
}
.shopee-panel-wide { grid-column: auto; }
.shopee-panel-head {
  min-height: 54px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
}
.shopee-timeline { min-height: 180px; max-height: 260px; padding: 13px 15px; }
.shopee-timeline-track i { background: #ee4d2d; }
.shopee-status-list,
.shopee-table { max-height: 420px; }
.shopee-product-row,
.shopee-stock-row,
.shopee-order-row,
.shopee-listing-row {
  min-height: 58px;
  padding: 9px 13px;
}
.shopee-product-row > div:nth-child(2) small {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: #7a8799;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shopee-listing-row {
  grid-template-columns: 40px minmax(240px, 1fr) 100px 100px 90px;
}
.shopee-table-header {
  min-height: 34px;
  color: #64748b;
  background: #f6f8fb;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}
.shopee-table-header:hover { background: #f6f8fb; }
.shopee-listing-row.shopee-table-header { padding-top: 7px; padding-bottom: 7px; }
.shopee-listing-row.shopee-table-header strong { font-size: 9px; }
.shopee-products,
.shopee-orders-table,
.shopee-stock-table,
.shopee-cost-products {
  max-height: min(620px, calc(100vh - 290px));
  overflow: auto;
}
.shopee-list-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
}
.shopee-list-toolbar label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--text-dim);
  font-size: 9px;
  font-weight: 750;
}
.shopee-search-field { flex: 1; }
.shopee-list-toolbar input,
.shopee-list-toolbar select,
.shopee-cost-toolbar input,
.shopee-cost-row input {
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: var(--panel);
  outline: none;
}
.shopee-list-toolbar input { width: min(460px, 100%); }
.shopee-list-toolbar select { min-width: 150px; }
.shopee-list-toolbar input:focus,
.shopee-list-toolbar select:focus,
.shopee-cost-toolbar input:focus,
.shopee-cost-row input:focus { border-color: #ee806a; }
.shopee-result-count {
  margin-left: auto;
  padding-bottom: 8px;
  color: var(--text-dim);
  font-size: 10px;
}
.shopee-stock-layout.active {
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, .8fr);
}
.shopee-stock-layout .shopee-summary { grid-column: 1 / -1; }
.shopee-stock-row b {
  min-width: 54px;
  padding: 4px 7px;
  border-radius: 5px;
  text-align: center;
}
.shopee-stock-row b.critical { color: #b42334; background: #fff0f2; }
.shopee-stock-row b.warning { color: #9a5b09; background: #fff6e8; }
.shopee-logistics-list { padding: 4px 12px; }
.shopee-logistics-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--border);
}
.shopee-logistics-row:last-child { border-bottom: 0; }
.shopee-logistics-row strong,
.shopee-logistics-row span { display: block; }
.shopee-logistics-row strong { font-size: 11px; }
.shopee-logistics-row span { margin-top: 3px; color: var(--text-dim); font-size: 9px; }
.shopee-logistics-row b {
  padding: 4px 7px;
  border-radius: 5px;
  color: #69778b;
  background: #eef1f5;
  font-size: 9px;
}
.shopee-logistics-row b.enabled { color: #107448; background: #eaf8f0; }
.shopee-order-row {
  grid-template-columns: minmax(220px, 1fr) minmax(190px, .8fr) minmax(150px, auto);
}
.shopee-order-operation { min-width: 0; }
.shopee-order-operation strong,
.shopee-order-operation span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shopee-order-operation strong { font-size: 10.5px; }
.shopee-order-operation span { margin-top: 3px; color: var(--text-dim); font-size: 9px; }
.shopee-capability-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(110px, 1fr));
  gap: 0;
  padding: 8px 12px;
  overflow-x: auto;
}
.shopee-capability-compact {
  min-width: 110px;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-right: 1px solid var(--border);
}
.shopee-capability-compact:last-child { border-right: 0; }
.shopee-capability-compact > i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
}
.shopee-capability-compact.available > i { background: var(--ok); }
.shopee-capability-compact.partial > i,
.shopee-capability-compact.local > i { background: var(--warn); }
.shopee-capability-compact.pending > i { background: var(--info); }
.shopee-capability-compact strong,
.shopee-capability-compact span { display: block; }
.shopee-capability-compact strong {
  overflow: hidden;
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shopee-capability-compact span { margin-top: 2px; color: var(--text-dim); font-size: 8px; }
.shopee-capabilities {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 9px;
  padding: 12px;
}
.shopee-capability-card {
  min-height: 104px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-left: 3px solid #94a3b8;
  border-radius: 6px;
  background: #fbfcfe;
}
.shopee-capability-card.available { border-left-color: var(--ok); }
.shopee-capability-card.partial,
.shopee-capability-card.local { border-left-color: var(--warn); }
.shopee-capability-card.pending { border-left-color: var(--info); }
.shopee-capability-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.shopee-capability-card strong { font-size: 11px; }
.shopee-capability-card > div span {
  flex: 0 0 auto;
  padding: 3px 6px;
  border-radius: 5px;
  color: #536176;
  background: #edf1f6;
  font-size: 8px;
  font-weight: 800;
}
.shopee-capability-card.available > div span { color: #107448; background: #eaf8f0; }
.shopee-capability-card.pending > div span { color: #1769aa; background: #edf6fd; }
.shopee-capability-card.partial > div span,
.shopee-capability-card.local > div span { color: #9a5b09; background: #fff6e8; }
.shopee-capability-card p {
  margin-top: 9px;
  color: var(--text-dim);
  font-size: 9.5px;
  line-height: 1.45;
}
.shopee-cost-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
}
.shopee-cost-toolbar strong,
.shopee-cost-toolbar span { display: block; }
.shopee-cost-toolbar strong { font-size: 11px; }
.shopee-cost-toolbar span { margin-top: 3px; color: var(--text-dim); font-size: 9px; }
.shopee-cost-toolbar input { width: min(340px, 40%); }
.shopee-cost-row {
  min-width: 1080px;
  min-height: 66px;
  display: grid;
  grid-template-columns: minmax(265px, 1fr) 100px 120px 82px 92px 175px 70px;
  align-items: center;
  gap: 11px;
  padding: 9px 13px;
  border-bottom: 1px solid var(--border);
}
.shopee-cost-row:last-child { border-bottom: 0; }
.shopee-cost-row.shopee-table-header {
  min-height: 34px;
  padding-top: 7px;
  padding-bottom: 7px;
}
.shopee-cost-row.shopee-table-header strong {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
}
.shopee-cost-product {
  min-width: 0;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}
.shopee-cost-product strong,
.shopee-cost-product span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shopee-cost-product strong { font-size: 11px; }
.shopee-cost-product span { margin-top: 3px; color: var(--text-dim); font-size: 9px; }
.shopee-cost-sale { font-size: 11px; text-align: right; }
.shopee-cost-row label { min-width: 0; }
.shopee-cost-row label > span { display: none; }
.shopee-cost-row input { width: 100%; min-width: 0; }
.shopee-cost-margin strong,
.shopee-cost-margin span { display: block; }
.shopee-cost-margin strong { font-size: 10.5px; }
.shopee-cost-margin span { margin-top: 3px; color: var(--text-dim); font-size: 8.5px; }
.shopee-cost-margin.negative strong { color: var(--crit); }
.shopee-cost-save { min-width: 64px; padding-left: 8px; padding-right: 8px; }

@media (max-width: 1180px) {
  .shopee-summary { grid-template-columns: repeat(3, minmax(145px, 1fr)); }
  .shopee-summary-four { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .shopee-finance-breakdown { grid-template-columns: repeat(3, minmax(135px, 1fr)); }
  .shopee-finance-breakdown-item:nth-child(3) { border-right: 0; }
  .shopee-finance-breakdown-item:nth-child(n + 4) { border-top: 1px solid var(--border); }
  .shopee-capability-strip { grid-template-columns: repeat(7, 125px); }
  .shopee-capabilities { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
}

@media (max-width: 900px) {
  .tabs { align-items: center; gap: 5px; overflow-x: auto; overflow-y: hidden; }
  .marketplace-nav-group {
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
  }
  .marketplace-nav-trigger {
    width: auto;
    min-width: 48px;
    min-height: 46px;
    grid-template-columns: 30px auto;
    padding: 5px 7px;
  }
  .marketplace-nav-label small,
  .marketplace-group-toggle { display: none; }
  .marketplace-subnav {
    max-height: none;
    flex-direction: row;
    gap: 3px;
    margin: 0;
    padding: 0 0 0 5px;
    border-left-color: #33415a;
  }
  .marketplace-subtab,
  .tabs .marketplace-subtab {
    width: auto;
    min-width: 44px;
    min-height: 44px;
    grid-template-columns: 22px auto auto;
    flex: 0 0 auto;
    padding: 5px 7px;
    white-space: nowrap;
  }
  .shopee-overview-grid,
  .shopee-stock-layout.active { grid-template-columns: 1fr; }
  .shopee-stock-layout .shopee-summary { grid-column: 1; }
}

@media (max-width: 700px) {
  .shopee-view-heading h2 { font-size: 18px; }
  .shopee-period-bar { align-items: stretch; }
  .shopee-summary,
  .shopee-summary-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shopee-finance-breakdown { grid-template-columns: 1fr; }
  .shopee-finance-breakdown-item,
  .shopee-finance-breakdown-item:nth-child(3) {
    border-top: 1px solid var(--border);
    border-right: 0;
  }
  .shopee-finance-breakdown-item:first-child { border-top: 0; }
  .shopee-metric { min-height: 88px; padding: 10px; }
  .shopee-metric strong { font-size: 17px; }
  .shopee-list-toolbar { align-items: stretch; flex-direction: column; }
  .shopee-list-toolbar input,
  .shopee-list-toolbar select { width: 100%; }
  .shopee-result-count { margin-left: 0; padding: 0; }
  .shopee-listing-row { grid-template-columns: 36px minmax(0, 1fr) 86px; }
  .shopee-listing-row .shopee-listing-stock,
  .shopee-listing-row .shopee-listing-status,
  .shopee-listing-row.shopee-table-header > strong:nth-of-type(3),
  .shopee-listing-row.shopee-table-header > strong:nth-of-type(4) { display: none; }
  .shopee-order-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 12px;
  }
  .shopee-order-operation { grid-column: 1 / -1; grid-row: 2; }
  .shopee-orders-table .shopee-table-header { display: none; }
  .shopee-capabilities { grid-template-columns: 1fr; }
  .shopee-cost-toolbar { align-items: stretch; flex-direction: column; }
  .shopee-cost-toolbar input { width: 100%; }
  .shopee-finance-toolbar { align-items: stretch; flex-direction: column; }
  .shopee-finance-subtabs { overflow-x: auto; }
  .report-download { align-self: flex-start; }
  .external-cost-form { grid-template-columns: 1fr; }
  .external-cost-form-actions { justify-content: flex-end; }
  .external-cost-row { grid-template-columns: 82px minmax(0, 1fr) 30px; gap: 8px; }
  .external-cost-row b { grid-column: 2; grid-row: 2; text-align: left; }
  .external-cost-row button { grid-column: 3; grid-row: 1 / 3; }
}

@media (max-width: 620px) {
  .marketplace-nav-trigger { grid-template-columns: 30px; }
  .marketplace-nav-label { display: none; }
  .marketplace-subtab,
  .tabs .marketplace-subtab {
    position: relative;
    grid-template-columns: 22px;
  }
  .marketplace-subtab > span:nth-child(2) { display: none; }
  .marketplace-subtab .badge {
    position: absolute;
    top: 0;
    right: 0;
  }
}

/* Overrides finais para as linhas expansíveis Shopee. */
.shopee-listing-row {
  min-width: 1040px;
  grid-template-columns: 42px minmax(280px, 1.6fr) 100px 110px 90px 100px 82px 24px;
  gap: 10px;
}
.shopee-listing-row.stock-context {
  min-width: 0;
  grid-template-columns: 42px minmax(180px, 1fr) 82px 24px;
}
.shopee-listing-row.stock-context .shopee-listing-price,
.shopee-listing-row.stock-context .shopee-listing-sales,
.shopee-listing-row.stock-context .shopee-listing-quality,
.shopee-listing-row.stock-context .shopee-listing-status { display: none; }
.shopee-stock-layout.active { grid-template-columns: 1fr; }
.shopee-stock-layout .shopee-panel { grid-column: 1; }

@media (max-width: 700px) {
  .shopee-listing-row {
    min-width: 0;
    grid-template-columns: 36px minmax(0, 1fr) 72px 54px 20px;
  }
  .shopee-listing-row .shopee-listing-sales,
  .shopee-listing-row .shopee-listing-quality,
  .shopee-listing-row .shopee-listing-status { display: none; }
  .shopee-listing-row .shopee-listing-stock,
  .shopee-listing-row .shopee-listing-price { display: block; }
  .shopee-listing-row.shopee-table-header > strong:nth-of-type(2),
  .shopee-listing-row.shopee-table-header > strong:nth-of-type(4) { display: block; }
  .shopee-listing-row.shopee-table-header > strong:nth-of-type(3),
  .shopee-listing-row.shopee-table-header > strong:nth-of-type(5),
  .shopee-listing-row.shopee-table-header > strong:nth-of-type(6) { display: none; }
  .shopee-listing-row.stock-context { min-width: 0; }
  .shopee-listing-row.stock-context .shopee-listing-status { display: none; }
}

/* Shopee: chat, financeiro real e inteligência de catálogo */
.icon-btn {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 16px;
}
.icon-btn.danger { color: var(--crit); }
.shopee-product-facts {
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
}
.shopee-order-item-financial {
  margin-top: 4px;
  color: #516177;
  font-size: 8px;
  line-height: 1.45;
}
.shopee-order-row > .shopee-row-value small {
  display: block;
  margin-top: 4px;
  color: var(--text-dim);
  font-size: 8px;
  line-height: 1.4;
}
.shopee-cost-sale strong,
.shopee-cost-sale span {
  display: block;
}
.shopee-cost-sale span {
  margin-top: 3px;
  color: var(--text-dim);
  font-size: 8px;
  font-weight: 500;
}
.shopee-chat-shell {
  min-height: min(680px, calc(100vh - 170px));
  display: grid;
  grid-template-columns: minmax(280px, 330px) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
}
.shopee-chat-sidebar {
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: #f8fafc;
}
.shopee-chat-sidebar > header,
.shopee-chat-contact {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.shopee-chat-sidebar header strong,
.shopee-chat-sidebar header span,
.shopee-chat-contact strong,
.shopee-chat-contact span {
  display: block;
}
.shopee-chat-sidebar header strong,
.shopee-chat-contact strong { font-size: 11px; }
.shopee-chat-sidebar header span,
.shopee-chat-contact span {
  margin-top: 3px;
  color: var(--text-dim);
  font-size: 8.5px;
}
.shopee-chat-filters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 8px 9px 4px;
}
.shopee-chat-filters button {
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--text-dim);
  background: transparent;
  font-size: 9px;
  font-weight: 750;
  cursor: pointer;
}
.shopee-chat-filters button.active {
  border-color: #ffc6b9;
  color: #a9321c;
  background: #fff3f0;
}
#shopee-chat-search,
#shopee-chat-share-search {
  min-height: 34px;
  margin: 5px 9px 8px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  background: #fff;
  outline: none;
}
#shopee-chat-search:focus,
#shopee-chat-share-search:focus { border-color: #ee806a; }
.shopee-chat-conversations {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
}
.shopee-chat-conversation {
  width: 100%;
  min-height: 66px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 54px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 0;
  border-top: 1px solid #e5e9ef;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.shopee-chat-conversation:hover { background: #fff; }
.shopee-chat-conversation.active {
  box-shadow: inset 3px 0 #ee4d2d;
  background: #fff;
}
.shopee-chat-conversation.unread { background: #fff7f4; }
.shopee-chat-avatar {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  color: #a9321c;
  background: #ffe7e0;
  font-size: 12px;
  font-weight: 800;
}
.shopee-chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.shopee-chat-conversation-text,
.shopee-chat-conversation-text strong,
.shopee-chat-conversation-text small {
  min-width: 0;
  display: block;
}
.shopee-chat-conversation-text strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shopee-chat-conversation.unread strong { font-weight: 850; }
.shopee-chat-conversation-text small {
  margin-top: 4px;
  overflow: hidden;
  color: var(--text-dim);
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shopee-chat-conversation-meta {
  align-self: stretch;
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  justify-content: space-between;
}
.shopee-chat-conversation-meta small { color: var(--text-dim); font-size: 7.5px; }
.shopee-chat-conversation-meta b {
  min-width: 17px;
  min-height: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  background: #ee4d2d;
  font-size: 8px;
}
.shopee-chat-conversation-meta b:empty { background: transparent; }
.shopee-chat-more {
  margin: 7px 9px 9px;
  font-size: 9px;
}
.shopee-chat-main {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.shopee-chat-contact-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}
.shopee-chat-messages {
  min-height: 0;
  padding: 16px 18px;
  overflow-y: auto;
  background: #f4f6f9;
}
.shopee-chat-message {
  display: flex;
  justify-content: flex-start;
  margin: 7px 0;
}
.shopee-chat-message.own { justify-content: flex-end; }
.shopee-chat-message > div {
  max-width: min(72%, 620px);
  padding: 9px 11px;
  border: 1px solid #dfe4eb;
  border-radius: 7px 7px 7px 2px;
  color: #253047;
  background: #fff;
  font-size: 10.5px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.shopee-chat-message.own > div {
  border-color: #ffd2c8;
  border-radius: 7px 7px 2px 7px;
  background: #fff1ed;
}
.shopee-chat-message > div > small {
  display: block;
  margin-top: 5px;
  color: #7b8798;
  font-size: 7.5px;
  text-align: right;
}
.shopee-chat-image-message {
  width: auto;
  max-width: min(280px, 100%);
  max-height: 320px;
  display: block;
  border-radius: 5px;
  object-fit: contain;
}
.shopee-chat-sticker-message {
  display: block;
  width: 88px;
  height: 88px;
  object-fit: contain;
}
.shopee-chat-product-message {
  min-width: min(360px, 100%);
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  color: inherit;
  text-decoration: none;
}
.shopee-chat-product-message img {
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 4px;
  object-fit: cover;
}
.shopee-chat-product-message strong,
.shopee-chat-product-message small { display: block; }
.shopee-chat-product-message strong { font-size: 9.5px; }
.shopee-chat-product-message small { margin-top: 4px; color: var(--text-dim); font-size: 8px; }
.shopee-chat-composer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--panel);
}
.shopee-chat-tools { display: flex; gap: 4px; }
.shopee-chat-tools label { margin: 0; cursor: pointer; }
.shopee-chat-tools input { display: none; }
.shopee-chat-composer textarea {
  width: 100%;
  min-height: 40px;
  max-height: 110px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: #fff;
  font: inherit;
  line-height: 1.35;
  resize: vertical;
  outline: none;
}
.shopee-chat-composer textarea:focus { border-color: #ee806a; }
.shopee-chat-share {
  position: absolute;
  right: 12px;
  bottom: 70px;
  z-index: 8;
  width: min(520px, calc(100% - 24px));
  max-height: 440px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #cfd6e1;
  border-radius: 7px;
  box-shadow: var(--shadow-3);
  background: #fff;
}
.shopee-chat-share > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 11px;
  border-bottom: 1px solid var(--border);
}
.shopee-chat-share > header strong { font-size: 10.5px; }
#shopee-chat-share-results { overflow-y: auto; }
#shopee-chat-share-results.sticker-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(42px, 1fr));
  gap: 5px;
  padding: 7px;
}
.shopee-chat-sticker {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-width: 0;
  padding: 3px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}
.shopee-chat-sticker:hover {
  border-color: #ffd0c6;
  background: #fff7f4;
}
.shopee-chat-sticker img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.shopee-chat-share-row {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 0;
  border-top: 1px solid var(--border);
  color: var(--text);
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.shopee-chat-share-row:hover { background: #f8fafc; }
.shopee-chat-share-row > span,
.shopee-chat-share-row strong,
.shopee-chat-share-row small { min-width: 0; display: block; }
.shopee-chat-share-row > span { flex: 1; }
.shopee-chat-share-row strong {
  overflow: hidden;
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shopee-chat-share-row small { margin-top: 4px; color: var(--text-dim); font-size: 8px; }
.shopee-create-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 8px;
}
.shopee-create-intelligence {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.shopee-create-intelligence > section {
  min-width: 0;
  padding: 13px;
  border-right: 1px solid var(--border);
}
.shopee-create-intelligence > section:last-child { border-right: 0; }
.shopee-create-intelligence > section > header strong,
.shopee-create-intelligence > section > header span { display: block; }
.shopee-create-intelligence > section > header strong { font-size: 11px; }
.shopee-create-intelligence > section > header span { margin-top: 3px; color: var(--text-dim); font-size: 8.5px; }
.shopee-intelligence-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--border);
}
.shopee-intelligence-row:first-child { margin-top: 9px; }
.shopee-intelligence-row .shopee-product-thumb {
  width: 34px;
  height: 34px;
}
.shopee-intelligence-row strong,
.shopee-intelligence-row span { display: block; min-width: 0; }
.shopee-intelligence-row strong {
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shopee-intelligence-row span { margin-top: 3px; color: var(--text-dim); font-size: 7.8px; }
.shopee-intelligence-row b { color: #334155; font-size: 9px; white-space: nowrap; }
.shopee-simulator {
  border: 1px solid var(--border);
  border-top: 3px solid #ee4d2d;
  border-radius: 7px;
  background: var(--panel);
}
.shopee-simulator > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.shopee-simulator > header span {
  color: #d94a2d;
  font-size: 8px;
  font-weight: 850;
}
.shopee-simulator h3 { margin-top: 2px; font-size: 15px; }
.shopee-simulator > header small { color: var(--text-dim); font-size: 8.5px; text-align: right; }
.shopee-simulator-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 8px;
  padding: 12px 14px 8px;
}
.shopee-simulator-grid label {
  color: var(--text-dim);
  font-size: 8px;
  font-weight: 750;
}
.shopee-simulator-grid input {
  width: 100%;
  min-height: 34px;
  margin-top: 5px;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  background: #fff;
  outline: none;
}
.shopee-simulator-grid input:focus { border-color: #ee806a; }
.shopee-simulator-note {
  margin: 0 !important;
  padding: 0 14px 10px;
  font-size: 8.5px !important;
}
.shopee-simulator-results {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  border-top: 1px solid var(--border);
}
.shopee-simulator-results .shopee-metric {
  min-height: 82px;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
}
.shopee-simulator-results .shopee-metric:last-child { border-right: 0; }

@media (max-width: 1180px) {
  .shopee-create-summary,
  .shopee-simulator-results { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .shopee-create-intelligence { grid-template-columns: 1fr; }
  .shopee-create-intelligence > section { border-right: 0; border-bottom: 1px solid var(--border); }
  .shopee-create-intelligence > section:last-child { border-bottom: 0; }
  .shopee-simulator-grid { grid-template-columns: repeat(4, minmax(120px, 1fr)); }
}

@media (max-width: 900px) {
  .shopee-chat-shell { grid-template-columns: 1fr; }
  .shopee-chat-sidebar {
    max-height: 290px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .shopee-chat-main { min-height: 520px; }
}

@media (max-width: 700px) {
  .shopee-create-summary,
  .shopee-simulator-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shopee-simulator-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shopee-chat-composer { grid-template-columns: 1fr auto; }
  .shopee-chat-tools { grid-column: 1 / -1; }
  .shopee-chat-message > div { max-width: 88%; }
  .shopee-chat-contact { align-items: flex-start; }
  #shopee-chat-share-results.sticker-grid { grid-template-columns: repeat(5, minmax(42px, 1fr)); }
}
