/* ==========================================================================
   Afiliado Dog PRO — Design System "Cyber Automation" (Stitch)
   Tokens: stitch_stitch_ui_design_system/cyber_automation/DESIGN.md
   ========================================================================== */

:root {
  --bg-app: #0b111a;
  --bg-panel: #0d1520;
  --bg-card: #111823;
  --bg-card-hover: #162436;
  --bg-input: #0d1520;
  --border: #1a2a3a;
  --border-strong: #24384d;
  --glass: rgba(13, 21, 32, 0.6);
  --glass-border: rgba(255, 255, 255, 0.05);

  --primary: #00bfff;
  --primary-hover: #00acc1;
  --primary-soft: rgba(0, 191, 255, 0.1);
  --primary-line: rgba(0, 191, 255, 0.3);
  --primary-glow: 0 0 16px rgba(0, 191, 255, 0.5);

  --success: #00ff88;
  --success-hover: #00cc6a;
  --success-soft: rgba(0, 255, 136, 0.1);
  --success-line: rgba(0, 255, 136, 0.3);

  --media: #39ff14;
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.1);
  --warning-line: rgba(245, 158, 11, 0.3);
  --danger: #ff4757;
  --danger-soft: rgba(255, 71, 87, 0.1);
  --danger-line: rgba(255, 71, 87, 0.3);

  --text: #e2e8f0;
  --text-2: #94a3b8;
  --muted: #64748b;

  --mp-shopee: #ee4d2d;
  --mp-ml: #ffe600;
  --mp-amazon: #ff9900;
  --mp-magalu: #0086ff;
  --mp-ali: #ff4747;

  --r-sm: 2px;
  --r: 4px;
  --r-lg: 8px;
  --r-xl: 12px;
  --r-full: 9999px;

  --sidebar-w: 260px;
  --topbar-h: 64px;

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg-app);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 20px;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

::selection {
  background: var(--primary);
  color: var(--bg-app);
}

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

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--text);
}

p {
  margin: 0;
}

code,
.mono {
  font-family: var(--mono);
}

[hidden] {
  display: none !important;
}

/* Scrollbars (4px, ciano) */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--r-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Material Symbols */
.ms {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  flex-shrink: 0;
  user-select: none;
}
.ms.fill {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.ms.sm {
  font-size: 16px;
}
.ms.lg {
  font-size: 24px;
}

/* ==========================================================================
   Tipografia utilitária
   ========================================================================== */
.t-kpi {
  font-size: 36px;
  line-height: 44px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.t-xl {
  font-size: 28px;
  line-height: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.t-lg {
  font-size: 22px;
  line-height: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.t-md {
  font-size: 18px;
  line-height: 24px;
  font-weight: 600;
}
.t-sm {
  font-size: 12px;
  line-height: 16px;
}
.t-label {
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.muted {
  color: var(--text-2);
}
.dim {
  color: var(--muted);
}
.c-primary {
  color: var(--primary);
}
.c-success {
  color: var(--success);
}
.c-warning {
  color: var(--warning);
}
.c-danger {
  color: var(--danger);
}
.strong {
  font-weight: 600;
  color: var(--text);
}
.upper {
  text-transform: uppercase;
}
.nowrap {
  white-space: nowrap;
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   Layout utilitário
   ========================================================================== */
.row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.row.wrap {
  flex-wrap: wrap;
}
.row.between {
  justify-content: space-between;
}
.row.top {
  align-items: flex-start;
}
.row.end {
  align-items: flex-end;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.stack-sm {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.grow {
  flex: 1 1 auto;
  min-width: 0;
}
.gap-4 {
  gap: 4px;
}
.gap-12 {
  gap: 12px;
}
.gap-16 {
  gap: 16px;
}
.mt-8 {
  margin-top: 8px;
}
.mt-12 {
  margin-top: 12px;
}
.mt-16 {
  margin-top: 16px;
}
.mt-24 {
  margin-top: 24px;
}
.mb-8 {
  margin-bottom: 8px;
}
.mb-12 {
  margin-bottom: 12px;
}
.mb-16 {
  margin-bottom: 16px;
}
.mb-24 {
  margin-bottom: 24px;
}

.grid {
  display: grid;
  gap: 24px;
}
.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.grid-7-5 {
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
}
.grid-8-4 {
  grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
}
.grid-tight {
  gap: 12px;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
  border: 0;
}

/* ==========================================================================
   App Shell
   ========================================================================== */
.app {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 60;
  box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.8);
}

.brand {
  height: var(--topbar-h);
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, rgba(0, 191, 255, 0.25), rgba(0, 255, 136, 0.15));
  border: 1px solid var(--primary-line);
  display: grid;
  place-items: center;
  font-size: 18px;
  box-shadow: 0 0 12px rgba(0, 191, 255, 0.25);
  flex-shrink: 0;
}
.brand-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.pro-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: var(--r);
  background: var(--primary);
  color: var(--bg-app);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  box-shadow: 0 0 10px rgba(0, 191, 255, 0.5);
  vertical-align: middle;
}

.nav {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r);
  border: 0;
  border-left: 2px solid transparent;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  text-align: left;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s, color 0.15s;
}
.nav-item .ms {
  color: var(--muted);
  transition: color 0.15s;
}
.nav-item:hover {
  background: var(--bg-card-hover);
  color: var(--text);
}
.nav-item:hover .ms {
  color: var(--primary);
}
.nav-item.active {
  background: var(--bg-card-hover);
  color: var(--primary);
  border-left-color: var(--primary);
  box-shadow: 0 0 12px rgba(0, 191, 255, 0.15);
}
.nav-item.active .ms {
  color: var(--primary);
}
.nav-item .nav-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-count {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: var(--r-full);
  background: var(--success-soft);
  border: 1px solid var(--success-line);
  color: var(--success);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.sidebar-foot {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.usage-box {
  padding: 12px;
  border-radius: var(--r-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.usage-box .row {
  justify-content: space-between;
  font-size: 12px;
}
.usage-lines {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 16px;
  color: var(--muted);
  margin-top: 8px;
}
.usage-lines b {
  color: var(--text);
  font-weight: 600;
}

/* Topbar */
.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  background: rgba(11, 17, 26, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 24px;
}
.topbar .spacer {
  flex: 1;
}
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text-2);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: all 0.15s;
}
.icon-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--bg-card-hover);
}
.icon-btn .dot-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: var(--primary-glow);
}
.mobile-only {
  display: none !important;
}

.num-select {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px;
  min-width: 0;
  max-width: 300px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--bg-panel);
}
.num-select:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(0, 191, 255, 0.3);
}
.num-select select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  color: var(--text);
  font: 500 13px var(--font);
  height: 34px;
  padding: 0 18px 0 0;
  outline: none;
  cursor: pointer;
  min-width: 0;
  flex: 1;
  width: auto;
  box-shadow: none !important;
}
.num-select select option {
  background: var(--bg-panel);
}
.num-select .ms.chev {
  position: absolute;
  right: 6px;
  pointer-events: none;
  color: var(--muted);
}

