/* La Petite Events — Liquid Glass transparente sobre degradê marrom */
:root {
  --bg: #1a0f09;              /* marrom profundo */
  /* degradê marrom com brilho terracota e ouro (padrão) ou grafite, escolhido no Perfil */
  --bg-glow: radial-gradient(ellipse 70% 45% at 15% 18%, rgba(196, 110, 70, .55), transparent 70%),
             radial-gradient(ellipse 60% 40% at 80% 45%, rgba(214, 168, 92, .30), transparent 70%),
             radial-gradient(ellipse 80% 45% at 40% 95%, rgba(120, 70, 40, .45), transparent 70%),
             linear-gradient(180deg, #2a170d, #1a0f09);
  /* vidro cristal: sem fumê e sem fosco — véu bem fino + borda brilhante, fundo nítido */
  --smoke: linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, 0) 30%),
           linear-gradient(160deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
  --smoke-tab: linear-gradient(160deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .04));
  --pop: linear-gradient(160deg, #3a2619, #1e130c);   /* menus/tooltip: opacos */
  --top-fade-rgb: 42, 23, 13;   /* topo ao rolar (mobile): a cor do alto do fundo de cada tema */
  --ink: #f6efe6;             /* texto direto sobre o fundo */
  --ink-muted: rgba(246, 239, 230, .64);
  --glass: rgba(255, 255, 255, .06);
  --glass-strong: rgba(255, 255, 255, .10);
  --stroke: rgba(255, 255, 255, .30);
  --stroke-soft: rgba(255, 255, 255, .08);
  --highlight: rgba(255, 255, 255, .24);
  --text: #f6efe6;
  --muted: rgba(246, 239, 230, .64);
  --faint: rgba(246, 239, 230, .40);
  /* destaque no fundo marrom: areia #c1a181 (fosca) — botões, abas, gráfico, barras */
  --accent: #c1a181;
  --accent-rgb: 193, 161, 129;
  --accent-soft: rgba(var(--accent-rgb), .16);
  --accent-end: #d6bb9b;      /* fim do degradê de barras/gráfico */
  --accent-grad: linear-gradient(180deg, #d0b393, #a98a6b);
  --accent-bar: linear-gradient(90deg, #a98a6b, #d6bb9b);
  --on-accent: #2a1a0c;       /* texto sobre o ouro */
  --gold: #c1a181;
  --green: #4ade9c;
  --green-rgb: 74, 222, 156;
  --red: #ff7a70;
  --yellow: #f0c04a;
  --blue: #7fabff;
  --r-lg: 26px;
  --r-md: 18px;
  --mono: "Cascadia Code", "SF Mono", Consolas, monospace;
  --blur: blur(26px) saturate(170%);
  --shadow: 0 14px 30px rgba(10, 5, 2, .40), 0 3px 8px rgba(10, 5, 2, .26);   /* sombra atrás dos espelhos */
  --inner-light: inset 0 1px 0 rgba(255, 255, 255, .45), inset 1px 0 0 rgba(255, 255, 255, .12),
                 inset 0 -1px 0 rgba(0, 0, 0, .25);   /* borda brilhante do cristal */
}
:root[data-theme="grafite"] {
  --bg: #222123;
  --bg-glow: radial-gradient(ellipse 95% 45% at 50% 0%, rgba(226, 214, 195, .26), transparent 70%),
             linear-gradient(180deg, #353436, #222123);
  --pop: linear-gradient(160deg, #3a3236, #1d1a1c);
  /* no fundo grafite o destaque continua ouro fosco */
  --accent: #d9b26a;
  --accent-rgb: 217, 178, 106;
  --accent-end: #e6c27e;
  --accent-grad: linear-gradient(180deg, #e8c584, #c4984a);
  --accent-bar: linear-gradient(90deg, #c4984a, #e6c27e);
  --gold: #d9b26a;
  --top-fade-rgb: 52, 51, 53;   /* topo do degradê grafite */
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.5 -apple-system, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
.hidden { display: none !important; }
code {
  font-family: var(--mono); font-size: 12px;
  background: rgba(255, 255, 255, .07); border: 1px solid var(--stroke-soft);
  padding: 1px 7px; border-radius: 7px;
}

/* ---------- cena de fundo (champanhe com grão de papel) ---------- */
.bg-scene { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--bg-glow); }
.bg-scene::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .08;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.crown-wm {
  position: absolute; right: -60px; bottom: -40px; width: 620px; opacity: .05;
  filter: blur(2px); transform: rotate(-8deg); pointer-events: none;
}
/* o que fica direto sobre o fundo claro usa tinta escura */
.view-head, .profile-head { --text: var(--ink); --muted: var(--ink-muted); color: var(--ink); }

/* ---------- layout flutuante ---------- */
.app { position: relative; z-index: 1; display: flex; height: 100vh; padding: 16px; gap: 16px; }

.sidebar {
  width: 248px; flex-shrink: 0; display: flex; flex-direction: column;
  background: var(--smoke); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--stroke); border-radius: var(--r-lg);
  box-shadow: var(--shadow), var(--inner-light);
  padding: 22px 14px 16px;
}
.logo { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 8px 20px; text-align: center; }
.logo-crown {
  width: 68px; height: auto; margin-bottom: 6px;
  filter: drop-shadow(0 4px 14px rgba(223, 174, 82, .35));
}
.logo-name { font-weight: 700; font-size: 15px; letter-spacing: .4px; }
.logo-name span { background: var(--accent-bar); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-sub { font-size: 10.5px; color: var(--faint); letter-spacing: .5px; }

.sidebar nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 13px;
  color: var(--muted); cursor: pointer; font-weight: 500; font-size: 13.5px;
  border: 1px solid transparent; transition: background .15s, color .15s, border-color .15s;
  user-select: none;
}
.sidebar nav a:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.sidebar nav a.active {
  background: linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .05));
  border-color: var(--stroke); color: var(--text);
  box-shadow: inset 0 1px 0 var(--highlight), 0 4px 14px rgba(0, 0, 0, .25);
}
.sidebar nav a.active .ico { color: var(--accent); }
.sidebar nav .ico { width: 16px; text-align: center; opacity: .9; }
.badge {
  margin-left: auto; background: var(--accent); color: var(--on-accent); font-size: 10.5px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 5px;
  box-shadow: 0 3px 10px rgba(var(--accent-rgb), .45);
}
.sidebar-foot { border-top: 1px solid var(--stroke-soft); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.live-dot-wrap { display: flex; gap: 7px; align-items: center; font-size: 11.5px; color: var(--muted); padding: 0 6px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.live-dot.on { background: var(--green); box-shadow: 0 0 10px rgba(var(--green-rgb), .8); }

/* ---------- botões (pílulas de vidro) ---------- */
.btn {
  border: 1px solid var(--stroke); border-radius: 999px; padding: 8px 14px;
  font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--text);
  background: linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .04));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 var(--highlight);
  transition: transform .12s, box-shadow .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 var(--highlight), 0 6px 16px rgba(0, 0, 0, .3); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--accent-grad); border-color: rgba(255, 255, 255, .55); color: var(--on-accent);
  box-shadow: inset 0 1px 0 #fff, 0 6px 18px rgba(0, 0, 0, .28);
}
.btn-ghost { background: rgba(255, 255, 255, .04); color: var(--muted); box-shadow: none; }
.btn-ghost:hover { color: var(--text); background: rgba(255, 255, 255, .08); }

/* ---------- main ---------- */
.main { flex: 1; overflow-y: auto; padding: 14px 6px 60px 2px; }
.view-head { margin: 8px 4px 22px; }
.view-head h1 { font-size: 22px; font-weight: 700; letter-spacing: -.3px; }
.view-head p { color: var(--muted); font-size: 13px; margin-top: 3px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 14px; margin-bottom: 16px; }
.card {
  background: var(--smoke); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--stroke); border-radius: var(--r-md);
  box-shadow: var(--shadow), var(--inner-light);
  padding: 15px 17px; transition: transform .18s, box-shadow .18s;
}
.card:hover { transform: translateY(-2px); }
.card .label { font-size: 11px; color: var(--muted); letter-spacing: .5px; text-transform: uppercase; font-weight: 600; }
.card .value { font-size: 23px; font-weight: 700; margin-top: 5px; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.card .sub { font-size: 11.5px; color: var(--faint); margin-top: 3px; }
.card.accent .value { color: var(--accent); text-shadow: 0 0 24px rgba(var(--accent-rgb), .35); }
.card.green .value { color: var(--green); text-shadow: 0 0 24px rgba(var(--green-rgb), .3); }
.card.red .value { color: var(--red); text-shadow: 0 0 24px rgba(255, 122, 112, .3); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }

.panel {
  background: var(--smoke); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--stroke); border-radius: var(--r-lg);
  box-shadow: var(--shadow), var(--inner-light);
  padding: 18px 20px; margin-bottom: 14px; min-width: 0; overflow: hidden;
}
#chart { width: 100%; height: 150px; display: block; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.panel-head h2 { font-size: 13.5px; font-weight: 650; }
.pill { font-size: 10.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; letter-spacing: .4px;
        border: 1px solid var(--stroke-soft); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1); }
.pill-live { background: rgba(var(--green-rgb), .13); color: var(--green); }
.hint { color: var(--muted); font-size: 12.5px; margin-bottom: 12px; }

/* ---------- rows / feed ---------- */
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--stroke-soft); font-size: 13px; }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .num { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12.5px; }
.row .money { font-variant-numeric: tabular-nums; font-weight: 650; }
.bar-wrap { flex: 1; height: 6px; background: rgba(255, 255, 255, .07); border-radius: 3px; overflow: hidden;
            box-shadow: inset 0 1px 2px rgba(0, 0, 0, .3); }
.bar { height: 100%; background: var(--accent-bar); border-radius: 3px;
       box-shadow: 0 0 10px rgba(var(--accent-rgb), .4); }

.feed { display: flex; flex-direction: column; max-height: 420px; overflow-y: auto; }
/* listas que crescem: rolagem dentro do cartão, igual ao feed ao vivo, pra página não ficar comprida */
.scroll { max-height: 420px; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; }
.scroll-tall { max-height: 560px; }
.feed-item { display: flex; gap: 12px; padding: 9px 6px; border-bottom: 1px solid var(--stroke-soft); font-size: 13px; align-items: center; border-radius: 10px; }
.feed-item:last-child { border-bottom: 0; }
.feed-item.flash { animation: flash 1.3s ease-out; }
@keyframes flash { from { background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .3); } }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 8px currentColor; }
.dot.success, .dot.approved { background: var(--green); color: rgba(var(--green-rgb), .7); }
.dot.warning, .dot.pending, .dot.refunded { background: var(--yellow); color: rgba(240, 192, 74, .7); }
.dot.error, .dot.refused, .dot.chargeback { background: var(--red); color: rgba(255, 122, 112, .7); }
.dot.info, .dot.abandoned { background: var(--blue); color: rgba(127, 171, 255, .7); }
.dot.unknown { background: var(--faint); color: transparent; }
.feed-item .t { color: var(--faint); font-size: 11.5px; margin-left: auto; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.feed-item b { font-weight: 650; }
.feed-item .desc { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- tabelas ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th { text-align: left; color: var(--faint); font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; padding: 6px 9px; border-bottom: 1px solid var(--stroke); }
.tbl td { padding: 9px; border-bottom: 1px solid var(--stroke-soft); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: rgba(255, 255, 255, .05); }
.type-tag {
  font-family: var(--mono); font-size: 11px; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--stroke-soft); background: rgba(255, 255, 255, .05); white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}
.type-tag.approved { color: var(--green); border-color: rgba(var(--green-rgb), .35); }
.type-tag.refused, .type-tag.chargeback { color: var(--red); border-color: rgba(255, 122, 112, .35); }
.type-tag.refunded, .type-tag.pending { color: var(--yellow); border-color: rgba(240, 192, 74, .35); }
.type-tag.abandoned { color: var(--blue); border-color: rgba(127, 171, 255, .35); }
.provider-tag { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: capitalize; }

/* tabela de vendas */
.ta-r { text-align: right; }
.c-date { white-space: nowrap; color: var(--muted); }
.c-prod { font-weight: 600; }
.cli-name { font-size: 12.5px; }
.cli-mail { font-size: 11px; color: var(--faint); }
.pay-method { font-size: 11px; color: var(--faint); margin-top: 3px; }
.c-val { white-space: nowrap; font-size: 13px; }
.status-tag {
  display: inline-block; font-size: 11px; font-weight: 650; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--stroke-soft); background: rgba(255, 255, 255, .05); white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}
