/*
 * Auto Insta — Design System
 * Inspirado no Material Design 3 + paleta ManyChat.
 * Regra de ouro: NENHUMA sombra. Elevação = borda + tonalidade.
 */

/* ---------- Tokens ---------- */
:root {
  --primary: #2d7ff9;
  --primary-hover: #1e6feb;
  --primary-tonal: #eaf2ff;
  --primary-tonal-hover: #dcebff;

  --green: #0aa653;
  --green-tonal: #e7f7ee;
  --green-strong: #08813f;

  --orange: #ff9f0a;
  --orange-tonal: #fff4e0;

  --yellow: #ffe95c;
  --peach: #ffd6c4;

  --danger: #e5484d;
  --danger-tonal: #fdebec;

  --purple: #7c3aed;
  --pink: #c026d3;

  --text: #111417;
  --text-2: #6a7280;
  --text-3: #9aa1ab;

  --bg: #ffffff;
  --surface: #f7f8fa;
  --surface-2: #f1f3f5;
  --border: #e7e9ed;
  --border-strong: #d5d9df;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-full: 999px;

  --sidebar-w: 240px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0 0 .35em; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0 0 .8em; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: none; }
small, .muted { color: var(--text-2); }
.text-3 { color: var(--text-3); }
strong { font-weight: 650; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Estrutura do app ---------- */
.app-shell { display: flex; min-height: 100vh; }

.main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  padding: 28px 36px 64px;
  max-width: 1240px;
}

@media (max-width: 900px) {
  .main { margin-left: 0; padding: 20px 16px 96px; }
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.page-header__titles { min-width: 0; }
.page-header h1 { margin-bottom: 2px; }
.page-header .subtitle { color: var(--text-2); margin: 0; }
.page-header__actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-2); margin-bottom: 10px;
}
.breadcrumb a { color: var(--text-2); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--text-3); }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: #fbfbfc;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  gap: 4px;
  z-index: 40;
}

.sidebar__logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 19px; font-weight: 800; letter-spacing: -0.02em;
  padding: 4px 10px 14px;
  color: var(--text);
}
.sidebar__logo .logo-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--yellow), var(--peach));
  display: grid; place-items: center; font-size: 16px;
}
.sidebar__logo-img { height: 44px; width: auto; max-width: 100%; display: block; }

/* Selo "orgulhosamente desenvolvido para empreendedores" */
.made-for {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 11.5px; color: var(--text-3);
  margin-top: 14px; padding-top: 12px;
  text-align: left; line-height: 1.3;
}
.made-for img { width: 22px; height: 22px; border-radius: 6px; flex: none; border: 1px solid var(--border); }
.sidebar .made-for { border-top: 1px solid var(--border); margin-top: 10px; }

.sidebar__account {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: #fff;
  min-width: 0;
}
.sidebar__account .acct-name { font-weight: 650; font-size: 13.5px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__account .acct-status { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 5px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); display: inline-block; }
.status-dot--off { background: var(--text-3); }

.sidebar__nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.sidebar__item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-full);
  color: var(--text);
  font-weight: 550;
  font-size: 14.5px;
  transition: background .15s ease;
}
.sidebar__item svg { width: 20px; height: 20px; color: var(--text-2); flex: none; }
.sidebar__item:hover { background: var(--surface-2); text-decoration: none; }
.sidebar__item--active { background: var(--green-tonal); color: var(--green-strong); }
.sidebar__item--active svg { color: var(--green); }
.sidebar__item .nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  font-size: 11.5px; font-weight: 700;
  border-radius: var(--r-full);
  padding: 1px 8px;
}

.sidebar__footer { border-top: 1px solid var(--border); padding-top: 10px; display: flex; flex-direction: column; gap: 2px; }

.sidebar__section-label {
  font-size: 10.5px; font-weight: 800; letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 14px 12px 4px;
}

.sidebar__toggle { display: none; }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar--open { transform: translateX(0); }
  .sidebar__toggle {
    display: grid; place-items: center;
    position: fixed; left: 14px; bottom: 14px; z-index: 50;
    width: 52px; height: 52px; border-radius: var(--r-full);
    background: var(--text); color: #fff; border: none; cursor: pointer;
  }
  .sidebar__toggle svg { width: 22px; height: 22px; }
}