.top-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: var(--r-full);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid;
  cursor: pointer;
  background: transparent;
  transition: box-shadow 0.15s;
}
.top-pill.ok {
  color: var(--success);
  background: var(--success-soft);
  border-color: var(--success-line);
}
.top-pill.ok:hover {
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.3);
}
.top-pill.warn {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: var(--warning-line);
}
.top-pill.warn:hover {
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
}
.top-pill.danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: var(--danger-line);
}
.top-pill .link {
  color: var(--primary);
  font-weight: 700;
  margin-left: 4px;
  padding-left: 8px;
  border-left: 1px solid var(--warning-line);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 4px 4px;
  border-radius: var(--r);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  position: relative;
}
.user-chip:hover {
  border-color: var(--border);
  background: var(--bg-panel);
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00bfff, #00ff88);
  color: var(--bg-app);
  font-weight: 700;
  font-size: 13px;
  display: grid;
  place-items: center;
  position: relative;
  flex-shrink: 0;
}
.avatar::after {
  content: '';
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid var(--bg-app);
}
.user-meta {
  text-align: left;
  line-height: 15px;
}
.user-meta .name {
  font-size: 13px;
  font-weight: 600;
  max-width: 140px;
}
.user-meta .sub {
  font-size: 11px;
  color: var(--muted);
}

/* Popovers & Drawers (glass, nível 4) */
.glass {
  background: rgba(13, 21, 32, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  box-shadow: inset 0 0 0 1px var(--glass-border), 0 16px 40px -8px rgba(0, 0, 0, 0.8);
}
.popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-width: calc(100vw - 24px);
  border-radius: var(--r-lg);
  z-index: 80;
  padding: 12px;
}
.menu-pop {
  width: 220px;
  padding: 6px;
}
.menu-pop button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--r);
  background: transparent;
  color: var(--text-2);
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.menu-pop button:hover {
  background: var(--bg-card-hover);
  color: var(--text);
}
.menu-pop button.danger:hover {
  color: var(--danger);
}
.notif-list {
  max-height: 340px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}
.notif-item {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: var(--r);
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 12.5px;
  line-height: 17px;
}
.notif-item time {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 2px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 9, 14, 0.6);
  z-index: 90;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 520px;
  max-width: 100vw;
  z-index: 95;
  padding: 20px;
  overflow-y: auto;
  border-radius: 0;
}
.drawer h3 {
  font-size: 18px;
}
.help-topics-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.help-topics-bar .chip {
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-2);
  padding: 5px 10px;
  font-size: 11.5px;
}
.help-topics-bar .chip:hover {
  border-color: var(--primary-line);
  color: var(--text);
}
.help-topics-bar .chip.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}
.help-field-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.help-field-item {
  padding: 10px 12px;
  border-radius: var(--r);
  background: rgba(8, 13, 20, 0.7);
  border: 1px solid var(--border);
  font-size: 12.5px;
  line-height: 18px;
}
.help-field-item .fname {
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}
.help-field-item .fex {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 1px 6px;
  border-radius: 4px;
}
.link-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link-btn:hover {
  opacity: 0.85;
}
.help-steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 8px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.help-steps li {
  counter-increment: step;
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: var(--r-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 13px;
  line-height: 19px;
}
.help-steps li b {
  color: var(--text);
}
.help-steps li code {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--primary);
  background: rgba(0, 212, 255, 0.1);
  padding: 1px 5px;
  border-radius: 4px;
}
.help-steps li::before {
  content: counter(step);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  border: 1px solid var(--primary-line);
  color: var(--primary);
  font: 700 12px var(--mono);
}

