/* Painéis SaaS — identidade IMPETUS OS (vermelho + prata + charcoal) */
:root {
  --bg: #0b0b0d;
  --bg2: #121214;
  --bg3: #1a1a1e;
  --bg4: #24242a;
  --cream: #E8E8EC;
  --muted: #8b8b96;
  --gold: #E31E24;
  --gold-rgb: 227, 30, 36;
  --gold-soft: rgba(227, 30, 36, 0.16);
  --silver: #C5C9D1;
  --danger: #ff6b6b;
  --ok: #5dbe8a;
  --line: rgba(232, 232, 236, 0.08);
  --font: "Outfit", system-ui, sans-serif;
  --display: "Rajdhani", "Outfit", system-ui, sans-serif;
  --radius: 14px;
}

* { box-sizing: border-box; }
html {
  scrollbar-width: thin;
  scrollbar-color: rgba(227, 30, 36, 0.45) #121214;
}
html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1100px 560px at 8% -12%, rgba(227, 30, 36, 0.16) 0%, transparent 52%),
    radial-gradient(900px 420px at 100% 0%, rgba(197, 201, 209, 0.07) 0%, transparent 48%),
    var(--bg);
  color: var(--cream);
  font-family: var(--font);
  font-weight: 400;
}
::selection {
  background: rgba(227, 30, 36, 0.35);
  color: #fff;
}
/*
 * UX-LAYOUT-001 — quando o AppShell (.shell) está montado:
 * trava o scroll do documento; só .main rola.
 * Login/auth (sem .shell) preservam scroll normal do body.
 */
html:has(.shell),
html:has(#root .shell),
body:has(.shell),
body:has(#root .shell) {
  height: 100%;
  overflow: hidden;
}
#root:has(.shell) {
  height: 100%;
  min-height: 100%;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, .display {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.03em;
}

.muted { color: var(--muted); }
.gold { color: var(--gold); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid var(--gold);
  background: var(--gold);
  color: #fff;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  cursor: pointer;
  transition: opacity .15s ease, transform .15s ease, box-shadow .15s ease;
  box-shadow: 0 8px 22px rgba(227, 30, 36, 0.28);
}
.btn:hover { opacity: 0.94; transform: translateY(-1px); box-shadow: 0 12px 28px rgba(227, 30, 36, 0.38); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-ghost {
  background: transparent;
  color: var(--cream);
  border-color: var(--line);
  box-shadow: none;
}
.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: none;
}
.btn-danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}
.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.78rem; }

.field { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.field label { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.field input, .field select, .field textarea {
  background: var(--bg3);
  border: 1px solid var(--line);
  color: var(--cream);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  font: inherit;
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: rgba(var(--gold-rgb), 0.55);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-error { background: rgba(196, 122, 106, 0.12); color: #e2b4aa; border: 1px solid rgba(196,122,106,.25); }
.alert-ok { background: rgba(122, 158, 126, 0.12); color: #b9d0bc; border: 1px solid rgba(122,158,126,.25); }

/* Login */
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}
.auth-card {
  width: min(420px, 100%);
  background: linear-gradient(180deg, var(--bg2), var(--bg));
  border: 1px solid rgba(var(--gold-rgb), 0.18);
  border-radius: 20px;
  padding: 2.25rem 1.75rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 48px rgba(227, 30, 36, 0.08);
}
.auth-card .brand {
  font-family: var(--display);
  font-size: 2rem;
  margin: 0 0 0.25rem;
}
/* Marca IMPETUS OS — identidade do SaaS (nunca na loja pública do vendedor) */
.brand-mark {
  display: block;
  width: 168px;
  height: auto;
  margin: 0 auto 1.1rem;
  border-radius: 16px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.4), 0 0 28px rgba(227, 30, 36, 0.16);
}
.brand-mark.lg { width: 236px; }
.side .brand-mark {
  width: 100%;
  max-width: 176px;
  margin: 0.25rem auto 0.9rem;
}
.side .store-name {
  padding: 0 0.5rem;
  margin: 0;
  font-family: var(--display);
  font-size: 1.2rem;
  color: var(--cream);
  line-height: 1.2;
}
.auth-card .sub { margin: 0 0 1.75rem; color: var(--muted); font-size: 0.95rem; }

/* App shell — UX-LAYOUT-001: sidebar fixa + scroll só no conteúdo */
.shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: 100%;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
.side {
  background: linear-gradient(180deg, #16161a 0%, var(--bg2) 40%);
  border-right: 1px solid rgba(var(--gold-rgb), 0.12);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  /* Largura constante da coluna do grid; scroll interno se o menu for longo */
  z-index: 20;
}
.side .brand {
  font-family: var(--display);
  font-size: 1.55rem;
  margin: 0 0 0.15rem;
  padding: 0 0.5rem;
}
.side .who {
  padding: 0 0.5rem 1.25rem;
  color: var(--muted);
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(var(--gold-rgb), 0.22);
  margin-bottom: 0.75rem;
}
.side-nav { display: flex; flex-direction: column; gap: 0.35rem; }
.side-drawer-head {
  display: flex;
  align-items: center;
  justify-content: center;
}
.m-topbar, .m-bottom, .nav-backdrop, .m-icon-btn.side-close { display: none; }
.plan-badge {
  align-self: flex-start;
  margin: 0 0.5rem 0.9rem;
  padding: 0.22rem 0.6rem;
  border: 1px solid var(--gold);
  border-radius: 999px;
  color: var(--gold);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.mode-switch {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg3);
}
.mode-switch button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
}
.mode-switch button.active {
  background: var(--gold-soft);
  color: var(--gold);
}
.mode-switch button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.ai-tag {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav-btn {
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--cream);
  font: inherit;
  padding: 0.7rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
}
.nav-btn:hover, .nav-btn.active {
  background: var(--gold-soft);
  color: var(--gold);
}
.nav-btn .soon {
  float: right;
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.main {
  padding: 1.75rem 2rem 3rem;
  min-height: 0;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.main-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  /* Sticky dentro da área de conteúdo (não no body) */
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 0.35rem 0 0.85rem;
  margin-top: -0.35rem;
  background: linear-gradient(180deg, rgba(11, 11, 13, 0.97) 70%, rgba(11, 11, 13, 0.88) 100%);
  backdrop-filter: blur(6px);
}
.main-head h1 { margin: 0; font-size: 2rem; }
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}
.stat {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.stat .k { color: var(--muted); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; }
.stat .v { font-family: var(--display); font-size: 1.85rem; margin-top: 0.25rem; color: var(--gold); }
button.stat {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  appearance: none;
}
.stat-nav {
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.stat-nav:hover,
.stat-nav:focus-visible {
  border-color: rgba(201, 169, 110, 0.55);
  box-shadow: 0 0 0 1px rgba(201, 169, 110, 0.2);
  transform: translateY(-1px);
  outline: none;
}
.stat-nav:active { transform: translateY(0); }

/* KPI-DRILLDOWN-001 — triggers interativos (AppShell Admin) */
.ie-trigger {
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.ie-trigger:hover,
.ie-trigger:focus-visible {
  border-color: rgba(227, 30, 36), 0.55);
  box-shadow: 0 0 0 1px rgba(227, 30, 36), 0.2);
  transform: translateY(-1px);
  outline: none;
}
.ie-trigger:active { transform: translateY(0); }
.stat.ie-trigger::after,
.pi-kpi-card.ie-trigger::after,
.pi-metric-card.ie-trigger::after {
  content: 'Explorar';
  display: block;
  margin-top: 0.35rem;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.18s ease;
}
.stat.ie-trigger:hover::after,
.stat.ie-trigger:focus-visible::after,
.pi-kpi-card.ie-trigger:hover::after,
.pi-kpi-card.ie-trigger:focus-visible::after,
.pi-metric-card.ie-trigger:hover::after,
.pi-metric-card.ie-trigger:focus-visible::after {
  opacity: 1;
  color: var(--gold);
}

.panel {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}
.toolbar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  align-items: center;
}
.toolbar input, .toolbar select {
  background: var(--bg3);
  border: 1px solid var(--line);
  color: var(--cream);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  font: inherit;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
table.data th, table.data td {
  text-align: left;
  padding: 0.75rem 0.55rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.data th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
table.data tr { cursor: pointer; }
table.data tr:hover td { background: rgba(255,255,255,0.02); }

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--line);
}
.badge-ACTIVE { color: var(--ok); border-color: rgba(122,158,126,.35); }
.badge-BLOCKED { color: var(--danger); border-color: rgba(196,122,106,.35); }
.badge-INACTIVE { color: var(--muted); }

.photo-box {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg3);
}
.photo-frame {
  position: relative;
  flex: 0 0 auto;
  width: 92px;
  height: 116px;
  border-radius: 12px;
  border: 1px dashed rgba(243, 237, 227, 0.16);
  background: var(--bg2);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.photo-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-frame span {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.photo-controls {
  flex: 1 1 240px;
  min-width: 0;
}
.photo-controls > label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.6rem;
}
.photo-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.photo-actions input[type='file'] {
  flex: 1 1 200px;
  min-width: 0;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--cream);
  font: inherit;
  font-size: 0.85rem;
  padding: 0.5rem 0.6rem;
}
.photo-actions input[type='file']::file-selector-button {
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  border-radius: 999px;
  font: inherit;
  font-size: 0.78rem;
  padding: 0.3rem 0.8rem;
  margin-right: 0.7rem;
  cursor: pointer;
}
.photo-hint {
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}
.thumb {
  width: 40px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg3);
  vertical-align: middle;
  margin-right: 0.55rem;
}

.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: grid;
  place-items: center;
  padding: 1rem;
  z-index: 40;
}
.modal {
  width: min(640px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.5rem;
}
.modal h2 { margin-top: 0; }
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}

