:root {
  --bg: #080E0B;
  --panel: #0D1510;
  --panel-2: #121D17;
  --accent: #1FD4A0;
  --accent-dim: rgba(31,212,160,0.12);
  --accent-border: rgba(31,212,160,0.22);
  --accent-2: #D4A800;
  --accent-2-dim: rgba(212,168,0,0.13);
  --accent-2-border: rgba(212,168,0,0.28);
  --accent-3: #F0B429;
  --accent-3-dim: rgba(240,180,41,0.12);
  --ink: #E6EEE8;
  --ink-2: #B8CCBF;
  --muted: #6B8077;
  --line: #192219;
  --line-2: #1F2C22;
  --shadow: 0 0 0 1px rgba(255,255,255,0.03) inset, 0 8px 32px rgba(0,0,0,0.5);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --font-d: 'Syne', sans-serif;
  --font-b: 'Figtree', ui-sans-serif, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 15% 0%, rgba(31,212,160,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 85% 100%, rgba(255,196,9,0.05) 0%, transparent 55%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-b);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; }
[hidden] { display: none !important; }

/* ── LOADING SCREEN ── */
#loadingScreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 15% 0%, rgba(31,212,160,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 85% 100%, rgba(255,196,9,0.05) 0%, transparent 55%);
}
.loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}
.loading-logo-wrap {
  position: relative;
  width: 140px;
  height: 140px;
}
.loading-logo-base {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.15;
}
.loading-logo-fill {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  clip-path: inset(100% 0 0 0);
  animation: logo-fill 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes logo-fill {
  0%   { clip-path: inset(100% 0 0 0); }
  55%  { clip-path: inset(0% 0 0 0); }
  75%  { clip-path: inset(0% 0 0 0); }
  90%  { clip-path: inset(0% 0 0 0); opacity: 1; }
  100% { clip-path: inset(0% 0 0 0); opacity: 0; }
}
.loading-text {
  font-family: var(--font-d);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.loading-dots span {
  display: inline-block;
  animation: dot-blink 1.4s infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-blink {
  0%, 80%, 100% { opacity: 0; }
  40%            { opacity: 1; }
}

/* ── LOGIN ── */
#login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-wrap {
  width: min(380px, 100%);
  background: rgba(13, 21, 16, 0.78);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(31,212,160,0.16);
  border-radius: var(--radius);
  padding: 40px 36px 36px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.03) inset, 0 32px 80px rgba(0,0,0,0.65);
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Header da logo centralizado */
.login-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 28px;
}
.login-logo {
  height: 80px;
  width: auto;
  display: block;
  margin-bottom: 16px;
}
.login-brand {
  font-family: var(--font-d);
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1;
  margin-bottom: 6px;
}
.login-sub {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Divisor */
.login-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(31,212,160,0.2), transparent);
  margin-bottom: 28px;
}

/* Formulário */
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-field-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: -6px;
}
.login-input {
  background: rgba(18, 29, 23, 0.9);
  border-color: var(--line-2);
  font-size: 1rem;
  letter-spacing: 0.1em;
  min-height: 48px;
  padding: 0 16px;
}
.login-input:focus { border-color: var(--accent-border); outline: 2px solid var(--accent-border); }