/* Conteúdo */
.content {
  flex: 1;
  padding: 24px 32px 48px;
  max-width: 1600px;
  width: 100%;
}
.tab-panel {
  display: none;
  animation: fadeIn 0.2s ease;
}
.tab-panel.active {
  display: block;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.page-head .title-block {
  max-width: 760px;
  min-width: 0;
}
.page-head h1 {
  font-size: 28px;
  line-height: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.page-head h1 .ms {
  color: var(--primary);
  font-size: 28px;
}
.page-head p {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 15px;
  line-height: 22px;
}
.page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}
.eyebrow .sep {
  color: var(--muted);
}
.eyebrow .dim {
  color: var(--muted);
}
.live-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: var(--r);
  border: 1px solid var(--primary-line);
  background: var(--primary-soft);
  color: var(--primary);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

/* ==========================================================================
   Componentes
   ========================================================================== */

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  min-width: 0;
}
.card.hoverable:hover {
  background: var(--bg-card-hover);
}
.card.pad-0 {
  padding: 0;
}
.card.glow {
  border-color: var(--primary-line);
  box-shadow: 0 0 24px rgba(0, 191, 255, 0.08);
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  line-height: 24px;
  font-weight: 600;
  min-width: 0;
}
.card-title .ms {
  color: var(--primary);
}
.card-sub {
  font-size: 12.5px;
  color: var(--text-2);
  margin-top: 2px;
  line-height: 18px;
}
.ico-box {
  width: 40px;
  height: 40px;
  border-radius: var(--r-lg);
  display: grid;
  place-items: center;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--primary);
  flex-shrink: 0;
}
.ico-box.success {
  color: var(--success);
  border-color: var(--success-line);
  background: var(--success-soft);
}
.ico-box.warning {
  color: var(--warning);
  border-color: var(--warning-line);
  background: var(--warning-soft);
}
.ico-box.danger {
  color: var(--danger);
  border-color: var(--danger-line);
  background: var(--danger-soft);
}
.card-foot {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}
.inset {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--r);
  border: 1px solid transparent;
  font: 600 14px var(--font);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, box-shadow 0.15s, color 0.15s, border-color 0.15s,
    transform 0.05s;
  text-decoration: none !important;
}
.btn:active {
  transform: scale(0.98);
}
.btn:disabled,
.btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none !important;
  transform: none;
}
.btn .ms {
  font-size: 18px;
}
.btn-primary {
  background: var(--primary);
  color: var(--bg-app);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: var(--primary-glow);
}
.btn-success {
  background: var(--success);
  color: var(--bg-app);
}
.btn-success:hover:not(:disabled) {
  background: var(--success-hover);
  box-shadow: 0 0 14px rgba(0, 255, 136, 0.4);
}
.btn-ghost,
.btn-secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover:not(:disabled),
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  color: var(--primary);
}
.btn-outline-primary {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}
.btn-outline-primary:hover:not(:disabled) {
  box-shadow: var(--primary-glow);
}
.btn-danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}
.btn-danger:hover:not(:disabled) {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 0 12px rgba(255, 71, 87, 0.4);
}
.btn-warning {
  background: transparent;
  border-color: var(--warning-line);
  color: var(--warning);
}
.btn-warning:hover:not(:disabled) {
  background: var(--warning-soft);
  border-color: var(--warning);
}
.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 12.5px;
}
.btn-sm .ms {
  font-size: 16px;
}
.btn-xs {
  height: 26px;
  padding: 0 8px;
  font-size: 11.5px;
  gap: 4px;
}
.btn-xs .ms {
  font-size: 14px;
}
.btn-lg {
  height: 52px;
  padding: 0 24px;
  font-size: 16px;
}
.btn-block {
  width: 100%;
}
.btn-icon {
  width: 32px;
  padding: 0;
}
.btn-icon.btn-xs {
  width: 26px;
}

/* Badges & Chips */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text-2);
}
.badge .ms {
  font-size: 14px;
}
.badge.dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge.success,
.b-success {
  background: var(--success-soft);
  border-color: var(--success-line);
  color: var(--success);
}
.badge.media {
  background: rgba(57, 255, 20, 0.1);
  border-color: rgba(57, 255, 20, 0.3);
  color: var(--media);
}
.badge.warning,
.b-warning {
  background: var(--warning-soft);
  border-color: var(--warning-line);
  color: var(--warning);
}
.badge.danger,
.b-danger {
  background: var(--danger-soft);
  border-color: var(--danger-line);
  color: var(--danger);
}
.badge.info,
.b-info {
  background: var(--primary-soft);
  border-color: var(--primary-line);
  color: var(--primary);
}
.badge.square {
  border-radius: var(--r);
  font-family: var(--mono);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--r);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--primary);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 16px;
  white-space: nowrap;
}
button.chip {
  cursor: pointer;
}
button.chip:hover {
  border-color: var(--primary);
}
.chip.neg {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: var(--danger-line);
}
.chip.neutral {
  color: var(--text-2);
}
.chip .x {
  cursor: pointer;
  opacity: 0.8;
  font-size: 14px;
}
.chip .x:hover {
  opacity: 1;
}
.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.15s;
}
.toggle-chip:hover {
  border-color: var(--primary);
  color: var(--text);
}
.toggle-chip.on {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}
.toggle-chip.on-success {
  background: var(--success-soft);
  border-color: var(--success);
  color: var(--success);
}