/* Estoque — formulário e lista responsivos */
.inv-form { display: grid; gap: .15rem; }
.inv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 .85rem;
}
.inv-grid-nums { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.inv-span-2 { grid-column: 1 / -1; }
.inv-form .section-label {
  margin: 1rem 0 .35rem;
  padding-top: .35rem;
  border-top: 1px solid var(--line);
}
.inv-form .section-label:first-of-type,
.inv-form-panel > .section-label {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}
.inv-form .field { margin-bottom: .75rem; }
.inv-form .field input,
.inv-form .field select,
.inv-form .field textarea {
  width: 100%;
  max-width: 100%;
}
.inv-form-actions {
  margin-top: .5rem;
  padding-top: .75rem;
  border-top: 1px solid var(--line);
}
.inv-photo { margin-bottom: .5rem; }
.inv-cards { display: none; gap: .75rem; }
.inv-table-wrap { overflow: auto; }
.inv-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0,0,0,.16);
  padding: .85rem;
  display: grid;
  gap: .7rem;
}
.inv-card-top { display: flex; gap: .75rem; align-items: flex-start; }
.inv-card-thumb {
  width: 56px;
  height: 70px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg3);
  flex-shrink: 0;
}
.inv-card-thumb-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: .75rem;
}
.inv-card-info { min-width: 0; display: grid; gap: .25rem; }
.inv-card-info strong {
  font-size: .98rem;
  line-height: 1.25;
  word-break: break-word;
}
.inv-card-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .4rem;
  text-align: center;
}
.inv-card-stats > div {
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .45rem .25rem;
}
.inv-card-stats .muted {
  display: block;
  font-size: .65rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: .15rem;
}
.inv-card-stats strong { font-size: .82rem; }
.inv-card-actions { justify-content: stretch; }
.inv-card-actions .btn { flex: 1; }
.inv-summary { line-height: 1.45; }

@media (max-width: 860px) {
  .inv-grid { grid-template-columns: 1fr 1fr; gap: 0 .65rem; }
  .inv-grid-nums { grid-template-columns: 1fr 1fr; }
  .inv-photo {
    flex-direction: column;
    align-items: stretch;
  }
  .inv-photo .photo-frame {
    width: 100%;
    max-width: 140px;
    height: 160px;
    margin: 0 auto;
  }
  .photo-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .photo-actions input[type='file'],
  .photo-actions .btn {
    width: 100%;
  }
  .inv-cards { display: grid; }
  .inv-table-wrap { display: none; }
  .inv-form-actions .btn { width: 100%; }
}
.section-label {
  grid-column: 1 / -1;
  margin: 0.5rem 0 0.25rem;
  color: var(--gold);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
}
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* IMPETUS Copilot */
.copilot-panel {
  display: flex;
  flex-direction: column;
  min-height: min(70vh, 640px);
  padding: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 50% at 10% 0%, rgba(201, 162, 39, 0.08), transparent 55%),
    var(--bg2);
}
.copilot-thread {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.25rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.copilot-msg {
  max-width: min(520px, 92%);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.copilot-msg.user {
  align-self: flex-end;
  align-items: flex-end;
}
.copilot-msg.assistant {
  align-self: flex-start;
}
.copilot-bubble {
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  line-height: 1.45;
  font-size: 0.95rem;
  white-space: pre-wrap;
}
.copilot-msg.user .copilot-bubble {
  background: rgba(201, 162, 39, 0.14);
  border-color: rgba(201, 162, 39, 0.35);
  color: var(--text);
}
.copilot-msg.assistant .copilot-bubble {
  background: var(--bg3);
  border-left: 2px solid var(--gold);
}
.copilot-quick {
  padding: 0 1.25rem;
  border-top: 1px solid var(--line);
  padding-top: 0.85rem;
}
.copilot-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem 1.25rem;
  border-top: 1px solid var(--line);
}
.copilot-form input {
  flex: 1;
  margin: 0;
}

/* PDI-003 PR-D — Assistente onboarding (P2 /app) */
.onboard-panel { margin-bottom: 1.25rem; border-color: rgba(227, 30, 36), 0.35); }
.onboard-head {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.onboard-progress-wrap { display: flex; align-items: center; gap: .65rem; min-width: 8rem; }
.onboard-progress {
  flex: 1;
  height: 6px;
  background: var(--bg2);
  border-radius: 999px;
  overflow: hidden;
  min-width: 5rem;
}
.onboard-progress > span {
  display: block;
  height: 100%;
  background: var(--gold);
  border-radius: 999px;
  transition: width .25s ease;
}
.onboard-pct { font-size: .78rem; color: var(--gold); min-width: 2.2rem; text-align: right; }
.onboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.onboard-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .75rem .85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg2);
}
.onboard-item.done { opacity: 0.82; border-color: rgba(122, 158, 126, 0.35); }
.onboard-check { color: var(--gold); flex: none; line-height: 1.4; font-size: .95rem; }
.onboard-item.done .onboard-check { color: var(--ok); }
.onboard-item-body { flex: 1; min-width: 0; }
.onboard-item-body strong { display: block; font-weight: 500; font-size: .92rem; }
.onboard-item-body p { margin: .25rem 0 0; font-size: .78rem; line-height: 1.45; }
.onboard-actions { margin-top: 1rem; justify-content: flex-end; }