/* ---------- Cards ---------- */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px;
}
.card--tight { padding: 14px 16px; }
.card--surface { background: var(--surface); border-color: transparent; }
.card--clickable { display: block; color: inherit; transition: border-color .15s ease, background .15s ease; }
.card--clickable:hover { border-color: var(--border-strong); background: #fcfcfd; text-decoration: none; }
.card--selected { border: 2px solid var(--primary); background: var(--primary-tonal); }
.card + .card { margin-top: 14px; }

.card-title { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-title h2, .card-title h3 { margin: 0; }
.card-title svg { width: 20px; height: 20px; color: var(--text-2); }

.section-num {
  width: 26px; height: 26px; flex: none;
  border-radius: var(--r-full);
  background: var(--text); color: #fff;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
}

.grid { display: grid; gap: 14px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }

.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } .split .phone-wrap { display: none; } }

/* ---------- Hero (banner amarelo estilo ManyChat) ---------- */
.hero-banner {
  border-radius: var(--r-lg);
  background: linear-gradient(105deg, var(--yellow) 0%, #ffe388 45%, var(--peach) 100%);
  padding: 26px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  flex-wrap: wrap;
  border: none;
}
.hero-banner h2 { margin-bottom: 4px; }
.hero-banner p { margin: 0; color: #3d3a2c; }

/* Variante com o degradê oficial do Instagram (página inicial) */
.hero-banner--ig {
  background: linear-gradient(100deg, #feda75 0%, #fa7e1e 25%, #d62976 55%, #962fbf 80%, #4f5bd5 100%);
}
.hero-banner--ig h2 { color: #fff; }
.hero-banner--ig p { color: rgba(255, 255, 255, .9); }

/* .btn.btn--white: especificidade maior porque o bloco base .btn vem depois no arquivo */
.btn.btn--white { --btn-bg: #fff; --btn-fg: var(--text); --btn-bg-hover: #f3f4f6; }

/* ---------- Botões ---------- */
.btn {
  --btn-bg: var(--primary);
  --btn-fg: #fff;
  --btn-bg-hover: var(--primary-hover);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--r-full);
  border: 1px solid transparent;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: inherit;
  font-weight: 650;
  font-size: 14.5px;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, opacity .15s ease;
  text-decoration: none;
  user-select: none;
}
.btn:hover { background: var(--btn-bg-hover); text-decoration: none; }
.btn svg { width: 18px; height: 18px; flex: none; }

.btn--tonal { --btn-bg: var(--primary-tonal); --btn-fg: var(--primary); --btn-bg-hover: var(--primary-tonal-hover); }
.btn--green { --btn-bg: var(--green); --btn-fg: #fff; --btn-bg-hover: var(--green-strong); }
.btn--green-tonal { --btn-bg: var(--green-tonal); --btn-fg: var(--green-strong); --btn-bg-hover: #d9f2e4; }
.btn--outlined { --btn-bg: transparent; --btn-fg: var(--text); --btn-bg-hover: var(--surface); border-color: var(--border-strong); }
.btn--text { --btn-bg: transparent; --btn-fg: var(--primary); --btn-bg-hover: var(--primary-tonal); padding: 8px 14px; }
.btn--danger { --btn-bg: var(--danger); --btn-fg: #fff; --btn-bg-hover: #d13438; }
.btn--danger-text { --btn-bg: transparent; --btn-fg: var(--danger); --btn-bg-hover: var(--danger-tonal); }
.btn--dark { --btn-bg: var(--text); --btn-fg: #fff; --btn-bg-hover: #2a2e33; }

.btn--sm { padding: 6px 14px; font-size: 13px; }
.btn--sm svg { width: 15px; height: 15px; }
.btn--lg { padding: 13px 26px; font-size: 15.5px; }
.btn--full { width: 100%; }
.btn--icon { padding: 9px; border-radius: var(--r-full); }
.btn--icon.btn--sm { padding: 6px; }

.btn[disabled], .btn--loading { opacity: .65; pointer-events: none; }

/* Spinner (anti duplo clique) */
.btn__spinner {
  display: none;
  width: 15px; height: 15px; flex: none;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn--loading .btn__spinner { display: inline-block; }
.btn--loading > svg { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Formulários ---------- */
.field { margin-bottom: 16px; }
.field > label {
  display: block;
  font-weight: 650;
  font-size: 13.5px;
  margin-bottom: 6px;
}
.field .hint { font-size: 12.5px; color: var(--text-2); margin-top: 5px; }

.input, textarea.input, select.input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  font: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color .15s ease;
}
.input:focus { border-color: var(--primary); outline: none; }
.input::placeholder { color: var(--text-3); }
textarea.input { resize: vertical; min-height: 84px; }
.input--error { border-color: var(--danger); }

.form-errors {
  background: var(--danger-tonal);
  border: 1px solid #f5c6c8;
  color: #9b2226;
  border-radius: var(--r-sm);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 14px;
}
.form-errors ul { margin: 4px 0 0; padding-left: 18px; }

/* Radios/checks estilo MD3 (pílula selecionável) */
.choice-row { display: flex; gap: 10px; flex-wrap: wrap; }
.choice {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-full);
  padding: 9px 18px;
  cursor: pointer;
  font-weight: 550; font-size: 14px;
  transition: all .15s ease;
  background: #fff;
}
.choice:hover { background: var(--surface); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-tonal);
  color: var(--primary);
}
.choice:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.choice svg { width: 17px; height: 17px; }

/* Switch MD3 */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 550; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track {
  width: 46px; height: 26px; flex: none;
  border-radius: var(--r-full);
  background: var(--surface-2);
  border: 1.5px solid var(--border-strong);
  position: relative;
  transition: background .15s ease, border-color .15s ease;
}
.switch__track::after {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--text-2);
  transition: all .15s ease;
}
.switch input:checked + .switch__track { background: var(--green); border-color: var(--green); }
.switch input:checked + .switch__track::after { left: 23px; background: #fff; }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: var(--r-full);
  padding: 5px 13px;
  font-size: 13.5px; font-weight: 550;
  color: var(--text);
}
.chip--primary { background: var(--primary-tonal); color: var(--primary); }
.chip--green { background: var(--green-tonal); color: var(--green-strong); }
.chip button {
  border: none; background: none; cursor: pointer; padding: 0;
  color: inherit; opacity: .6; display: grid; place-items: center;
  font-size: 15px; line-height: 1;
}
.chip button:hover { opacity: 1; }

.chip--suggestion {
  background: #fff; border: 1px dashed var(--border-strong);
  cursor: pointer; color: var(--text-2);
  transition: all .15s ease;
}
.chip--suggestion:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-tonal); }

/* Entrada de chips (palavras-chave) */
.chips-input {
  display: flex; flex-wrap: wrap; gap: 7px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 8px 10px;
  background: #fff;
  cursor: text;
}
.chips-input:focus-within { border-color: var(--primary); }
.chips-input input {
  flex: 1; min-width: 130px;
  border: none; outline: none; font: inherit; padding: 4px;
  background: transparent;
}

/* Chips de variáveis */
.var-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.var-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--orange-tonal);
  color: #9a6700;
  border: none;
  border-radius: var(--r-full);
  padding: 4px 12px;
  font-size: 12.5px; font-weight: 650;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s ease;
}
.var-chip:hover { background: #ffe9c2; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: var(--r-full);
  padding: 3px 11px;
  font-size: 12px; font-weight: 700;
  letter-spacing: .01em;
}
.badge--green { background: var(--green-tonal); color: var(--green-strong); }
.badge--orange { background: var(--orange); color: #fff; }
.badge--orange-tonal { background: var(--orange-tonal); color: #9a6700; }
.badge--blue { background: var(--primary-tonal); color: var(--primary); }
.badge--purple { background: #f1e8ff; color: var(--purple); }
.badge--gray { background: var(--surface-2); color: var(--text-2); }
.badge--red { background: var(--danger-tonal); color: var(--danger); }
.badge--dark { background: var(--text); color: #fff; }

/* ---------- Stepper (wizard) ---------- */
.stepper { display: flex; align-items: center; gap: 0; margin-bottom: 28px; }
.stepper__step { display: flex; align-items: center; gap: 10px; }
.stepper__dot {
  width: 34px; height: 34px; flex: none;
  border-radius: var(--r-full);
  border: 2px solid var(--border-strong);
  background: #fff;
  color: var(--text-2);
  display: grid; place-items: center;
  font-weight: 700; font-size: 14px;
  transition: all .2s ease;
}
.stepper__label { font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.stepper__bar { flex: 1; height: 2px; background: var(--border); margin: 0 14px; min-width: 24px; border-radius: 2px; }

.stepper__step--current .stepper__dot { border-color: var(--primary); background: var(--primary); color: #fff; }
.stepper__step--current .stepper__label { color: var(--text); }
.stepper__step--done .stepper__dot { border-color: var(--green); background: var(--green-tonal); color: var(--green-strong); }
.stepper__bar--done { background: var(--green); }

@media (max-width: 700px) { .stepper__label { display: none; } }

/* ---------- Preview de celular ---------- */
.phone-wrap { position: sticky; top: 24px; }
.phone {
  width: 320px; max-width: 100%;
  margin: 0 auto;
  border: 1px solid var(--border-strong);
  border-radius: 36px;
  background: #fff;
  overflow: hidden;
}
.phone__notch { height: 22px; display: grid; place-items: center; }
.phone__notch::after { content: ""; width: 90px; height: 7px; border-radius: var(--r-full); background: var(--surface-2); }
.phone__header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.phone__header .ph-name { font-weight: 650; font-size: 13.5px; line-height: 1.15; }
.phone__header .ph-sub { font-size: 11.5px; color: var(--text-2); }
.phone__screen {
  padding: 16px 14px 20px;
  min-height: 300px; max-height: 460px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
  background: #fff;
}
.phone__hint { text-align: center; font-size: 12px; color: var(--text-3); margin: auto 0; padding: 30px 10px; }

.dm-bubble {
  max-width: 82%;
  padding: 9px 14px;
  border-radius: 18px;
  font-size: 13.5px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.dm-bubble--in { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 6px; }
.dm-bubble--out {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: #fff;
  border-bottom-right-radius: 6px;
}
.dm-bubble--human { background: var(--primary); color: #fff; align-self: flex-end; border-bottom-right-radius: 6px; }
.dm-meta { font-size: 10.5px; color: var(--text-3); align-self: center; margin: 4px 0 2px; }
.dm-chips { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; max-width: 88%; }
.dm-chip {
  border: 1px solid var(--primary);
  color: var(--primary);
  background: #fff;
  border-radius: var(--r-full);
  padding: 5px 13px;
  font-size: 12.5px; font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s ease;
}
.dm-chip:hover { background: var(--primary-tonal); }
.dm-link-btn {
  display: block;
  margin-top: 7px;
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.55);
  color: #fff;
  border-radius: var(--r-sm);
  text-align: center;
  padding: 6px 10px;
  font-size: 12.5px; font-weight: 650;
}

/* Preview de comentário (post) */
.post-preview { border-top: 1px solid var(--border); }
.post-preview__media {
  height: 130px;
  background: linear-gradient(135deg, #a5b4fc, #f0abfc);
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 13px;
}
.comment-row { display: flex; gap: 9px; padding: 9px 14px; align-items: flex-start; }
.comment-row .c-body { font-size: 13px; line-height: 1.35; }
.comment-row .c-user { font-weight: 650; margin-right: 5px; }
.comment-row--reply { padding-left: 40px; background: var(--surface); }

/* ---------- Avatares ---------- */
.avatar {
  width: 36px; height: 36px; flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #fda4af, #fdba74);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: 14px;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { width: 28px; height: 28px; font-size: 11.5px; }
.avatar--lg { width: 52px; height: 52px; font-size: 20px; }
.avatar--ig { background: linear-gradient(135deg, #f9ce34, #ee2a7b 55%, #6228d7); }

/* ---------- Listas / linhas ---------- */
.list-rows { display: flex; flex-direction: column; }
.list-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 10px;
  background: #fff;
  color: inherit;
  transition: border-color .15s ease, background .15s ease;
}
a.list-row:hover { border-color: var(--border-strong); background: #fcfcfd; text-decoration: none; }
.list-row__body { flex: 1; min-width: 0; }
.list-row__title { font-weight: 650; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.list-row__sub { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row__meta { display: flex; align-items: center; gap: 10px; flex: none; }
.list-row--unread { border-left: 3px solid var(--primary); }

/* ---------- Stat chips (cabeçalho dos builders) ---------- */
.stat-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--surface);
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text-2);
}
.stat-chip svg { width: 15px; height: 15px; color: var(--primary); }
.stat-chip b, .stat-chip strong { color: var(--text); font-size: 14px; font-weight: 700; }

/* ---------- Stat cards ---------- */
.stat-card { text-align: left; }
.stat-card .stat-value { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.stat-card .stat-label { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.stat-card .stat-label svg { width: 15px; height: 15px; }

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  padding: 52px 24px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.empty-state__icon {
  width: 58px; height: 58px;
  margin: 0 auto 14px;
  border-radius: var(--r-full);
  background: #fff;
  border: 1px solid var(--border);
  display: grid; place-items: center;
}
.empty-state__icon svg { width: 26px; height: 26px; color: var(--text-2); }
.empty-state h3 { margin-bottom: 4px; }
.empty-state p { color: var(--text-2); max-width: 420px; margin: 0 auto 18px; }

/* ---------- Banners informativos ---------- */
.banner {
  display: flex; gap: 12px; align-items: flex-start;
  border-radius: var(--r-md);
  padding: 14px 16px;
  font-size: 14px;
  border: 1px solid transparent;
  margin-bottom: 16px;
}
.banner svg { width: 19px; height: 19px; flex: none; margin-top: 1px; }
.banner--info { background: var(--primary-tonal); color: #174a9c; }
.banner--info svg { color: var(--primary); }
.banner--warning { background: var(--orange-tonal); color: #7a5200; }
.banner--warning svg { color: var(--orange); }
.banner--success { background: var(--green-tonal); color: var(--green-strong); }
.banner--success svg { color: var(--green); }
.banner--danger { background: var(--danger-tonal); color: #9b2226; }
.banner--danger svg { color: var(--danger); }
.banner strong { display: block; }

/* ---------- Toasts (flash) ---------- */
.toasts {
  position: fixed; top: 18px; right: 18px; z-index: 100;
  display: flex; flex-direction: column; gap: 10px;
  max-width: 360px;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--text); color: #fff;
  border-radius: var(--r-md);
  padding: 12px 18px;
  font-size: 14px; font-weight: 550;
  animation: toast-in .25s ease;
}
.toast--alert { background: var(--danger); }
.toast svg { width: 18px; height: 18px; flex: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- Dialog (confirmação) ---------- */
dialog.dialog {
  border: none;
  border-radius: var(--r-lg);
  padding: 26px;
  max-width: 380px; width: calc(100% - 40px);
  font-family: var(--font);
}
dialog.dialog::backdrop { background: rgba(17, 20, 23, .4); }
.dialog h3 { margin-bottom: 6px; }
.dialog p { color: var(--text-2); margin-bottom: 20px; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Tabs ---------- */
.tabs {
  display: inline-flex;
  background: var(--surface-2);
  border-radius: var(--r-full);
  padding: 4px;
  gap: 2px;
  margin-bottom: 20px;
}
.tab {
  border: none; background: transparent;
  border-radius: var(--r-full);
  padding: 8px 18px;
  font: inherit; font-weight: 600; font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  text-decoration: none;
  transition: all .15s ease;
}
.tab svg { width: 16px; height: 16px; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab--active { background: #fff; color: var(--text); border: 1px solid var(--border); }

/* ---------- Grade de mídias (posts/reels) ---------- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.media-tile {
  position: relative;
  border: 2px solid transparent;
  border-radius: var(--r-sm);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1;
  background: var(--surface-2);
  transition: border-color .15s ease;
}
.media-tile input { position: absolute; opacity: 0; pointer-events: none; }
.media-tile img, .media-tile .media-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-tile .media-thumb { display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 12px; padding: 8px; text-align: center; }
.media-tile:has(input:checked) { border-color: var(--primary); }
.media-tile:has(input:checked)::after {
  content: "✓";
  position: absolute; top: 6px; right: 6px;
  width: 22px; height: 22px;
  background: var(--primary); color: #fff;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
}
.media-tile__kind {
  position: absolute; left: 6px; top: 6px;
  background: rgba(17,20,23,.65); color: #fff;
  font-size: 10.5px; font-weight: 700;
  border-radius: 6px; padding: 2px 7px;
}
.media-tile__caption {
  position: absolute; inset: auto 0 0 0;
  background: linear-gradient(transparent, rgba(17,20,23,.75));
  color: #fff; font-size: 10.5px;
  padding: 14px 7px 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- Variações de resposta ---------- */
.variations { display: flex; flex-direction: column; gap: 10px; }
.variation-card {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  background: var(--surface);
  position: relative;
}
.variation-card textarea.input { background: #fff; }
.variation-card__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.variation-card__head .v-label { font-size: 12.5px; font-weight: 700; color: var(--text-2); letter-spacing: .02em; }

/* ---------- Chatbot builder (árvore) ---------- */
.bot-tree { display: flex; flex-direction: column; }
.bot-step { position: relative; }
.bot-step__children { margin-left: 34px; padding-left: 22px; border-left: 2px solid var(--border); display: flex; flex-direction: column; }
.bot-step__connector { display: flex; align-items: center; gap: 8px; margin: 12px 0 8px; }
.bot-option-pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--primary-tonal); color: var(--primary);
  border-radius: var(--r-full);
  padding: 5px 14px;
  font-size: 13px; font-weight: 700;
}
.bot-option-pill svg { width: 14px; height: 14px; }

.bot-card {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: #fff;
  padding: 14px 16px;
  max-width: 640px;
}
.bot-card--root { border-color: var(--green); border-width: 1.5px; }
.bot-card__bubble {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: #fff;
  border-radius: 16px 16px 16px 5px;
  padding: 10px 14px;
  font-size: 14px;
  white-space: pre-wrap;
  max-width: 92%;
}
.bot-card__actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Conversa (chat ao vivo) ---------- */
.chat-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 0; border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; min-height: 70vh; background: #fff; }
@media (max-width: 900px) { .chat-layout { grid-template-columns: 1fr; } .chat-layout__list--hidden-mobile { display: none; } }
.chat-layout__list { border-right: 1px solid var(--border); overflow-y: auto; max-height: 78vh; }
.chat-layout__main { display: flex; flex-direction: column; max-height: 78vh; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.chat-composer { border-top: 1px solid var(--border); padding: 12px 16px; display: flex; gap: 10px; align-items: flex-end; background: #fff; }
.chat-composer textarea.input { min-height: 44px; max-height: 130px; }

.conv-item {
  display: flex; gap: 11px; align-items: center;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: inherit;
}
.conv-item:hover { background: var(--surface); text-decoration: none; }
.conv-item--active { background: var(--primary-tonal); }
.conv-item__body { flex: 1; min-width: 0; }
.conv-item__name { font-weight: 650; font-size: 14px; }
.conv-item__last { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Tabela simples ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12.5px; color: var(--text-2); font-weight: 650; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); }
.table tr:last-child td { border-bottom: none; }

/* ---------- Utilidades ---------- */
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.flex-center { display: flex; align-items: center; gap: 10px; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.text-sm { font-size: 13px; } .text-xs { font-size: 12px; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ---------- Telas de autenticação ---------- */
.auth-layout {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, #fffbe6 0%, #fff 40%, #f2f7ff 100%);
  padding: 24px;
}
.auth-card {
  width: 100%; max-width: 420px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 36px;
}
.auth-card .auth-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 22px; font-weight: 800;
  margin-bottom: 6px;
}
.auth-card .auth-logo img { height: 54px; width: auto; max-width: 100%; }
.auth-card .auth-sub { color: var(--text-2); margin-bottom: 24px; }
.auth-footer { text-align: center; margin-top: 18px; font-size: 14px; color: var(--text-2); }

/* Selo de parceiro no cadastro vindo da CW App Store */
.cw-partner-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  border-radius: var(--r-md);
  background: #f1e8ff;
  color: var(--purple);
  font-size: 14px;
}
.cw-partner-badge svg { width: 18px; height: 18px; flex: 0 0 auto; }