.mp-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 7px;
  border-radius: var(--r);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid;
  white-space: nowrap;
}
.mp-shopee {
  color: #ff7a59;
  background: rgba(238, 77, 45, 0.12);
  border-color: rgba(238, 77, 45, 0.4);
}
.mp-mercadolivre,
.mp-ml {
  color: var(--mp-ml);
  background: rgba(255, 230, 0, 0.08);
  border-color: rgba(255, 230, 0, 0.35);
}
.mp-amazon,
.mp-amz {
  color: var(--mp-amazon);
  background: rgba(255, 153, 0, 0.1);
  border-color: rgba(255, 153, 0, 0.4);
}
.mp-magalu {
  color: #4aa8ff;
  background: rgba(0, 134, 255, 0.1);
  border-color: rgba(0, 134, 255, 0.4);
}
.mp-aliexpress {
  color: #ff6b6b;
  background: rgba(255, 71, 71, 0.1);
  border-color: rgba(255, 71, 71, 0.4);
}
.mp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  background: var(--muted);
  flex-shrink: 0;
}
.status-dot.on {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse 2s infinite;
}
.status-dot.wait {
  background: var(--warning);
  box-shadow: 0 0 8px var(--warning);
}
.status-dot.off {
  background: var(--danger);
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

/* Forms */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field > label,
.field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.field-label .hint,
.field > label .hint {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 400;
}
.form-grid {
  display: grid;
  gap: 14px 16px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.form-grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.form-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

input[type='text'],
input[type='email'],
input[type='password'],
input[type='number'],
input[type='time'],
input[type='date'],
input[type='search'],
input[type='tel'],
input[type='url'],
input:not([type]),
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font: 400 14px var(--font);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  color-scheme: dark;
}
textarea {
  padding: 10px 12px;
  line-height: 20px;
  resize: vertical;
}
textarea.code,
input.code {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 20px;
  background: var(--bg-app);
}
select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
select option,
select optgroup {
  background: var(--bg-panel);
  color: var(--text);
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(0, 191, 255, 0.3);
}
input[type='color'] {
  width: 40px;
  height: 40px;
  padding: 3px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--bg-input);
  cursor: pointer;
}
.input-affix {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--bg-input);
  transition: border-color 0.15s, box-shadow 0.15s;
  min-width: 0;
}
.input-affix:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(0, 191, 255, 0.3);
}
.input-affix input {
  border: 0 !important;
  box-shadow: none !important;
  background: transparent;
  min-width: 0;
}
.input-affix .affix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.input-affix .affix.left {
  border-right: 1px solid var(--border);
}
.input-affix.success {
  border-color: var(--success);
}
.input-affix.success .affix {
  color: var(--success);
}

/* Checkbox / Radio */
input[type='checkbox']:not(.toggle),
input[type='radio'] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 1px solid var(--border-strong);
  background: var(--bg-panel);
  border-radius: var(--r);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
input[type='radio'] {
  border-radius: 50%;
}
input[type='checkbox']:not(.toggle):checked,
input[type='radio']:checked {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 8px rgba(0, 191, 255, 0.5);
}
input[type='checkbox']:not(.toggle):checked::after {
  content: '';
  width: 4px;
  height: 8px;
  border: solid var(--bg-app);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}
input[type='radio']:checked::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bg-app);
}
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
  user-select: none;
}
.check-row:hover {
  color: var(--text);
}
.check-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
}
.check-tile:has(input:checked) {
  border-color: var(--primary-line);
  color: var(--text);
}

/* Toggle switch */
input.toggle {
  appearance: none;
  -webkit-appearance: none;
  width: 44px;
  height: 24px;
  margin: 0;
  border-radius: var(--r-full);
  background: var(--border-strong);
  border: 1px solid var(--border-strong);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, box-shadow 0.2s;
}
input.toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-2);
  transition: transform 0.2s, background 0.2s;
}
input.toggle:checked {
  background: var(--success);
  border-color: var(--success);
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.35);
}
input.toggle:checked::after {
  transform: translateX(20px);
  background: #fff;
}
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  cursor: pointer;
}
.switch-row:hover {
  border-color: var(--border-strong);
}
.switch-row .txt b {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.switch-row .txt small {
  display: block;
  font-size: 12px;
  line-height: 16px;
  color: var(--muted);
  margin-top: 2px;
}

/* Segmented control / Tabs */
.seg {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--r-lg);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  max-width: 100%;
  overflow-x: auto;
}
.seg button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r);
  background: transparent;
  color: var(--text-2);
  font: 500 13px var(--font);
  cursor: pointer;
  white-space: nowrap;
}
.seg button:hover {
  color: var(--text);
  background: var(--bg-card-hover);
}
.seg button.active {
  background: var(--primary);
  color: var(--bg-app);
  font-weight: 600;
  box-shadow: 0 0 12px rgba(0, 191, 255, 0.35);
}
.seg.full {
  display: flex;
}
.seg.full button {
  flex: 1;
  justify-content: center;
}

.subtabs {
  display: flex;
  gap: 4px;
  padding: 6px;
  border-radius: var(--r-lg);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
}
.subtabs button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--r);
  background: transparent;
  color: var(--text-2);
  font: 500 14px var(--font);
  cursor: pointer;
  white-space: nowrap;
}
.subtabs button:hover {
  color: var(--text);
  background: var(--bg-card-hover);
}
.subtabs button.active {
  background: var(--primary);
  color: var(--bg-app);
  font-weight: 600;
  box-shadow: 0 0 12px rgba(0, 191, 255, 0.35);
}
.subtabs .count {
  font-family: var(--mono);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: var(--r);
  background: rgba(0, 0, 0, 0.25);
}
.subtabs button:not(.active) .count {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-2);
}
.subpane {
  display: none;
}
.subpane.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

/* Progress */
.progress {
  height: 6px;
  border-radius: var(--r-full);
  background: var(--border);
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--success));
  box-shadow: 0 0 8px rgba(0, 191, 255, 0.5);
  transition: width 0.4s ease;
}
.progress.thin {
  height: 4px;
}
.progress.warn > span {
  background: var(--warning);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}
