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

:root {
  --bg: #f4f5f9;
  --surface: #ffffff;
  --surface2: #f8f9fc;
  --border: #e8eaf0;
  --border2: #d1d5de;
  --text: #1a1d2e;
  --text2: #4a5068;
  --muted: #8b91a8;
  --primary: #4361ee;
  --primary-light: #eef0fd;
  --primary-dark: #2541c4;
  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  /* Rosa-crítico do design system aprovado (docs/stitch-reference/README.md) no
     lugar do vermelho de erro de formulário — menos alarmante em uso contínuo. */
  --danger: #f43f5e;
  --danger-light: #fff1f2;
  --sidebar-w: 220px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.10);
  /* Raio subiu de 10px pra 18px (faixa 16-20px aprovada) — cara de app, não de planilha. */
  --r: 18px;
  --rs: 10px;
}

:root[data-theme="dark"] {
  --bg: #0e131f;
  --surface: #161c28;
  --surface2: #1d2534;
  --border: #2a3244;
  --border2: #3a4459;
  --text: #e9ecf3;
  --text2: #a6afc2;
  --muted: #79839a;
  --primary-light: #1b2444;
  --success-light: #10271e;
  --warning-light: #2a2410;
  /* Rosa-crítico em tom escuro, mesma lógica do claro. */
  --danger: #fb7185;
  --danger-light: rgba(244, 63, 94, 0.15);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow: 0 4px 12px rgba(0,0,0,0.5);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.6);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── SIDEBAR ─────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.sidebar-logo {
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #fff;
  flex-shrink: 0;
}

.logo-text { line-height: 1.2; }
.logo-name { font-size: 13px; font-weight: 700; color: var(--text); }
.logo-sub { font-size: 11px; color: var(--muted); }

/* ── NAV ─────────────────────────────────────────── */
.sidebar-nav { flex: 1; padding: 10px 8px; overflow-y: auto; }
.nav-section { margin-bottom: 4px; }
.nav-section-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; padding: 12px 8px 5px; }

.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 11px; border-radius: var(--rs); border: none; background: none;
  color: var(--text2); font-family: 'Inter', system-ui, sans-serif; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all 0.15s; text-align: left; position: relative;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
/* ícones do menu em tom neutro/profissional (sem cor), como o Reploy */
.nav-item .nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; filter: grayscale(1); opacity: 0.65; transition: opacity 0.15s; }
.nav-item:hover .nav-icon, .nav-item.active .nav-icon { opacity: 0.95; }

.nav-badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 8px; min-width: 18px; text-align: center; }
.nav-badge.muted { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }

.sidebar-bottom { padding: 10px 8px; border-top: 1px solid var(--border); }

/* ── CONTENT ─────────────────────────────────────── */
.content { margin-left: var(--sidebar-w); flex: 1; min-width: 0; min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }
.page { min-width: 0; }

.content-header {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0 28px; height: 52px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50; box-shadow: var(--shadow-sm);
}
.page-title { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; display: flex; align-items: center; gap: 8px; }
.page-title .breadcrumb { font-size: 13px; font-weight: 400; color: var(--muted); }
.header-actions { display: flex; align-items: center; gap: 8px; }

/* Filtro de negócio (filiais) */
.pills-bar { display: none; align-items: center; gap: 7px; padding: 12px 28px 0; flex-wrap: wrap; }
.pills-bar.visible { display: flex; }
.filter-pill {
  padding: 6px 13px; border-radius: 20px; border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text2); font-family: 'Inter', system-ui, sans-serif; font-size: 12.5px; font-weight: 600;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.filter-pill:hover { border-color: var(--border2); }
.filter-pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ── PAGES ───────────────────────────────────────── */
.page { display: none; padding: 20px 28px 28px; }
.page.active { display: block; }