/* Botão flutuante de suporte WhatsApp — apenas no painel do vendedor (.vendor-support-wa) */
.vendor-support-wa {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 9000;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 0.95rem 0.7rem 0.75rem;
  border-radius: 999px;
  background: #25d366;
  color: #fff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.vendor-support-wa:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  color: #fff;
}
.vendor-support-wa:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
.vendor-support-wa svg {
  display: block;
  flex: none;
}
.vendor-support-wa-label {
  padding-right: 0.15rem;
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    height: 100dvh;
    max-height: 100dvh;
  }
  .m-topbar {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .65rem .85rem;
    padding-top: max(.65rem, env(safe-area-inset-top));
    border-bottom: 1px solid var(--line);
    background: rgba(18, 16, 14, .94);
    backdrop-filter: blur(10px);
    z-index: 30;
    min-height: 58px;
  }
  .m-topbar-brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-width: 0;
    flex: 1;
  }
  .m-topbar-brand strong {
    display: block;
    font-size: .95rem;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .m-topbar-brand .muted {
    display: block;
    font-size: .72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .m-topbar-logo {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: contain;
    background: #121214;
    flex-shrink: 0;
    box-shadow: 0 0 12px rgba(227, 30, 36, 0.22);
  }
  .m-topbar-plan .plan-badge {
    margin: 0;
    font-size: .58rem;
    padding: .18rem .45rem;
  }
  .m-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--bg3);
    color: var(--cream);
    cursor: pointer;
    flex-shrink: 0;
  }
  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    z-index: 40;
  }
  .nav-backdrop[hidden] { display: none !important; }
  .side {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(86vw, 300px);
    max-height: none;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    z-index: 50;
    transform: translateX(-105%);
    transition: transform .22s ease;
    padding: 1rem .85rem calc(1rem + env(safe-area-inset-bottom));
    box-shadow: 8px 0 32px rgba(0, 0, 0, .35);
  }
  .shell.nav-open .side { transform: translateX(0); }
  .side-drawer-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem;
  }
  .side-drawer-head .brand-mark {
    max-width: 120px;
    margin: 0;
  }
  .m-icon-btn.side-close { display: inline-flex; }
  .side .store-name { font-size: 1.15rem; margin-top: .75rem; }
  .side .who { padding-bottom: .85rem; margin-bottom: .55rem; }
  .side-nav .nav-btn {
    min-height: 44px;
    font-size: .92rem;
    text-align: left;
    justify-content: flex-start;
  }
  .main {
    padding: 1rem .9rem calc(5.5rem + env(safe-area-inset-bottom));
    min-height: 0;
  }
  .main-head h1 { font-size: 1.55rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .panel { padding: .95rem; }
  .actions { gap: .55rem; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 38px; }
  .m-bottom {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: .15rem;
    position: sticky;
    bottom: 0;
    z-index: 25;
    padding: .4rem .35rem calc(.45rem + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(18, 16, 14, .96);
    backdrop-filter: blur(12px);
  }
  .m-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .18rem;
    min-height: 52px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: .68rem;
    letter-spacing: .02em;
    cursor: pointer;
    border-radius: 12px;
    padding: .25rem .1rem;
  }
  .m-tab.active {
    color: var(--gold);
    background: rgba(227, 30, 36), .1);
  }
  .m-tab svg { display: block; }
  .vendor-support-wa {
    right: 1rem;
    bottom: calc(4.6rem + env(safe-area-inset-bottom));
    padding: 0.75rem;
    border-radius: 50%;
  }
  .vendor-support-wa-label { display: none; }
  html.nav-drawer-open,
  html.nav-drawer-open body {
    overflow: hidden;
  }
  .admin-shell .stats {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 148px), 1fr));
  }
  .admin-shell .toolbar {
    flex-wrap: wrap;
  }
  .admin-shell .toolbar input,
  .admin-shell .toolbar select {
    min-width: 0;
    flex: 1 1 12rem;
  }
  .admin-shell .stat .v,
  .admin-shell .stat .k {
    overflow-wrap: anywhere;
  }
  .admin-shell .nav-btn {
    min-height: 44px;
  }
}