.progress.danger > span {
  background: var(--danger);
}
.progress.ok > span {
  background: var(--success);
  box-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
}

/* Alerts */
.alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 13.5px;
  line-height: 21px;
  color: var(--text-2);
}
.alert > .ms {
  margin-top: 1px;
}
.alert b {
  color: var(--text);
}
.alert.info {
  border-color: var(--primary-line);
  background: linear-gradient(90deg, rgba(0, 191, 255, 0.07), rgba(0, 191, 255, 0.02));
}
.alert.info > .ms {
  color: var(--primary);
}
.alert.warn {
  border-color: var(--warning-line);
  background: var(--warning-soft);
}
.alert.warn > .ms {
  color: var(--warning);
}
.alert.ok {
  border-color: var(--success-line);
  background: var(--success-soft);
}
.alert.ok > .ms {
  color: var(--success);
}
.alert.danger {
  border-color: var(--danger-line);
  background: var(--danger-soft);
}
.alert.danger > .ms {
  color: var(--danger);
}
.alert.compact {
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 18px;
}

.empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-xl);
}
.empty .ms {
  display: block;
  margin: 0 auto 8px;
  font-size: 32px;
  color: var(--border-strong);
}

/* Console */
.console {
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 19px;
  padding: 12px;
  height: 460px;
  overflow-y: auto;
  color: var(--text-2);
}
.log-line {
  padding: 2px 0;
  word-break: break-word;
}
.log-line .ts {
  color: var(--muted);
}
.log-line .lvl {
  font-weight: 700;
  margin: 0 6px;
}
.log-line.info .lvl {
  color: var(--primary);
}
.log-line.success .lvl {
  color: var(--success);
}
.log-line.warn .lvl {
  color: var(--warning);
}
.log-line.error .lvl {
  color: var(--danger);
}
.log-line.error {
  color: #ffb3ba;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--r-lg);
}
table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 16px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr:hover {
  background: var(--bg-card-hover);
}
.table tbody tr:last-child td {
  border-bottom: 0;
}

/* KPI */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}
.kpi {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  transition: background 0.15s;
}
.kpi:hover {
  background: var(--bg-card-hover);
}
.kpi .kpi-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-2);
}
.kpi .kpi-head .ms {
  color: var(--muted);
  font-size: 18px;
}
.kpi .kpi-value {
  font-size: 34px;
  line-height: 42px;
  font-weight: 700;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}
.kpi .kpi-value small {
  font-size: 15px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0;
}
.kpi .kpi-delta {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.kpi .kpi-delta .d {
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.kpi .kpi-delta .d.up {
  color: var(--success);
}
.kpi .kpi-delta .d.down {
  color: var(--danger);
}
.kpi .kpi-foot {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 16px;
  color: var(--muted);
}
.kpi .kpi-foot b {
  color: var(--text);
  font-weight: 600;
}
.kpi.highlight {
  border-color: var(--success);
  background: linear-gradient(180deg, rgba(0, 255, 136, 0.08), rgba(0, 255, 136, 0.01));
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.12);
}
.kpi.highlight .kpi-head {
  color: var(--success);
  font-weight: 600;
}
.kpi.highlight .kpi-head .ms {
  color: var(--success);
}
.kpi.highlight .kpi-value {
  color: var(--success);
  text-shadow: 0 0 18px rgba(0, 255, 136, 0.35);
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg-card);
  overflow: hidden;
}
.mini-stat {
  padding: 12px 16px;
  border-right: 1px solid var(--border);
  min-width: 0;
}
.mini-stat:last-child {
  border-right: 0;
}
.mini-stat .lbl {
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.mini-stat .lbl .ms {
  font-size: 15px;
}
.mini-stat .val {
  font-size: 20px;
  font-weight: 700;
  margin-top: 2px;
}
.mini-stat .sub {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
}

/* Chart */
.chart-wrap {
  position: relative;
  width: 100%;
  overflow-x: auto;
}
.chart-wrap svg {
  display: block;
  min-width: 640px;
  width: 100%;
  height: auto;
}
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
}
.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}
.chart-legend .line i {
  height: 3px;
  width: 16px;
  border-radius: 2px;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}
.chart-tip {
  position: absolute;
  pointer-events: none;
  padding: 8px 10px;
  border-radius: var(--r);
  font-size: 11.5px;
  line-height: 17px;
  font-family: var(--mono);
  color: var(--text);
  z-index: 5;
  white-space: nowrap;
}

/* Lists */
.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  min-width: 0;
}
.list-item:hover {
  border-color: var(--border-strong);
}
.thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--r);
  object-fit: cover;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--muted);
  flex-shrink: 0;
}
.thumb.lg {
  width: 60px;
  height: 60px;
}
.li-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.li-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.scroll-list {
  max-height: 520px;
  overflow-y: auto;
  padding-right: 2px;
}

/* Onboarding */
.onb-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.onb-step {
  padding: 14px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.onb-step.pending {
  border-color: var(--primary);
  box-shadow: 0 0 16px rgba(0, 191, 255, 0.15);
}
.onb-step .top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.onb-step .name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
}
.onb-step .name .ms {
  color: var(--text-2);
}
.onb-step .desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 16px;
}