.status-tag.approved { color: var(--green); background: rgba(var(--green-rgb), .12); border-color: rgba(var(--green-rgb), .3); }
.status-tag.refused, .status-tag.chargeback { color: var(--red); background: rgba(255, 122, 112, .12); border-color: rgba(255, 122, 112, .3); }
.status-tag.refunded, .status-tag.pending { color: var(--yellow); background: rgba(240, 192, 74, .12); border-color: rgba(240, 192, 74, .3); }
.status-tag.abandoned { color: var(--blue); background: rgba(127, 171, 255, .12); border-color: rgba(127, 171, 255, .3); }

.filters { display: flex; gap: 8px; margin: 0 2px 14px; }
select {
  background: var(--glass-strong); color: var(--text); border: 1px solid var(--stroke);
  border-radius: 999px; padding: 7px 14px; font-size: 12.5px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 var(--highlight);
}
select option { background: #1d1b1e; color: var(--text); }
/* filtros soltos sobre o fundo claro: pílulas de vidro fumê */
.filters select, .filters .btn { background: var(--smoke); border-color: rgba(255, 255, 255, .12); }

/* ---------- logs ---------- */
.logs { font-family: var(--mono); font-size: 11.8px; max-height: 560px; overflow-y: auto; display: flex; flex-direction: column; }
.log-line { display: flex; gap: 10px; padding: 4px 2px; border-bottom: 1px solid rgba(255, 255, 255, .035); }
.log-line .lt { color: var(--faint); flex-shrink: 0; }
.log-line .lvl { width: 46px; flex-shrink: 0; font-weight: 700; }
.log-line .lvl.info { color: var(--blue); }
.log-line .lvl.error { color: var(--red); }
.log-line .lvl.warn { color: var(--yellow); }
.log-line .src { color: var(--gold); width: 60px; flex-shrink: 0; }

/* ---------- integrações ---------- */
.apikey-row { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.apikey-row code { padding: 8px 14px; font-size: 12px; border-radius: 999px; }
.code-sample {
  font-family: var(--mono); font-size: 11.8px;
  background: rgba(0, 0, 0, .35); border: 1px solid var(--stroke-soft);
  border-radius: 14px; padding: 15px; overflow-x: auto; color: rgba(235, 235, 245, .8); line-height: 1.6;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .3);
}

/* ---------- seletor de data ---------- */
.date-picker { position: relative; }
.date-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  background: var(--glass-strong); color: var(--text); border: 1px solid var(--stroke);
  border-radius: 999px; padding: 8px 14px; font-size: 12.5px; font-weight: 500; cursor: pointer;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 var(--highlight);
}
.date-btn svg { width: 15px; height: 15px; opacity: .6; flex-shrink: 0; }
/* fixed = fica por cima de tudo e nunca é cortado pelo painel */
.date-pop {
  position: fixed; z-index: 200; width: 290px; max-width: calc(100vw - 24px);
  background: var(--pop); color: var(--text);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--stroke); border-radius: 18px; padding: 8px;
  box-shadow: 0 24px 60px rgba(50, 32, 18, .45), inset 0 1px 0 var(--highlight);
}
.date-opt {
  display: block; padding: 9px 12px; border-radius: 11px; font-size: 13px;
  color: var(--text); cursor: pointer; user-select: none;
}
.date-opt:hover { background: rgba(255, 255, 255, .07); }
.cal { border-top: 1px solid var(--stroke-soft); margin-top: 6px; padding: 10px 4px 4px; }
.cal-head { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 10px; }
.cal-head span { font-size: 13px; font-weight: 600; }
.cal-head button {
  background: transparent; border: 0; color: var(--muted); cursor: pointer;
  font-size: 15px; padding: 4px 8px; border-radius: 8px;
}
.cal-head button:hover { background: rgba(255, 255, 255, .07); color: var(--text); }
.cal-head #cal-prev { margin-right: auto; }
.cal-head #cal-next { margin-left: auto; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-week span { text-align: center; font-size: 10.5px; color: var(--faint); padding-bottom: 6px; font-weight: 600; }
.cal-day {
  aspect-ratio: 1; display: grid; place-items: center; border: 0; cursor: pointer;
  background: transparent; color: var(--text); font-size: 12.5px; border-radius: 9px;
  font-variant-numeric: tabular-nums;
}
.cal-day.empty { cursor: default; }
.cal-day:not(.empty):hover { background: rgba(255, 255, 255, .09); }
.cal-day.today { background: rgba(255, 255, 255, .10); font-weight: 700; }
.cal-day.in-range { background: rgba(var(--accent-rgb), .18); border-radius: 0; }
.cal-day.selected {
  background: var(--accent-grad); color: var(--on-accent); font-weight: 700;
  box-shadow: 0 4px 12px rgba(var(--accent-rgb), .45);
}
.cal-hint {
  text-align: center; font-size: 10.5px; color: var(--faint);
  padding: 9px 4px 3px; line-height: 1.35;
}
.cal-hint.active { color: var(--accent); font-weight: 600; }

/* ---------- tela de login ---------- */
.auth-screen {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  padding: 24px; background: var(--bg-glow);
}
.auth-card {
  width: min(380px, 100%); text-align: center;
  background: var(--smoke); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--stroke); border-radius: var(--r-lg);
  box-shadow: var(--shadow), var(--inner-light);
  padding: 32px 26px 26px;
}
.auth-crown { width: 84px; height: auto; filter: drop-shadow(0 4px 16px rgba(223,174,82,.4)); }
.auth-title { font-size: 17px; font-weight: 700; margin-top: 10px; letter-spacing: .3px; }
.auth-title span { background: var(--accent-bar);
                   -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-sub { font-size: 13px; color: var(--muted); margin: 4px 0 22px; }
.auth-card form { display: flex; flex-direction: column; gap: 10px; }
.auth-card input {
  background: var(--glass-strong); color: var(--text); border: 1px solid var(--stroke);
  border-radius: 999px; padding: 12px 18px; font-size: 14px; outline: none; text-align: center;
  box-shadow: inset 0 1px 0 var(--highlight);
}
input::placeholder { color: var(--faint); }
.auth-card input:focus { border-color: rgba(var(--accent-rgb), .55); }
.auth-card .btn { padding: 12px 18px; font-size: 14px; }
.auth-error { color: var(--red); font-size: 12.5px; margin-top: 12px; min-height: 16px; }
.btn-faceid {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 18px; font-size: 14px; margin-bottom: 4px;
  background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.05));
}
.btn-faceid svg { width: 21px; height: 21px; color: var(--gold); }
.auth-or { font-size: 11.5px; color: var(--faint); margin: 12px 0 10px; letter-spacing: .5px; }

/* ---------- hero (receita gigante + filtros + meta) ---------- */
.hero {
  background: linear-gradient(150deg, rgba(var(--accent-rgb), .22), rgba(var(--accent-rgb), .05) 55%, transparent), var(--smoke);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--stroke); border-radius: var(--r-lg);
  box-shadow: var(--shadow), var(--inner-light);
  padding: 18px 20px 16px; margin-bottom: 16px;
}
.hero-filters { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.hero-filters select { flex: 1; min-width: 130px; }
.hero-top { display: flex; align-items: center; justify-content: space-between; }
.hero-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; font-weight: 600; }
.eye-btn {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 999px;
  border: 1px solid var(--stroke); background: rgba(255, 255, 255, .05); color: var(--muted);
  cursor: pointer; transition: color .15s, background .15s, transform .12s;
}
.eye-btn svg { width: 18px; height: 18px; }
.eye-btn:hover { color: var(--text); background: rgba(255, 255, 255, .1); }
.eye-btn:active { transform: scale(.92); }
.eye-btn.on { color: var(--accent); border-color: rgba(var(--accent-rgb), .4); background: var(--accent-soft); }
.hero-actions { display: flex; gap: 8px; }
#btn-refresh.spin svg { animation: lpe-spin .7s linear infinite; }
@keyframes lpe-spin { to { transform: rotate(360deg); } }
.hero-value {
  font-size: 44px; font-weight: 800; letter-spacing: -1.2px; line-height: 1.15;
  background: linear-gradient(90deg, #f2e8dc, var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-variant-numeric: tabular-nums;
}
.hero-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.hero-chart { width: 100%; height: 150px; display: block; margin-top: 12px; cursor: pointer; }
.chart-tip {
  position: fixed; z-index: 120; pointer-events: none;
  background: var(--pop); color: var(--text);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--stroke); border-radius: 12px; padding: 7px 12px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 1px; white-space: nowrap;
}
.chart-tip b { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chart-tip span { font-size: 11px; color: var(--muted); }
.goal { margin-top: 14px; }
.goal-head { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.goal-medal { font-weight: 650; color: var(--text); }
.goal-bar { height: 8px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden;
            box-shadow: inset 0 1px 2px rgba(0,0,0,.35); }
.goal-fill { height: 100%; border-radius: 4px; min-width: 4px;
             background: var(--accent-bar);
             box-shadow: 0 0 12px rgba(var(--accent-rgb), .5); transition: width .6s ease; }

/* ---------- barra de abas flutuante (mobile) ---------- */
.tabbar {
  display: none; position: fixed; z-index: 40;
  left: 16px; right: 16px; bottom: calc(14px + env(safe-area-inset-bottom));
  background: var(--smoke-tab);
  backdrop-filter: blur(18px) saturate(110%); -webkit-backdrop-filter: blur(18px) saturate(110%);
  border: 1px solid var(--stroke); border-radius: 28px;
  box-shadow: 0 14px 34px rgba(40, 25, 12, .34), inset 0 1px 0 var(--highlight);
  padding: 8px 10px;
  justify-content: space-around; align-items: center;
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10px; color: rgba(255, 255, 255, .82); text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  text-decoration: none; cursor: pointer;
  padding: 5px 10px; border-radius: 18px; user-select: none; font-weight: 600;
  transition: color .15s, background .15s;
}
.tabbar a .tico { width: 22px; height: 22px; }
.tabbar a.active {
  color: var(--on-accent);
  background: var(--accent-grad);
  box-shadow: inset 0 1px 0 #fff, 0 4px 12px rgba(0, 0, 0, .3);
}

/* ---------- perfil ---------- */
.profile-head { display: flex; flex-direction: column; align-items: center; padding: 18px 0 22px; }
.profile-avatar { width: 84px; height: 84px; border-radius: 50%; box-shadow: 0 8px 26px rgba(0,0,0,.45), 0 0 0 2px var(--stroke); margin-bottom: 12px; }
.profile-name { font-size: 18px; font-weight: 700; }
.profile-sub { font-size: 12.5px; color: var(--muted); }
.toggle-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--stroke-soft); cursor: pointer; }
.toggle-row:last-of-type { border-bottom: 0; }
.toggle-ico { width: 26px; text-align: center; font-size: 16px; }
.toggle-label { flex: 1; font-size: 14px; }
.switch { appearance: none; width: 46px; height: 27px; border-radius: 14px; background: rgba(255,255,255,.14);
          position: relative; cursor: pointer; transition: background .2s; flex-shrink: 0;
          box-shadow: inset 0 1px 3px rgba(0,0,0,.35); }