/* Botão — padrão interno do painel (acento verde, sem branco) */
.login-btn {
  width: 100%;
  justify-content: center;
  min-height: 46px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  border-color: var(--accent-border);
  color: var(--accent);
  background: var(--accent-dim);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.login-btn:hover {
  background: rgba(31,212,160,0.2);
  border-color: var(--accent);
  color: var(--ink);
}

.login-error { font-size: 0.82rem; color: var(--accent-2); min-height: 1.2em; margin-top: -4px; }

/* ── SHELL ── */
.shell {
  width: min(1220px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 32px 0 64px;
}

/* ── TOPBAR ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 24px;
  margin-bottom: 28px;
  background: rgba(13, 21, 16, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(31,212,160,0.12);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(255,255,255,0.03) inset, 0 4px 24px rgba(0,0,0,0.35);
}
.brand { display: flex; flex-direction: row; align-items: center; gap: 12px; }
.brand-text { display: flex; flex-direction: column; }
.brand-logo { height: 40px; width: auto; display: block; flex-shrink: 0; }
.brand-name {
  font-family: var(--font-d);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--ink);
  line-height: 1;
}
.brand-sub { font-size: 0.72rem; color: var(--muted); font-weight: 500; margin-top: 3px; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.client-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--ink-2);
}
/* Ponto decorativo do chip removido: a única luz de status passa a ser a luz de
   conexão do WhatsApp (#waDot), para não confundir verde decorativo com status real. */
.client-chip::before {
  display: none;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.updated-text { font-size: 0.78rem; color: var(--muted); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-xs);
  background: var(--panel-2);
  color: var(--ink-2);
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn:hover { border-color: var(--muted); color: var(--ink); }
.btn-primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-primary:hover { opacity: 0.9; }

/* ── VIEW TABS ── */
.view-tabs {
  display: inline-flex;
  gap: 4px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 24px;
}
.tab {
  min-height: 34px;
  padding: 0 18px;
  border-radius: var(--radius-xs);
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.tab.active { background: var(--panel-2); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,0.3); }
.tab:hover:not(.active) { color: var(--ink-2); }

/* ── FILTER BAR ── */
.filter-bar {
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.filter-label {
  font-size: 0.77rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}
.filter-sep { width: 1px; height: 20px; background: var(--line-2); flex-shrink: 0; }
.date-input {
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-xs);
  color: var(--ink);
  padding: 6px 12px;
  font-size: 0.83rem;
  min-height: 34px;
  min-width: 0;
  color-scheme: dark;
}
.date-input:focus { outline: 2px solid var(--accent-border); }
.period-pill {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.period-pill:hover, .period-pill.active {
  border-color: var(--accent-border);
  color: var(--accent);
  background: var(--accent-dim);
}

/* ── KPI HERO GRID ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
.kpi-card {
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
}
.kpi-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 130%, var(--glow-color, var(--accent-dim)) 0%, transparent 65%);
  pointer-events: none;
}
.kpi-card.c1 { --glow-color: var(--accent-dim); }
.kpi-card.c2 { --glow-color: var(--accent-2-dim); }
.kpi-card.c3 { --glow-color: rgba(184,204,191,0.06); }
.kpi-label {
  font-size: 0.77rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}
.kpi-value {
  font-family: var(--font-d);
  font-size: clamp(2.6rem, 5vw, 3.8rem);
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.kpi-sub { font-size: 0.78rem; color: var(--muted); margin-bottom: 10px; }
.kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}
.kpi-delta.up { background: var(--accent-dim); color: var(--accent); }
.kpi-delta.down { background: var(--accent-2-dim); color: var(--accent-2); }
.kpi-delta.flat { background: var(--line-2); color: var(--muted); }
.kpi-delta-period { font-size: 0.72rem; color: var(--muted); margin-top: 4px; display: block; }
.kpi-accent { color: var(--accent); }
.kpi-accent-2 { color: var(--accent-2); }

/* ── CHART PANEL ── */
.chart-panel {
  background: var(--panel);
  border: 1px solid rgba(31,212,160,0.09);
  border-radius: var(--radius);
  padding: 24px 26px 20px;
  margin-bottom: 12px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.25);
}
.panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.panel-title { font-family: var(--font-d); font-size: 0.95rem; font-weight: 700; color: var(--ink); }
.panel-sub { font-size: 0.78rem; color: var(--muted); }
.chart-legend { display: flex; align-items: center; gap: 16px; }
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 0.8rem; color: var(--ink-2); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: block; flex-shrink: 0; }
.legend-dot.customer { background: #1FD4A0; }
.legend-dot.system { background: #D4A800; }
canvas { width: 100%; display: block; }

/* ── OP CARDS ── */
.op-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
.op-card {
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.op-label { font-size: 0.77rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 8px; }
.op-value { font-family: var(--font-d); font-size: clamp(1.8rem, 3.5vw, 2.6rem); font-weight: 700; color: var(--ink); line-height: 1; margin-bottom: 6px; }
.op-meta { font-size: 0.8rem; color: var(--accent); font-weight: 600; }
.op-card.danger .op-value, .op-card.danger .op-meta { color: var(--accent-2); }

/* ── SUMMARY CALLOUT ── */
.summary-callout {
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 12px;
}
.summary-callout .panel-header { margin-bottom: 10px; }
.summary-body { font-size: 0.97rem; line-height: 1.65; color: var(--ink-2); max-width: 900px; }
.auto-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── CHART TOOLTIP ── */
.chart-tooltip {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  min-width: 160px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.tooltip-date { font-family: var(--font-d); font-weight: 700; font-size: 0.8rem; color: var(--ink-2); margin-bottom: 8px; padding-bottom: 7px; border-bottom: 1px solid var(--line-2); }
.tooltip-row { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; padding: 2px 0; }
.tooltip-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.tooltip-label { color: var(--muted); flex: 1; }
.tooltip-value { font-family: var(--font-d); font-weight: 700; color: var(--ink); }
.tooltip-total { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line-2); }
.tooltip-total .tooltip-label { color: var(--ink-2); font-weight: 600; }

/* ── INSIGHT GRID (2-col) ── */
.insight-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.insight-panel { background: var(--panel); border: 1px solid rgba(31,212,160,0.09); border-radius: var(--radius); padding: 20px 22px; box-shadow: 0 2px 16px rgba(0,0,0,0.25); }
.insight-panel .panel-header { margin-bottom: 14px; }

/* ── CATEGORY ROWS ── */
.cat-list { display: grid; gap: 10px; }
.cat-row { width: 100%; text-align: left; background: transparent; border: none; color: var(--ink); cursor: pointer; padding: 10px 12px; border-radius: var(--radius-xs); transition: background 0.12s; }
.cat-row:hover { background: var(--panel-2); }
.cat-row-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 7px; }
.cat-name { font-weight: 600; font-size: 0.88rem; }
.cat-count { font-family: var(--font-d); font-weight: 700; font-size: 0.88rem; color: var(--muted); flex-shrink: 0; }
.meter { height: 4px; background: var(--line-2); border-radius: 999px; overflow: hidden; margin-bottom: 6px; }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.cat-example { font-size: 0.77rem; color: var(--muted); font-style: italic; }

/* ── HOUR ROWS ── */
.hour-list { display: grid; gap: 8px; }
.hour-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--panel-2);
  border: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  color: var(--ink);
  text-align: left;
  transition: background 0.12s;
}
.hour-row:hover { background: var(--line-2); }
.hour-time { font-family: var(--font-d); font-weight: 700; font-size: 0.88rem; }
.hour-bar-wrap { flex: 1; height: 4px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.hour-bar { height: 100%; background: var(--accent-3); border-radius: inherit; }
.hour-count { font-size: 0.8rem; color: var(--muted); font-weight: 600; white-space: nowrap; }

/* ── HOUR CHANNEL FILTER ── */
.hour-channel-filter { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.hcf-btn { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-family: var(--font-b); font-size: 0.78rem; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.hcf-btn:hover { border-color: var(--accent); color: var(--ink); }
.hcf-btn.active { background: var(--accent-dim); border-color: var(--accent-border); color: var(--accent); }

/* modal feed mode */
.modal-messages .feed { padding: 0; }
.hour-feed-item:hover { border-color: var(--accent-border); }
.hour-feed-item .feed-action-hint { color: var(--accent); }

/* ── FEED (leads / weak) ── */
.feed { display: grid; gap: 10px; }
.feed-item {
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-xs);
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.feed-item:hover { border-color: var(--muted); }
.feed-item.warn {
  border-left: 3px solid var(--accent-2);
  background: color-mix(in srgb, var(--accent-2-dim) 60%, var(--panel-2));
}
.feed-item.warn:hover { border-color: var(--accent-2); }
.feed-action-hint { font-size: 0.74rem; color: var(--accent); font-weight: 600; margin-top: 8px; opacity: 0.75; }
.feed-item:hover .feed-action-hint { opacity: 1; }
.feed-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.feed-name { font-weight: 700; font-size: 0.88rem; }
.feed-time { font-size: 0.76rem; color: var(--muted); white-space: nowrap; }
.feed-text { font-size: 0.87rem; color: var(--ink-2); margin-bottom: 8px; line-height: 1.45; }
.feed-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}
.tag.warn { background: var(--accent-2-dim); color: var(--accent-2); border-color: var(--accent-2-border); }
.feed-mini-label { font-size: 0.72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }

/* ── SINGLE PANEL ── */
.single-panel { background: var(--panel); border: 1px solid rgba(31,212,160,0.09); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 12px; box-shadow: 0 2px 16px rgba(0,0,0,0.25); }
.single-panel .panel-header { margin-bottom: 14px; }

/* ── QUALITY GRID ── */
.quality-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quality-card {
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-xs);
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.quality-card:hover { border-color: var(--muted); }
.quality-card.active { border-color: var(--accent-border); background: var(--accent-dim); }
.quality-card.active .quality-label { color: var(--accent); }
.quality-label { font-size: 0.77rem; font-weight: 600; color: var(--muted); margin-bottom: 8px; transition: color 0.15s; }
.quality-value { font-family: var(--font-d); font-size: 1.9rem; font-weight: 700; color: var(--ink); line-height: 1; }

/* ── PLATFORM GRID ── */
.platform-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.platform-card {
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-xs);
  padding: 18px 16px;
  display: grid;
  align-content: space-between;
  min-height: 108px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.platform-card:hover { border-color: var(--muted); }
.platform-card.active { border-color: var(--accent-border); background: color-mix(in srgb, var(--accent-dim) 50%, var(--panel-2)); }
.platform-card.whatsapp.active { border-color: rgba(37,211,102,0.4); }
.platform-card.instagram.active { border-color: rgba(225,48,108,0.4); }
.platform-hint { font-size: 0.72rem; color: var(--muted); margin-top: 6px; font-style: italic; }
.platform-pct { font-family: var(--font-d); font-size: 2.2rem; font-weight: 700; line-height: 1; }
.platform-name { font-size: 0.85rem; font-weight: 600; color: var(--ink-2); }
.platform-count { font-size: 0.78rem; color: var(--muted); }
.platform-card.whatsapp .platform-pct { color: #25D366; }
.platform-card.instagram .platform-pct { color: #E1306C; }

/* ── MEDIA TYPES ── */
.media-grid { display: flex; flex-direction: column; gap: 8px; }
.media-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 10px 14px;
}
.media-icon { font-size: 1.4rem; flex-shrink: 0; width: 28px; text-align: center; }
.media-info { flex: 1; min-width: 0; }
.media-label { font-size: 0.85rem; font-weight: 600; color: var(--ink-2); }
.media-count { font-size: 0.75rem; color: var(--muted); }
.media-pct { font-family: var(--font-d); font-size: 1.5rem; font-weight: 700; color: var(--accent); flex-shrink: 0; }

/* ── CONTACT ORIGIN ── */
.origin-list { display: flex; flex-direction: column; gap: 10px; }
.origin-row { display: flex; align-items: flex-start; gap: 10px; }
.origin-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.origin-body { flex: 1; min-width: 0; }
.origin-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.origin-label { font-size: 0.85rem; font-weight: 500; color: var(--ink-2); }
.origin-count { font-size: 0.78rem; color: var(--muted); }
.origin-bar-wrap { height: 5px; background: var(--panel-2); border-radius: 999px; overflow: hidden; }
.origin-bar { height: 100%; background: var(--accent); border-radius: 999px; min-width: 2px; transition: width 0.4s; }

.conv-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color 0.15s;
}
.conv-filter-tag:hover { border-color: var(--muted); }
.conv-filter-tag .x { color: var(--muted); font-size: 0.9em; }

/* ── CONVERSATIONS FEED ── */
.conv-list { display: grid; gap: 0; }
.conv-row {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-top: 1px solid var(--line);
  color: var(--ink);
  padding: 16px 4px;
  cursor: pointer;
  display: grid;
  gap: 6px;
  transition: background 0.1s;
}
.conv-row:first-child { border-top: none; }
.conv-row:hover { background: color-mix(in srgb, var(--panel-2) 60%, transparent); border-radius: var(--radius-xs); }
.conv-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.conv-name { font-weight: 700; font-size: 0.92rem; }
.conv-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.channel-badge { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 800; color: #fff; }
.channel-badge.whatsapp { background: #128C4A; }
.channel-badge.instagram { background: #a11b6f; }
.channel-badge.other { background: var(--muted); }
.conv-time { font-size: 0.78rem; color: var(--muted); }
.conv-preview { font-size: 0.86rem; color: var(--muted); line-height: 1.4; max-width: 72ch; }
.conv-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 0.74rem; font-weight: 700; }
.badge-cat { background: var(--accent-dim); color: var(--accent); border: 1px solid var(--accent-border); }
.badge-wait { background: var(--accent-3-dim); color: var(--accent-3); border: 1px solid rgba(240,180,41,0.2); }
.badge-done { background: var(--line-2); color: var(--muted); }
.badge-neutral { background: var(--line-2); color: var(--muted); }
.conv-list-footer { padding: 14px 4px 0; display: flex; align-items: center; gap: 12px; }
.conv-more-btn {
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-xs);
  color: var(--ink-2);
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 34px;
  padding: 0 16px;
  transition: border-color 0.15s, color 0.15s;
}
.conv-more-btn:hover { border-color: var(--muted); color: var(--ink); }
.conv-load-more-btn { display: block; width: 100%; margin-top: 12px; background: transparent; border: 1px solid var(--line-2); border-radius: var(--radius-xs); color: var(--ink-2); font-size: 0.83rem; font-weight: 600; cursor: pointer; min-height: 36px; padding: 0 16px; transition: border-color 0.15s, color 0.15s; }
.conv-load-more-btn:hover { border-color: var(--muted); color: var(--ink); }
.conv-showing-text { font-size: 0.78rem; color: var(--muted); }
.conv-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.active-filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal-box {
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  width: min(940px, 100%);
  max-height: min(860px, calc(100vh - 40px));
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 18px;
  border-bottom: 1px solid var(--line-2);
  flex-shrink: 0;
}
.modal-head h2 { font-family: var(--font-d); font-size: 1rem; font-weight: 700; margin-bottom: 3px; }
.modal-meta { font-size: 0.8rem; color: var(--muted); }
.modal-messages { flex: 1 1 auto; min-height: 180px; overflow-y: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 72%; border-radius: 12px; padding: 10px 14px; }
.msg.received { background: var(--panel-2); border: 1px solid var(--line-2); align-self: flex-start; }
.msg.sent { background: var(--accent-dim); border: 1px solid var(--accent-border); align-self: flex-end; }
.msg-label { font-size: 0.74rem; font-weight: 700; color: var(--muted); margin-bottom: 5px; }
.msg.sent .msg-label { color: var(--accent); }
.msg-text { font-size: 0.88rem; color: var(--ink); line-height: 1.5; white-space: pre-wrap; }
.msg-time { font-size: 0.72rem; color: var(--muted); margin-top: 5px; text-align: right; }
.msg.cat-msg { cursor: pointer; max-width: 100%; transition: border-color 0.15s; }
.msg.cat-msg:hover { border-color: var(--muted); }
.msg.cat-msg .feed-action-hint { margin-top: 6px; }

/* ── COMPOSER (enviar mensagem) ── */
.modal-composer { border-top: 1px solid var(--line-2); padding: 14px 22px; background: var(--panel); }
.composer-row { display: flex; gap: 10px; align-items: flex-end; }
.composer-input {
  flex: 1;
  min-height: 42px;
  max-height: 140px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-xs);
  background: var(--panel-2);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.4;
}
.composer-input:focus { outline: 2px solid var(--accent-border); }
.composer-send { min-height: 42px; white-space: nowrap; }
.composer-send:disabled { opacity: 0.5; cursor: default; }
.composer-foot { display: flex; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.composer-resume {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-xs);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.composer-resume:hover { border-color: var(--accent-border); color: var(--accent); }
.composer-resume:disabled { opacity: 0.5; cursor: default; }
.composer-msg { font-size: 0.78rem; color: var(--muted); min-height: 1em; margin: 0; }

/* ── COPILOTO + MEMÓRIA COMERCIAL ── */
.modal-tools {
  border-top: 1px solid var(--line-2);
  padding: 10px 22px;
  display: block;
  background: rgba(255,255,255,0.015);
  flex-shrink: 0;
}
.modal-tools[hidden] { display: none; }
.modal-tool-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}
.tool-toggle {
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-xs);
  background: var(--panel-2);
  color: var(--ink);
  text-align: left;
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: border-color 0.15s, background 0.15s;
}
.tool-toggle:hover,
.tool-toggle.active {
  border-color: var(--accent-border);
  background: var(--accent-dim);
}
.tool-toggle-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--ink);
}
.tool-toggle-sub {
  min-width: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tool-details {
  margin-top: 8px;
  max-height: min(340px, 42vh);
  overflow-y: auto;
}
.tool-details[hidden],
.tool-panel[hidden] { display: none; }
.copilot-panel,
.customer-memory-panel {
  border: 1px solid var(--line-2);
  border-radius: var(--radius-xs);
  background: var(--panel-2);
  padding: 12px;
  min-width: 0;
}
.tool-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.tool-title { font-size: 0.86rem; font-weight: 800; color: var(--ink); }
.tool-sub { margin: 2px 0 0; font-size: 0.76rem; color: var(--muted); line-height: 1.35; }
.tool-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.copilot-result {
  border-top: 1px solid var(--line-2);
  margin-top: 10px;
  padding-top: 10px;
  color: var(--ink-2);
  font-size: 0.84rem;
  line-height: 1.5;
  max-height: 210px;
  overflow-y: auto;
}
.copilot-result strong { color: var(--ink); }
.copilot-result ul { margin: 6px 0; padding-left: 18px; }
.memory-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 10px;
  max-height: 64px;
  overflow: hidden;
}
.memory-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--ink-2);
  background: rgba(255,255,255,0.025);
  font-size: 0.72rem;
  font-weight: 700;
}
.memory-chip-remove {
  width: 0;
  height: 18px;
  min-width: 0;
  border: 0;
  border-radius: 999px;
  padding: 0;
  opacity: 0;
  overflow: hidden;
  cursor: pointer;
  color: var(--ink);
  background: rgba(255,255,255,0.10);
  font: inherit;
  line-height: 18px;
  transition: opacity .15s ease, width .15s ease, min-width .15s ease;
}
.memory-chip:hover .memory-chip-remove,
.memory-chip:focus-within .memory-chip-remove {
  width: 18px;
  min-width: 18px;
  opacity: 1;
}
.memory-chip-remove:hover,
.memory-chip-remove:focus-visible {
  background: rgba(255,92,92,0.22);
  color: #ffd4d4;
  outline: none;
}
@media (hover: none) {
  .memory-chip {
    padding-right: 5px;
  }
  .memory-chip-remove {
    width: 18px;
    min-width: 18px;
    opacity: .82;
  }
}
.memory-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  margin: 8px 0 5px;
}
.memory-notes { width: 100%; min-height: 56px; max-height: 120px; }
.memory-tags-input { min-height: 36px; font-size: 0.82rem; width: 100%; }
.memory-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
@media (max-width: 820px) {
  .modal-overlay { padding: 8px; }
  .modal-box {
    width: 100%;
    max-height: calc(100vh - 16px);
  }
  .modal-head { padding: 16px; }
  .modal-messages {
    min-height: 150px;
    padding: 14px 16px;
  }
  .modal-tools,
  .modal-composer { padding: 10px 16px; }
  .modal-tool-strip { grid-template-columns: 1fr; }
  .tool-details { max-height: min(360px, 46vh); }
  .msg { max-width: 92%; }
  .composer-row { flex-direction: column; align-items: stretch; }
  .composer-send { width: 100%; }
}