/* WhatsApp Phone mockup */
.phone {
  border-radius: 28px;
  border: 1px solid var(--border-strong);
  background: #0a1014;
  padding: 10px;
  box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.8);
}
.phone-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 18px 18px 0 0;
  background: #1f2c33;
  color: #e9edef;
}
.phone-head .g-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #2a3942;
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}
.phone-head .g-name {
  font-weight: 600;
  font-size: 14px;
  line-height: 18px;
}
.phone-head .g-sub {
  font-size: 11.5px;
  color: #8696a0;
}
.phone-body {
  background-color: #0b141a;
  background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 16px 16px;
  padding: 14px 12px;
  min-height: 360px;
  max-height: 640px;
  overflow-y: auto;
  border-radius: 0 0 18px 18px;
}
.day-pill {
  display: block;
  width: fit-content;
  margin: 0 auto 12px;
  padding: 3px 10px;
  border-radius: 8px;
  background: #182229;
  color: #8696a0;
  font-size: 11px;
  font-weight: 600;
}
.wa-bubble {
  max-width: 92%;
  margin-left: auto;
  background: #005c4b;
  color: #e9edef;
  border-radius: 8px 0 8px 8px;
  padding: 4px;
  font-size: 13.5px;
  line-height: 19px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
}
.wa-bubble img {
  width: 100%;
  border-radius: 6px;
  display: block;
  max-height: 340px;
  object-fit: cover;
}
.wa-bubble .wa-text {
  padding: 6px 6px 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.wa-bubble .wa-text code {
  font-family: var(--mono);
  font-size: 12.5px;
}
.wa-bubble .wa-time {
  text-align: right;
  font-size: 10.5px;
  color: rgba(233, 237, 239, 0.6);
  padding: 2px 6px 2px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 3px;
}
.wa-bubble .wa-time .ms {
  font-size: 15px;
  color: #53bdeb;
}

/* QR / Pairing */
.connect-stage {
  min-height: 300px;
  border-radius: var(--r-xl);
  border: 1px dashed var(--border-strong);
  background: var(--bg-panel);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}
.qr-frame {
  padding: 12px;
  background: #fff;
  border-radius: var(--r-lg);
  display: inline-block;
  box-shadow: 0 0 24px rgba(0, 191, 255, 0.3);
}
.qr-frame img {
  width: 230px;
  height: 230px;
  display: block;
}
.pair-code {
  font-family: var(--mono);
  font-size: 36px;
  line-height: 44px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--primary);
  padding: 16px 28px;
  border-radius: var(--r-lg);
  border: 1px solid var(--primary);
  background: var(--primary-soft);
  text-shadow: 0 0 16px rgba(0, 191, 255, 0.6);
  box-shadow: 0 0 24px rgba(0, 191, 255, 0.2);
  display: inline-block;
}
.steps-inline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  text-align: left;
}
.steps-inline .s {
  padding: 10px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 12px;
  line-height: 17px;
  color: var(--text-2);
}
.steps-inline .s b {
  display: block;
  color: var(--text);
  font-size: 12.5px;
  margin-bottom: 2px;
}
.steps-inline .s .n {
  font-family: var(--mono);
  color: var(--primary);
  font-weight: 700;
}
.connected-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  background: var(--success-soft);
  border: 1px solid var(--success);
  color: var(--success);
  box-shadow: 0 0 24px rgba(0, 255, 136, 0.3);
}
.connected-avatar .ms {
  font-size: 36px;
}

/* Number cards */
.num-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}
.num-card {
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.num-card.selected {
  border-color: var(--success);
  box-shadow: 0 0 16px rgba(0, 255, 136, 0.15);
}
.num-card .meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  font-size: 12px;
}
.num-card .meta div {
  padding: 6px 8px;
  border-radius: var(--r);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--muted);
}
.num-card .meta b {
  display: block;
  color: var(--text);
  font-weight: 600;
}

/* Groups table */
.group-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 260px;
}
.g-ava {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--bg-app);
  flex-shrink: 0;
}
.g-name {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.g-jid {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  word-break: break-all;
}
.cap {
  min-width: 200px;
}
.cap .row {
  justify-content: space-between;
  font-size: 12.5px;
  margin-bottom: 6px;
}
.role-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.role-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  user-select: none;
}
.role-opt:hover {
  border-color: var(--border-strong);
  color: var(--text);
}
.role-opt input {
  display: none !important;
}
.role-opt:has(input:checked).target {
  background: var(--success);
  border-color: var(--success);
  color: var(--bg-app);
  font-weight: 700;
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.35);
}
.role-opt:has(input:checked).source {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--bg-app);
  font-weight: 700;
  box-shadow: 0 0 12px rgba(0, 191, 255, 0.35);
}
.role-opt:has(input:checked).control {
  background: var(--warning);
  border-color: var(--warning);
  color: var(--bg-app);
  font-weight: 700;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.35);
}