.switch::after { content: ""; position: absolute; top: 2.5px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
                 background: #fff; transition: transform .2s; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.switch:checked { background: var(--accent-bar); }
.switch:checked::after { transform: translateX(18px); }
.profile-more .more-link { display: flex; align-items: center; gap: 12px; padding: 12px 4px; color: var(--text);
                           border-bottom: 1px solid var(--stroke-soft); cursor: pointer; font-size: 14px; font-weight: 500; }
.profile-more .more-link:last-child { border-bottom: 0; }
.profile-more .more-link .ico { color: var(--accent); width: 20px; text-align: center; }
.theme-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.theme-opt {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px;
  border: 1px solid var(--stroke); background: var(--glass); color: var(--muted);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
}
.theme-opt.active { color: var(--gold); border-color: rgba(var(--accent-rgb), .55); background: rgba(var(--accent-rgb), .12); }
.theme-sw { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 0 0 2px rgba(255, 255, 255, .14); }
.theme-sw.grafite { background: radial-gradient(circle at 50% 10%, #8f877c, #222123 75%); }
.theme-sw.marrom { background: radial-gradient(circle at 30% 25%, #c46e46, #2a170d 75%); }
.theme-sw.vidro { background: linear-gradient(160deg, rgba(255,255,255,.55), rgba(255,255,255,.08)); border: 1px solid rgba(255,255,255,.4); }
.theme-sw.unslop { background: #1c1a18; border: 1px solid rgba(239,233,222,.2); box-shadow: inset 0 -9px 0 -6px #c9a882; }
.profile-foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--faint); }

.push-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.push-controls .btn:disabled { opacity: .7; cursor: default; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.push-controls .btn[data-state="enabled"] { color: var(--green); }

.base-config { margin-bottom: 16px; }
.base-config label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 7px; font-weight: 600; }
.base-status { font-size: 12px; margin-top: 4px; }
.base-status .ok { color: var(--green); }
.base-status .warn { color: var(--yellow); }
.btn-copy-url { padding: 5px 12px; font-size: 11.5px; }

.dest-form { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.dest-form input {
  background: var(--glass-strong); color: var(--text); border: 1px solid var(--stroke);
  border-radius: 999px; padding: 8px 14px; font-size: 12.5px; outline: none;
  box-shadow: inset 0 1px 0 var(--highlight);
}
.dest-form input:focus { border-color: rgba(var(--accent-rgb), .5); }
.dest-form #dest-url { flex: 2; min-width: 220px; }
.dest-form #dest-topics { flex: 1; min-width: 90px; }
.dest-form #dest-label { flex: 1; min-width: 110px; }

/* ---------- toasts ---------- */
#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 9px; z-index: 50; }
.toast {
  background: var(--smoke); color: var(--text);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--stroke); border-left: 3px solid var(--accent);
  border-radius: 16px; padding: 11px 15px; min-width: 260px; max-width: 340px;
  box-shadow: var(--shadow), inset 0 1px 0 var(--highlight);
  animation: slide-in .3s cubic-bezier(.2, .9, .3, 1.2); font-size: 12.5px;
}
.toast.success { border-left-color: var(--green); }
.toast.warning { border-left-color: var(--yellow); }
.toast.error { border-left-color: var(--red); }
.toast b { display: block; font-size: 12.5px; margin-bottom: 1px; }
.toast span { color: var(--muted); font-size: 12px; }
@keyframes slide-in { from { transform: translateX(30px) scale(.96); opacity: 0; } }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(5, 6, 10, .45);
              backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
              display: grid; place-items: center; z-index: 60; }
.modal {
  background: var(--smoke); color: var(--text);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--stroke); border-radius: 22px;
  box-shadow: var(--shadow), inset 0 1px 0 var(--highlight);
  width: min(680px, 92vw); max-height: 80vh; display: flex; flex-direction: column; padding: 18px 20px;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.modal .code-sample { overflow: auto; flex: 1; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(128, 110, 95, .40); border-radius: 5px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* tabelas largas rolam dentro do painel (não empurram a página) */
#events-table { overflow-x: auto; }

/* ============ MOBILE / RESPONSIVO (layout de app) ============ */
@media (max-width: 860px) {
  body { overflow: auto; }
  .app {
    flex-direction: column; height: auto; min-height: 100vh; gap: 10px;
    /* respeita a área segura do notch quando aberto como app na tela inicial */
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right))
             10px max(10px, env(safe-area-inset-left));
  }

  /* no mobile a navegação vive na tabbar inferior — some a sidebar */
  .sidebar { display: none; }
  .tabbar { display: flex; }

  /* conteúdo: a página rola; espaço extra no fim pra tabbar flutuante não cobrir */
  .main { overflow-y: visible; padding: 4px 2px calc(104px + env(safe-area-inset-bottom)); }
  .view-head { margin: 6px 4px 16px; }
  .view-head h1 { font-size: 19px; }

  .hero { padding: 16px 16px 14px; }
  .hero-value { font-size: 38px; }

  /* tabela de vendas vira lista de cartões */
  #events-table .tbl, #events-table tbody { display: block; width: 100%; }
  #events-table .tbl tr:first-child { display: none; }        /* cabeçalho */
  #events-table .tbl tr {
    display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; align-items: center;
    padding: 12px 4px; border-bottom: 1px solid var(--stroke-soft);
  }
  #events-table .tbl td { display: block; padding: 0; border: 0; }
  #events-table .c-prod { order: 1; }
  #events-table .c-val { order: 2; text-align: right; font-weight: 700; }
  #events-table .c-cli { order: 3; }
  #events-table .c-status { order: 4; text-align: right; }
  #events-table .c-date { order: 5; grid-column: 1 / -1; font-size: 11px; }
  .cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .grid-2 { grid-template-columns: 1fr; }

  /* formulários e filtros empilham e ocupam a largura toda */
  .dest-form { flex-direction: column; }
  .dest-form input, .dest-form select, .dest-form .btn { width: 100%; }
  .dest-form #dest-url, .dest-form #dest-topics, .dest-form #dest-label { min-width: 0; }
  .filters { flex-wrap: wrap; }
  .filters select, .filters .btn { flex: 1; }
  .apikey-row { flex-wrap: wrap; }
  .apikey-row code { flex: 1; min-width: 0; overflow-x: auto; }
}

@media (max-width: 480px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .view-head h1 { font-size: 18px; }
  .panel { padding: 14px 14px; border-radius: 18px; }
  .card .value { font-size: 21px; }
  .hero-value { font-size: 34px; }
  .crown-wm { width: 360px; opacity: .05; }
}

/* cristal: cards e campos sem desfoque (o fundo aparece nítido); a barra flutuante,
   menus e avisos mantêm o desfoque para o texto continuar legível por cima do conteúdo */
.card, .panel, .hero, .sidebar, .auth-card, .filters select, .filters .btn, .date-btn, select {
  backdrop-filter: none; -webkit-backdrop-filter: none;
}

/* topo ao rolar (mobile): o conteúdo esmaece sob o relógio, sem corte seco.
   Só degradê (sem desfoque): o Safari do iPhone corta reto o desfoque com máscara.
   Paradas suaves pra não formar faixa. Liga só depois de rolar (.scrolled). */
@media (max-width: 860px) {
  body::before {
    content: ""; position: fixed; left: 0; right: 0; top: 0; z-index: 30; pointer-events: none;
    height: calc(env(safe-area-inset-top) + 56px);
    background: linear-gradient(
      rgba(var(--top-fade-rgb), .96) 0%,
      rgba(var(--top-fade-rgb), .90) calc(env(safe-area-inset-top) * .6),
      rgba(var(--top-fade-rgb), .72) calc(env(safe-area-inset-top) + 8px),
      rgba(var(--top-fade-rgb), .42) calc(env(safe-area-inset-top) + 24px),
      rgba(var(--top-fade-rgb), .16) calc(env(safe-area-inset-top) + 40px),
      rgba(var(--top-fade-rgb), 0) 100%);
    opacity: 0; transition: opacity .2s;
  }
  body.scrolled::before { opacity: 1; }
}

/* ---------- recuperação ---------- */
.rec-step { display: grid; grid-template-columns: 1fr auto; gap: 6px 8px; margin-bottom: 12px; }
.rec-step textarea { grid-column: 1 / -1; grid-row: 2; }
.rec-delay-wrap { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rec-step textarea {
  min-height: 130px; resize: vertical; background: var(--glass-strong); color: var(--text);
  border: 1px solid var(--stroke); border-radius: 14px; padding: 10px 12px; font: inherit; font-size: 12.5px;
}
.rec-step input { width: 90px; background: var(--glass-strong); color: var(--text); border: 1px solid var(--stroke); border-radius: 999px; padding: 8px 12px; font-size: 12.5px; }
.dest-form label input { background: var(--glass-strong); color: var(--text); border: 1px solid var(--stroke); border-radius: 999px; padding: 6px 10px; }
.status-tag.recovered { color: var(--green); background: rgba(var(--green-rgb), .12); border-color: rgba(var(--green-rgb), .3); }
.status-tag.failed, .status-tag.opted_out { color: var(--red); background: rgba(255, 122, 112, .12); border-color: rgba(255, 122, 112, .3); }
.status-tag.waiting, .status-tag.active { color: var(--yellow); background: rgba(240, 192, 74, .12); border-color: rgba(240, 192, 74, .3); }
.status-tag.replied { color: var(--blue); background: rgba(127, 171, 255, .12); border-color: rgba(127, 171, 255, .3); }
@media (max-width: 760px) {
  .rec-row { flex-wrap: wrap; row-gap: 4px; }
  .rec-row .grow { flex-basis: 100%; order: 2; }
  .rec-row .num { order: 3; font-size: 11px; }
  .rec-row .rec-stop { order: 4; margin-left: auto; }
}

/* ---------- retenção ---------- */
.ret-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; margin: 6px 0 12px; background: rgba(255,255,255,.06); }
.ret-bar span { display: block; height: 100%; }
.ret-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12px; color: var(--muted); }
.ret-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.ret-legend b { color: var(--text); font-variant-numeric: tabular-nums; }
.ret-score { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.ret-score.risco { color: var(--red); } .ret-score.atencao { color: var(--yellow); } .ret-score.saudavel { color: var(--green); }
.ret-next { font-size: 12px; text-align: right; max-width: 240px; }
.ret-next.blocked { color: var(--faint); }
.ret-pb { border-top: 1px solid rgba(255,255,255,.06); padding: 12px 0; display: grid; grid-template-columns: auto 1fr auto; gap: 6px 12px; align-items: center; }
.ret-pb .ret-pb-text { grid-column: 1 / -1; margin: 0; white-space: pre-line; color: var(--muted); font-size: 12.5px; line-height: 1.5;
  padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid var(--stroke-soft); }
.ret-pb .hint .pill { margin-left: 6px; }
.ret-pb .when { font-size: 11.5px; color: var(--faint); }
.status-tag.risco { color: var(--red); background: rgba(255, 122, 112, .12); border-color: rgba(255, 122, 112, .3); }
.status-tag.atencao { color: var(--yellow); background: rgba(240, 192, 74, .12); border-color: rgba(240, 192, 74, .3); }
.status-tag.saudavel { color: var(--green); background: rgba(var(--green-rgb), .12); border-color: rgba(var(--green-rgb), .3); }
@media (max-width: 760px) {
  .ret-row { flex-wrap: wrap; row-gap: 4px; }
  .ret-row .grow { flex-basis: 100%; order: 2; }
  .ret-row .ret-next { order: 3; text-align: left; max-width: none; flex: 1; }
  .ret-row .ret-pause { order: 4; }
}

.ag-bars{display:flex;align-items:flex-end;gap:6px;height:150px;margin-top:10px}
.ag-col{flex:1;display:flex;flex-direction:column;align-items:center;height:100%;min-width:0}
.ag-stack{flex:1;width:100%;max-width:28px;display:flex;flex-direction:column;justify-content:flex-end;border-radius:4px;overflow:hidden}
.ag-stack span{display:block;width:100%}
.ag-col small{font-size:10px;opacity:.6;margin-top:4px}
.ag-dot{display:inline-block;width:9px;height:9px;border-radius:2px;vertical-align:middle;margin-right:2px}

.teach-log{display:flex;flex-direction:column;gap:10px;margin:10px 0;min-height:60px}
.teach-msg{max-width:88%;padding:9px 12px;border-radius:12px;font-size:13.5px;line-height:1.45;white-space:pre-wrap}
.teach-msg.equipe{align-self:flex-end;background:rgba(201,162,74,.18)}
.teach-msg.ia{align-self:flex-start;background:var(--stroke-soft)}
.teach-item{border:1px solid var(--stroke-soft);border-radius:10px;padding:8px;margin-top:8px;display:flex;flex-direction:column;gap:6px;white-space:normal}
/* campos da aba Agente, do chat de ensinar e das sugestões no mesmo vidro do resto do painel */
#view-agent input, .teach-item input, .teach-item textarea, .teach-form textarea, .ins-q, .ins-a, #sup-ignore, #ret-holdout {
  background: var(--glass-strong); color: var(--text); border: 1px solid var(--stroke);
  border-radius: 12px; padding: 8px 12px; font: inherit; font-size: 13px; outline: none;
  box-shadow: inset 0 1px 0 var(--highlight); box-sizing: border-box; max-width: 100%;
}
#view-agent input:focus, .teach-form textarea:focus, .teach-item input:focus, .teach-item textarea:focus,
.ins-q:focus, .ins-a:focus { border-color: rgba(var(--accent-rgb), .55); }
.teach-item input, .teach-item textarea, .ins-q, .ins-a { width: 100%; }
.teach-item textarea, .ins-a { resize: vertical; min-height: 64px; }
.teach-item img { max-width: 160px; border-radius: 8px; }
.teach-form { display: flex; gap: 8px; align-items: flex-end; width: 100%; min-width: 0; }
.teach-form textarea { flex: 1 1 auto; min-width: 0; width: 100%; min-height: 46px; max-height: 180px; resize: vertical; border-radius: 16px; }
.teach-form .btn { flex: 0 0 auto; }
@media (max-width: 720px) {
  .teach-form { flex-direction: column; align-items: stretch; }
  .teach-msg { max-width: 100%; }
}

