/* Telas de captação, automação e IA (Leads, Webhooks, Facebook, Meta Ads, Roteadores, Follow-ups, Tráfego) */
.nav-section-label { font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase; color: rgba(255,255,255,0.4); padding: 14px 20px 6px; font-weight: 600; }

.g-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.g-head p { margin: 0; color: var(--text-secondary); font-size: 14px; max-width: 720px; line-height: 1.5; }
.g-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.g-tabs { display: inline-flex; gap: 4px; background: #F1F1EF; padding: 4px; border-radius: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.g-tab { border: none; background: transparent; padding: 7px 14px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--text-secondary); cursor: pointer; }
.g-tab.active { background: #fff; color: var(--dark); box-shadow: var(--shadow-sm); }

.g-box { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px; }
.g-box h3 { margin: 0 0 6px; font-size: 16px; }
.g-box .g-sub { color: var(--text-secondary); font-size: 13px; margin: 0 0 14px; line-height: 1.5; }
.g-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.g-row { display: flex; gap: 12px; flex-wrap: wrap; }
.g-row > .form-group { flex: 1; min-width: 160px; }
.g-empty { text-align: center; padding: 48px 20px; color: var(--text-secondary); }
.g-empty i { color: #999; margin-bottom: 10px; }
.g-empty h3 { color: var(--dark); margin: 8px 0 6px; font-size: 17px; }
.g-empty p { max-width: 460px; margin: 0 auto 18px; font-size: 14px; line-height: 1.5; }
.g-muted { color: var(--text-secondary); font-size: 12px; }
.g-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: #F6F6F4; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; word-break: break-all; white-space: pre-wrap; max-height: 260px; overflow: auto; }
.g-copy { display: flex; gap: 8px; align-items: stretch; }
.g-copy .g-code { flex: 1; margin: 0; }
.g-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #bbb; margin-right: 6px; vertical-align: middle; }
.g-dot.on { background: var(--success); }
.g-dot.off { background: var(--danger); }
.g-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 600; background: #F1F1EF; color: #555; }
.g-pill.yellow { background: var(--primary); color: var(--dark); }
.g-pill.green { background: #E9F7EF; color: #1E8A4C; }
.g-pill.red { background: #FDEEEE; color: #C9353A; }
.g-pill.blue { background: var(--dark); color: var(--primary); }

/* Kanban de leads */
.g-kanban { display: grid; grid-template-columns: repeat(6, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 10px; }
.g-col { background: #F6F6F4; border-radius: 12px; padding: 10px; min-height: 200px; }
.g-col.drop { outline: 2px dashed var(--dark); }
.g-col-head { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; padding: 4px 4px 10px; color: #444; }
.g-lead { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; transition: box-shadow .15s; }
.g-lead:hover { box-shadow: var(--shadow-md); }
.g-lead strong { display: block; font-size: 14px; margin-bottom: 2px; }
.g-lead .g-muted { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* Conversa */
.g-chat { background: #F6F6F4; border-radius: 10px; padding: 12px; max-height: 360px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.g-msg { max-width: 80%; padding: 7px 10px; border-radius: 8px; font-size: 13px; line-height: 1.4; white-space: pre-wrap; word-wrap: break-word; }
.g-msg.in { background: #fff; align-self: flex-start; }
.g-msg.out { background: #FFF8DB; align-self: flex-end; }
.g-msg small { display: block; font-size: 10px; color: #777; margin-top: 3px; }

/* Lista de atividade */
.g-log { list-style: none; margin: 0; padding: 0; }
.g-log li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #F0F0F0; font-size: 13px; }
.g-log li:last-child { border-bottom: none; }
.g-log details summary { cursor: pointer; color: var(--text-secondary); font-size: 12px; margin-top: 4px; }

/* Editor de etapas / ações */
.g-step { border: 1px solid var(--border); border-radius: 12px; padding: 14px 44px 14px 14px; margin-bottom: 10px; background: #FCFCFB; position: relative; }
.g-step-n { position: absolute; top: -10px; left: 12px; background: var(--dark); color: var(--primary); font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px; }
.g-step .g-step-del { position: absolute; top: 8px; right: 8px; }
.g-timeline { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--text-secondary); margin: 6px 0 0; }

/* Métricas */
.g-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: 12px; margin-bottom: 16px; }
.g-kpi { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px; min-width: 0; overflow: hidden; }
.g-kpi span { font-size: 12px; color: var(--text-secondary); }
.g-kpi strong { display: block; font-size: clamp(17px, 1.45vw, 22px); margin-top: 4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; line-height: 1.25; }
.g-kpi span { display: block; overflow-wrap: anywhere; }
.g-box, .g-action > div { min-width: 0; overflow-wrap: anywhere; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Relatório do tráfego */
.g-report { white-space: pre-wrap; font-size: 14px; line-height: 1.6; }
.g-action { display: flex; justify-content: space-between; gap: 12px; align-items: center; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }

/* Modal genérico */
.g-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 16px; }
.g-modal { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-height: 92vh; display: flex; flex-direction: column; }
.g-modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.g-modal-head h3 { margin: 0; font-size: 17px; }
.g-modal-body { padding: 18px 20px; overflow-y: auto; }
.g-modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

.g-switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; user-select: none; }
.g-switch input { width: 36px; height: 20px; appearance: none; background: #ccc; border-radius: 99px; position: relative; cursor: pointer; transition: background .2s; margin: 0; flex-shrink: 0; }
.g-switch input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: left .2s; }
.g-switch input:checked { background: var(--success); }
.g-switch input:checked::after { left: 18px; }

@media (max-width: 760px) {
  .g-kanban { grid-template-columns: repeat(6, 78vw); }
}

/* Conversas ao vivo (Roteadores) */
.g-chatwrap { display: grid; grid-template-columns: 320px 1fr; height: calc(100vh - 260px); min-height: 480px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.g-chatlist { border-right: 1px solid var(--border); overflow-y: auto; }
.g-chatitem { padding: 10px 12px; border-bottom: 1px solid #F0F0F0; cursor: pointer; font-size: 13px; }
.g-chatitem:hover { background: #FAFAF8; }
.g-chatitem.active { background: #FFF8D6; }
.g-chatprev { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.g-chatpane { display: flex; flex-direction: column; min-width: 0; }
.g-chathead { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.g-chatmsgs { flex: 1; max-height: none; border-radius: 0; }
.g-chatinput { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.g-chatinput textarea { resize: none; }
@media (max-width: 760px) {
  .g-chatwrap { grid-template-columns: 1fr; height: auto; }
  .g-chatlist { max-height: 260px; border-right: none; border-bottom: 1px solid var(--border); }
  .g-chatmsgs { min-height: 360px; }
}

/* Cartão de lead: editar e excluir */
.g-lead-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.g-lead-tools { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; flex-shrink: 0; }
.g-lead:hover .g-lead-tools, .g-lead:focus-within .g-lead-tools { opacity: 1; }
.g-ico { border: none; background: transparent; padding: 3px; border-radius: 6px; cursor: pointer; color: #888; line-height: 0; }
.g-ico:hover { background: #F1F1EF; color: var(--dark); }
.g-ico.danger:hover { background: #FDEEEE; color: #C9353A; }
.g-lead-input { padding: 4px 8px; font-size: 14px; height: auto; margin-bottom: 2px; }
@media (hover: none) { .g-lead-tools { opacity: 1; } }

/* Dashboard com gráficos */
html body .dash-kpi-row { grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); }
html body .dash-kpi-val { font-size: clamp(16px, 1.3vw, 24px); white-space: nowrap; overflow: visible; text-overflow: clip; line-height: 1.2; }
.dash-chart-head { display: block !important; }
.dash-chart-head h4 { font-size: 16px; }