/* PR-048 — Centro de Segurança (escopo .sec-* / badge-SEC-*) */
.sec-grid-2 {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}
@media (min-width: 1024px) {
  .sec-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
}
.badge-SEC-OK { color: var(--ok); border-color: rgba(122,158,126,.35); }
.badge-SEC-WARN { color: var(--gold); border-color: rgba(227,30,36),.35); }
.badge-SEC-ALERT { color: #d4a574; border-color: rgba(212,165,116,.35); }
.badge-SEC-CRIT { color: var(--danger); border-color: rgba(196,122,106,.35); }
.badge-SEC-INFO { color: var(--muted); border-color: var(--line); }
/* PR-049 — accents escopo Centro (não alteram :root global) */
.sec-score {
  font-family: var(--display);
  font-size: 1.85rem;
  color: #7eb8c9;
}
.stat.sec-kpi-info .v { color: #7eb8c9; }
.stat.sec-kpi-gov .v { color: #a89bc4; }
.badge-SEC-GOV { color: #a89bc4; border-color: rgba(168,155,196,.35); }
.sec-label-gov { color: #a89bc4; }
.sec-layer {
  border-top: 1px solid var(--line);
  padding-top: 0.85rem;
}
.sec-list {
  margin: 0 0 0.75rem;
  padding-left: 1.1rem;
}
.sec-list li { margin-bottom: 0.35rem; }
.sec-expand-btn { margin-top: 0.15rem; }

/* PR-050 — Visual Analytics */
.sec-chart-toolbar { margin-bottom: 0.75rem; }
.sec-chart-panel { margin: 0; }
.sec-chart-svg {
  width: 100%;
  height: auto;
  min-height: 160px;
  display: block;
}
.sec-chart-svg-square {
  max-width: 200px;
  margin: 0 auto;
  min-height: 160px;
}
.sec-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin-top: 0.65rem;
}
.sec-chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.sec-chart-legend-item i {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
  display: inline-block;
}
.sec-chart-caption { margin: 0.5rem 0 0; font-size: 0.78rem; }
.sec-chart-empty { padding: 1.25rem 0.5rem; }
.sec-bar-row {
  display: grid;
  grid-template-columns: minmax(7rem, 28%) 1fr 2.5rem;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.45rem;
}
.sec-bar-label { font-size: 0.78rem; }
.sec-bar-track {
  height: 0.55rem;
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.sec-bar-fill { height: 100%; border-radius: 999px; }
.sec-bar-value { font-size: 0.78rem; text-align: right; color: var(--cream); }
.sec-heat-grid {
  display: grid;
  gap: 3px;
}
.sec-heat-cell {
  aspect-ratio: 1;
  min-height: 12px;
  border-radius: 3px;
  border: 1px solid var(--line);
}
.sec-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 280px;
  overflow-y: auto;
}
.sec-timeline-item {
  display: grid;
  grid-template-columns: 7.5rem auto 1fr;
  gap: 0.4rem 0.65rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
}
.sec-timeline-item .muted:last-child { grid-column: 1 / -1; }
.sec-timeline-time { font-size: 0.75rem; }
@media (max-width: 860px) {
  .sec-bar-row { grid-template-columns: 1fr; }
  .sec-timeline-item { grid-template-columns: 1fr; }
  .sec-chart-svg { min-height: 140px; }
}

/* PR-051 — UX / a11y / Focus Mode */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.sec-updating {
  margin-left: 0.5rem;
  color: var(--gold);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}
.sec-layer {
  animation: sec-fade-in 160ms ease-out;
}
@keyframes sec-fade-in {
  from { opacity: 0.55; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .sec-layer { animation: none; }
}
.sec-expand-btn:focus-visible,
.sec-chart-toolbar select:focus-visible,
#sec-refresh-poll:focus-visible,
.toolbar input:focus-visible,
.toolbar select:focus-visible,
.toolbar button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.sec-focus-banner {
  background: rgba(196, 122, 106, 0.12);
  color: #e2b4aa;
  border: 1px solid rgba(196, 122, 106, 0.3);
  margin-bottom: 1rem;
}
.sec-focus-mode [data-sec-focus="secondary"] {
  opacity: 0.48;
  transition: opacity 180ms ease;
}
.sec-focus-mode [data-sec-focus="primary"] {
  box-shadow: inset 0 0 0 1px rgba(196, 122, 106, 0.35);
  transition: box-shadow 180ms ease, opacity 180ms ease;
}
.sec-focus-mode .stat[data-sec-focus="primary"] {
  box-shadow: inset 0 0 0 1px rgba(196, 122, 106, 0.28);
}
.sec-state[data-sec-state="loading"],
.sec-state[data-sec-state="awaiting"] {
  min-height: 1.5rem;
}

/* ── PLATFORM-INTELLIGENCE-001 — Estilos exclusivos PI (prefixo .pi-) ── */
.pi-wrap { display: flex; flex-direction: column; gap: 1.25rem; }

.pi-topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  /* UX-LAYOUT-001 — filtros PI permanecem visíveis ao rolar o .main */
  position: sticky;
  top: 0;
  z-index: 12;
}
.pi-topbar-title { display: flex; flex-direction: column; gap: 0.1rem; }
.pi-topbar-title h2 { margin: 0; font-size: 1.15rem; letter-spacing: 0.04em; }
.pi-topbar-title small { color: var(--muted); font-size: 0.72rem; letter-spacing: 0.05em; }
.pi-period-group { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.pi-period-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 8px;
  padding: 0.35rem 0.75rem;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pi-period-btn:hover { background: var(--bg3); color: var(--cream); }
.pi-period-btn.active { background: rgba(227,30,36),.18); border-color: var(--gold); color: var(--gold); }
.pi-custom-dates {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.pi-custom-dates input {
  background: var(--bg3);
  border: 1px solid var(--line);
  color: var(--cream);
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  font: inherit;
  font-size: 0.8rem;
  width: 120px;
}
.pi-refresh { color: var(--muted); font-size: 0.75rem; white-space: nowrap; }

/* KPI Cards */
.pi-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}
.pi-kpi-card {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  position: relative;
  overflow: hidden;
}
.pi-kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gold);
  opacity: 0.35;
}
.pi-kpi-label {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.pi-kpi-icon { font-size: 0.9rem; }
.pi-kpi-value {
  font-family: var(--display);
  font-size: 1.75rem;
  color: var(--gold);
  line-height: 1.1;
}
.pi-kpi-footer { display: flex; justify-content: space-between; align-items: flex-end; gap: 0.5rem; }
.pi-delta { font-size: 0.75rem; letter-spacing: 0.02em; }
.pi-delta.up   { color: #7a9e7e; }
.pi-delta.down { color: #c47a6a; }
.pi-delta.flat { color: var(--muted); }
.pi-sparkline { flex: 1; min-width: 0; opacity: 0.8; }
.pi-sparkline svg { width: 100%; height: 28px; display: block; }

/* Inteligência Executiva */
.pi-intel-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.pi-intel-head h3 {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.pi-intel-head span {
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--bg3);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.pi-intel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.65rem;
}
.pi-intel-card {
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem;
}
.pi-intel-card-label { font-size: 0.72rem; color: var(--muted); letter-spacing: 0.04em; margin-bottom: 0.4rem; text-transform: uppercase; }
.pi-intel-card-value { font-size: 1rem; font-weight: 500; line-height: 1.2; }
.pi-intel-card-desc  { font-size: 0.75rem; color: var(--muted); margin-top: 0.25rem; line-height: 1.35; }
.pi-intel-ok   { color: #7a9e7e; }
.pi-intel-warn { color: #d4a574; }
.pi-intel-crit { color: #c47a6a; }
.pi-intel-info { color: var(--gold); }
.pi-intel-muted { color: var(--muted); }

/* Chart panels */
.pi-chart-row {
  display: grid;
  gap: 0.75rem;
  align-items: start;
}
.pi-chart-row.col-3 { grid-template-columns: 2fr 1.2fr 1.2fr; }
.pi-chart-row.col-3-eq { grid-template-columns: 1fr 1fr 1fr; }
.pi-chart-row.col-2 { grid-template-columns: 1fr 1fr; }
.pi-chart-panel {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.pi-chart-title {
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pi-chart-svg {
  width: 100%;
  height: auto;
  display: block;
}
.pi-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  margin-top: 0.55rem;
}
.pi-chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.pi-chart-legend-item i {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 2px;
  flex: none;
}
.pi-chart-empty {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 1.5rem 0.5rem;
}

/* Horizontal bar chart */
.pi-hbar-row {
  display: grid;
  grid-template-columns: minmax(6rem, 30%) 1fr 3.5rem;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.5rem;
}
.pi-hbar-label { font-size: 0.78rem; color: var(--muted); }
.pi-hbar-track {
  height: 0.45rem;
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.pi-hbar-fill { height: 100%; border-radius: 999px; }
.pi-hbar-value { font-size: 0.78rem; color: var(--cream); text-align: right; }

/* Funnel */
.pi-funnel { display: flex; flex-direction: column; gap: 0.4rem; }
.pi-funnel-step {
  position: relative;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  font-size: 0.82rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  overflow: hidden;
}
.pi-funnel-step::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.15;
  border-radius: 8px;
}
.pi-funnel-step.step-1::before { background: #7eb8c9; }
.pi-funnel-step.step-2::before { background: #E31E24; }
.pi-funnel-step.step-3::before { background: #7a9e7e; }
.pi-funnel-step.step-4::before { background: #a89bc4; }
.pi-funnel-label { position: relative; color: var(--cream); }
.pi-funnel-val   { position: relative; color: var(--gold); font-weight: 500; }
.pi-funnel-pct   { position: relative; font-size: 0.72rem; color: var(--muted); }

/* Bottom metrics */
.pi-bottom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.65rem;
}
.pi-metric-card {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem;
}
.pi-metric-label { font-size: 0.7rem; color: var(--muted); letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 0.3rem; }
.pi-metric-value { font-size: 1.2rem; font-weight: 500; color: var(--cream); }
.pi-metric-sub   { font-size: 0.72rem; color: var(--muted); margin-top: 0.15rem; }
.pi-metric-delta { font-size: 0.72rem; margin-top: 0.1rem; }

/* Export bar */
.pi-export-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
}
.pi-export-bar-left { font-size: 0.82rem; color: var(--muted); }
.pi-export-bar-left strong { display: block; color: var(--cream); font-size: 0.88rem; }
.pi-export-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.pi-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--line);
  background: var(--bg3);
  color: var(--cream);
  border-radius: 8px;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.pi-export-btn:hover { background: rgba(227,30,36),.12); border-color: var(--gold); }
.pi-export-btn.pdf { border-color: rgba(196,122,106,.5); color: #e2b4aa; }
.pi-export-btn.pdf:hover { background: rgba(196,122,106,.12); }
.pi-export-btn.excel { border-color: rgba(122,158,126,.5); color: #b2d4b5; }
.pi-export-btn.excel:hover { background: rgba(122,158,126,.12); }

/* Loading skeleton */
.pi-skeleton {
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg2) 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: pi-skeleton-wave 1.4s ease infinite;
  border-radius: 8px;
}
@keyframes pi-skeleton-wave {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.pi-loading-row { display: flex; gap: 0.75rem; }
.pi-loading-card { flex: 1; height: 100px; }

/* Print styles */
@media print {
  html, body, #root, .shell, .main {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }
  .side, .pi-topbar, .pi-export-bar, .pi-period-group { display: none !important; }
  .main-head {
    position: static !important;
    background: none !important;
    backdrop-filter: none !important;
  }
  .pi-kpi-card::before { display: none; }
  .pi-wrap { gap: 0.75rem; }
  .pi-chart-row.col-3, .pi-chart-row.col-3-eq { grid-template-columns: 1fr 1fr; }
}

/* Responsive PI */
@media (max-width: 1100px) {
  .pi-chart-row.col-3 { grid-template-columns: 1fr 1fr; }
  .pi-chart-row.col-3 .pi-chart-panel:first-child { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .pi-chart-row.col-3, .pi-chart-row.col-3-eq, .pi-chart-row.col-2 { grid-template-columns: 1fr; }
  .pi-chart-row.col-3 .pi-chart-panel:first-child { grid-column: auto; }
  .pi-kpi-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
}

/* ── KPI-DRILLDOWN-001 — Insight Explorer (modal reutilizável) ── */
body.ie-open { overflow: hidden; }
.ie-root { position: relative; z-index: 80; }
.ie-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 5, 4, 0.72);
  backdrop-filter: blur(5px);
  display: grid;
  place-items: center;
  padding: 1rem;
  animation: ie-fade 160ms ease-out;
}
@keyframes ie-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.ie-modal {
  width: min(920px, 100%);
  max-height: min(92dvh, 920px);
  overflow: hidden;
  background: linear-gradient(180deg, var(--bg2), var(--bg));
  border: 1px solid rgba(227, 30, 36), 0.28);
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  animation: ie-rise 200ms ease-out;
}
@keyframes ie-rise {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ie-backdrop, .ie-modal { animation: none; }
  .ie-trigger { transition: none; }
}
.ie-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.35rem 1rem;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  background: rgba(18, 16, 14, 0.96);
  z-index: 2;
}
.ie-head-main {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  min-width: 0;
}
.ie-media {
  width: 72px;
  height: 90px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  flex-shrink: 0;
  background: var(--bg3);
}
.ie-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ie-kicker {
  margin: 0 0 0.25rem;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.ie-head h2 { margin: 0; font-size: 1.55rem; }
.ie-subtitle { margin: 0.35rem 0 0; font-size: 0.88rem; }
.ie-period { margin: 0.35rem 0 0; font-size: 0.82rem; }
.ie-desc { margin: 0; font-size: 0.95rem; line-height: 1.5; white-space: pre-wrap; }
.ie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding-bottom: 0.35rem;
}
.ie-actions a.ie-btn { text-decoration: none; display: inline-flex; align-items: center; }
.ie-btn-primary {
  border-color: rgba(227, 30, 36), 0.55);
  background: rgba(227, 30, 36), 0.16);
  color: var(--gold);
}
.ie-head-right { text-align: right; position: relative; padding-right: 2.2rem; min-width: 8rem; }
.ie-value {
  font-family: var(--display);
  font-size: 2rem;
  color: var(--gold);
  line-height: 1.1;
}
.ie-delta { font-size: 0.82rem; margin-top: 0.2rem; }
.ie-delta.up { color: var(--ok); }
.ie-delta.down { color: var(--danger); }
.ie-delta.flat { color: var(--muted); }
.ie-close {
  position: absolute;
  top: -0.15rem;
  right: 0;
  border: 1px solid var(--line);
  background: var(--bg3);
  color: var(--cream);
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
}
.ie-close:hover { border-color: var(--gold); color: var(--gold); }
.ie-body {
  padding: 1rem 1.35rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.ie-section h3 {
  margin: 0 0 0.65rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--font);
  font-weight: 500;
}
.ie-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}
.ie-chart-svg { width: 100%; height: auto; display: block; min-height: 180px; }
.ie-empty {
  padding: 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  border: 1px dashed var(--line);
  border-radius: 12px;
}
.ie-comp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.55rem;
}
.ie-comp {
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.ie-comp .muted { font-size: 0.7rem; letter-spacing: 0.04em; text-transform: uppercase; }
.ie-meta { display: flex; flex-direction: column; gap: 0.45rem; }
.ie-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.9rem;
}
.ie-meta-track {
  height: 0.45rem;
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.25rem;
}
.ie-meta-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 999px;
}
.ie-intel {
  margin: 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  color: var(--cream);
  font-size: 0.92rem;
  line-height: 1.45;
}
.ie-bar-row {
  display: grid;
  grid-template-columns: minmax(6rem, 28%) 1fr 4.5rem;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.45rem;
}
.ie-bar-label { font-size: 0.78rem; color: var(--muted); }
.ie-bar-track {
  height: 0.45rem;
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.ie-bar-fill { height: 100%; background: var(--gold); border-radius: 999px; }
.ie-bar-value { font-size: 0.78rem; text-align: right; }
.ie-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1.35rem 1.2rem;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
  background: rgba(18, 16, 14, 0.96);
}
.ie-nav, .ie-exports { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.ie-btn {
  border: 1px solid var(--line);
  background: var(--bg3);
  color: var(--cream);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
.ie-btn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.ie-btn:disabled { opacity: 0.4; cursor: not-allowed; }
@media (max-width: 860px) {
  .ie-grid-2 { grid-template-columns: 1fr; }
  .ie-head { flex-direction: column; }
  .ie-head-right { text-align: left; padding-right: 2.2rem; }
  .ie-bar-row { grid-template-columns: 1fr; }
  .ie-foot { flex-direction: column; align-items: stretch; }
}
@media print {
  body.ie-open .shell { display: none !important; }
  .ie-backdrop { position: static; background: none; backdrop-filter: none; padding: 0; }
  .ie-modal { box-shadow: none; border: 0; max-height: none; width: 100%; }
  .ie-close, .ie-foot { display: none !important; }
}

/* ── IMPETUS LIVE ── */
.live-tabs {
  display: flex;
  gap: .35rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 .9rem;
  margin: 0 0 .4rem;
  scrollbar-width: thin;
}
.live-tab {
  flex: none;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.2);
  color: var(--text);
  border-radius: 999px;
  padding: .45rem .85rem;
  font: inherit;
  font-size: .78rem;
  white-space: nowrap;
  cursor: pointer;
}
.live-tab.active {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(212, 175, 110, .12);
}
.live-hero { background: linear-gradient(145deg, rgba(212,175,110,.12), rgba(0,0,0,.25)); }
.live-cover {
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(255,80,80,.12), transparent 55%),
    radial-gradient(100% 70% at 100% 0%, rgba(238,77,45,.14), transparent 50%),
    linear-gradient(160deg, rgba(212,175,110,.14), rgba(0,0,0,.35));
  border: 1px solid rgba(212,175,110,.22);
}
.live-cover-kicker {
  margin: 0 0 .35rem;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold, #E31E24);
}
.live-cover-title {
  margin: 0 0 .4rem;
  font-family: var(--display, "Rajdhani", "Outfit", system-ui, sans-serif);
  font-weight: 400;
  font-size: clamp(1.55rem, 3.5vw, 2rem);
  letter-spacing: .02em;
  color: var(--cream, #F3EDE3);
}
.live-cover-sub { margin: 0 0 1rem; color: var(--muted, #8a7d70); font-size: .95rem; line-height: 1.45; }
.live-cover-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin: 0 0 1rem;
}
.live-cover-grid-compact { margin-bottom: .85rem; }
.live-cover-card {
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  background: #0a0a0a;
  display: grid;
}
.live-cover-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: #111;
}
.live-cover-meta {
  padding: .65rem .7rem .75rem;
  display: grid;
  gap: .2rem;
}
.live-cover-meta strong { font-size: .92rem; }
.live-cover-meta .muted { font-size: .75rem; line-height: 1.35; }
.live-cover-foot { margin: .75rem 0 0; font-size: .8rem; }
.live-account-logo {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,.08);
}
.live-cta { width: 100%; max-width: 420px; }
@media (max-width: 520px) {
  .live-cover-grid { grid-template-columns: 1fr 1fr; gap: .55rem; }
}
.live-list { list-style: none; padding: 0; margin: 0 0 .8rem; }
.live-list li { padding: .45rem 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.live-ai-line {
  font-size: .95rem;
  margin: 0 0 .75rem;
  color: var(--gold);
}
.live-product-lead {
  display: flex;
  gap: .75rem;
  align-items: center;
  margin-bottom: .8rem;
}
.live-product-lead img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.live-product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
}
.live-chip {
  padding: .55rem .65rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0,0,0,.18);
  font-size: .82rem;
}
.live-chip .muted { display: block; font-size: .75rem; margin-top: .2rem; }
.live-script { padding-left: 1.1rem; margin: 0; }
.live-script li { margin: .45rem 0; font-size: .88rem; }
.live-idea-cards { list-style: none; padding: 0; margin: .8rem 0 0; display: grid; gap: .5rem; }
.live-idea-btn {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.2);
  color: inherit;
  border-radius: 12px;
  padding: .75rem .85rem;
  cursor: pointer;
  font: inherit;
}
.live-idea-btn strong { display: block; margin-bottom: .25rem; }
.live-form { display: grid; gap: .65rem; }
.live-form label, .live-field {
  display: grid;
  gap: .3rem;
  font-size: .85rem;
}
.live-form input, .live-field select, .live-field input {
  border: 1px solid var(--line);
  background: rgba(0,0,0,.25);
  color: inherit;
  border-radius: 10px;
  padding: .55rem .65rem;
  font: inherit;
}
.live-agenda-row {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: center;
}
.live-accounts { display: grid; gap: .75rem; margin-top: .8rem; }
.live-account-card {
  display: flex;
  gap: .75rem;
  align-items: center;
  padding: .8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0,0,0,.18);
}
.live-plat-checks { display: grid; gap: .45rem; margin: .5rem 0 1rem; }
.live-check { display: flex; gap: .5rem; align-items: center; font-size: .9rem; }
.live-stage { display: grid; gap: .85rem; }
.live-camera-wrap {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0a0a0a;
  aspect-ratio: 9 / 14;
  max-height: 70vh;
}
.live-camera-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scaleX(-1);
}
.live-presenter-hud {
  position: absolute;
  left: .6rem;
  right: .6rem;
  bottom: .6rem;
  padding: .7rem .8rem;
  border-radius: 12px;
  background: rgba(8, 8, 10, .78);
  border: 1px solid rgba(212,175,110,.35);
  backdrop-filter: blur(6px);
}
.live-hud-label {
  margin: 0 0 .25rem;
  font-size: .7rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--gold);
}
.live-hud-tip { margin: 0; font-size: .92rem; }
.live-hud-cta { margin: .35rem 0 0; font-size: .8rem; }
.live-hud-step { margin: .45rem 0 0; font-size: .78rem; opacity: .9; }
.live-copilot { display: grid; gap: .85rem; }
.live-copilot-status { border-color: rgba(212,175,110,.45); }
.live-speak-card .live-speak-text {
  margin: 0;
  font-size: .95rem;
  line-height: 1.45;
}
.live-answer-box {
  margin-top: .85rem;
  padding: .75rem;
  border-radius: 10px;
  border: 1px solid rgba(212,175,110,.3);
  background: rgba(0,0,0,.22);
}
.live-moment-card { border-color: rgba(212,175,110,.4); }
.live-chip-active {
  border-color: rgba(212,175,110,.75) !important;
  box-shadow: 0 0 0 1px rgba(212,175,110,.35);
}
.live-camera-compact {
  aspect-ratio: 16 / 10;
  max-height: 280px;
}
@media (min-width: 861px) {
  .live-cta { width: auto; }
  .live-camera-wrap {
    aspect-ratio: 16 / 10;
    max-height: 62vh;
  }
  .live-camera-compact { max-height: 320px; }
}