/* Field tiles (anti-ban) */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.tile {
  padding: 12px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.tile .tl {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}
.tile .tl .v {
  font-family: var(--mono);
  color: var(--primary);
}
.tile .tl .ms {
  font-size: 16px;
  color: var(--muted);
}

/* Queue items */
.q-card {
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  background: var(--bg-card);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.q-card.src-mirror {
  border-left-color: var(--primary);
}
.q-card.src-shopee_miner {
  border-left-color: var(--success);
}
.q-card.src-manual {
  border-left-color: var(--warning);
}
.q-card.src-whatsapp_cmd {
  border-left-color: #a78bfa;
}
.q-card .q-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border-radius: var(--r);
  background: var(--bg-panel);
  border: 1px solid var(--border);
}
.h-item {
  padding: 12px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.h-item.failed {
  border-color: var(--warning-line);
  background: rgba(245, 158, 11, 0.06);
}

/* Product grid (catálogo / garimpo) */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.p-card {
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s, transform 0.15s;
}
.p-card:hover {
  border-color: var(--primary-line);
  transform: translateY(-2px);
}
.p-media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--bg-panel);
  overflow: hidden;
}
.p-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.p-media .tags {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}
.p-media .off {
  background: var(--danger);
  color: #fff;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 11.5px;
  padding: 2px 7px;
  border-radius: var(--r);
}
.p-media .comm {
  background: rgba(11, 17, 26, 0.85);
  color: var(--success);
  border: 1px solid var(--success-line);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--r);
}
.p-media .rate {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: rgba(11, 17, 26, 0.85);
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--r);
  color: var(--text);
}
.p-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.p-store {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.p-title {
  font-weight: 600;
  font-size: 14px;
  line-height: 19px;
}
.p-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}
.p-price s {
  font-size: 11.5px;
  color: var(--muted);
}
.p-price b {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.p-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 0 12px 12px;
}

/* Automações */
.rule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.rule-card {
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  border-top: 3px solid var(--success);
  background: var(--bg-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rule-card.paused {
  border-top-color: var(--warning);
}
.rule-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12.5px;
}
.rule-rows .r {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
}
.rule-rows .r > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.rule-rows .r .ms {
  font-size: 15px;
}
.rule-rows .r .v {
  color: var(--text);
  text-align: right;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rule-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.rule-stats div {
  padding: 8px;
  border-radius: var(--r);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
}
.rule-stats div small {
  display: block;
  font-family: var(--font);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 2px;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 24px;
}
.step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  cursor: pointer;
  font: inherit;
  color: var(--text-2);
  text-align: left;
  min-width: 0;
}
.step .n {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.step small {
  display: block;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.step b {
  display: block;
  font-size: 13.5px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.step.done .n {
  background: var(--success-soft);
  border-color: var(--success);
  color: var(--success);
}
.step.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 16px rgba(0, 191, 255, 0.15);
}
.step.active .n {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--bg-app);
}
.step-pane {
  display: none;
}
.step-pane.active {
  display: block;
  animation: fadeIn 0.2s ease;
}
.strategy-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.strategy {
  padding: 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--text-2);
  min-width: 0;
}
.strategy.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--text);
  box-shadow: 0 0 16px rgba(0, 191, 255, 0.15);
}
.strategy.active .ms {
  color: var(--primary);
}
.strategy.soon {
  opacity: 0.55;
}
.strategy b {
  display: block;
  color: var(--text);
  font-size: 14px;
}
.strategy small {
  font-size: 12px;
  color: var(--muted);
}

/* Smartlink banner */
.link-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-radius: var(--r-lg);
  border: 1px solid var(--primary-line);
  background: linear-gradient(90deg, rgba(0, 191, 255, 0.1), rgba(0, 255, 136, 0.04));
}
.link-banner .url {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  word-break: break-all;
}

/* Watermark preview */
.wm-preview {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--r);
  border: 1px solid var(--wm, var(--primary));
  background: rgba(11, 17, 26, 0.9);
  color: var(--wm, var(--primary));
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
}
.wm-preview .sep {
  color: var(--text-2);
}
.wm-preview .bt {
  color: #fff;
}
.swatches {
  display: flex;
  gap: 8px;
  align-items: center;
}
.swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}
.swatch.on {
  border-color: #fff;
  box-shadow: 0 0 10px currentColor;
}

/* Editor toolbar */
.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 10px;
}
.tb-group {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--bg-panel);
  overflow: hidden;
}
.tb-group button {
  width: 36px;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  font: 600 13px var(--mono);
}
.tb-group button:hover {
  background: var(--bg-card-hover);
  color: var(--primary);
}
.tpl-status {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

/* Auth */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg-app);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  overflow-y: auto;
}
.auth-hero {
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  background: radial-gradient(circle at 20% 20%, rgba(0, 191, 255, 0.14), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(0, 255, 136, 0.08), transparent 50%), var(--bg-panel);
  border-right: 1px solid var(--border);
}
.auth-hero h1 {
  font-size: 40px;
  line-height: 48px;
  font-weight: 700;
  letter-spacing: -0.03em;
  max-width: 560px;
}
.auth-hero h1 em {
  font-style: normal;
  color: var(--primary);
  text-shadow: 0 0 24px rgba(0, 191, 255, 0.45);
}
.auth-feats {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 460px;
}
.auth-feats div {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: rgba(17, 24, 35, 0.7);
  font-weight: 500;
}
.auth-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
}
.mobile-auth-brand {
  display: none !important;
}
@media (max-width: 1023px) {
  .mobile-auth-brand {
    display: flex !important;
  }
}

/* Toast */
.toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(420px, calc(100vw - 32px));
}
.toast {
  padding: 12px 14px;
  border-radius: var(--r-lg);
  font-size: 13px;
  line-height: 19px;
  color: var(--text);
  border-left: 3px solid var(--primary);
  animation: toastIn 0.25s ease;
}
.toast.success {
  border-left-color: var(--success);
}
.toast.error {
  border-left-color: var(--danger);
}
.toast.warn {
  border-left-color: var(--warning);
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Bottom nav (mobile) */
.bottom-nav {
  display: none;
}

/* Spinner */
.spin {
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Details/accordion */
details.acc {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg-panel);
}
details.acc > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  font-weight: 500;
}
details.acc > summary::-webkit-details-marker {
  display: none;
}
details.acc > summary .chev {
  margin-left: auto;
  color: var(--muted);
  transition: transform 0.2s;
}
details.acc[open] > summary .chev {
  transform: rotate(180deg);
}
details.acc > .acc-body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