/* ── ASSISTENTE IA ── */
.tab-assist { color: var(--accent); }
.tab-assist.active { color: var(--bg); }
.assist-panel {
  background: var(--panel);
  border: 1px solid rgba(31,212,160,0.14);
  border-radius: var(--radius);
  box-shadow: 0 2px 24px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 220px);
  min-height: 460px;
  overflow: hidden;
}
.assist-head { padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.assist-title-row { display: flex; align-items: flex-start; gap: 12px; }
.assist-spark { font-size: 1.4rem; line-height: 1; }
.assist-title { font-family: var(--font-d); font-size: 1.05rem; font-weight: 700; color: var(--ink); }
.assist-sub { font-size: 0.82rem; color: var(--muted); margin-top: 2px; max-width: 640px; }

.assist-chat { flex: 1; overflow-y: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.assist-msg { max-width: 82%; padding: 12px 16px; border-radius: 14px; font-size: 0.9rem; line-height: 1.55; }
.assist-msg.user { align-self: flex-end; background: var(--accent-dim); border: 1px solid var(--accent-border); color: var(--ink); }
.assist-msg.assistant { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--ink-2); }
.assist-msg.assistant strong { color: var(--ink); }
.assist-msg.assistant ul { margin: 6px 0; padding-left: 18px; }
.assist-msg.assistant li { margin: 3px 0; }
.assist-dots span { display: inline-block; animation: dot-blink 1.4s infinite; font-size: 1.2rem; }
.assist-dots span:nth-child(2) { animation-delay: 0.2s; }
.assist-dots span:nth-child(3) { animation-delay: 0.4s; }

.assist-suggestions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 22px 14px; }
.assist-chip {
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 7px 14px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.assist-chip:hover { border-color: var(--accent-border); color: var(--accent); }

.assist-input-row { display: flex; gap: 10px; align-items: flex-end; padding: 14px 22px; border-top: 1px solid var(--line-2); background: var(--panel); }
.assist-input {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  resize: none;
  padding: 11px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-xs);
  background: var(--panel-2);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.4;
}
.assist-input:focus { outline: 2px solid var(--accent-border); }
.assist-send { min-height: 44px; white-space: nowrap; }
.assist-send:disabled { opacity: 0.5; cursor: default; }
@media (max-width: 600px) {
  .assist-panel { height: calc(100vh - 180px); }
  .assist-msg { max-width: 90%; }
}