/* ---------- Conversas (caixa de entrada) ---------- */
.tabbar a { position: relative; padding: 5px 7px; }
.tab-badge { position: absolute; top: -2px; right: 2px; margin: 0; min-width: 16px; height: 16px; font-size: 9.5px; }
.ib-guide .ib-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.ib-steps li { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); line-height: 1.45; }
.ib-steps b { color: var(--text); }
.ib-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.ib-dot.voce { background: var(--yellow); box-shadow: 0 0 8px rgba(240, 192, 74, .7); }
.ib-dot.comigo { background: var(--accent); }
.ib-dot.agente { background: var(--blue); }
.ib-dot.janela { background: var(--green); }

.ib-shell {
  display: grid; grid-template-columns: 330px minmax(0, 1fr) 270px; gap: 0;
  height: calc(100vh - 170px); min-height: 520px;
  background: var(--smoke); border: 1px solid var(--stroke); border-radius: var(--r-lg);
  box-shadow: var(--shadow), var(--inner-light); overflow: hidden;
}
.ib-list-col { display: flex; flex-direction: column; border-right: 1px solid var(--stroke-soft); min-height: 0; }
.ib-tools { padding: 14px 12px 8px; display: flex; flex-direction: column; gap: 10px; }
.ib-tools input { width: 100%; }
.ib-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ib-chip {
  border: 1px solid var(--stroke-soft); background: rgba(255, 255, 255, .04); color: var(--muted);
  border-radius: 999px; padding: 5px 10px; font-size: 11.5px; font-weight: 600; cursor: pointer;
  display: inline-flex; gap: 6px; align-items: center;
}
.ib-chip b { font-size: 10.5px; opacity: .8; }
.ib-chip.active { background: var(--accent-grad); color: var(--on-accent); border-color: transparent; }
.ib-chip[data-f="voce"].has b { background: var(--yellow); color: #2a1a0c; border-radius: 9px; padding: 0 6px; opacity: 1; }
.ib-list { flex: 1; overflow-y: auto; padding: 4px 6px 10px; }
.ib-item {
  display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 4px 10px; align-items: center;
  padding: 10px 8px; border-radius: 14px; cursor: pointer; border: 1px solid transparent; position: relative;
}
.ib-item:hover { background: rgba(255, 255, 255, .05); }
.ib-item.sel { background: rgba(255, 255, 255, .09); border-color: var(--stroke-soft); }
.ib-item .ib-avatar { grid-row: span 2; }
.ib-item .nm { font-weight: 650; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-item .tm { font-size: 11px; color: var(--faint); text-align: right; }
.ib-item .pv { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-item.unread .nm, .ib-item.unread .pv { color: var(--text); }
.ib-item .un { background: var(--green); color: var(--on-green, #082414); font-weight: 800; font-size: 10.5px; min-width: 19px; height: 19px;
               border-radius: 10px; display: grid; place-items: center; padding: 0 5px; justify-self: end; }
.ib-item .bar { position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; }
.ib-item .bar.voce { background: var(--yellow); }
.ib-item .bar.comigo { background: var(--accent); }
.ib-tag { font-size: 9.5px; font-weight: 700; letter-spacing: .3px; padding: 1px 7px; border-radius: 999px; margin-left: 6px;
          border: 1px solid var(--stroke-soft); color: var(--muted); vertical-align: 1px; }
.ib-tag.assinante { color: var(--accent); border-color: rgba(var(--accent-rgb), .4); }
.ib-avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px;
  color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .3); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3);
}
.ib-list-empty { padding: 30px 16px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.5; }

.ib-chat-col { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ib-empty { margin: auto; text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; color: var(--muted); padding: 30px; font-size: 13px; }
.ib-empty-ico { font-size: 34px; opacity: .5; }
.ib-empty b { color: var(--text); }
.ib-chat { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.ib-chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--stroke-soft); }
.ib-chat-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ib-chat-title b { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-chat-title span { font-size: 11.5px; color: var(--muted); }
.ib-back { display: none; font-size: 22px; padding: 2px 12px; line-height: 1; }
.ib-info-btn { display: none; }
.ib-state { padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
.ib-banner { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; font-size: 12.5px; line-height: 1.45;
             border: 1px solid var(--stroke-soft); background: rgba(255, 255, 255, .04); }
.ib-banner .grow { flex: 1; }
.ib-banner b { color: var(--text); }
.ib-banner.voce { background: rgba(240, 192, 74, .12); border-color: rgba(240, 192, 74, .35); }
.ib-banner.comigo { background: rgba(var(--accent-rgb), .12); border-color: rgba(var(--accent-rgb), .35); }
.ib-banner.agente { background: rgba(127, 171, 255, .10); border-color: rgba(127, 171, 255, .3); }
.ib-banner.fechada { background: rgba(255, 122, 112, .10); border-color: rgba(255, 122, 112, .35); }
.ib-banner.aberta { padding: 6px 12px; font-size: 11.5px; color: var(--muted); background: transparent; }
.ib-banner .btn { white-space: nowrap; }
.ib-msgs { flex: 1; overflow-y: auto; padding: 6px 16px 14px; display: flex; flex-direction: column; gap: 4px; }
.ib-day { align-self: center; font-size: 10.5px; color: var(--faint); margin: 10px 0 4px; letter-spacing: .4px; text-transform: uppercase; }
.ib-sys { align-self: center; font-size: 11px; color: var(--muted); background: rgba(255, 255, 255, .05); border-radius: 999px; padding: 3px 12px; margin: 4px 0; }
.ib-b { max-width: min(78%, 520px); padding: 8px 12px 6px; border-radius: 16px; font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; position: relative; }
.ib-b .who { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .3px; margin-bottom: 2px; opacity: .85; }
.ib-b .at { display: block; text-align: right; font-size: 10px; opacity: .6; margin-top: 3px; }
.ib-b img { display: block; max-width: 100%; max-height: 280px; border-radius: 10px; margin: 2px 0 4px; cursor: zoom-in; }
.ib-b audio { width: 240px; max-width: 100%; margin: 2px 0; }
.ib-b.in { align-self: flex-start; background: rgba(255, 255, 255, .09); border: 1px solid var(--stroke-soft); border-bottom-left-radius: 5px; }
.ib-b.out { align-self: flex-end; background: rgba(127, 171, 255, .16); border: 1px solid rgba(127, 171, 255, .28); border-bottom-right-radius: 5px; }
.ib-b.out .who { color: var(--blue); }
.ib-b.team { align-self: flex-end; background: rgba(var(--accent-rgb), .22); border: 1px solid rgba(var(--accent-rgb), .45); border-bottom-right-radius: 5px; }
.ib-b.team .who { color: var(--accent); }
.ib-b.fail { border-color: rgba(255, 122, 112, .6); }
.ib-b .err { display: block; color: var(--red); font-size: 11px; margin-top: 3px; }
.ib-quick { padding: 8px 14px; border-top: 1px solid var(--stroke-soft); display: flex; flex-direction: column; gap: 6px; max-height: 200px; overflow-y: auto; }
.ib-quick button { text-align: left; border: 1px solid var(--stroke-soft); background: rgba(255, 255, 255, .04); color: var(--text);
                   border-radius: 12px; padding: 7px 10px; font-size: 12.5px; cursor: pointer; }
.ib-quick button:hover { background: rgba(255, 255, 255, .09); }
.ib-quick .ib-quick-edit { color: var(--muted); border-style: dashed; }
.ib-compose { border-top: 1px solid var(--stroke-soft); padding: 10px 12px 8px; }
.ib-compose.off { opacity: .5; pointer-events: none; }
.ib-compose-row { display: flex; gap: 8px; align-items: flex-end; }
.ib-compose textarea { flex: 1; resize: none; min-height: 40px; max-height: 160px; padding: 10px 14px; border-radius: 20px;
                       font: inherit; font-size: 13.5px; line-height: 1.4; }
.ib-icon { padding: 8px 10px; font-size: 15px; }
.ib-compose-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 11px; color: var(--faint); }
.ib-compose-foot input { width: 110px; padding: 2px 8px; font-size: 11px; border-radius: 8px; }
.ib-img-preview { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 12px; color: var(--muted); }
.ib-img-preview img { height: 64px; border-radius: 10px; }

.ib-info-col { border-left: 1px solid var(--stroke-soft); padding: 16px 16px; overflow-y: auto; font-size: 12.5px; }
.ib-info-col h3 { font-size: 12px; letter-spacing: .5px; text-transform: uppercase; color: var(--faint); margin: 14px 0 8px; }
.ib-info-col h3:first-child { margin-top: 0; }
.ib-kv { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--stroke-soft); }
.ib-kv span:first-child { color: var(--muted); }
.ib-kv span:last-child { text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.ib-legend { display: flex; flex-direction: column; gap: 6px; color: var(--muted); }
.ib-legend div { display: flex; gap: 8px; align-items: center; }
.ib-sw { width: 16px; height: 12px; border-radius: 4px; flex-shrink: 0; }
.ib-sw.in { background: rgba(255, 255, 255, .18); }
.ib-sw.out { background: rgba(127, 171, 255, .45); }
.ib-sw.team { background: rgba(var(--accent-rgb), .6); }
.ib-zoom { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .85); display: grid; place-items: center; cursor: zoom-out; }
.ib-zoom img { max-width: 94vw; max-height: 90vh; border-radius: 12px; }

@media (max-width: 1250px) {
  .ib-shell { grid-template-columns: 300px minmax(0, 1fr); }
  .ib-info-col { display: none; }
  .ib-info-btn { display: inline-flex; }
  .ib-shell.info .ib-info-col { display: block; position: absolute; right: 0; top: 0; bottom: 0; width: 290px; z-index: 5;
                                background: var(--pop); box-shadow: -10px 0 30px rgba(0, 0, 0, .4); }
  .ib-shell { position: relative; }
}
@media (max-width: 860px) {
  .ib-shell { grid-template-columns: 1fr; height: calc(100vh - 210px); min-height: 460px; border-radius: 20px; }
  .ib-shell .ib-chat-col { display: none; }
  /* a lista fica montada por trás (escondida) enquanto a conversa está aberta: ao voltar, ela está
     exatamente onde estava, sem recarregar nem voltar ao topo (como no WhatsApp) */
  .ib-shell.open .ib-list-col { display: flex; position: absolute; inset: 0; z-index: 0; visibility: hidden; background: var(--pop); }
  .ib-shell.open.peek .ib-list-col { visibility: visible; }
  .ib-shell.open .ib-chat-col { display: flex; }
  .ib-shell.open { position: fixed; inset: 0; z-index: 60; height: auto; min-height: 0; border-radius: 0; border: 0;
                   background: var(--pop); padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  .ib-shell.info .ib-info-col { width: 88vw; }
  .ib-back { display: inline-flex; }
  .ib-b { max-width: 86%; }
  .ib-kbd { display: none; }
  .ib-compose textarea { font-size: 16px; }   /* evita zoom do iPhone */
}
#ib-q, #ib-who, #ib-text {
  background: var(--glass-strong); color: var(--text); border: 1px solid var(--stroke); outline: none;
  font: inherit;
}
#ib-q { border-radius: 999px; padding: 9px 14px; font-size: 13px; }
#ib-q::placeholder, #ib-text::placeholder { color: var(--faint); }
#ib-q:focus, #ib-text:focus, #ib-who:focus { border-color: rgba(var(--accent-rgb), .7); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .15); }
.ib-b { white-space: normal; }
.ib-b > span:not(.who):not(.at):not(.err) { white-space: pre-wrap; display: block; }
body.ib-open .tabbar { display: none; }

.ib-rec { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 8px 12px; border-radius: 16px;
          background: rgba(255, 122, 112, .10); border: 1px solid rgba(255, 122, 112, .35); font-size: 13px; }
.ib-rec .grow { flex: 1; min-width: 0; }
.ib-rec audio { width: 100%; max-width: 320px; height: 36px; }
.ib-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: ibpulse 1s infinite; flex-shrink: 0; }
@keyframes ibpulse { 50% { opacity: .25; } }