/* ── BUTTONS ─────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--rs);
  border: none; cursor: pointer; font-family: 'Inter', system-ui, sans-serif; font-size: 13px; font-weight: 600;
  transition: all 0.15s; text-decoration: none; line-height: 1; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: transparent; color: var(--text2); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface2); border-color: var(--border2); color: var(--text); }
.btn-danger-ghost { background: transparent; color: var(--danger); border: 1px solid rgba(239,68,68,0.3); }
.btn-danger-ghost:hover { background: var(--danger-light); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; border-radius: 4px; }
.btn-icon {
  background: var(--surface2); border: 1px solid var(--border); color: var(--muted);
  width: 30px; height: 30px; padding: 0; display: flex; align-items: center; justify-content: center;
  border-radius: var(--rs); cursor: pointer; transition: all 0.15s;
}
.btn-icon:hover { color: var(--text); border-color: var(--border2); }

/* ── KPI / DASH ──────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.kpi-grid.g3 { grid-template-columns: repeat(3, 1fr); }
.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.kpi-card.yellow { border-color: rgba(245,158,11,0.4); background: var(--warning-light); }
.kpi-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.kpi-value { font-size: 26px; font-weight: 800; color: var(--text); letter-spacing: -1px; line-height: 1; margin-bottom: 5px; display: flex; align-items: center; gap: 8px; }
.kpi-sub { font-size: 12px; color: var(--muted); }
.trend-tag { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 10px; display: inline-flex; align-items: center; gap: 3px; }
.trend-tag.melhorando { background: var(--success-light); color: #059669; }
.trend-tag.piorando { background: var(--danger-light); color: var(--danger); }
.trend-tag.estavel { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }

.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dash-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.dash-card-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }

/* ── SECTION ─────────────────────────────────────── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-title { font-size: 15px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.info-box { background: var(--primary-light); border: 1px solid rgba(67,97,238,0.15); border-radius: var(--rs); padding: 10px 13px; font-size: 12px; color: #3451c7; margin-bottom: 16px; line-height: 1.6; }
.empty-block { text-align: center; color: var(--muted); font-size: 13px; padding: 32px 0; }

/* ── NEGÓCIOS (filiais) CARDS ────────────────────── */
.biz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.biz-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 10px; }
.biz-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.biz-name { font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.3; }
.biz-address { font-size: 12px; color: var(--muted); margin-top: 2px; }
.biz-rating-badge { flex-shrink: 0; background: var(--warning-light); color: #b45309; font-size: 12px; font-weight: 800; padding: 4px 9px; border-radius: 20px; white-space: nowrap; }
.biz-meta-row { font-size: 12px; color: var(--text2); display: flex; align-items: center; gap: 6px; }
.biz-status { font-size: 11.5px; font-weight: 600; padding: 5px 10px; border-radius: var(--rs); display: flex; align-items: center; gap: 5px; }
.biz-status.connected { background: var(--success-light); color: #059669; }
.biz-status.pending { background: var(--surface2); color: var(--text2); border: 1px dashed var(--border2); }
.biz-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; border-top: 1px solid var(--border); }

/* ── REVIEW CARDS ────────────────────────────────── */
.cards-list { display: flex; flex-direction: column; gap: 12px; }
.review-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.review-card.priority-high { border-color: rgba(239,68,68,0.35); background: linear-gradient(var(--danger-light), var(--danger-light)) padding-box, var(--danger-light); }
.review-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.review-who { display: flex; gap: 9px; align-items: flex-start; }
.review-business { font-size: 13px; font-weight: 700; color: var(--text); }
.review-meta { font-size: 12px; color: var(--muted); margin-top: 1px; }
.review-badge { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; background: var(--danger-light); color: var(--danger); white-space: nowrap; flex-shrink: 0; }
.review-text { font-size: 13px; color: var(--text2); margin-bottom: 10px; font-style: italic; line-height: 1.5; }
.field-label { font-size: 12px; font-weight: 600; color: var(--text2); display: block; margin-bottom: 5px; }
.action-box { border-radius: var(--rs); padding: 9px 12px; font-size: 13px; color: var(--text); margin-bottom: 10px; }
.action-box.private { background: var(--danger-light); border: 1px solid rgba(239,68,68,0.2); }
textarea.resp-input { width: 100%; min-height: 200px; background: var(--surface); border: 1.5px solid var(--border); color: var(--text); padding: 12px 14px; border-radius: var(--rs); font-family: 'Inter', system-ui, sans-serif; font-size: 13.5px; line-height: 1.6; outline: none; resize: vertical; margin-bottom: 10px; }
textarea.resp-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(67,97,238,0.1); }
.review-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.answered-row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--rs); padding: 10px 13px; cursor: pointer; transition: border-color 0.15s; }
.answered-row:hover { border-color: var(--border2); }
.answered-row-top { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.answered-row-top .arrow { font-size: 11px; color: var(--muted); transition: transform 0.15s; }
.answered-row-top .arrow.open { transform: rotate(90deg); }
.answered-detail { display: none; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.answered-detail.open { display: block; }

.history-list { display: flex; flex-direction: column; gap: 7px; }
.history-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 11px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--rs); }
.history-icon { font-size: 15px; flex-shrink: 0; margin-top: 1px; }
.history-text { flex: 1; font-size: 13px; color: var(--text); line-height: 1.4; }
.history-date { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ── PLACEHOLDER (em breve) ──────────────────────── */
.soon-block { text-align: center; padding: 60px 20px; max-width: 460px; margin: 0 auto; }
.soon-emoji { font-size: 44px; margin-bottom: 12px; }
.soon-title { font-size: 20px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.soon-sub { font-size: 14px; color: var(--muted); line-height: 1.6; }

/* ── CAIXA DE ENTRADA ────────────────────────────── */
.inbox-day { font-size: 12px; font-weight: 700; color: var(--text2); background: var(--surface2); border: 1px solid var(--border); border-radius: var(--rs); padding: 7px 12px; margin: 18px 0 10px; }
.inbox-day:first-child { margin-top: 0; }
.inbox-item { display: flex; align-items: flex-start; gap: 12px; padding: 14px 14px; border-bottom: 1px solid var(--border); transition: background 0.12s; }
.inbox-item:hover { background: var(--surface2); }
.inbox-item.unread { background: var(--primary-light); }
.inbox-item.unread:hover { background: var(--primary-light); }
.inbox-item { min-height: 44px; }
.inbox-item:active { background: var(--surface2); }

@media (max-width: 480px) {
  .kpi-grid, .kpi-grid.g3 { grid-template-columns: 1fr; }
}

/* ── BLINDAGEM MOBILE GLOBAL (telas secundárias, ajuste mínimo) ──
   Não redesenha nenhuma tela — só garante que nada force rolagem horizontal
   e que todo alvo clicável tenha tamanho de toque decente. Spec Fase 2, seção 6. */
@media (max-width: 768px) {
  .content { overflow-x: hidden; }
  .page { max-width: 100vw; }
  table { display: block; overflow-x: auto; max-width: 100%; }
  .btn, button, .nav-item, input[type="checkbox"], input[type="radio"] { min-height: 36px; }
}
.inbox-star { background: none; border: none; cursor: pointer; font-size: 15px; opacity: .35; padding: 2px; flex-shrink: 0; line-height: 1; transition: opacity .12s; }
.inbox-star:hover { opacity: .8; }
.inbox-star.on { opacity: 1; }
.inbox-main { flex: 1; min-width: 0; cursor: pointer; }
.inbox-src { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); font-weight: 600; margin-bottom: 3px; }
.inbox-unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.inbox-titulo { font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.4; }
.inbox-desc { font-size: 12.5px; color: var(--text2); line-height: 1.5; margin-top: 4px; }
.inbox-time { font-size: 11.5px; color: var(--muted); flex-shrink: 0; white-space: nowrap; }
.inbox-arch { background: none; border: none; cursor: pointer; font-size: 13px; opacity: .4; padding: 2px; flex-shrink: 0; }
.inbox-arch:hover { opacity: 1; }

/* ── AVISO (box amarelo) ─────────────────────────── */
.warn-box { background: var(--warning-light); border: 1px solid rgba(245,158,11,0.35); color: #92400e; border-radius: var(--rs); padding: 11px 14px; font-size: 12.5px; line-height: 1.6; margin-bottom: 14px; }
:root[data-theme="dark"] .warn-box { color: #f5c66b; }

/* ── GLOBAL SEARCH ───────────────────────────────── */
.global-search { width: 300px; max-width: 42vw; background: var(--surface2); border: 1.5px solid var(--border); color: var(--text); padding: 7px 12px; border-radius: 20px; font-family: inherit; font-size: 13px; outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
.global-search:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(67,97,238,0.1); }
@media (max-width: 560px) { .global-search { width: 160px; } }

/* ── AVALIAÇÕES (board estilo ReviewMankey) ──────── */
.av-filters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.star-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.star-filter button { padding: 6px 12px; border-radius: 20px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text2); font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.star-filter button:hover { border-color: var(--border2); }
.star-filter button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.av-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.av-col-head { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; color: var(--text); padding: 4px 2px 12px; }
.av-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.av-col-count { color: var(--muted); font-weight: 600; font-size: 12px; background: var(--surface2); border: 1px solid var(--border); padding: 1px 8px; border-radius: 10px; }
.av-cards { display: flex; flex-direction: column; gap: 12px; min-height: 90px; border-radius: var(--r); transition: background 0.15s; }
.av-cards.dragover { background: var(--primary-light); outline: 2px dashed var(--primary); outline-offset: 3px; }
.av-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 15px 16px; box-shadow: var(--shadow-sm); cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s; }
.av-card:hover { border-color: var(--border2); box-shadow: var(--shadow); }
.av-card:active { cursor: grabbing; }
.av-card.dragging { opacity: 0.45; transform: scale(0.98); }
.av-card.sel { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(67,97,238,0.12); }
.av-card.crit { border-left: 3px solid var(--danger); }
.av-received { font-size: 11px; color: var(--muted); background: var(--surface2); display: inline-block; padding: 3px 9px; border-radius: 6px; margin-bottom: 10px; }
.av-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.av-author { font-size: 14.5px; font-weight: 700; color: var(--text); line-height: 1.3; }
.av-avatar { width: 30px; height: 30px; border-radius: 8px; background: var(--warning-light); color: #b45309; font-size: 10.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; letter-spacing: 0.5px; }
.av-stars { color: #f5b400; font-size: 13px; letter-spacing: 2px; }
.senti { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 6px; }
.senti.pos { background: var(--success-light); color: #059669; }
.senti.neu { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }
.senti.neg { background: var(--warning-light); color: #b45309; }
.senti.mneg { background: var(--danger-light); color: var(--danger); }
.av-card-text { font-size: 13px; color: var(--text2); line-height: 1.5; margin: 6px 0 10px; }
.av-status { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 6px; background: var(--surface2); color: var(--text2); }
.av-status .d { width: 6px; height: 6px; border-radius: 50%; }
.av-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0; }
.tag-chip { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--primary-light); color: var(--primary); }
.av-foot { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.g-badge { width: 15px; height: 15px; border-radius: 50%; background: #fff; border: 1px solid var(--border); color: #4285F4; font-size: 10px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
@media (max-width: 860px) { .av-board { grid-template-columns: 1fr; } }

/* ── DRAWER (painel lateral da avaliação) ────────── */
.drawer-overlay { position: fixed; inset: 0; background: rgba(15,20,40,0.35); z-index: 900; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.drawer-overlay.open { opacity: 1; pointer-events: all; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 620px; max-width: 92vw; background: var(--surface); border-left: 1px solid var(--border); z-index: 901; transform: translateX(100%); transition: transform 0.25s cubic-bezier(.4,0,.2,1); display: flex; flex-direction: column; box-shadow: -8px 0 30px rgba(0,0,0,0.12); }
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.drawer-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px; }
.drawer-title { font-size: 18px; font-weight: 800; color: var(--text); letter-spacing: -0.3px; margin-bottom: 10px; text-wrap: balance; }
.dtable { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 18px; }
.drow { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.drow:last-child { border-bottom: none; }
.drow-k { width: 96px; flex-shrink: 0; color: var(--muted); font-size: 12.5px; }
.drow-v { flex: 1; color: var(--text); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dsection { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.reviewer-box { display: flex; align-items: center; gap: 11px; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 18px; }
.tag-add { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 6px; background: var(--surface2); color: var(--text2); border: 1px dashed var(--border2); cursor: pointer; font-family: inherit; }
.tag-x { cursor: pointer; opacity: .55; margin-left: 3px; }
.tag-x:hover { opacity: 1; }
.drawer-foot { border-top: 1px solid var(--border); padding: 14px 18px; flex-shrink: 0; background: var(--surface); }
@media (max-width: 560px) { .drawer { width: 100%; } }

/* ── KANBAN ──────────────────────────────────────── */
.kb-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kb-col { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--r); min-height: 200px; display: flex; flex-direction: column; }
.kb-col-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 10px; font-size: 12.5px; font-weight: 700; color: var(--text); border-radius: var(--r) var(--r) 0 0; background: var(--surface); }
.kb-count { background: var(--surface2); color: var(--muted); font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 10px; border: 1px solid var(--border); }
.kb-cards { padding: 10px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.kb-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--rs); padding: 10px 12px; cursor: grab; box-shadow: var(--shadow-sm); }
.kb-card:active { cursor: grabbing; }
.kb-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.kb-card-top span { color: var(--star, #f5b400); font-size: 11px; }
.kb-card-author { font-size: 11.5px; color: var(--muted); margin: 2px 0 5px; }
.kb-card-text { font-size: 12.5px; color: var(--text2); line-height: 1.45; font-style: italic; }
.kb-empty { text-align: center; color: var(--muted); font-size: 12px; padding: 14px 0; }

/* ── ÚLTIMAS AVALIAÇÕES (Painel) ─────────────────── */
.rec-sel { padding: 6px 10px; border: 1.5px solid var(--border); border-radius: var(--rs); font-family: inherit; font-size: 12px; background: var(--surface); color: var(--text); outline: none; }
.rec-row { display: flex; align-items: center; gap: 12px; padding: 11px 6px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.12s; }
.rec-row:last-child { border-bottom: none; }
.rec-row:hover { background: var(--surface2); }
.rec-av { width: 30px; height: 30px; border-radius: 8px; background: var(--warning-light); color: #b45309; font-size: 10.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rec-mid { flex: 1; min-width: 0; overflow: hidden; }
.rec-top { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; }
.rec-top .nome { font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.rec-txt { font-size: 12px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.rec-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.rec-date { font-size: 11px; color: var(--muted); }

/* ── GEO GRID (heatmap de ranking) ───────────────── */
.gg-wrap { display: flex; justify-content: center; padding: 20px 0; }
.gg-grid { display: inline-grid; gap: 6px; }
.gg-cell { width: 52px; height: 52px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; color: #fff; box-shadow: var(--shadow-sm); position: relative; }
.gg-cell.center::after { content: '📍'; position: absolute; top: -9px; right: -6px; font-size: 13px; }
.gg-cell.g1 { background: #10b981; }
.gg-cell.g2 { background: #34d399; }
.gg-cell.g3 { background: #f59e0b; }
.gg-cell.g4 { background: #f97316; }
.gg-cell.g5 { background: #f43f5e; }
.gg-legend { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; font-size: 11.5px; color: var(--text2); margin-top: 6px; }
.gg-legend span { display: inline-flex; align-items: center; gap: 5px; }
.gg-legend .dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ── SAZONAL ─────────────────────────────────────── */
.saz-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 14px; }
.saz-card.rel { border-color: rgba(67,97,238,0.35); }
.saz-days { width: 54px; height: 54px; border-radius: 12px; background: var(--primary-light); color: var(--primary); display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; }
.saz-days b { font-size: 18px; line-height: 1; }
.saz-days span { font-size: 9px; font-weight: 700; text-transform: uppercase; }
.saz-mid { flex: 1; min-width: 0; }
.saz-nome { font-weight: 700; font-size: 13.5px; color: var(--text); }
.saz-data { font-size: 12px; color: var(--muted); margin-top: 2px; }
.saz-badge { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: var(--success-light); color: #059669; margin-left: 6px; }

/* ── HEALTH SCORE ────────────────────────────────── */
.score-card { background: linear-gradient(135deg, #10151f, #1a2436); color: #fff; border-radius: var(--r); padding: 22px 24px; margin-bottom: 18px; box-shadow: var(--shadow); }
.score-top { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.score-big { display: flex; flex-direction: column; }
.score-label { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #f5b400; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.score-num { font-size: 52px; font-weight: 800; line-height: 1; letter-spacing: -2px; }
.score-num small { font-size: 20px; font-weight: 600; color: #8b93a8; }
.score-bars { flex: 1; min-width: 260px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; }
.score-bar-label { font-size: 12px; color: #c3cad9; display: flex; justify-content: space-between; margin-bottom: 4px; }
.score-bar-label b { color: #fff; }
.score-bar-track { height: 6px; background: rgba(255,255,255,0.12); border-radius: 4px; overflow: hidden; }
.score-bar-fill { height: 100%; border-radius: 4px; }
.score-note { font-size: 12px; color: #8b93a8; margin-top: 14px; }

/* ── CONFIGURAÇÕES / TEMA ────────────────────────── */
.theme-opts { display: flex; gap: 8px; }
.theme-btn { flex: 1; padding: 14px 10px; border: 1.5px solid var(--border); background: var(--surface); border-radius: var(--rs); cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--text2); display: flex; flex-direction: column; align-items: center; gap: 6px; transition: all 0.15s; }
.theme-btn .ico { font-size: 20px; }
.theme-btn:hover { border-color: var(--border2); }
.theme-btn.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }

/* ── PLANOS ──────────────────────────────────────── */
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.plan-card { border: 1.5px solid var(--border); border-radius: 12px; padding: 16px 18px; background: var(--surface); position: relative; }
.plan-card.pop { border-color: var(--primary); }
.plan-pop { position: absolute; top: 14px; right: 14px; font-size: 9.5px; font-weight: 800; color: var(--primary); letter-spacing: .5px; }
.plan-nome { font-size: 15px; font-weight: 800; margin-bottom: 6px; }
.plan-preco { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.plan-preco small { font-size: 12px; font-weight: 600; color: var(--muted); }
.plan-unid { font-size: 11.5px; color: var(--muted); margin: 2px 0 10px; }
.plan-feats { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.plan-feats li { font-size: 12px; color: var(--text2); line-height: 1.4; display: flex; gap: 6px; }
.plan-feats li::before { content: '✓'; color: var(--success); font-weight: 800; flex-shrink: 0; }
.plan-mais { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
@media (max-width: 780px) { .plan-grid { grid-template-columns: 1fr; } }

/* ── CARDS DE TOM DE VOZ ─────────────────────────── */
.tom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tom-card { border: 1.5px solid var(--border); border-radius: 10px; padding: 13px 15px; cursor: pointer; transition: all 0.15s; background: var(--surface); }
.tom-card:hover { border-color: var(--border2); }
.tom-card.on { border-color: var(--primary); background: var(--primary-light); }
.tom-nome { font-size: 13.5px; font-weight: 700; color: var(--text); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tom-desc { font-size: 12px; color: var(--muted); line-height: 1.45; margin: 4px 0 8px; }
.tom-ex { font-size: 12px; color: var(--text2); font-style: italic; line-height: 1.45; border-left: 2px solid var(--border2); padding-left: 9px; }
@media (max-width: 780px) { .tom-grid { grid-template-columns: 1fr; } }

/* ── GUIA (accordion) ────────────────────────────── */
.acc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-sm); overflow: hidden; }
.acc details { border-bottom: 1px solid var(--border); }
.acc details:last-child { border-bottom: none; }
.acc summary { padding: 14px 18px; font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: '⌄'; margin-left: auto; color: var(--muted); font-size: 16px; transition: transform 0.2s; }
.acc details[open] summary::after { transform: rotate(180deg); }
.acc .acc-body { padding: 0 18px 16px 46px; font-size: 13.5px; color: var(--text2); line-height: 1.6; }

/* ── AGENTES IA ──────────────────────────────────── */
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.agent-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.agent-card.off { opacity: 0.55; }
.agent-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.agent-name { font-size: 14px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.agent-stars { color: var(--star, #f5b400); font-size: 12px; letter-spacing: 1px; }
.agent-missao { font-size: 13px; color: var(--text2); line-height: 1.5; margin-bottom: 10px; }
.agent-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--text2); padding: 9px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.agent-meta b { color: var(--text); }
.agent-meta b.ok { color: var(--success); }
.agent-meta b.muted { color: var(--muted); }
.agent-idioma { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface2); border-radius: var(--rs); padding: 8px 11px; font-size: 12.5px; color: var(--text2); }
.switch.sm { width: 34px; height: 19px; }
.switch.sm .slider::before { height: 13px; width: 13px; }
.switch.sm input:checked + .slider::before { transform: translateX(15px); }
/* card escuro do contexto da marca */
.brand-card { background: linear-gradient(135deg, #10151f, #1a2436); color: #fff; border-radius: var(--r); padding: 20px 22px; margin-bottom: 16px; display: flex; align-items: center; gap: 18px; box-shadow: var(--shadow); flex-wrap: wrap; }
.agent-stars-row { font-size: 14px; letter-spacing: 1px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.agent-star-num { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: 0; text-transform: uppercase; }
.agent-tom { font-size: 12px; color: var(--muted); }
/* toggle switch */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; inset: 0; background: var(--border2); border-radius: 22px; transition: 0.2s; }
.switch .slider::before { content: ''; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: 0.2s; }
.switch input:checked + .slider { background: var(--success); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* ── CHIPS (insights) ────────────────────────────── */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 20px; background: var(--surface2); color: var(--text2); border: 1px solid var(--border); }
.chip.good { background: var(--success-light); color: #059669; border-color: transparent; }
.chip.bad { background: var(--danger-light); color: var(--danger); border-color: transparent; }
.chip.neutral { background: var(--primary-light); color: var(--primary); border-color: transparent; }

/* ── TABS ────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab-btn { padding: 8px 13px; font-size: 12.5px; font-weight: 500; color: var(--muted); cursor: pointer; border: none; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all 0.15s; font-family: 'Inter', system-ui, sans-serif; }
.tab-btn:hover { color: var(--text2); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ── MODALS ──────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,20,40,0.4); backdrop-filter: blur(3px); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 24px; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; position: relative; box-shadow: var(--shadow-md); }
.modal-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.modal-sub { font-size: 12px; color: var(--muted); margin-bottom: 18px; }
.modal-close { position: absolute; top: 14px; right: 14px; background: var(--surface2); border: 1px solid var(--border); color: var(--muted); cursor: pointer; font-size: 13px; padding: 5px 7px; border-radius: var(--rs); transition: all 0.15s; }
.modal-close:hover { color: var(--text); }
.modal-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.modal-field label { font-size: 12px; font-weight: 600; color: var(--text2); }
.modal-field input, .modal-field textarea, .modal-field select { background: var(--surface); border: 1.5px solid var(--border); color: var(--text); padding: 9px 12px; border-radius: var(--rs); font-family: 'Inter', system-ui, sans-serif; font-size: 13px; outline: none; transition: border-color 0.15s, box-shadow 0.15s; width: 100%; }
.modal-field input:focus, .modal-field textarea:focus, .modal-field select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(67,97,238,0.1); }
.modal-field textarea { resize: vertical; min-height: 60px; line-height: 1.5; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bulk-row { display: flex; gap: 10px; padding: 12px 2px; border-top: 1px solid var(--border); cursor: pointer; }
.bulk-row:first-child { border-top: none; }
.bulk-row input[type=checkbox] { margin-top: 2px; width: 16px; height: 16px; flex: none; cursor: pointer; accent-color: var(--primary); }
.bulk-row .bulk-main { flex: 1; min-width: 0; }
.bulk-row .bulk-head { font-size: 12.5px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.bulk-row .bulk-review { font-size: 12px; color: var(--muted); font-style: italic; margin-bottom: 6px; }
.bulk-row .bulk-resp { font-size: 12.5px; line-height: 1.5; color: var(--text2); background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; white-space: pre-wrap; }
.bulk-row.off { opacity: .4; }
.bulk-empty { padding: 18px 2px; color: var(--muted); font-size: 13px; }
.bp-case { border-left: 3px solid var(--primary); background: var(--surface2); border-radius: 0 8px 8px 0; padding: 10px 12px; margin: 10px 0; font-size: 12.8px; line-height: 1.6; color: var(--text2); }
.bp-case:first-child { margin-top: 0; }
.bp-case-t { font-weight: 700; color: var(--text); margin-bottom: 3px; }
#page-boaspraticas .acc .acc-body { padding-left: 18px; }

/* ── TOAST ───────────────────────────────────────── */
.toast { position: fixed; bottom: 20px; right: 20px; z-index: 9999; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 10px 15px; font-size: 13px; font-weight: 500; color: var(--text); display: flex; align-items: center; gap: 7px; opacity: 0; transform: translateY(8px); transition: all 0.25s; max-width: 320px; box-shadow: var(--shadow-md); }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--primary); }

.spinner { width: 13px; height: 13px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; flex-shrink: 0; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 1024px) {
  .kpi-grid, .kpi-grid.g3 { grid-template-columns: 1fr 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
}
.mobile-menu-btn { display: none; margin-right: 6px; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(15,20,40,0.4); z-index: 99; }
.sidebar-overlay.open { display: block; }
@media (max-width: 768px) {
  .mobile-menu-btn { display: flex; }
  .sidebar { transform: translateX(-100%); transition: transform 0.2s; z-index: 101; }
  .sidebar.open { transform: translateX(0); }
  .content { margin-left: 0; }
  .kpi-grid, .kpi-grid.g3 { grid-template-columns: 1fr 1fr; }
  .page { padding: 16px 14px; }
  .pills-bar { padding: 12px 14px 0; }
  .row2 { grid-template-columns: 1fr; }
}

/* ── BARRA INFERIOR (bottom tabs, mobile) ─────────── */
.bottom-tabs { display: none; }
@media (max-width: 768px) {
  .bottom-tabs {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 100;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .content { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
}
.bottom-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 56px;
  background: none;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
}
.bottom-tab.active { color: var(--primary); }
.bottom-tab-icon { font-size: 20px; filter: grayscale(1); opacity: 0.7; }
.bottom-tab.active .bottom-tab-icon { filter: none; opacity: 1; }
.bottom-tab-badge {
  position: absolute;
  top: 2px; right: calc(50% - 22px);
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  min-width: 15px;
  text-align: center;
}

/* Em mobile, Inbox/Painel/Avaliações já estão na barra inferior — some da gaveta
   "Mais" pra não duplicar o mesmo destino em dois lugares (spec Fase 2, seção 2).
   Agente SEO, Geo Grid, Sazonal e Agentes IA somem do mobile por decisão do usuário
   (16/09/2026) — continuam normais no desktop, é só uma questão de visibilidade
   condicional (spec Fase 2, seção 5), nenhuma função foi removida do produto. */
@media (max-width: 768px) {
  #nav-inbox, #nav-painel, #nav-avaliacoes,
  #nav-seo, #nav-geogrid, #nav-sazonal, #nav-agentes { display: none; }
}

.col-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.col-picker-btn {
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--text2);
  border-radius: var(--rs);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  min-height: 32px;
}
.col-picker-btn.active { border-color: var(--col-cor); color: var(--col-cor); background: color-mix(in srgb, var(--col-cor) 12%, var(--surface)); }

.av-col-switch { display: none; }
@media (max-width: 768px) {
  .av-col-switch { display: flex; gap: 6px; margin-bottom: 14px; overflow-x: auto; }
  .av-col-switch-btn {
    flex: 1;
    min-height: 40px;
    white-space: nowrap;
    border: 1px solid var(--border2);
    background: var(--surface);
    color: var(--text2);
    border-radius: var(--rs);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
  }
  .av-col-switch-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
  .av-board { grid-template-columns: 1fr; }
  .av-board > .av-col { display: none; }
  .av-board > .av-col.mobile-visivel { display: block; }
}