/* ==========================================================================
   Responsivo
   ========================================================================== */
@media (max-width: 1400px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .tile-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1279px) {
  .grid-7-5,
  .grid-8-4 {
    grid-template-columns: minmax(0, 1fr);
  }
  .onb-steps,
  .strategy-grid,
  .stepper {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .top-pill .hide-md {
    display: none;
  }
}

/* Tablet: sidebar só com ícones */
@media (max-width: 1023px) {
  :root {
    --sidebar-w: 72px;
  }
  .brand {
    justify-content: center;
    padding: 0;
  }
  .brand .brand-text,
  .nav-item .nav-label,
  .sidebar-foot .usage-box,
  .sidebar-foot .support-label {
    display: none;
  }
  .nav-item {
    justify-content: center;
    padding: 10px 0;
    position: relative;
  }
  .nav-count {
    position: absolute;
    top: 2px;
    right: 6px;
    min-width: 18px;
    height: 18px;
    font-size: 10px;
  }
  .sidebar-foot .row {
    flex-direction: column;
  }
  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mini-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .mini-stat:nth-child(3) {
    border-right: 0;
  }
  .mini-stat:nth-child(n + 4) {
    border-top: 1px solid var(--border);
  }
  .content {
    padding: 20px 20px 48px;
  }
  .user-meta {
    display: none;
  }
  .auth-overlay {
    grid-template-columns: minmax(0, 1fr);
  }
  .auth-hero {
    display: none;
  }
}

/* Mobile */
@media (max-width: 767px) {
  /* A página nunca rola para os lados no celular */
  html,
  body {
    max-width: 100%;
    overflow-x: clip;
  }
  /* iPhone: campos com fonte menor que 16px fazem o Safari dar zoom ao tocar e a tela fica "cortada" */
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
  .mobile-only {
    display: inline-grid !important;
  }
  .desktop-only {
    display: none !important;
  }
  .sidebar {
    --sidebar-w: 280px;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    /* Acima da camada escura (drawer-backdrop, 90): antes ela cobria o menu e bloqueava os toques */
    z-index: 100;
    max-width: 85vw;
    overflow-y: auto;
  }
  .sidebar.open {
    transform: none;
  }
  .sidebar.open .brand {
    justify-content: flex-start;
    padding: 0 16px;
  }
  .sidebar.open .brand .brand-text,
  .sidebar.open .nav-item .nav-label,
  .sidebar.open .sidebar-foot .usage-box,
  .sidebar.open .sidebar-foot .support-label {
    display: revert;
  }
  .sidebar.open .nav-item {
    justify-content: flex-start;
    padding: 10px;
  }
  .sidebar.open .nav-count {
    position: static;
  }
  .sidebar.open .sidebar-foot .row {
    flex-direction: row;
  }
  .main {
    margin-left: 0;
    padding-bottom: 68px;
  }
  .topbar {
    padding: 0 12px;
    gap: 8px;
  }
  .num-select {
    max-width: none;
    flex: 1;
  }
  .topbar .spacer {
    display: none;
  }
  .content {
    padding: 16px 16px 32px;
  }
  .page-head h1 {
    font-size: 24px;
    line-height: 30px;
  }
  .page-head p {
    font-size: 14px;
  }
  .page-actions {
    width: 100%;
  }
  .page-actions .btn {
    flex: 1;
  }
  .card {
    padding: 16px;
  }
  .kpi-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .kpi .kpi-value {
    font-size: 28px;
    line-height: 34px;
  }
  .mini-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mini-stat {
    border-right: 0 !important;
    border-top: 1px solid var(--border);
  }
  .mini-stat:nth-child(-n + 2) {
    border-top: 0;
  }
  .mini-stat:nth-child(odd) {
    border-right: 1px solid var(--border) !important;
  }
  .onb-steps,
  .strategy-grid,
  .stepper,
  .grid-4,
  .form-grid.cols-2,
  .form-grid.cols-3,
  .steps-inline {
    grid-template-columns: minmax(0, 1fr);
  }
  .tile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .p-actions {
    grid-template-columns: 1fr;
  }
  .pair-code {
    font-size: 26px;
    padding: 12px 16px;
  }
  .console {
    height: 320px;
  }
  .popover {
    position: fixed;
    top: calc(var(--topbar-h) + 4px);
    left: 12px;
    right: 12px;
    width: auto;
  }
  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 64px;
    z-index: 55;
    background: rgba(13, 21, 32, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
  }
  .bottom-nav button {
    border: 0;
    background: transparent;
    color: var(--muted);
    font: 500 10.5px var(--font);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    position: relative;
  }
  .bottom-nav button.active {
    color: var(--primary);
  }
  .bottom-nav button.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 25%;
    right: 25%;
    height: 2px;
    background: var(--primary);
    box-shadow: var(--primary-glow);
  }
  .toast-container {
    bottom: 76px;
    right: 16px;
    left: 16px;
  }
  .table td,
  .table th {
    padding: 10px 12px;
  }
}

/* Chaves de API: campo de texto mascarado (não "senha"), para o navegador não oferecer salvar como login */
.secret-field {
  -webkit-text-security: disc;
  text-security: disc;
}
.secret-field::placeholder {
  -webkit-text-security: none;
}