/* compositor no jeito do WhatsApp: pílula com o texto e um botão redondo à direita */
.ib-compose { padding: 8px 10px 8px; }
.ib-compose-row { display: flex; gap: 8px; align-items: flex-end; }
.ib-pill, .ib-rec {
  flex: 1; min-width: 0; display: flex; align-items: flex-end; gap: 2px;
  background: var(--glass-strong); border: 1px solid var(--stroke); border-radius: 24px;
  padding: 3px 6px; min-height: 46px;
}
.ib-pill:focus-within { border-color: rgba(var(--accent-rgb), .7); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .15); }
.ib-pill.hidden, .ib-rec.hidden { display: none; }
.ib-pill #ib-text, .ib-pill #ib-text:focus {
  flex: 1; background: transparent; border: 0; box-shadow: none; border-radius: 0;
  padding: 11px 6px; min-height: 0; max-height: 140px; font-size: 14.5px; line-height: 1.35;
}
.ib-ic {
  width: 38px; height: 38px; flex-shrink: 0; display: grid; place-items: center; border: 0; background: transparent;
  color: var(--muted); border-radius: 50%; cursor: pointer; margin-bottom: 1px;
}
.ib-ic svg { width: 22px; height: 22px; }
.ib-ic:hover { color: var(--text); background: rgba(255, 255, 255, .07); }
.ib-ic.danger:hover { color: var(--red); }
.ib-round {
  width: 46px; height: 46px; flex-shrink: 0; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; color: var(--on-accent); background: var(--accent-grad);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 6px 16px rgba(0, 0, 0, .3); transition: transform .12s;
}
.ib-round svg { width: 22px; height: 22px; }
.ib-round[data-mode="send"] svg { margin-left: 3px; }
.ib-round:active { transform: scale(.94); }
.ib-round.busy { opacity: .6; pointer-events: none; }
.ib-rec { align-items: center; gap: 8px; padding: 3px 6px 3px 4px; background: rgba(255, 255, 255, .08); border-color: var(--stroke); font-size: 14px; }
.ib-rec .ib-ic { margin: 0; }
.ib-rec audio { flex: 1; min-width: 0; height: 36px; }
.ib-rec .rec-clock { font-variant-numeric: tabular-nums; min-width: 34px; }
.ib-wave { flex: 1; display: flex; align-items: center; gap: 3px; height: 26px; overflow: hidden; }
.ib-wave i { width: 3px; border-radius: 2px; background: var(--accent); opacity: .75; animation: ibwave 1s ease-in-out infinite; }
.ib-wave i:nth-child(3n) { animation-delay: -.3s; } .ib-wave i:nth-child(3n+1) { animation-delay: -.6s; } .ib-wave i:nth-child(4n) { animation-delay: -.15s; }
@keyframes ibwave { 0%, 100% { height: 5px; } 50% { height: 22px; } }
.ib-rec-sending { flex: 1; color: var(--muted); padding-left: 10px; }
.ib-compose-foot { padding: 0 10px; }
@media (max-width: 860px) {
  .ib-compose { padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .ib-pill #ib-text { font-size: 16px; }
  .ib-compose-foot { display: none; }
}

.ib-audio { display: flex; align-items: center; gap: 10px; min-width: 220px; max-width: 300px; padding: 2px 0; flex: 1; }
.ib-audio audio { display: none; }
.ib-play { width: 36px; height: 36px; flex-shrink: 0; border: 0; border-radius: 50%; cursor: pointer; display: grid; place-items: center;
           background: rgba(255, 255, 255, .14); color: var(--text); }
.ib-play svg { width: 18px; height: 18px; }
.ib-b.team .ib-play { background: rgba(var(--accent-rgb), .35); }
.ib-track { position: relative; flex: 1; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .22); cursor: pointer; }
.ib-track::before { content: ""; position: absolute; inset: -10px 0; }
.ib-prog { height: 100%; width: 0; border-radius: 2px; background: var(--accent); }
.ib-knob { position: absolute; top: 50%; left: 0; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--accent);
           box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.ib-dur { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 32px; text-align: right; }
.ib-rec .ib-audio { max-width: none; }