/* ── DINHEIRO RECUPERADO (#1) ── */
.money-panel {
  background: linear-gradient(135deg, rgba(255,196,9,0.10), rgba(31,212,160,0.06));
  border: 1px solid rgba(255,196,9,0.28);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 12px;
  box-shadow: 0 2px 24px rgba(0,0,0,0.28);
}
.money-hero { margin-bottom: 16px; }
.money-hero-label { font-size: 0.82rem; font-weight: 600; color: var(--accent-3); text-transform: uppercase; letter-spacing: 0.06em; display: flex; align-items: center; gap: 6px; }
.money-info-btn { background: rgba(255,196,9,0.15); border: 1px solid rgba(255,196,9,0.35); color: #FFC409; border-radius: 50%; width: 16px; height: 16px; font-size: 0.65rem; font-weight: 700; cursor: pointer; line-height: 1; padding: 0; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.money-info-btn:hover { background: rgba(255,196,9,0.3); }
.money-info-tooltip { background: #0e1a13; border: 1px solid rgba(255,196,9,0.3); border-radius: 10px; padding: 14px 16px; margin-top: 8px; font-size: 0.78rem; color: var(--muted); line-height: 1.55; }
.money-info-tooltip strong { color: var(--ink); }
.money-editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin: 12px 0; }
.money-editor-row { display: flex; flex-direction: column; gap: 4px; }
.money-editor-row label { font-size: 0.76rem; color: var(--muted); }
.money-editor-row .money-editor-input { display: flex; align-items: center; gap: 6px; }
.money-editor-row .money-editor-input span { color: var(--muted); font-size: 0.82rem; }
.money-editor-row input { width: 100%; }
.money-editor-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
@media (max-width: 640px) { .money-editor-grid { grid-template-columns: 1fr; } }

/* Logs do Assistente IA (admin) */
.logs-head { margin-bottom: 16px; }
.logs-title { font-size: 1.1rem; font-weight: 700; color: var(--ink); margin: 0 0 4px; }
.logs-sub { font-size: 0.82rem; color: var(--muted); margin: 0; }
.logs-msg { font-size: 0.84rem; color: var(--muted); margin-bottom: 12px; }
.logs-list { display: flex; flex-direction: column; gap: 12px; }
.log-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; }
.log-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 0.74rem; color: var(--muted); margin-bottom: 8px; }
.log-meta .log-client { color: var(--accent-3); font-weight: 600; }
.log-q { font-size: 0.9rem; color: var(--ink); font-weight: 600; margin-bottom: 6px; white-space: pre-wrap; }
.log-a { font-size: 0.86rem; color: var(--muted); line-height: 1.5; white-space: pre-wrap; }
.log-a::before { content: "↳ "; color: var(--accent); }
.money-hero-value { font-family: var(--font-d); font-size: clamp(2.4rem, 6vw, 3.6rem); font-weight: 800; line-height: 1.05; color: #FFC409; letter-spacing: -0.02em; }
.money-hero-sub { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }
.money-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.money-card { background: rgba(8,14,11,0.5); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 12px 14px; }
.money-card-value { font-family: var(--font-d); font-size: 1.4rem; font-weight: 700; color: var(--ink); }
.money-card-label { font-size: 0.74rem; color: var(--muted); line-height: 1.3; margin-top: 4px; }

/* ── RADAR DE OPORTUNIDADES (#3) ── */
.radar-legend { display: flex; gap: 6px; flex-wrap: wrap; }
.radar-tag { font-size: 0.68rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em; }
.radar-tag.sensivel { background: rgba(229,72,77,0.16); color: #ff6b6f; }
.radar-tag.risco { background: rgba(255,196,9,0.16); color: #FFC409; }
.radar-tag.quente { background: var(--accent-dim); color: var(--accent); }
.radar-list { display: flex; flex-direction: column; gap: 8px; }
.radar-item { background: var(--panel-2); border: 1px solid var(--line-2); border-left-width: 3px; border-radius: var(--radius-sm); padding: 12px 14px; cursor: pointer; transition: border-color 0.15s; }
.radar-item:hover { border-color: var(--muted); }
.radar-item.sensivel { border-left-color: #e5484d; }
.radar-item.risco { border-left-color: #FFC409; }
.radar-item.quente { border-left-color: var(--accent); }
.radar-item-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.radar-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.radar-dot.sensivel { background: #e5484d; }
.radar-dot.risco { background: #FFC409; }
.radar-dot.quente { background: var(--accent); }
.radar-name { font-weight: 700; color: var(--ink); font-size: 0.9rem; }
.radar-wait { font-size: 0.72rem; color: var(--accent-2); margin-left: auto; }
.radar-motivo { font-size: 0.84rem; color: var(--ink-2); margin-top: 6px; }
.radar-sample { font-size: 0.8rem; color: var(--muted); margin-top: 4px; font-style: italic; }
.radar-more-btn {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  background: transparent;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.radar-more-btn:hover { border-color: var(--accent-border); background: var(--accent-dim); }

/* ── ONDE A IA PRECISA MELHORAR (#8) ── */
.gaps-list { display: flex; flex-direction: column; gap: 8px; }
.gap-item { display: flex; gap: 14px; align-items: center; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 12px 14px; }
.gap-clickable { cursor: pointer; transition: border-color 0.15s; }
.gap-clickable:hover { border-color: var(--muted); }
.gap-count { font-family: var(--font-d); font-size: 1.6rem; font-weight: 700; color: var(--accent-2); min-width: 36px; text-align: center; }
.gap-tema { font-size: 0.88rem; color: var(--ink-2); }
.gap-tema strong { color: var(--ink); }
.gap-exemplo { font-size: 0.78rem; color: var(--muted); margin-top: 3px; font-style: italic; }

/* ── RESERVATION VIEW ── */
.res-kpi-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 12px; }
.res-kpi {
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 18px 16px;
  display: grid;
  align-content: space-between;
  min-height: 110px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.res-kpi:hover { border-color: var(--muted); }
.res-kpi.active { border-color: var(--accent-border); background: var(--accent-dim); }
.res-kpi-label { font-size: 0.77rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; }
.res-kpi.active .res-kpi-label { color: var(--accent); }
.res-kpi-value { font-family: var(--font-d); font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; line-height: 1; color: var(--ink); }
.res-kpi-sub { font-size: 0.76rem; color: var(--muted); }

/* ── FILTRO POR DATA / PERÍODO ── */
.res-range-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
}
.res-range-group { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; }
.res-range-label { font-size: 0.8rem; color: var(--muted); }
.res-range-input { min-height: 34px; padding: 0 10px; width: auto; max-width: 160px; font-size: 0.82rem; }
.res-range-btn { min-height: 34px; padding: 0 12px; font-size: 0.8rem; }
.res-range-apply { border-color: var(--accent-border); color: var(--accent); }
.res-range-apply:hover { border-color: var(--accent); color: var(--accent); }

/* ── FORM ── */
.form-panel { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 20px 22px; }
.form-panel .panel-header { margin-bottom: 16px; }
.res-form { display: grid; gap: 12px; }
.form-field { display: grid; gap: 6px; }
.form-label { font-size: 0.78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.form-input, .form-select, .form-textarea {
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-xs);
  color: var(--ink);
  padding: 8px 12px;
  font-size: 0.88rem;
  min-height: 38px;
  width: 100%;
  color-scheme: dark;
}
.form-textarea { min-height: 90px; resize: vertical; }
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: 2px solid var(--accent-border); }
.form-actions { display: flex; gap: 8px; margin-top: 4px; }
.form-msg { font-size: 0.82rem; color: var(--muted); min-height: 1em; }

/* ── TWO-COL ── */
.two-col { display: grid; grid-template-columns: 380px 1fr; gap: 12px; }
.res-agenda { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 20px 22px; }
.res-agenda .panel-header { margin-bottom: 14px; align-items: center; }
.res-day { margin-bottom: 18px; }
.res-day-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--muted); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.res-day-header strong { color: var(--ink); font-size: 0.88rem; }
.res-card { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--radius-xs); padding: 12px 14px; margin-bottom: 8px; display: grid; gap: 8px; }
.res-card-top { display: flex; justify-content: space-between; align-items: center; }
.res-card-name { font-weight: 700; font-size: 0.9rem; }
.res-card-phone { font-size: 0.8rem; color: var(--muted); }
.res-card-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.res-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 0.73rem; font-weight: 700; background: var(--line-2); color: var(--muted); }
.res-card-actions { display: flex; gap: 6px; justify-content: flex-end; }
.res-card-actions button { min-height: 28px; font-size: 0.78rem; padding: 0 10px; }

/* ── EMPTY ── */
.empty-text { color: var(--muted); font-size: 0.88rem; padding: 16px 0; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .shell { width: calc(100vw - 32px); padding: 20px 0 48px; }
  .kpi-grid, .op-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .insight-grid { grid-template-columns: 1fr; }
  .quality-grid { grid-template-columns: repeat(2, 1fr); }
  .platform-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .res-agenda { order: -1; }
  .res-kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .topbar { flex-wrap: wrap; }
}
@media (max-width: 600px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .kpi-card { padding: 12px 10px; aspect-ratio: 1; }
  .kpi-sub, .kpi-delta-period { display: none; }
  .kpi-value { font-size: 2.2rem; margin-bottom: 2px; letter-spacing: -0.02em; }
  .kpi-label { font-size: 0.63rem; margin-bottom: 6px; }
  .op-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .op-card { padding: 12px 10px; display: flex; flex-direction: column; justify-content: space-between; }
  .op-meta { font-size: 0.6rem; line-height: 1.3; margin-top: 4px; }
  .op-value { font-size: 2.4rem; margin-bottom: 0; line-height: 1; }
  .op-label { font-size: 0.6rem; letter-spacing: 0.04em; line-height: 1.3; margin-bottom: 6px; }
  .res-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .quality-grid { grid-template-columns: repeat(2, 1fr); }
  .res-range-input { flex: 1; max-width: none; min-width: 120px; }
  .res-range-group { width: 100%; flex-wrap: wrap; }
}

/* ── TREINAR IA (#10) ── */
.tab-train.active { background: var(--accent-2-dim); color: var(--accent-3); }
.train-intro { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.train-intro-title { font-family: var(--font-d); font-size: 1.15rem; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.train-intro-sub { font-size: 0.86rem; color: var(--ink-2); line-height: 1.55; margin: 0; }
.train-client-banner { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 8px 10px; border: 1px solid rgba(31,212,160,.25); border-radius: 8px; color: var(--accent); background: rgba(31,212,160,.08); font-size: .82rem; font-weight: 700; }
.train-client-banner::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(31,212,160,.5); }
.train-form { display: flex; flex-direction: column; gap: 16px; }
.train-section { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 18px 20px; }
.train-section-title { font-size: 0.78rem; font-weight: 700; color: var(--accent-3); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line-2); }
.train-field { margin-bottom: 14px; }
.train-field:last-child { margin-bottom: 0; }
.train-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .train-row-2 { grid-template-columns: 1fr; } }
.train-label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.train-area { min-height: auto; line-height: 1.5; resize: vertical; font-family: inherit; }
.train-hint { display: block; font-size: 0.76rem; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.train-field-highlight { background: var(--accent-2-dim); border: 1px solid var(--accent-2-border); border-radius: var(--radius-sm); padding: 14px; }
.train-toggle-field { padding-top: 4px; }
.train-toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.88rem; color: var(--ink); }
.train-toggle input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.train-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; position: sticky; bottom: 0; background: var(--bg); padding: 14px 0; }
.train-save { min-width: 180px; }
.train-msg { font-size: 0.84rem; color: var(--muted); }
.train-msg-ok { color: var(--accent); }
.train-msg-err { color: var(--accent-2); }
@media (max-width: 640px) {
  .train-foot { flex-direction: column; align-items: stretch; }
  .train-save { width: 100%; }
}

/* ══════════ Conectar WhatsApp (Stage 3) ══════════ */
.btn-gear { padding: 6px 10px; font-size: 1rem; line-height: 1; }
.wa-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600;
  white-space: nowrap;
}
.wa-pill-ok { background: rgba(34,197,94,.15); color: #22c55e; border: 1px solid rgba(34,197,94,.35); }
.wa-pill-muted { background: rgba(148,163,184,.12); color: #94a3b8; border: 1px solid rgba(148,163,184,.3); }

.wa-modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.65); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.wa-modal {
  position: relative; width: 100%; max-width: 380px;
  background: #0f1720; border: 1px solid rgba(148,163,184,.2); border-radius: 16px;
  padding: 28px 24px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.wa-modal h3 { margin: 0 0 6px; font-size: 1.15rem; }
.wa-modal-msg { color: #94a3b8; font-size: .85rem; line-height: 1.4; margin: 0 0 18px; }
.wa-modal-close {
  position: absolute; top: 10px; right: 14px; background: none; border: none;
  color: #94a3b8; font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.wa-modal-close:hover { color: #fff; }
.wa-qr-wrap {
  position: relative; width: 260px; height: 260px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border-radius: 12px;
}
.wa-qr { width: 240px; height: 240px; display: none; }
.wa-qr-spinner { color: #0f1720; font-size: .85rem; font-weight: 600; }
.wa-connected { margin-top: 16px; color: #22c55e; font-weight: 700; font-size: 1rem; }
.wa-modal-err { margin-top: 14px; color: #f87171; font-size: .85rem; }

/* Luz de status do WhatsApp (vermelho=off, amarelo=conectando, verde=on) */
.wa-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin: 0 4px; vertical-align: middle; background: #6b7280; }
.wa-dot-red { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,.7); }
.wa-dot-yellow { background: #eab308; box-shadow: 0 0 6px rgba(234,179,8,.8); animation: waBlinkY 1s infinite; }
.wa-dot-green { background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: waPulseG 1.8s infinite; }
@keyframes waBlinkY { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes waPulseG { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.5);} 70% { box-shadow: 0 0 0 7px rgba(34,197,94,0);} 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0);} }

/* Seletor de cliente + Add Cliente no header (compacto/elegante) */
.client-select-wrap { display: inline-flex; align-items: center; gap: 8px; }
.client-select {
  appearance: none; -webkit-appearance: none;
  background: var(--panel-2); color: var(--ink-2);
  border: 1px solid var(--line-2); border-radius: 999px;
  padding: 6px 30px 6px 14px; font-size: .8rem; font-weight: 600;
  max-width: 190px; cursor: pointer;
  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='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.client-select:hover { border-color: var(--accent); }
.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-primary { background: var(--accent); color: #06270f; border-color: var(--accent); font-weight: 700; }
.btn-primary:hover { filter: brightness(1.08); }

/* Modal Novo cliente */
.nc-form { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.nc-input { width: 100%; text-align: left; }
.nc-btn { width: 100%; }
.nc-result { display: flex; flex-direction: column; gap: 8px; text-align: left; margin-top: 4px; }
.nc-token { display: block; word-break: break-all; background: #0b1118; padding: 11px; border-radius: 8px; font-size: .8rem; color: var(--ink-2); border: 1px solid var(--line-2); }

/* Botão excluir cliente */
.btn-danger { color: #f87171; border-color: rgba(248,113,113,.35); }
.btn-danger:hover { background: rgba(248,113,113,.12); border-color: #f87171; color: #fca5a5; }

/* ══════════ CONTROLE DE ACESSO POR PLANO ══════════ */
/* Bloco bloqueado por plano: fica visível, mas opaco e com faixa premium */
.feat-locked { position: relative; }
.feat-locked > :not(.feat-ribbon) { opacity: .5; filter: grayscale(.35); pointer-events: none; user-select: none; }
.feat-ribbon {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 14px; padding: 11px 14px;
  background: linear-gradient(90deg, var(--accent-3-dim), rgba(212,168,0,0.06));
  border: 1px solid var(--accent-2-border); border-radius: var(--radius-sm);
  opacity: 1 !important; filter: none !important; pointer-events: auto !important;
}
.feat-ribbon-lock { font-size: 1.05rem; }
.feat-ribbon-text { flex: 1; min-width: 180px; color: var(--ink); font-size: .86rem; font-weight: 500; }
.feat-ribbon-btn {
  border: 0; cursor: pointer; white-space: nowrap;
  background: var(--accent-3); color: #1a1500; font-weight: 700; font-size: .82rem;
  padding: 7px 14px; border-radius: 999px;
}
.feat-ribbon-btn:hover { filter: brightness(1.08); }

/* Modal Acessos (admin) */
.access-modal { max-width: 520px; text-align: left; }
.access-field { margin: 14px 0 6px; display: flex; flex-direction: column; gap: 5px; }
.access-grid { display: grid; grid-template-columns: 1fr; gap: 7px; margin: 12px 0 4px; max-height: 46vh; overflow-y: auto; }
.access-item {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 9px 11px; border: 1px solid var(--line-2); border-radius: var(--radius-xs);
  background: var(--panel-2); font-size: .87rem; color: var(--ink-2);
}
.access-item:hover { border-color: var(--accent-border); }
.access-item input { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }

/* Modal Upsell (cliente) */
.upsell-modal { max-width: 420px; text-align: center; }
.upsell-icon { font-size: 2.2rem; margin-bottom: 8px; }
.upsell-cta { display: inline-block; margin-top: 16px; text-decoration: none; }

/* ── Rodada (lista de transmissão própria) ── */
.rodada-card { margin-bottom: 18px; }
.rodada-step { margin-top: 20px; }
.rodada-manual-field { margin-top: 12px; }
.rodada-base-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.rodada-period { width: auto; min-width: 140px; }
.rodada-since { width: auto; }
.rodada-base-head { margin-bottom: 8px; }
.rodada-contacts { max-height: 260px; overflow-y: auto; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.rodada-contacts:empty { display: none; }
.rodada-contact { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-xs); cursor: pointer; }
.rodada-contact:hover { background: var(--panel-2); }
.rodada-contact-name { color: var(--ink); font-weight: 600; font-size: 0.88rem; }
.rodada-contact-meta { color: var(--muted); font-size: 0.78rem; margin-left: auto; text-align: right; }
.rodada-tips { border: 1px solid var(--accent-2-border); background: var(--accent-2-dim); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 0.85rem; line-height: 1.55; color: var(--ink-2); margin-bottom: 12px; }
.rodada-tips ul { margin: 6px 0 0; padding-left: 18px; }
.rodada-message { width: 100%; }
.rodada-counter { color: var(--muted); font-size: 0.78rem; margin: 6px 0 10px; }
.rodada-counter-warn { color: var(--accent-3); }
.rodada-counter-bad { color: #E4685E; font-weight: 600; }
.rodada-variate { display: flex; }
.rodada-estimate { color: var(--ink-2); font-size: 0.85rem; line-height: 1.5; margin: 0 0 12px; }
.rodada-campaigns { display: flex; flex-direction: column; gap: 12px; }
.rodada-campaign { border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 12px 14px; }
.rodada-campaign-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.rodada-chip { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-2); }
.rodada-chip-sending { color: var(--accent); border-color: var(--accent-border); background: var(--accent-dim); }
.rodada-chip-paused { color: var(--accent-3); border-color: var(--accent-2-border); background: var(--accent-3-dim); }
.rodada-chip-done { color: var(--ink-2); }
.rodada-chip-canceled { color: #E4685E; border-color: rgba(228,104,94,0.3); background: rgba(228,104,94,0.1); }
.rodada-campaign-when { color: var(--muted); font-size: 0.78rem; }
.rodada-campaign-progress { margin-left: auto; color: var(--ink); font-size: 0.82rem; font-weight: 600; }
.rodada-meter { margin-bottom: 10px; }
.rodada-campaign-msg { color: var(--ink-2); font-size: 0.85rem; line-height: 1.5; margin: 0 0 6px; white-space: pre-wrap; }
.rodada-campaign-detail { color: var(--muted); font-size: 0.78rem; margin: 0 0 8px; }
.rodada-campaign-actions { display: flex; gap: 8px; }

/* ── Comentário → Direct ─────────────────────────────────────── */
.comment-step { margin-top: 22px; }
.comment-hint { color: var(--muted); font-size: 0.82rem; margin: 2px 0 10px; }
.comment-post-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.comment-posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 12px; }
.comment-post { display: flex; flex-direction: column; text-align: left; padding: 0; border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); cursor: pointer; overflow: hidden; transition: border-color .15s; }
.comment-post:hover { border-color: var(--accent); }
.comment-post.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-dim); }
.comment-post img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.comment-post-noimg { width: 100%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .78rem; background: var(--bg); }
.comment-post-cap { font-size: .74rem; color: var(--ink); padding: 6px 8px 0; line-height: 1.3; max-height: 3.2em; overflow: hidden; }
.comment-post-type { font-size: .66rem; color: var(--muted); padding: 2px 8px 8px; text-transform: uppercase; letter-spacing: .04em; }
.comment-vars { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.comment-var { display: flex; align-items: center; gap: 8px; }
.comment-var-input { flex: 1; }
.comment-rules { display: flex; flex-direction: column; gap: 12px; }
.comment-rule { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; background: var(--panel); }
.comment-rule-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.comment-rule-kw { font-weight: 700; color: var(--ink); }
.comment-badge { font-size: .7rem; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.comment-badge.on { background: var(--accent-dim); color: var(--accent); }
.comment-badge.off { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.comment-rule-post { font-size: .8rem; color: var(--accent); margin-left: auto; text-decoration: none; }
.comment-rule-post:hover { text-decoration: underline; }
.comment-rule-body { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--ink); line-height: 1.4; }
.comment-rule-body strong { color: var(--muted); font-weight: 600; }
.comment-rule-more { color: var(--muted); font-size: .78rem; }
.comment-rule-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