/* Contas conectadas — Configurações */
.cfg-connections {
  display: grid;
  gap: .85rem;
}
.cfg-conn-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .85rem;
  background: rgba(0,0,0,.18);
}
.cfg-conn-head {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: baseline;
  margin-bottom: .55rem;
}
@media (min-width: 861px) {
  .cfg-connections {
    grid-template-columns: 1fr 1fr;
  }
}

/* Central de Pedidos */
.oh-tabs {
  display: flex;
  gap: .35rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 .75rem;
  scrollbar-width: thin;
}
.oh-tab {
  flex: none;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.2);
  color: var(--text);
  border-radius: 999px;
  padding: .45rem .85rem;
  font: inherit;
  font-size: .78rem;
  white-space: nowrap;
  cursor: pointer;
}
.oh-tab.active {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(212, 175, 110, .12);
}
.oh-kpi {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem;
  margin-bottom: 1rem;
}
.oh-kpi-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .75rem;
  background: rgba(0,0,0,.2);
  display: grid;
  gap: .25rem;
}
.oh-kpi-card strong { font-size: 1.15rem; }
.oh-conn {
  padding: .65rem 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.oh-filters { display: grid; gap: .55rem; margin-bottom: .5rem; }
.oh-search { display: flex; gap: .45rem; }
.oh-search input {
  flex: 1;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.25);
  color: inherit;
  border-radius: 10px;
  padding: .5rem .65rem;
  font: inherit;
}
.oh-table-wrap { overflow: auto; }
.oh-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.oh-table th, .oh-table td {
  border-bottom: 1px solid rgba(255,255,255,.06);
  padding: .45rem .35rem;
  text-align: left;
  vertical-align: top;
}
.oh-sup-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.oh-sup-list li {
  padding: .65rem 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.oh-label-cell {
  min-width: 7.5rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  align-items: flex-start;
}
.oh-label-ok { color: #9bb89a; font-size: .8rem; font-weight: 600; }
.oh-label-miss { color: #c47a6a; font-size: .78rem; }
.oh-upload-btn { cursor: pointer; display: inline-flex; align-items: center; }
.oh-upload-btn input { display: none; }
@media (min-width: 861px) {
  .oh-kpi { grid-template-columns: repeat(3, 1fr); }
}

/* ─── IMPETUS Ads IA ─── */
.ads-ia-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.ads-ia-wallet {
  background: linear-gradient(145deg, rgba(201, 162, 39, 0.18), rgba(20, 20, 20, 0.9));
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: 14px;
  padding: .85rem 1rem;
  min-width: 220px;
  max-width: 340px;
  display: grid;
  gap: .35rem;
}
.ads-ia-wallet strong { font-size: 1.35rem; }

.mp-product-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.mp-product-card {
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  padding: 1rem;
  background: rgba(255,255,255,.02);
}
.mp-product-card-head {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: baseline;
  margin-bottom: .75rem;
}
.mp-link-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem;
}
.mp-link-cards-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 900px) {
  .mp-link-cards,
  .mp-link-cards-2 { grid-template-columns: 1fr; }
}
.mp-link-card {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  padding: .7rem .75rem;
  background: rgba(0,0,0,.2);
  display: grid;
  gap: .35rem;
}
.mp-link-card.ok {
  border-color: rgba(37, 211, 102, 0.4);
}
.mp-link-card-title {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
}
.mp-link-badge {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: .65rem;
  font-weight: 700;
  background: color-mix(in srgb, var(--c, #888) 25%, transparent);
  border: 1px solid color-mix(in srgb, var(--c, #888) 50%, transparent);
}
.mp-link-status {
  margin-left: auto;
  font-size: .72rem;
  opacity: .85;
}
.mp-link-card input {
  width: 100%;
  padding: .45rem .55rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.35);
  color: inherit;
}
.mp-open-link {
  font-size: .75rem;
  color: var(--gold, #E31E24);
  text-decoration: none;
}
.mp-open-link:hover { text-decoration: underline; }
.mp-sync-card {
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  padding: .65rem .75rem;
  background: rgba(255,255,255,.03);
}
.mp-sync-card.ok {
  border-color: rgba(37, 211, 102, 0.35);
}
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.ads-credits-modal[hidden] { display: none !important; }
.ads-credits-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
}
.ads-credits-modal-panel {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
  background: var(--panel, #161616);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  padding: 1rem 1.1rem 1.2rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.ads-credits-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}
.ads-credits-grid,
.ads-credits-dash {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .75rem;
}
.ads-credit-card,
.ads-credit-dash-card {
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  padding: .85rem;
  background: rgba(255,255,255,.03);
}
.ads-credit-card.ok,
.ads-credit-dash-card.ok {
  border-color: rgba(37, 211, 102, 0.35);
}
.ads-credit-card header,
.ads-credit-dash-card header {
  display: flex;
  gap: .65rem;
  align-items: center;
}
.ads-credit-logo {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .02em;
  background: color-mix(in srgb, var(--logo-color, #888) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--logo-color, #888) 45%, transparent);
  color: #fff;
  flex-shrink: 0;
}
.ads-ia-channels {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-bottom: 1rem;
}
.ads-ia-ch {
  border: 1px solid var(--line, #333);
  border-radius: 999px;
  padding: .35rem .75rem;
  font-size: .78rem;
  background: rgba(255,255,255,0.03);
  display: inline-flex;
  gap: .4rem;
  align-items: center;
}
.ads-ia-ch.ok { border-color: rgba(37, 211, 102, 0.45); }
.ads-ia-ch.link {
  cursor: pointer;
  background: transparent;
  color: inherit;
  font: inherit;
}
.ads-ia-presets { display: flex; flex-wrap: wrap; gap: .4rem; }
.ads-ia-presets .active {
  border-color: rgba(201, 162, 39, 0.7);
  background: rgba(201, 162, 39, 0.15);
}
.ads-ia-result.go { border-color: rgba(37, 211, 102, 0.45); }
.ads-ia-result.block { border-color: rgba(220, 80, 80, 0.45); }
.ads-ia-badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: .25rem .55rem;
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
}
.ads-ia-result.go .ads-ia-badge { background: rgba(37, 211, 102, 0.2); color: #9dffc0; }
.ads-ia-result.block .ads-ia-badge { background: rgba(220, 80, 80, 0.2); color: #ffb4b4; }
.ads-ia-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
  margin: .85rem 0;
}
@media (min-width: 720px) {
  .ads-ia-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.ads-ia-kpis > div {
  background: rgba(0,0,0,0.25);
  border-radius: 10px;
  padding: .55rem .65rem;
  display: grid;
  gap: .15rem;
}
.ads-ia-kpis strong { font-size: 1.05rem; }
.ads-ia-alloc { display: grid; gap: .4rem; margin-top: .5rem; }
.ads-ia-alloc-row {
  display: grid;
  grid-template-columns: 1.2fr .8fr 1fr auto;
  gap: .4rem;
  align-items: center;
  font-size: .82rem;
  padding: .45rem .55rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
}
@media (max-width: 640px) {
  .ads-ia-alloc-row { grid-template-columns: 1fr 1fr; }
}
.ads-warn { color: #e8b04a; font-size: .72rem; }
.ads-ia-alt {
  margin: .75rem 0 0;
  padding: .65rem .75rem;
  border-radius: 10px;
  background: rgba(201, 162, 39, 0.1);
  font-size: .85rem;
}
.ads-ia-products { display: grid; gap: .45rem; }
.ads-ia-prod {
  text-align: left;
  border: 1px solid var(--line, #333);
  background: rgba(255,255,255,0.02);
  color: inherit;
  border-radius: 12px;
  padding: .7rem .8rem;
  display: grid;
  gap: .2rem;
  cursor: pointer;
  font: inherit;
}
.ads-ia-prod.active { border-color: rgba(201, 162, 39, 0.55); }
.ads-ia-camps { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.ads-ia-camps li {
  display: grid;
  gap: .15rem;
  padding: .55rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.ads-ia-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin: 0 0 1rem;
}
.ads-tab {
  border: 1px solid var(--line, #333);
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: .4rem .85rem;
  font: inherit;
  font-size: .8rem;
  cursor: pointer;
}
.ads-tab.active {
  border-color: rgba(201, 162, 39, 0.65);
  background: rgba(201, 162, 39, 0.14);
}
.ads-ia-prod-card {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: center;
  border: 1px solid var(--line, #333);
  border-radius: 12px;
  padding: .75rem .85rem;
  background: rgba(255,255,255,0.02);
}

.ads-conn-grid {
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  margin-top: .75rem;
}
.ads-conn-card {
  border: 1px solid var(--line, #333);
  border-radius: 14px;
  padding: .85rem;
  background: rgba(255,255,255,0.02);
}
.ads-conn-card.ok { border-color: rgba(37, 211, 102, 0.4); }
.ads-conn-card header {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  align-items: baseline;
}
.ads-conn-status {
  font-size: .72rem;
  opacity: .85;
}

/*
 * ADMIN-DASHBOARD-MOBILE-DENSITY-001
 * Compacta cabeçalhos de conteúdo do Admin no smartphone.
 * Não altera AppShell / navegação (.m-topbar, #nav-open, .shell.nav-open, .side).
 * Desktop (≥861px) permanece nas regras originais acima.
 */
@media (max-width: 860px) {
  .admin-shell .main-head {
    position: static;
    align-items: flex-start;
    gap: 0.45rem;
    margin-bottom: 0.7rem;
    margin-top: 0;
    padding: 0.1rem 0 0.35rem;
    background: transparent;
    backdrop-filter: none;
  }
  .admin-shell .main-head h1,
  .admin-shell .main-head #sec-page-title {
    font-size: 1.2rem;
    line-height: 1.2;
  }
  .admin-shell .main-head p.muted {
    margin: 0.12rem 0 0 !important;
    font-size: 0.72rem !important;
    line-height: 1.35;
    letter-spacing: 0.04em;
  }
  .admin-shell .main-head .actions {
    width: 100%;
    margin-top: 0.15rem;
  }
  .admin-shell .main-head .btn-sm {
    min-height: 40px;
    padding: 0.4rem 0.85rem;
  }
  .admin-shell .stats {
    margin-bottom: 0.85rem;
    gap: 0.55rem;
  }
  .admin-shell .stat {
    padding: 0.7rem 0.8rem;
  }
  .admin-shell .stat .v {
    font-size: 1.45rem;
  }

  #sec-center .sec-grid-2 {
    margin-top: 0.85rem;
    gap: 0.75rem;
  }
  #sec-center .main-head #sec-overall-status {
    display: inline-flex;
    vertical-align: middle;
  }

  .pi-topbar {
    padding: 0.55rem 0.7rem;
    gap: 0.4rem;
    border-radius: 12px;
  }
  .pi-topbar-title {
    flex: 1 1 100%;
    min-width: 0;
  }
  .pi-topbar-title h2 {
    font-size: 0.95rem;
    line-height: 1.2;
  }
  .pi-topbar-title small {
    font-size: 0.68rem;
    line-height: 1.3;
  }
  .pi-period-group {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    gap: 0.3rem;
    width: 100%;
    max-width: 100%;
    padding-bottom: 0.1rem;
    scrollbar-width: thin;
  }
  .pi-period-btn {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
  }
  .pi-custom-dates {
    flex: 0 0 auto;
  }
  .pi-refresh {
    width: 100%;
    white-space: normal;
  }
}

/* Support Copilot drawer */
.vendor-support-drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 1rem 1rem 5.5rem;
}
.vendor-support-drawer[hidden] { display: none !important; }
.vendor-support-panel {
  width: min(420px, 100%);
  max-height: min(70vh, 560px);
  background: #14110f;
  border: 1px solid rgba(243,237,227,.16);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #f3ede3;
}
.vendor-support-head {
  display: flex;
  gap: .75rem;
  justify-content: space-between;
  align-items: flex-start;
  padding: .9rem 1rem;
  border-bottom: 1px solid rgba(243,237,227,.12);
}
.vendor-support-head p {
  margin: .25rem 0 0;
  font-size: .78rem;
  color: #8a7d70;
}
.vendor-support-thread {
  flex: 1;
  overflow: auto;
  padding: .85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.vendor-support-msg { display: flex; }
.vendor-support-msg.user { justify-content: flex-end; }
.vendor-support-bubble {
  max-width: 92%;
  padding: .65rem .8rem;
  border-radius: 12px;
  font-size: .88rem;
  line-height: 1.45;
  white-space: pre-wrap;
  background: rgba(255,255,255,.06);
}
.vendor-support-msg.user .vendor-support-bubble {
  background: #c9a96e;
  color: #1a140f;
}
.vendor-support-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  padding: 0 .85rem .55rem;
}
.vendor-support-form {
  display: flex;
  gap: .45rem;
  padding: .75rem .85rem;
  border-top: 1px solid rgba(243,237,227,.12);
}
.vendor-support-form input {
  flex: 1;
  min-width: 0;
  background: #0d0b0a;
  border: 1px solid rgba(243,237,227,.16);
  color: #f3ede3;
  border-radius: 10px;
  padding: .55rem .7rem;
}
.vendor-support-wa-link {
  display: block;
  text-align: center;
  font-size: .8rem;
  padding: 0 .85rem .85rem;
  color: #25d366;
}