.ib-avatar { overflow: hidden; flex-shrink: 0; }
.ib-avatar.has-photo { background: #fff !important; }
.ib-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* celular: sem zoom ao tocar nos campos (iPhone aumenta a tela quando a letra é menor que 16 px)
   e a conversa sempre do tamanho da tela visível, mesmo com o teclado aberto */
@media (max-width: 860px) {
  #ib-text, #ib-text:focus, .ib-pill #ib-text, .ib-pill #ib-text:focus, #ib-q, #ib-q:focus, #ib-who {
    font-size: 16px !important;
  }
  body.ib-open { overflow: hidden; overscroll-behavior: none; }
  .ib-shell.open { height: var(--ib-vvh, 100%); bottom: auto; overflow: hidden; touch-action: manipulation; }
  .ib-shell.open .ib-chat-col, .ib-shell.open .ib-chat { width: 100%; max-width: 100vw; overflow: hidden; }
  .ib-shell.open .ib-msgs { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
}

.ib-tick { display: inline-flex; vertical-align: -2px; margin-left: 2px; }
.ib-tick svg { width: 15px; height: 13px; }
.ib-tick.pending svg { width: 12px; height: 12px; opacity: .8; }
.ib-tick.read { color: #53bdeb; opacity: 1; }
.ib-tick.failed { color: var(--red); }
.ib-b .at:has(.ib-tick.read) { opacity: .85; }
.ib-b.pending { opacity: .92; }

/* ---------- conversa no jeito do Mensagens (Apple) ---------- */
.ib-msgs, .ib-state, .ib-compose { padding-left: max(16px, calc((100% - 760px) / 2)); padding-right: max(16px, calc((100% - 760px) / 2)); }
.ib-msgs { gap: 2px; padding-top: 10px; padding-bottom: 16px; }
.ib-day { align-self: center; margin: 14px 0 6px; font-size: 11px; color: var(--faint); letter-spacing: .2px; text-transform: none; }
.ib-day b { font-weight: 600; color: var(--muted); }
.ib-sys { margin: 6px 0; font-size: 11px; background: transparent; color: var(--faint); padding: 0; }
.ib-name { font-size: 11px; color: var(--muted); margin: 8px 12px 2px; }
.ib-name.out, .ib-name.team { align-self: flex-end; }
.ib-name.in { align-self: flex-start; }
.ib-b {
  max-width: min(68%, 460px); padding: 7px 13px 8px; border-radius: 19px; font-size: 14px; line-height: 1.38;
  border: 0 !important; box-shadow: none; margin: 0;
}
.ib-b .tx { white-space: pre-wrap; display: block; }
.ib-b .who, .ib-b .at { display: none; }
.ib-b.first { margin-top: 6px; }
/* cantos de grupo: o lado de quem fala fica mais reto entre balões seguidos; o último "aponta" para quem falou */
.ib-b.in { background: rgba(255, 255, 255, .13); color: var(--text); border-radius: 19px 19px 19px 6px; }
.ib-b.in:not(.first) { border-top-left-radius: 6px; }
.ib-b.out, .ib-b.team { border-radius: 19px 19px 6px 19px; }
.ib-b.out:not(.first), .ib-b.team:not(.first) { border-top-right-radius: 6px; }
.ib-b.out { background: linear-gradient(180deg, #843621, #703724); color: #fff; }
.ib-b.team { background: var(--accent-grad); color: var(--on-accent); }
.ib-b.team a, .ib-b.out a { color: inherit; text-decoration: underline; }
.ib-b.media-only { background: transparent !important; padding: 0; }
.ib-b img, .ib-b video { display: block; max-width: min(280px, 100%); max-height: 320px; width: auto; border-radius: 16px; margin: 0; cursor: zoom-in; }
.ib-b:not(.media-only) img { margin: -3px -9px 6px; max-width: calc(100% + 18px); border-radius: 14px; }
.ib-b.fail { opacity: .75; }
.ib-b.pending { opacity: .7; }
.ib-receipt { font-size: 10.5px; color: var(--faint); margin: 3px 6px 2px; display: flex; align-items: center; gap: 4px; }
.ib-receipt.out, .ib-receipt.team { align-self: flex-end; }
.ib-receipt.in { align-self: flex-start; }
.ib-receipt.bad { color: var(--red); max-width: 70%; text-align: right; }
.ib-b.team .ib-play { background: rgba(0, 0, 0, .18); color: var(--on-accent); }
.ib-b.team .ib-track { background: rgba(0, 0, 0, .2); }
.ib-b.team .ib-prog, .ib-b.team .ib-knob { background: var(--on-accent); }
.ib-b.team .ib-dur { color: var(--on-accent); opacity: .8; }
.ib-b.out .ib-play { background: rgba(255, 255, 255, .22); color: #fff; }
.ib-b.out .ib-prog, .ib-b.out .ib-knob { background: #fff; }
.ib-b.out .ib-dur { color: #fff; opacity: .85; }
.ib-sw.out { background: #3c8cf5; }
.ib-sw.team { background: var(--accent); }
@media (max-width: 860px) {
  .ib-b { max-width: 80%; }
}

@media (max-width: 860px) {
  .ib-shell.open.kb { padding-bottom: 0; }
  .ib-shell.open.kb .ib-compose { padding-bottom: 6px; }
  .ib-shell.open.kb .ib-compose-foot { display: none; }
}


/* sem o "puxa e estica" do iPhone ao chegar no topo/fim: a tela para onde o conteúdo acaba */
/* (só no celular; no computador fica o elástico normal do trackpad) */
.main, .ib-list, .ib-msgs, .ib-info-col, .ib-quick { overscroll-behavior: contain; }
@media (max-width: 860px) {
  html, body { overscroll-behavior: none; }
}

/* gesto de voltar: a lista aparece por baixo enquanto a conversa desliza */
@media (max-width: 860px) {
  .ib-shell.open.peek .ib-list-col { display: flex; position: absolute; inset: 0; z-index: 0; background: var(--pop); }
  .ib-shell.open.peek .ib-chat-col { position: relative; z-index: 1; background: var(--pop); box-shadow: -12px 0 30px rgba(0, 0, 0, .45); }
  .ib-shell.open.peek .ib-list-col::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, .25); pointer-events: none; }
  .main { will-change: auto; }
}

/* computador: elástico das caixas que rolam (ver rubberBand no app.js) */
.rb > * { transform: translateY(var(--rb, 0px)); will-change: transform; }

/* hora e tiques no canto do balão */
.ib-b .meta { display: flex; justify-content: flex-end; align-items: center; gap: 3px; font-size: 10.5px; line-height: 1;
              opacity: .62; margin: 3px -4px -2px 10px; white-space: nowrap; }
.ib-b.team .meta { color: var(--on-accent); }
.ib-b.out .meta { color: #fff; opacity: .8; }
.ib-b.media-only .meta { position: absolute; right: 8px; bottom: 7px; margin: 0; opacity: 1; color: #fff;
                         background: rgba(0, 0, 0, .45); padding: 3px 6px; border-radius: 9px; }
.ib-b .meta .ib-tick { margin: 0; }
.ib-took { opacity: .75; font-weight: 400; }
.ib-b .meta .ib-tick svg { width: 14px; height: 12px; }

/* celular, aba Conversas: tela "congelada" como um app. A caixa ocupa do topo até a ilha de baixo;
   a página não rola, só a lista de dentro */
@media (max-width: 860px) {
  body.in-inbox { overflow: hidden; overscroll-behavior: none; }
  body.in-inbox .ib-shell:not(.open) {
    position: fixed; z-index: 5; left: 12px; right: 12px; height: auto; min-height: 0;
    top: calc(10px + env(safe-area-inset-top));
    bottom: calc(92px + env(safe-area-inset-bottom));
  }
  body.in-inbox #ib-guide, body.in-inbox #view-inbox > .view-head { display: none; }
}

/* gesto de voltar: a lista que aparece por baixo já está no mesmo lugar e tamanho em que fica depois
   (caixa presa entre o topo e a ilha), com a ilha visível. Assim não "pula" nem parece recarregar */
@media (max-width: 860px) {
  body.in-inbox .ib-shell.open .ib-list-col {
    inset: calc(10px + env(safe-area-inset-top)) 12px calc(92px + env(safe-area-inset-bottom)) 12px;
    border: 1px solid var(--stroke); border-radius: var(--r-lg); overflow: hidden;
    background: var(--smoke); box-shadow: var(--shadow), var(--inner-light);
  }
  body.in-inbox .ib-shell.open.peek { background: transparent; }
  body.in-inbox .ib-shell.open.peek .ib-list-col::after { border-radius: inherit; }
  body.ib-open.ib-peek .tabbar { display: flex; z-index: 0; }   /* a ilha fica por baixo da conversa que desliza */
}

/* papel de parede da conversa (desenhos de confeitaria em linha, bem suaves, como o do WhatsApp) */
.ib-chat { position: relative; isolation: isolate; }
.ib-chat::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: url("/static/chat-wallpaper.svg"); background-size: 280px 280px; background-repeat: repeat;
  opacity: .075;
}
.ib-chat-head, .ib-state, .ib-compose { position: relative; }
.ib-chat-head { background: rgba(30, 22, 20, .55); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.ib-compose { background: rgba(30, 22, 20, .55); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }

/* compositor igual ao do WhatsApp: [+]  [ texto  ⚡ ]  📷  (🎤/➤) — ícones brancos soltos, pílula lisa */
.ib-compose { padding-top: 8px; padding-bottom: 8px; position: relative; }
.ib-compose-row { gap: 6px; align-items: flex-end; }
.ib-compose-row .ib-plus, .ib-compose-row .ib-cam { color: var(--text); width: 42px; height: 46px; margin: 0; }
.ib-compose-row .ib-plus svg { width: 26px; height: 26px; }
.ib-compose-row .ib-cam svg { width: 26px; height: 26px; }
.ib-compose-row .ib-plus:hover, .ib-compose-row .ib-cam:hover { background: transparent; opacity: .8; }
.ib-pill {
  background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .10); border-radius: 23px;
  padding: 2px 4px 2px 14px; box-shadow: none !important;
}
.ib-pill:focus-within { border-color: rgba(255, 255, 255, .22); box-shadow: none; }
.ib-pill #ib-text { padding: 11px 2px; }
.ib-pill .ib-ic { color: var(--text); opacity: .85; }
.ib-compose-row.typing .ib-cam { display: none; }
.ib-compose-row.recording .ib-plus, .ib-compose-row.recording .ib-cam { display: none; }
.ib-round { width: 46px; height: 46px; box-shadow: none; }
.ib-attach-menu {
  position: absolute; left: 10px; bottom: calc(100% + 6px); z-index: 20; min-width: 220px;
  background: rgba(38, 30, 28, .96); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border: 1px solid var(--stroke); border-radius: 18px; padding: 6px; box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
  display: flex; flex-direction: column;
}
.ib-attach-menu.hidden { display: none; }
.ib-attach-menu button { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; background: transparent;
  color: var(--text); font: inherit; font-size: 14px; border-radius: 12px; cursor: pointer; text-align: left; }
.ib-attach-menu button:hover { background: rgba(255, 255, 255, .07); }
.ib-att-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.ib-att-ic svg { width: 18px; height: 18px; }
.ib-att-ic.g { background: #3b82f6; } .ib-att-ic.c { background: #e0507a; } .ib-att-ic.q { background: #c9a063; color: #2a1a0c; }

/* teclado aberto: a barra de escrever encosta no teclado (sem a folga da barrinha do iPhone) */
@media (max-width: 860px) {
  .ib-shell.open.kb { padding-bottom: 0 !important; }
  .ib-shell.open.kb .ib-compose { padding-bottom: 6px !important; }
}

/* ---------- barra de escrever: um tom só, sem vidro ----------
   A barra e a folga da barrinha do iPhone ficam na mesma cor (antes apareciam dois tons). */
.ib-compose {
  background: #221a18 !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  border-top: 1px solid rgba(255, 255, 255, .07);
}
.ib-chat-head { background: #221a18 !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  border-bottom: 1px solid rgba(255, 255, 255, .07); }
.ib-pill { background: rgba(255, 255, 255, .08) !important; border: 1px solid rgba(255, 255, 255, .10) !important; box-shadow: none !important; }
.ib-pill:focus-within { border-color: rgba(255, 255, 255, .22) !important; }
.ib-round { background: var(--accent-grad) !important; box-shadow: none !important; }
.ib-compose-row .ib-plus, .ib-compose-row .ib-cam { color: rgba(255, 255, 255, .92); }
@media (max-width: 860px) {
  .ib-shell.open { padding-bottom: 0 !important; background: #221a18; }
  .ib-compose { padding-bottom: calc(8px + env(safe-area-inset-bottom)) !important; }
  .ib-shell.open.kb .ib-compose { padding-bottom: 6px !important; }
}

/* computador: a conversa fica dentro da caixa de vidro do painel; topo e barra de escrever no mesmo
   tom dela (o tom sólido escuro é só do celular, onde a conversa ocupa a tela toda) */
@media (min-width: 861px) {
  .ib-chat-head, .ib-compose { background: transparent !important; }
}

/* ---------- Suporte: estado, abas e ajustes ---------- */
.sup-state { display: flex; align-items: center; gap: 12px; padding: 14px 18px; }
.sup-state .grow { flex: 1; color: var(--muted); font-size: 13.5px; }
.sup-state .grow b { color: var(--text); font-weight: 600; }
.sup-tabs {
  display: flex; gap: 4px; padding: 4px; margin: 4px 0 14px; width: fit-content; max-width: 100%; overflow-x: auto;
  border: 1px solid var(--stroke-soft); border-radius: 14px; background: rgba(255, 255, 255, .04);
}
.sup-tabs button {
  border: 0; background: none; color: var(--muted); font: 600 13px var(--font, inherit); white-space: nowrap;
  padding: 8px 14px; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: background-color .15s, color .15s;
}
.sup-tabs button:hover { color: var(--text); }
.sup-tabs button.on { background: rgba(255, 255, 255, .10); color: var(--text); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10); }
.seg-n:empty { display: none; }
.sup-tabs .t-sm { display: none; }
.seg-n { font-size: 11px; line-height: 18px; min-width: 18px; padding: 0 6px; border-radius: 9px; background: var(--accent-grad); color: var(--on-accent); }
.sup-form { padding: 6px 20px 16px; }
.sf-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--stroke-soft);
}
.sf-row b { font-weight: 600; font-size: 14px; }
.sf-row .hint { margin: 2px 0 0; }
.sf-row > select, .sf-row > input { width: 100%; }
.sf-inline { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.sf-inline input { width: 72px; }
.sf-more summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 14px 0 4px; }
.sf-more[open] summary { padding-bottom: 0; }
.sup-form #sup-status { margin-top: 12px; }
@media (max-width: 760px) {
  .sup-state { flex-wrap: wrap; padding: 12px 14px; }
  .sup-state .grow { flex-basis: 100%; order: 3; }
  .sup-state .btn { margin-left: auto; }
  .sup-tabs { width: 100%; overflow: visible; }
  .sup-tabs button { flex: 1 1 0; justify-content: center; padding: 8px 4px; font-size: 12.5px; }
  .sup-tabs .t-lg { display: none; } .sup-tabs .t-sm { display: inline; }
  #sup-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  #sup-cards .card { padding: 10px 12px; min-height: 0; }
  #sup-cards .card .label { font-size: 9.5px; letter-spacing: .3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #sup-cards .card .value { font-size: 20px; margin: 4px 0 0; }
  #sup-cards .card .sub { display: none; }
  #sup-gaps .sup-gap-ans { flex-basis: 100%; }
  #sup-gaps .row .btn { flex: 1; }
  .sf-row { grid-template-columns: 1fr; gap: 8px; }
  .sup-form { padding: 4px 16px 14px; }
}
#view-support .sf-row input, #view-support .sup-gap-ans, #view-support .ins-q, #view-support .ins-a {
  background: var(--glass-strong); color: var(--text); border: 1px solid var(--stroke);
  border-radius: 12px; padding: 9px 14px; font: inherit; font-size: 13px; outline: none;
  box-shadow: inset 0 1px 0 var(--highlight);
}
#view-support .sf-row input:focus, #view-support .sup-gap-ans:focus { border-color: rgba(var(--accent-rgb), .5); }
#sup-gaps .row { gap: 8px 10px; }
#sup-gaps .row > .grow { flex-basis: 100%; }
#sup-gaps .sup-gap-ans { flex: 1; min-width: 200px; }
@media (max-width: 760px) { #sup-gaps .row .sup-gap-ans { flex: 1 1 100%; } }

/* =====================================================================
   Estilo "Unslop" (Perfil → Aparência → Estilo). Vale com o fundo marrom
   ou grafite. Menos vidro e brilho: superfícies em degraus, bordas finas,
   texto sem maiúsculas espaçadas, números em fonte própria e um só destaque.
   ===================================================================== */
:root[data-style="unslop"] {
  --smoke: rgba(255, 255, 255, .055);
  --smoke-tab: rgba(38, 24, 16, .9);
  --stroke: rgba(246, 239, 230, .10);
  --stroke-soft: rgba(246, 239, 230, .07);
  --highlight: rgba(255, 255, 255, .08);
  --inner-light: inset 0 1px 0 rgba(255, 255, 255, .06);
  --shadow: 0 1px 2px rgba(0, 0, 0, .18);
  --blur: blur(20px);
  --r-lg: 16px;
  --r-md: 14px;
  --accent: #c9a882;
  --accent-rgb: 201, 168, 130;
  --accent-grad: #c9a882;
  --accent-bar: #c9a882;
  --accent-end: #c9a882;
  --gold: #c9a882;
  --on-accent: #2a170d;
  --muted: rgba(246, 239, 230, .70);
  --faint: rgba(246, 239, 230, .50);
  --num: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --serif: "Newsreader", Georgia, serif;
}
:root[data-style="unslop"] {
  /* cores de estado sóbrias: verde musgo, terracota e mostarda, sem neon */
  --green: #9cb38c;
  --green-rgb: 156, 179, 140;
  --on-green: #1d2618;
  --red: #d98b77;
  --yellow: #d4b26a;
  --blue: #9aa9b8;
}
:root[data-style="unslop"] .live-dot.on { box-shadow: none; }
:root[data-style="unslop"] .card.green .value, :root[data-style="unslop"] .card.red .value { color: var(--text); }
:root[data-style="unslop"]:not([data-theme="grafite"]) {
  --bg-glow: radial-gradient(ellipse 70% 45% at 15% 18%, rgba(196, 110, 70, .40), transparent 70%),
             radial-gradient(ellipse 60% 40% at 80% 45%, rgba(214, 168, 92, .18), transparent 70%),
             radial-gradient(ellipse 80% 45% at 40% 95%, rgba(120, 70, 40, .35), transparent 70%),
             linear-gradient(180deg, #2a170d, #1a0f09);
}
/* grafite no Unslop: neutro e chapado, a cor fica só no dourado */
:root[data-style="unslop"][data-theme="grafite"] {
  /* mesmo tom do grafite do Vidro (cinza quente com luz no topo); cartões translúcidos por cima */
  --bg: #222123;
  --bg-glow: radial-gradient(ellipse 95% 45% at 50% 0%, rgba(226, 214, 195, .22), transparent 70%),
             linear-gradient(180deg, #353436, #222123);
  --smoke: rgba(255, 255, 255, .06);
  --smoke-tab: rgba(48, 47, 49, .94);
  --pop: #3a383a;
  --stroke: rgba(255, 255, 255, .11);
  --stroke-soft: rgba(255, 255, 255, .07);
  --text: #f4efe8; --ink: #f4efe8;
  --muted: rgba(244, 239, 232, .68); --ink-muted: rgba(244, 239, 232, .68); --faint: rgba(244, 239, 232, .48);
}
:root[data-style="unslop"] .bg-scene::after,
:root[data-style="unslop"] .crown-wm { display: none; }

/* menu lateral: linhas iguais, item ativo num degrau de superfície */
:root[data-style="unslop"] .sidebar nav { gap: 2px; }
:root[data-style="unslop"] .sidebar nav a { padding: 8px 10px; border-radius: 8px; font-weight: 400; font-size: 14px; border: 0; }
:root[data-style="unslop"] .sidebar nav a.active {
  background: rgba(255, 255, 255, .08); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
:root[data-style="unslop"] .logo-crown { filter: none; }
:root[data-style="unslop"] .logo-name { font-weight: 500; letter-spacing: 0; }
:root[data-style="unslop"] .logo-name span { background: none; color: var(--faint); }
:root[data-style="unslop"] .logo-sub { display: none; }
:root[data-style="unslop"] .badge { box-shadow: none; font-weight: 600; }
:root[data-style="unslop"] .live-dot.on { box-shadow: none; }

/* botões: cantos de controle, sem pulo no hover */
:root[data-style="unslop"] .btn { border-radius: 10px; font-weight: 500; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
  background: rgba(255, 255, 255, .07); border-color: var(--stroke); }
:root[data-style="unslop"] .btn:hover { transform: none; box-shadow: none; background: rgba(255, 255, 255, .12); }
:root[data-style="unslop"] .btn:active { transform: scale(.98); }
:root[data-style="unslop"] .btn-primary { background: var(--accent); border-color: transparent; color: var(--on-accent); }
:root[data-style="unslop"] .btn-primary:hover { background: #d6b896; }
:root[data-style="unslop"] .btn-ghost { background: transparent; }
:root[data-style="unslop"] .eye-btn { border-radius: 10px; }
:root[data-style="unslop"] .pill { letter-spacing: 0; font-weight: 500; box-shadow: none; }
:root[data-style="unslop"] select,
:root[data-style="unslop"] .dest-form input { border-radius: 10px; box-shadow: none; }

/* títulos e rótulos: frase normal, sem maiúsculas espaçadas */
:root[data-style="unslop"] .view-head h1 { font-weight: 500; letter-spacing: -.01em; font-size: 24px; }
:root[data-style="unslop"] .panel-head h2 { font-weight: 500; font-size: 14px; }
:root[data-style="unslop"] .card .label,
:root[data-style="unslop"] .hero-label,
:root[data-style="unslop"] .tbl th,
:root[data-style="unslop"] .ib-day,
:root[data-style="unslop"] .ib-info-col h3 { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 13px; }
:root[data-style="unslop"] .card:hover { transform: none; }
:root[data-style="unslop"] .card .value { font-weight: 500; letter-spacing: 0; font-size: 26px; }
:root[data-style="unslop"] .card.accent .value,
:root[data-style="unslop"] .card.green .value,
:root[data-style="unslop"] .card.red .value { text-shadow: none; }
:root[data-style="unslop"] .card .sub { color: var(--faint); font-size: 12px; }

/* receita: o número é o destaque, em serifa, sem degradê */
:root[data-style="unslop"] .hero { background: var(--smoke); }
:root[data-style="unslop"] .hero-value {
  font-family: var(--serif); font-weight: 400; letter-spacing: -.02em; font-size: 48px;
  background: none; color: var(--text);
}
:root[data-style="unslop"] .goal-bar { height: 6px; box-shadow: none; }
:root[data-style="unslop"] .goal-fill { box-shadow: none; }
:root[data-style="unslop"] .goal-head .num,
:root[data-style="unslop"] .num,
:root[data-style="unslop"] .tbl td.num { font-family: var(--num); font-size: 12.5px; }

/* celular: barra de baixo em ilha, aba ativa num degrau (sem degradê dourado) */
:root[data-style="unslop"] .tabbar {
  left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  border-radius: 24px; padding: 6px; gap: 4px; border-color: rgba(246, 239, 230, .12);
  box-shadow: 0 12px 32px rgba(10, 5, 2, .45), inset 0 1px 0 rgba(255, 255, 255, .08);
}
:root[data-style="unslop"] .tabbar a {
  flex: 1; justify-content: center; border-radius: 18px; padding: 7px 4px; min-height: 52px;
  font-weight: 500; font-size: 10.5px; color: var(--faint); text-shadow: none;
}
:root[data-style="unslop"] .tabbar a.active {
  color: var(--text); background: rgba(255, 255, 255, .10); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}
:root[data-style="unslop"] .tabbar a:active { transform: scale(.97); }

/* ---------- Visão geral no estilo Unslop ---------- */
.ovu, .nav-label { display: none; }
:root[data-style="unslop"] #view-overview > :not(.ovu) { display: none !important; }
:root[data-style="unslop"] .ovu { display: block; }
.ovu-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; margin: 8px 0 20px; }
.ovu-head h1 { font-size: 28px; font-weight: 400; letter-spacing: -.01em; color: var(--ink); }
.ovu-tools { display: flex; align-items: center; gap: 8px; }
.ovu-tools .hero-filters { margin: 0; flex-wrap: nowrap; }
.ovu-tools .hero-filters select { min-width: 170px; }
.ovu-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.ovu-stat { padding: 18px 20px; margin: 0; }
.ovu-stat .l { color: var(--muted); font-size: 13px; }
.ovu-stat .n { font-size: 28px; font-weight: 500; line-height: 1; margin: 12px 0 8px; font-variant-numeric: tabular-nums; }
.ovu-stat .c { color: var(--faint); font-size: 12px; }
.ovu-stat .c .up { color: var(--green); } .ovu-stat .c .down { color: var(--red); }
.ovu-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }
.ovu-row .panel { margin: 0; }
.ovu-rev-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.ovu-lbl { color: var(--muted); font-size: 13px; }
.ovu-rev-num { font-family: var(--serif, Georgia, serif); font-size: 44px; line-height: 1; letter-spacing: -.02em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.ovu-rev-sub { color: var(--faint); font-size: 13px; margin-top: 8px; }
.ovu-legend { display: flex; gap: 16px; color: var(--faint); font-size: 12px; white-space: nowrap; }
.ovu-legend b { font-weight: 400; }
.ovu-legend i { display: inline-block; width: 12px; height: 2px; vertical-align: middle; margin-right: 6px; background: var(--accent); }
.ovu-legend i.prev { background: var(--faint); opacity: .7; }
.ovu-fig { position: relative; height: 260px; }
.ovu-fig svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ovu-fig text { font: 400 11px var(--num, monospace); fill: var(--faint); }
.ovu-goal { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--stroke-soft); }
.ovu-goal-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.ovu-goal-head b { font: 400 12px var(--num, monospace); color: var(--text); }
.ovu-bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.ovu-bar > div { height: 100%; border-radius: 3px; background: var(--accent); }
.ovu-side h2, .ovu-feed h2 { font-size: 14px; font-weight: 500; display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.ovu-side h2 small { font: 400 12px var(--num, monospace); color: var(--faint); }
.ovu-side .ovu-h2b { margin-top: 24px; }
.ovu-line { display: grid; grid-template-columns: minmax(84px, 40%) minmax(40px, 1fr) auto; gap: 12px; align-items: center; min-height: 36px; }
.ovu-line .k { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#ovu-prov .ovu-line .k { text-transform: capitalize; }
.ovu-line .v { font: 400 13px var(--num, monospace); text-align: right; font-variant-numeric: tabular-nums; }
.ovu-line .b { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.ovu-line .b > div { height: 100%; border-radius: 2px; background: var(--faint); }
.ovu-line:first-of-type .b > div, .ovu-line.lead .b > div { background: var(--accent); }
.ovu-live { display: inline-flex; align-items: center; gap: 6px; font: 400 12px var(--num, monospace); color: var(--faint); }
.ovu-live::before { content: ""; width: 6px; height: 6px; border-radius: 3px; background: var(--green); }
/* o feed de sempre, arrumado em colunas: hora · ponto · o que aconteceu · valor */
.ovu-feed .feed { max-height: none; }
.ovu-feed .feed-item { padding: 0; min-height: 40px; border-radius: 0; gap: 12px; }
.ovu-feed .feed-item .t { order: -2; margin: 0; width: 64px; font: 400 12px var(--num, monospace); color: var(--faint); }
.ovu-feed .feed-item .dot { order: -1; }
.ovu-feed .feed-item .provider-tag { margin-left: auto; background: none; border: 0; color: var(--faint); padding: 0; font-weight: 400; }
.ovu-feed .feed-item b { font-weight: 500; color: var(--text); }

/* menu em grupos (só no Unslop) */
:root[data-style="unslop"] .sidebar nav .nav-label { display: block; color: var(--faint); font-size: 12px; padding: 0 10px; margin: 20px 0 6px; }
:root[data-style="unslop"] .sidebar nav .nl-vendas { order: 0; margin-top: 0; }
:root[data-style="unslop"] .sidebar nav a[data-view="overview"] { order: 1; }
:root[data-style="unslop"] .sidebar nav a[data-view="events"] { order: 2; }
:root[data-style="unslop"] .sidebar nav a[data-view="tracking"] { order: 3; }
:root[data-style="unslop"] .sidebar nav a[data-view="recovery"] { order: 4; }
:root[data-style="unslop"] .sidebar nav a[data-view="retention"] { order: 5; }
:root[data-style="unslop"] .sidebar nav .nl-atend { order: 10; }
:root[data-style="unslop"] .sidebar nav a[data-view="inbox"] { order: 11; }
:root[data-style="unslop"] .sidebar nav a[data-view="agent"] { order: 12; }
:root[data-style="unslop"] .sidebar nav a[data-view="support"] { order: 13; }
:root[data-style="unslop"] .sidebar nav a[data-view="whatsapp"] { order: 14; }
:root[data-style="unslop"] .sidebar nav .nl-sist { order: 20; }
:root[data-style="unslop"] .sidebar nav a[data-view="notifications"] { order: 21; }
:root[data-style="unslop"] .sidebar nav a[data-view="monitor"] { order: 22; }
:root[data-style="unslop"] .sidebar nav a[data-view="logs"] { order: 23; }
:root[data-style="unslop"] .sidebar nav a[data-view="integrations"] { order: 24; }
:root[data-style="unslop"] .sidebar nav a[data-view="profile"] { order: 25; }
:root[data-style="unslop"] .sidebar { padding-top: 18px; }
:root[data-style="unslop"] .logo { flex-direction: row; justify-content: flex-start; gap: 10px; padding: 0 10px 22px; }
:root[data-style="unslop"] .logo-crown { width: 24px; margin: 0; }
/* ícones de linha no lugar dos símbolos */
:root[data-style="unslop"] .sidebar nav .ico {
  width: 16px; height: 16px; font-size: 0; opacity: 1; background: currentColor; flex: none;
  -webkit-mask: var(--i) center / 16px 16px no-repeat; mask: var(--i) center / 16px 16px no-repeat;
}

@media (max-width: 1100px) {
  .ovu-row { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .ovu-head { flex-direction: column; align-items: stretch; gap: 12px; margin: 6px 0 14px; }
  .ovu-head h1 { font-size: 22px; }
  .ovu-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .ovu-tools .hero-filters { flex-wrap: nowrap; }
  .ovu-tools .hero-filters select { min-width: 0; }
  .ovu-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
  .ovu-stat { padding: 14px 16px; }
  .ovu-stat .n { font-size: 24px; margin: 8px 0 4px; }
  .ovu-row { gap: 8px; margin-bottom: 8px; }
  .ovu-rev-head { flex-direction: column; }
  .ovu-rev-num { font-size: 36px; }
  .ovu-fig { height: 190px; }
  .ovu-goal-head { flex-direction: column; gap: 4px; }
  .ovu-feed .feed-item .provider-tag { display: none; }
  .ovu-feed .feed-item .desc { font-size: 13px; }
}

:root[data-style="unslop"] .sidebar nav a[data-view="overview"] .ico { --i: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.6%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%203v18h18%22/%3E%3Cpath%20d%3D%22m7%2015%204-4%203%203%205-6%22/%3E%3C/svg%3E"); }
:root[data-style="unslop"] .sidebar nav a[data-view="events"] .ico { --i: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.6%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M6%202h12v20l-3-2-3%202-3-2-3%202Z%22/%3E%3Cpath%20d%3D%22M9%207h6M9%2011h6%22/%3E%3C/svg%3E"); }
:root[data-style="unslop"] .sidebar nav a[data-view="tracking"] .ico { --i: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.6%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%228%22/%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%223%22/%3E%3C/svg%3E"); }
:root[data-style="unslop"] .sidebar nav a[data-view="recovery"] .ico { --i: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.6%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%2012a9%209%200%201%200%203-6.7L3%208%22/%3E%3Cpath%20d%3D%22M3%203v5h5%22/%3E%3C/svg%3E"); }
:root[data-style="unslop"] .sidebar nav a[data-view="retention"] .ico { --i: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.6%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M17%202l4%204-4%204%22/%3E%3Cpath%20d%3D%22M3%2011V9a3%203%200%200%201%203-3h15%22/%3E%3Cpath%20d%3D%22M7%2022l-4-4%204-4%22/%3E%3Cpath%20d%3D%22M21%2013v2a3%203%200%200%201-3%203H3%22/%3E%3C/svg%3E"); }
:root[data-style="unslop"] .sidebar nav a[data-view="inbox"] .ico { --i: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.6%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M21%2012a8%208%200%200%201-11.6%207.1L4%2020l1-4.6A8%208%200%201%201%2021%2012Z%22/%3E%3C/svg%3E"); }
:root[data-style="unslop"] .sidebar nav a[data-view="agent"] .ico { --i: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.6%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%225%22%20y%3D%228%22%20width%3D%2214%22%20height%3D%2211%22%20rx%3D%223%22/%3E%3Cpath%20d%3D%22M12%204v4M9%2013h.01M15%2013h.01%22/%3E%3C/svg%3E"); }
:root[data-style="unslop"] .sidebar nav a[data-view="support"] .ico { --i: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.6%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M4%206h16M4%2012h10M4%2018h7%22/%3E%3C/svg%3E"); }
:root[data-style="unslop"] .sidebar nav a[data-view="whatsapp"] .ico { --i: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.6%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M5%2019l1.2-3.6A8%208%200%201%201%209%2018.5Z%22/%3E%3C/svg%3E"); }
:root[data-style="unslop"] .sidebar nav a[data-view="notifications"] .ico { --i: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.6%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M6%208a6%206%200%200%201%2012%200c0%207%203%209%203%209H3s3-2%203-9%22/%3E%3Cpath%20d%3D%22M10%2021h4%22/%3E%3C/svg%3E"); }
:root[data-style="unslop"] .sidebar nav a[data-view="monitor"] .ico { --i: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.6%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%2012h4l3-8%204%2016%203-8h4%22/%3E%3C/svg%3E"); }
:root[data-style="unslop"] .sidebar nav a[data-view="logs"] .ico { --i: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.6%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M8%206h13M8%2012h13M8%2018h13M3%206h.01M3%2012h.01M3%2018h.01%22/%3E%3C/svg%3E"); }
:root[data-style="unslop"] .sidebar nav a[data-view="integrations"] .ico { --i: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.6%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M9%207%204%2012l5%205M15%207l5%205-5%205%22/%3E%3C/svg%3E"); }
:root[data-style="unslop"] .sidebar nav a[data-view="profile"] .ico { --i: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.6%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%228%22%20r%3D%224%22/%3E%3Cpath%20d%3D%22M4%2021a8%208%200%200%201%2016%200%22/%3E%3C/svg%3E"); }

/* Perfil → Aparência: duas chaves liga/desliga com a bolinha da cor */
.ap-tgs { display: flex; gap: 24px; padding: 4px 4px 2px; }
.ap-tg { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.ap-tg .theme-sw { width: 14px; height: 14px; }
.ap-tg .theme-sw.unslop { box-shadow: none; border: 0; background: #c9a882; }

/* ---------- Unslop no celular: as outras abas no mesmo ritmo da Visão geral ---------- */
@media (max-width: 760px) {
  :root[data-style="unslop"] .view-head { margin: 6px 2px 14px; }
  :root[data-style="unslop"] .view-head h1 { font-size: 22px; font-weight: 400; }
  :root[data-style="unslop"] .view-head p { display: none; }                 /* o título já diz onde está */
  :root[data-style="unslop"] .cards:not(#sup-cards) {
    grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px;
  }
  :root[data-style="unslop"] .cards:not(#sup-cards) .card { padding: 14px 16px; border-radius: 14px; }
  :root[data-style="unslop"] .cards:not(#sup-cards) .card .label { font-size: 12.5px; line-height: 1.3; }
  :root[data-style="unslop"] .cards:not(#sup-cards) .card .value { font-size: 22px; margin-top: 8px; line-height: 1.1; white-space: nowrap; }
  :root[data-style="unslop"] .cards:not(#sup-cards) .card .sub {
    font-size: 11.5px; line-height: 1.35; margin-top: 4px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  :root[data-style="unslop"] .panel { padding: 16px; border-radius: 14px; margin-bottom: 8px; }
  :root[data-style="unslop"] .panel-head { margin-bottom: 10px; }
  :root[data-style="unslop"] .hint { font-size: 12.5px; }
  :root[data-style="unslop"] .row { padding: 10px 2px; }
}

/* fases da retenção em tons de terra no Unslop (a cor de cada fase vem de uma variável) */
:root[data-style="unslop"] {
  --st-onboarding: #a9b4bd; --st-ativacao: #b7a7b0; --st-recorrente: #9cb38c; --st-renovacao: #d4b26a;
  --st-em_atraso: #d29a6a; --st-vencida: #c97a68; --st-cancelada: #7d746e; --st-vitalicia: #c9a882; --st-sem_pagamento: #57504c;
}

/* filtro de produto (menu próprio) */
.hero-filters .prod-picker { flex: 1; min-width: 130px; }
.prod-pop { max-height: min(60vh, 360px); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.prod-pop .date-opt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-pop .date-opt.on { color: var(--accent); background: rgba(255, 255, 255, .06); }
#prod-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:root[data-style="unslop"] .date-btn { border-radius: 10px; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none;
  background: rgba(255, 255, 255, .07); border-color: var(--stroke); }
:root[data-style="unslop"] .date-pop { border-radius: 14px; box-shadow: 0 16px 40px rgba(0, 0, 0, .35); }
:root[data-style="unslop"] .date-opt { border-radius: 8px; }
:root[data-style="unslop"][data-theme="grafite"] .date-pop { background: #262421; }
.ovu-tools .hero-filters .prod-picker { min-width: 190px; }
@media (max-width: 760px) { .ovu-tools .hero-filters .prod-picker { min-width: 0; } }

/* gráfico da Visão geral (Unslop): etiqueta ao passar o mouse ou tocar */
.ovu-fig svg { cursor: crosshair; touch-action: pan-y; }
.ovu-tip {
  position: absolute; z-index: 2; pointer-events: none; min-width: 150px;
  padding: 8px 10px; border-radius: 10px; font-size: 12px; line-height: 1.5;
  background: var(--pop); color: var(--text); border: 1px solid var(--stroke);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
  opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s, left .08s linear, top .08s linear;
}
.ovu-tip.on { opacity: 1; transform: none; }
.ovu-tip b { display: block; font-weight: 500; margin-bottom: 2px; font-family: var(--num, monospace); font-size: 11.5px; color: var(--muted); }
.ovu-tip span { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.ovu-tip i { width: 10px; height: 2px; background: var(--accent); flex: none; }
.ovu-tip i.prev { background: var(--faint); }
.ovu-tip em { font-style: normal; margin-left: auto; padding-left: 10px; font-family: var(--num, monospace); }
.ovu-tip small { display: block; margin-top: 2px; color: var(--faint); font-size: 11px; }
@media (prefers-reduced-motion: reduce) { .ovu-tip { transition: none; } }

/* filtro por provedor: as linhas de "Por provedor" são clicáveis */
.prov-row { cursor: pointer; border-radius: 8px; transition: opacity .15s, background .15s; }
.prov-row:hover { background: rgba(255, 255, 255, .04); }
.prov-row.dim { opacity: .45; }
.prov-row.dim:hover { opacity: .8; }
#ovu-prov.has-sel .ovu-line .b > div { background: var(--faint); }
#ovu-prov.has-sel .ovu-line.sel .b > div { background: var(--accent); }
.prov-row.sel .k { color: var(--text); }
.prov-clear { cursor: pointer; color: var(--accent); text-decoration: none; margin-left: 2px; }
.prov-clear:hover { text-decoration: underline; }

/* bloqueio de seleção (ver o script no <head> do index.html) */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, select, [contenteditable], .ib-b, .code-sample, pre, code, .selectable {
  -webkit-user-select: text; user-select: text; -webkit-touch-callout: default;
}
img { -webkit-user-drag: none; user-drag: none; }
