/*
 * Painel Ads — visual no padrão do iPhone (HIG): listas inset, large title,
 * segmented control e tab bar. Escuro por padrão (html[data-theme=dark]); a
 * camada "Liquid Glass" no fim do arquivo deixa superfícies translúcidas e bem
 * arredondadas, com fallback sólido. No desktop (≥1024px) a tab bar vira sidebar.
 */
@font-face { font-family: "Barlow"; src: url("/barlow-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/barlow-600.woff2") format("woff2"); font-weight: 600 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("/barlow-condensed-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face {
  font-family: "Inter";
  src: url("/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f2f2f7;
  --bg2: #ffffff;
  --bg3: #f2f2f7;
  --label: #000000;
  --label2: rgba(60, 60, 67, .6);
  --label3: rgba(60, 60, 67, .3);
  --sep: rgba(60, 60, 67, .29);
  --fill: rgba(118, 118, 128, .12);
  --fill2: rgba(118, 118, 128, .2);
  --blue: #007aff;
  --green: #34c759;
  --red: #ff3b30;
  --orange: #ff9500;
  --yellow: #ffcc00;
  --teal: #30b0c7;
  --indigo: #5856d6;
  --purple: #af52de;
  --pink: #ff2d55;
  --gray: #8e8e93;
  /* texto colorido sobre fundo claro precisa de mais contraste que o tom do sistema */
  --green-ink: #1f8a3b;
  --red-ink: #d70015;
  --orange-ink: #b25000;
  --blue-ink: #0062cc;
  --green-bg: rgba(52, 199, 89, .15);
  --red-bg: rgba(255, 59, 48, .12);
  --orange-bg: rgba(255, 149, 0, .16);
  --blue-bg: rgba(0, 122, 255, .12);
  --gray-bg: rgba(118, 118, 128, .14);
  --bar: rgba(249, 249, 249, .8);
  --thumb: #ffffff;
  --backdrop: rgba(0, 0, 0, .32);
  --r-card: 14px;
  --gap: 16px;
  --side: 16px;
  --tabbar-h: 49px;
  --side-w: 272px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  color: var(--label);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}
html[data-theme=dark] {
  --bg: #000000;
  --bg2: #1c1c1e;
  --bg3: #2c2c2e;
  --label: #ffffff;
  --label2: rgba(235, 235, 245, .6);
  --label3: rgba(235, 235, 245, .3);
  --sep: rgba(84, 84, 88, .65);
  --fill: rgba(118, 118, 128, .24);
  --fill2: rgba(118, 118, 128, .36);
  --blue: #0a84ff;
  --green: #30d158;
  --red: #ff453a;
  --orange: #ff9f0a;
  --yellow: #ffd60a;
  --teal: #40c8e0;
  --indigo: #5e5ce6;
  --purple: #bf5af2;
  --pink: #ff375f;
  --green-ink: #30d158;
  --red-ink: #ff453a;
  --orange-ink: #ff9f0a;
  --blue-ink: #0a84ff;
  --green-bg: rgba(48, 209, 88, .18);
  --red-bg: rgba(255, 69, 58, .18);
  --orange-bg: rgba(255, 159, 10, .2);
  --blue-bg: rgba(10, 132, 255, .2);
  --gray-bg: rgba(118, 118, 128, .26);
  --bar: rgba(22, 22, 24, .8);
  --thumb: #636366;
  --backdrop: rgba(0, 0, 0, .55);
  color-scheme: dark;
}
@media (min-width: 428px) { :root { --side: 20px; } }

* { box-sizing: border-box; }
html { height: 100%; }
body { margin: 0; min-height: 100%; font-size: 17px; line-height: 22px; letter-spacing: -.43px; overscroll-behavior-y: none; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; -webkit-appearance: none; appearance: none; text-align: inherit; }
a { color: var(--blue); text-decoration: none; }
code, pre { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0; }
code { font-size: .88em; background: var(--fill); padding: 1px 5px; border-radius: 5px; }
svg { flex: none; }
[hidden], .hidden { display: none !important; }
.num, .v, .hero, .kpi b { font-variant-numeric: tabular-nums; }
.up { color: var(--green-ink); }
.down { color: var(--red-ink); }
.warn { color: var(--orange-ink); }
.muted { color: var(--label2); }
.blue { color: var(--blue); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic.fill { fill: currentColor; stroke: none; }

.boot { min-height: 100vh; display: grid; place-items: center; color: var(--label2); font-size: 15px; }

/* ------------------------------------------------------------ estrutura */

.app { min-height: 100vh; min-height: 100dvh; padding-bottom: calc(var(--tabbar-h) + var(--sab) + 24px); }
.side-nav { display: none; }

.nav {
  position: sticky; top: 0; z-index: 30;
  padding-top: var(--sat);
  background: transparent;
  transition: background-color .2s;
}
.nav::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; border-bottom: .5px solid var(--sep); opacity: 0; transition: opacity .2s; }
.nav.scrolled { background: var(--bar); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); }
.nav.scrolled::after { opacity: 1; }
.nav-in { height: 44px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 0 var(--side); max-width: var(--page-w, none); margin: 0 auto; }
.nav-title { font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s; }
.nav.scrolled .nav-title { opacity: 1; transform: none; }
.nav-l { display: flex; align-items: center; min-width: 0; }
.nav-r { display: flex; align-items: center; justify-content: flex-end; gap: 18px; min-width: 0; }
.nav-btn { color: var(--blue); font-size: 17px; min-height: 44px; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; transition: opacity .12s; }
.nav-btn:active { opacity: .4; }
.nav-btn .ic { width: 22px; height: 22px; }
.nav-btn.back { margin-left: -8px; gap: 1px; max-width: 42vw; }
.nav-btn.back span { overflow: hidden; text-overflow: ellipsis; }
.nav-btn.back .ic { width: 26px; height: 26px; stroke-width: 2.4; margin-right: -3px; }
.nav-btn.busy .ic { animation: spin 1s linear infinite; }
.fresh { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; letter-spacing: -.08px; color: var(--label2); min-height: 44px; white-space: nowrap; }
.fresh i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.fresh.err i { background: var(--red); }
.fresh.off i { background: var(--label3); }
.fresh.run i { background: var(--orange); animation: pulse 1s ease-in-out infinite; }

.page { max-width: var(--page-w, none); margin: 0 auto; }
.page.push { animation: push .32s cubic-bezier(.2, .8, .2, 1); }
.page.pop { animation: pop .32s cubic-bezier(.2, .8, .2, 1); }
.page.fade { animation: fade .2s ease-out; }
@keyframes push { from { opacity: 0; transform: translateX(28px); } }
@keyframes pop { from { opacity: 0; transform: translateX(-28px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .35; } }

.large { font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: .37px; padding: 3px var(--side) 8px; overflow-wrap: anywhere; }
.large.t1 { font-size: 28px; line-height: 34px; letter-spacing: .36px; }
.sub { font-size: 15px; line-height: 20px; letter-spacing: -.23px; color: var(--label2); padding: 0 var(--side) 14px; margin-top: -4px; }
.crumb { font-size: 13px; line-height: 18px; letter-spacing: -.08px; color: var(--label2); padding: 0 var(--side) 12px; margin-top: -4px; }
.crumb b { color: var(--label); font-weight: 600; }

#body { transition: opacity .15s; min-height: 40vh; }
#body.loading { opacity: .5; }

/* tab bar (celular) */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; padding: 0 2px var(--sab);
  background: var(--bar); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  border-top: .5px solid var(--sep);
}
.tabbar a { flex: 1; height: var(--tabbar-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--gray); font-size: 10px; line-height: 12px; font-weight: 500; letter-spacing: .1px; }
.tabbar a svg { width: 26px; height: 26px; }
.tabbar a.on { color: var(--blue); }
.tabbar a:active { opacity: .6; }

/* ------------------------------------------------------------ segmented control e chips */

.seg { position: relative; display: flex; margin: 0 var(--side) var(--gap); padding: 2px; background: var(--fill); border-radius: 9px; }
.seg button { flex: 1; position: relative; z-index: 1; min-height: 28px; padding: 5px 4px; text-align: center; font-size: 13px; line-height: 18px; letter-spacing: -.08px; font-weight: 500; border-radius: 7px; white-space: nowrap; }
.seg button.on { font-weight: 600; }
.seg-thumb {
  position: absolute; top: 2px; bottom: 2px; left: 2px;
  width: calc((100% - 4px) / var(--n));
  transform: translateX(calc(var(--i) * 100%));
  background: var(--thumb); border-radius: 7px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}
.seg.none .seg-thumb { opacity: 0; }

.chips { display: flex; gap: 8px; padding: 0 var(--side) 14px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 6px 13px; border-radius: 999px; background: var(--bg2); font-size: 15px; line-height: 20px; letter-spacing: -.23px; white-space: nowrap; color: var(--label); transition: transform .12s ease-out; }
.chip:active { transform: scale(.97); }
.chip.on { background: var(--label); color: var(--bg2); font-weight: 500; }
.chip.filter { background: var(--blue-bg); color: var(--blue-ink); font-weight: 500; padding-right: 9px; }
.chip.filter .ic { width: 15px; height: 15px; stroke-width: 2.6; opacity: .7; }
.chip small { font-size: 13px; opacity: .6; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); }

.search { display: flex; align-items: center; gap: 6px; height: 36px; margin: 0 var(--side) 12px; padding: 0 8px; background: var(--fill); border-radius: 10px; color: var(--label2); }
.search .ic { width: 18px; height: 18px; }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; color: var(--label); }
.search input::placeholder { color: var(--label2); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* ------------------------------------------------------------ cards, listas e linhas */

.card { background: var(--bg2); border-radius: var(--r-card); margin: 0 var(--side) var(--gap); padding: 16px; }
.hdr { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13px; line-height: 18px; letter-spacing: -.08px; color: var(--label2); text-transform: uppercase; padding: 0 calc(var(--side) + 16px) 7px; }
.hdr span:last-child:not(:first-child), .hdr a { text-transform: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.foot { font-size: 13px; line-height: 18px; letter-spacing: -.08px; color: var(--label2); margin: -14px calc(var(--side) + 16px) 22px; }
.list { background: var(--bg2); border-radius: var(--r-card); margin: 0 var(--side) 22px; overflow: hidden; }
.row { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 11px 16px; color: var(--label); }
.row + .row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--sep); }
.list.icons > .row + .row::before { left: 58px; }
a.row, button.row, label.row.tap { transition: background-color .15s; cursor: pointer; }
a.row:active, button.row:active, label.row.tap:active { background: var(--fill); }
.row .t { flex: 1; min-width: 0; }
.row button.t { align-self: stretch; text-align: left; }
.row .t b { display: block; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .t.wrap b { white-space: normal; }
.row .t small { display: block; font-size: 13px; line-height: 18px; letter-spacing: -.08px; color: var(--label2); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .t.wrap small, .row .t small.wrap { white-space: normal; }
.row .v { color: var(--label2); text-align: right; white-space: nowrap; flex: none; max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
.row .v.strong { color: var(--label); font-weight: 600; }
.row .v.up { color: var(--green-ink); }
.row .v.down { color: var(--red-ink); }
.row .end { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.row .end .v { max-width: none; }
.row .chev { width: 8px; height: 14px; color: var(--label3); margin-left: -2px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.row.action { justify-content: center; color: var(--blue); }
.row.action.danger { color: var(--red); }
.row.action:disabled { color: var(--label3); }
.row .check { width: 18px; height: 18px; color: var(--blue); stroke-width: 2.6; }
.row.hi { animation: hi 2.4s ease-out; }
@keyframes hi { 0%, 40% { background: var(--blue-bg); } }
.ico { flex: none; width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; color: #fff; background: var(--gray); }
.ico .ic { width: 18px; height: 18px; stroke-width: 2.2; }
.dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--label3); }
.dot.on { background: var(--green); }
.dot.bad { background: var(--red); }
.dot.wait { background: var(--orange); }

.pill { display: inline-block; font-size: 12px; line-height: 16px; letter-spacing: 0; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; background: var(--gray-bg); color: var(--label2); }
.pill.g { background: var(--green-bg); color: var(--green-ink); }
.pill.r { background: var(--red-bg); color: var(--red-ink); }
.pill.o { background: var(--orange-bg); color: var(--orange-ink); }
.pill.b { background: var(--blue-bg); color: var(--blue-ink); }

/* números */
.k { font-size: 13px; line-height: 18px; letter-spacing: -.08px; font-weight: 500; color: var(--label2); }
.hero { font-size: 40px; line-height: 44px; font-weight: 700; letter-spacing: -.5px; margin-top: 2px; white-space: nowrap; }
.delta { font-size: 15px; line-height: 20px; letter-spacing: -.23px; font-weight: 600; margin-top: 2px; }
.delta span { font-weight: 400; color: var(--label2); }
.delta b { font-weight: 600; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 var(--side) var(--gap); }
.kpi { background: var(--bg2); border-radius: var(--r-card); padding: 12px 14px; min-width: 0; }
.kpi b { display: block; font-size: 22px; line-height: 28px; letter-spacing: -.26px; font-weight: 700; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi b + .k { margin-top: 1px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .k.up, .kpi .k.down { font-weight: 600; }
.k.up { color: var(--green-ink); }
.k.down { color: var(--red-ink); }
.kpis.three { grid-template-columns: repeat(3, 1fr); }
.kpis.three .kpi b { font-size: 20px; }

.legend { display: flex; align-items: center; gap: 14px; font-size: 12px; line-height: 16px; letter-spacing: 0; color: var(--label2); margin-top: 8px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.legend .r { margin-left: auto; }
.chart-wrap { position: relative; height: 120px; margin-top: 14px; touch-action: pan-y; cursor: crosshair; }
.chart-wrap svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.cdot { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; box-shadow: 0 0 0 3px var(--bg2); pointer-events: none; }
.scrub { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--label2); pointer-events: none; }

/* Campanhas: KPIs extras, gráfico diário, funil do escopo e métricas de entrega em cada linha */
.camp-kpis .kpi { padding: 10px 12px; }
.camp-kpis .kpi b { font-size: 17px; line-height: 22px; }
.chart-wrap.tall { height: 150px; }
#cchart-legend { flex-wrap: wrap; gap: 4px 12px; }
/* funil de conversão horizontal (funnel.js), medido na referência da UTMify: card azul-noite,
   título condensado, rótulos no topo das colunas, divisórias finas e área em gradiente */
.card.fx { display: flex; flex-direction: column; min-height: 420px; padding: 30px 27px 24px; background: #0d1430; border: 1px solid #1d2549; border-radius: 28px; box-shadow: 0 18px 40px rgba(0, 0, 0, .35); -webkit-backdrop-filter: none; backdrop-filter: none; color: #eef0fd; }
.fx-title { margin: 0; font: 700 33px/1.05 "Barlow Condensed", "Arial Narrow", sans-serif; letter-spacing: .2px; text-transform: uppercase; color: #eef0fd; }
.fx-sub { margin: 8px 0 0; font: 400 18px/1.3 "Barlow", system-ui, sans-serif; color: #9299c5; }
.fx-sub { margin-bottom: 28px; }
.fx-plot { position: relative; flex: 1 1 250px; min-height: 230px; max-height: 262px; margin: auto 0; }
.fx-svg { position: absolute; inset: 0; display: block; overflow: visible; }
.fx-lbl { fill: #8a91b8; font-family: "Barlow", system-ui, sans-serif; font-weight: 400; text-anchor: middle; dominant-baseline: central; }
.fx-val { fill: #ffffff; font-family: "Barlow", system-ui, sans-serif; font-weight: 600; text-anchor: middle; dominant-baseline: central; font-variant-numeric: tabular-nums; pointer-events: none; }
.fx-div { stroke: rgba(160, 170, 220, .16); stroke-width: 1; }
.fx-hi { fill: rgba(255, 255, 255, .045); opacity: 0; transition: opacity .15s, x .15s; }
.fx-hi.on { opacity: 1; }
.fx-hit { fill: transparent; cursor: pointer; }
.fx-tip { position: absolute; z-index: 2; display: grid; gap: 2px; min-width: 150px; padding: 10px 12px; border-radius: 14px; font: 400 13px/17px "Barlow", system-ui, sans-serif; color: #eef0fd; background: rgba(18, 26, 60, .92); border: 1px solid #2a3466; box-shadow: 0 12px 30px rgba(0, 0, 0, .45); pointer-events: none; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.fx-tip b { font-weight: 600; }
.fx-tip .num:not(small) { font-size: 18px; font-weight: 600; }
.fx-tip small { font-size: 12px; color: #9299c5; }
.fx-empty { margin: auto 0; padding: 40px 0; text-align: center; font: 400 16px/1.4 "Barlow", system-ui, sans-serif; color: #9299c5; }
.fx-foot { margin: 14px 0 0; font: 400 12px/16px "Barlow", system-ui, sans-serif; color: #6c7399; }
/* lista em texto: leitor de tela sempre; na tela só se o SVG não desenhar */
.fx-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 8px; font: 400 15px/1.3 "Barlow", system-ui, sans-serif; }
.fx-list b { font-weight: 600; }
.fx-list small { color: #9299c5; }
.fx.fx-on .fx-list { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 599px) {
  .card.fx { min-height: 0; padding: 22px 18px 18px; border-radius: 24px; }
  .fx-title { font-size: 25px; }
  .fx-sub { font-size: 15px; margin-top: 4px; }
  .fx-sub { margin-bottom: 18px; }
  .fx-plot { flex-basis: 230px; min-height: 230px; max-height: 230px; }
}
.row.camp { flex-wrap: wrap; row-gap: 8px; }
.mgrid { order: 9; flex: 1 0 100%; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-left: 21px; padding: 7px 0 1px; border-top: .5px solid var(--sep); }
.mgrid span { min-width: 0; }
.mgrid small { display: block; font-size: 11px; line-height: 13px; color: var(--label2); }
.mgrid b { display: block; font-size: 13px; line-height: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mgrid b.up { color: var(--green-ink); }
.mgrid b.down { color: var(--red-ink); }

/* barra de proporção (trilho + preenchimento) */
.meter { height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; margin-top: 8px; }
.meter i { display: block; height: 100%; border-radius: 3px; background: var(--blue); min-width: 2px; }
.meter.g i { background: var(--green); }
.meter.r i { background: var(--red); }
.split-bar { display: flex; height: 28px; border-radius: 7px; overflow: hidden; gap: 2px; font-size: 12px; font-weight: 600; letter-spacing: 0; color: #fff; }
.split-bar span { display: flex; align-items: center; padding: 0 8px; min-width: 0; white-space: nowrap; overflow: hidden; }

/* ------------------------------------------------------------ funil */

.fstats { display: grid; grid-template-columns: repeat(3, 1fr); margin: -2px 0 16px; }
.fstats > div { padding: 0 10px; min-width: 0; }
.fstats > div:first-child { padding-left: 0; }
.fstats > div + div { border-left: .5px solid var(--sep); }
.fstats .k { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fstats b { display: block; font-size: 22px; line-height: 28px; letter-spacing: -.26px; font-weight: 700; margin-top: 1px; white-space: nowrap; }
.fworst { background: var(--red-bg); border-radius: 10px; padding: 10px 12px; margin-bottom: 18px; }
.fworst b { display: block; font-size: 15px; line-height: 20px; letter-spacing: -.23px; font-weight: 600; color: var(--red-ink); }
.fworst span { display: block; font-size: 13px; line-height: 18px; letter-spacing: -.08px; color: var(--label2); }
.fcmp { display: grid; grid-template-columns: minmax(0, 2.2fr) repeat(var(--n), minmax(0, 1fr)); gap: 9px 14px; font-size: 13px; line-height: 18px; letter-spacing: -.08px; }
.fcmp .fc-step { color: var(--label2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fcmp .top { font-weight: 700; }
.fcmp .fc-head { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* aba Funil: números e maior queda dentro do card escuro do funil, e um funil por segmento */
.fx .fstats { margin: 0 0 14px; }
.fx .fstats .k { color: #9299c5; font: 400 13px/18px "Barlow", system-ui, sans-serif; }
.fx .fstats b { color: #eef0fd; font-family: "Barlow", system-ui, sans-serif; font-weight: 600; }
.fx .fstats > div + div { border-left-color: #1d2549; }
.fx .fworst { background: rgba(236, 59, 131, .12); border: 1px solid rgba(236, 59, 131, .28); border-radius: 14px; margin-bottom: 8px; font-family: "Barlow", system-ui, sans-serif; }
.fx .fworst b { color: #ff8db5; }
.fx .fworst span { color: #9299c5; }
.card.fx + .card.fx { margin-top: 16px; }
.fx-segs { display: grid; gap: 12px; }
.card.fx.fx-sm { min-height: 0; padding: 20px 20px 16px; border-radius: 24px; }
.fx-sm .fx-title { font-size: 24px; }
.fx-sm .fx-sub { font-size: 15px; margin-bottom: 12px; }
.fx-sm .fx-plot { flex-basis: 190px; min-height: 190px; max-height: 190px; }

/* ------------------------------------------------------------ mapas de calor */

.hstrip { display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: hidden; margin: 6px 0 5px; }
.hstrip i { flex: 1; min-width: 3px; }
.zmap { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); column-gap: 12px; row-gap: 2px; }
.zone { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px; font-size: 13px; line-height: 18px; letter-spacing: -.08px; min-width: 0; }
.zone:first-child { border-radius: 10px 10px 0 0; }
.zone:nth-last-child(2) { border-radius: 0 0 10px 10px; }
.zone b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zone span { font-weight: 600; }
.znote { align-self: center; font-size: 12px; line-height: 16px; letter-spacing: 0; color: var(--label2); }
.znote.down { color: var(--red-ink); font-weight: 600; }
.znote.blue { color: var(--blue-ink); font-weight: 600; }
.zscale { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 12px; line-height: 16px; letter-spacing: 0; color: var(--label2); }
.zscale i { flex: 1; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #5856d6, #30b0c7, #ffcc00, #ff9500, #ff3b30); }
.hrow { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.hrow + .hrow { margin-top: 12px; }
.hrow > div { min-width: 0; }
.hrow b { display: block; font-weight: 400; }
.hrow small { display: block; font-size: 13px; line-height: 18px; letter-spacing: -.08px; color: var(--label2); margin-top: 1px; }
.htile { flex: none; width: 56px; height: 44px; border-radius: 10px; display: grid; place-items: center; font-size: 15px; letter-spacing: -.23px; font-weight: 700; }
.mrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.mrow > div { min-width: 0; }
.mrow b { font-weight: 600; font-size: 15px; line-height: 20px; letter-spacing: -.23px; }
.mrow > div b { display: block; font-weight: 400; }
.mrow small { display: block; font-size: 13px; line-height: 18px; letter-spacing: -.08px; color: var(--label2); margin-top: 1px; }

/* ------------------------------------------------------------ formulários no estilo Ajustes */

.row.field { padding-top: 0; padding-bottom: 0; }
.row.field .t { flex: 0 1 auto; padding: 11px 0; }
.row.field .in { flex: 1; min-width: 60px; width: 100%; min-height: 44px; border: 0; background: none; outline: none; text-align: right; color: var(--label); padding: 0; border-radius: 0; }
.row.field .in::placeholder { color: var(--label3); }
.row.field select.in { -webkit-appearance: none; appearance: none; color: var(--label2); padding-right: 18px; text-align-last: right; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='14' viewBox='0 0 10 14' fill='none' stroke='%238e8e93' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1.5 5 5 1.5 8.5 5M1.5 9 5 12.5 8.5 9'/%3E%3C/svg%3E") right center / 10px 14px no-repeat; }
.row.field.stack { flex-direction: column; align-items: stretch; gap: 0; padding-top: 9px; padding-bottom: 4px; }
.row.field.stack .t { padding: 0; }
.row.field.stack .t b { font-size: 13px; line-height: 18px; letter-spacing: -.08px; color: var(--label2); }
.row.field.stack .in { text-align: left; min-height: 36px; }
.row .unit { color: var(--label2); flex: none; }
.row .mini { width: 76px; flex: none; min-height: 32px; padding: 4px 8px; border: 0; border-radius: 8px; background: var(--fill); text-align: right; outline: none; color: var(--label); }
.row .mini:focus { box-shadow: 0 0 0 2px var(--blue); }
.row .mini.time { width: 96px; text-align: center; }

.sw { -webkit-appearance: none; appearance: none; flex: none; position: relative; width: 51px; height: 31px; border-radius: 16px; background: var(--fill2); margin: 0; cursor: pointer; transition: background-color .22s; }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .06); transition: transform .22s cubic-bezier(.2, .8, .2, 1); }
.sw:checked { background: var(--green); }
.sw:checked::after { transform: translateX(20px); }
.sw:disabled { opacity: .5; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px; padding: 12px 16px; border-radius: 12px; background: var(--blue); color: #fff; font-weight: 600; text-align: center; transition: transform .12s ease-out, opacity .12s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; }
.btn.tint { background: var(--blue-bg); color: var(--blue-ink); }
.btn.danger { background: var(--red-bg); color: var(--red-ink); }
.btn.gray { background: var(--fill); color: var(--label); }
.btn.sm { width: auto; min-height: 34px; padding: 6px 14px; border-radius: 999px; font-size: 15px; letter-spacing: -.23px; }
.btns { display: flex; flex-direction: column; gap: 10px; margin: 0 var(--side) 22px; }
.btns.inline { flex-direction: row; flex-wrap: wrap; }
.btns.inline .btn { flex: 1; }

.codebox { margin: 0; padding: 12px 16px; font-size: 12.5px; line-height: 18px; white-space: pre-wrap; word-break: break-all; color: var(--label); max-height: 320px; overflow: auto; }

/* ------------------------------------------------------------ estados */

.empty { padding: 44px 24px; text-align: center; color: var(--label2); font-size: 15px; line-height: 20px; letter-spacing: -.23px; }
.empty .ic { width: 44px; height: 44px; stroke-width: 1.5; color: var(--label3); margin-bottom: 10px; }
.empty b { display: block; font-size: 20px; line-height: 25px; letter-spacing: -.45px; font-weight: 600; color: var(--label); margin-bottom: 4px; }
.empty .btn { margin: 16px auto 0; }
.list .empty, .card .empty { padding: 28px 16px; }
.sk { background: var(--fill); border-radius: var(--r-card); margin: 0 var(--side) var(--gap); animation: pulse 1.4s ease-in-out infinite; }
.sk.h1 { height: 150px; }
.sk.h2 { height: 76px; }
.sk.h3 { height: 240px; }

.toast { position: fixed; z-index: 90; left: 50%; top: calc(var(--sat) + 10px); transform: translateX(-50%); max-width: min(92vw, 420px); padding: 11px 18px; border-radius: 22px; background: var(--bar); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); box-shadow: 0 8px 28px rgba(0, 0, 0, .18), 0 0 0 .5px var(--sep); font-size: 15px; line-height: 20px; letter-spacing: -.23px; font-weight: 500; text-align: center; animation: toast .35s cubic-bezier(.32, .72, 0, 1); }
.toast.err { color: var(--red-ink); }
@keyframes toast { from { opacity: 0; transform: translate(-50%, -16px); } }

.ptr { position: fixed; z-index: 35; top: calc(var(--sat) + 8px); left: 50%; width: 28px; height: 28px; margin-left: -14px; color: var(--label2); opacity: 0; pointer-events: none; }
.ptr.go { animation: spin .8s linear infinite; }

/* ------------------------------------------------------------ sheets e alertas */

.sheet-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; background: var(--backdrop); animation: fade .25s ease-out; }
.sheet { width: 100%; max-width: 560px; max-height: calc(100dvh - var(--sat) - 28px); display: flex; flex-direction: column; background: var(--bg); border-radius: 14px 14px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .18); animation: sheet .4s cubic-bezier(.32, .72, 0, 1); will-change: transform; }
.sheet-wrap.out { animation: fade .2s ease-in reverse forwards; }
.sheet-wrap.out .sheet { animation: sheet .22s ease-in reverse forwards; }
@keyframes sheet { from { transform: translateY(100%); } }
.sheet-head { flex: none; position: relative; padding: 8px var(--side) 6px; touch-action: none; }
.grab { width: 36px; height: 5px; border-radius: 3px; background: var(--label3); margin: 0 auto 10px; }
.sheet-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 36px; }
.sheet-bar h2 { font-size: 17px; line-height: 22px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 56vw; }
.sheet-bar .nav-btn { min-height: 36px; }
.sheet-bar .nav-btn.done { font-weight: 600; justify-self: end; }
.sheet-sub { text-align: center; font-size: 13px; line-height: 18px; letter-spacing: -.08px; color: var(--label2); margin-top: -2px; padding-bottom: 4px; }
.sheet-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 12px 0 calc(var(--sab) + 12px); }
.sheet-body > :last-child { margin-bottom: 8px; }

.alert-wrap { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 24px; background: var(--backdrop); animation: fade .2s ease-out; }
.alert { width: 100%; max-width: 280px; border-radius: 14px; overflow: hidden; background: var(--bar); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); text-align: center; animation: alert .25s cubic-bezier(.2, .8, .2, 1); }
html:not([data-theme=dark]) .alert { background: rgba(245, 245, 245, .92); }
@keyframes alert { from { opacity: 0; transform: scale(1.12); } }
.alert-body { padding: 19px 16px 17px; }
.alert-body b { display: block; font-size: 17px; line-height: 22px; font-weight: 600; }
.alert-body p { font-size: 13px; line-height: 18px; letter-spacing: -.08px; margin-top: 3px; }
.alert-btns { display: flex; border-top: .5px solid var(--sep); }
.alert-btns button { flex: 1; min-height: 44px; color: var(--blue); text-align: center; }
.alert-btns button + button { border-left: .5px solid var(--sep); }
.alert-btns button.strong { font-weight: 600; }
.alert-btns button.danger { color: var(--red); }
.alert-btns button:active { background: var(--fill); }

/* ------------------------------------------------------------ login */

.login { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; max-width: 420px; margin: 0 auto; padding: calc(var(--sat) + 24px) 0 calc(var(--sab) + 24px); }
.login .mark { width: 64px; height: 64px; border-radius: 15px; background: var(--blue); color: #fff; display: grid; place-items: center; margin: 0 auto 18px; }
.login .mark .ic { width: 34px; height: 34px; }
.login h1 { font-size: 28px; line-height: 34px; letter-spacing: .36px; font-weight: 700; text-align: center; }
.login .lead { text-align: center; color: var(--label2); font-size: 15px; line-height: 20px; letter-spacing: -.23px; margin: 6px var(--side) 28px; }
.login .err { color: var(--red-ink); font-size: 13px; line-height: 18px; letter-spacing: -.08px; text-align: center; margin: -10px var(--side) 16px; }

/* ------------------------------------------------------------ linha do tempo */

.tl { margin: 0 var(--side) 22px; background: var(--bg2); border-radius: var(--r-card); padding: 6px 16px; }
.tl-item { position: relative; padding: 10px 0 10px 22px; }
.tl-item::before { content: ""; position: absolute; left: 4px; top: 0; bottom: 0; width: 1.5px; background: var(--sep); }
.tl-item:first-child::before { top: 16px; }
.tl-item:last-child::before { bottom: calc(100% - 16px); }
.tl-item::after { content: ""; position: absolute; left: 0; top: 16px; width: 9px; height: 9px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 3px var(--bg2); }
.tl-item.warn::after { background: var(--orange); }
.tl-item.error::after { background: var(--red); }
.tl-item.debug::after { background: var(--gray); }
.tl-item b { display: block; font-weight: 400; font-size: 15px; line-height: 20px; letter-spacing: -.23px; }
.tl-item small { display: block; font-size: 13px; line-height: 18px; letter-spacing: -.08px; color: var(--label2); overflow-wrap: anywhere; }
.tl-item details { margin-top: 4px; }
.tl-item summary { font-size: 13px; color: var(--blue); cursor: pointer; list-style: none; }
.tl-item summary::-webkit-details-marker { display: none; }
.tl-item pre { margin: 6px 0 0; padding: 10px; border-radius: 8px; background: var(--fill); font-size: 12px; line-height: 17px; white-space: pre-wrap; word-break: break-all; max-height: 240px; overflow: auto; }

/* ------------------------------------------------------------ desktop: sidebar no lugar da tab bar */

@media (min-width: 1024px) {
  :root { --side: 24px; }
  .tabbar { display: none; }
  .app { margin-left: var(--side-w); padding-bottom: 48px; --page-w: 760px; }
  .app.wide { --page-w: 1160px; }
  .side-nav { display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; width: var(--side-w); padding: 22px 12px 16px; border-right: .5px solid var(--sep); overflow-y: auto; }
  .side-nav h1 { font-size: 22px; line-height: 28px; letter-spacing: -.26px; font-weight: 700; padding: 0 12px 16px; display: flex; align-items: center; gap: 10px; }
  .side-nav h1 i { width: 28px; height: 28px; border-radius: 7px; background: var(--blue); color: #fff; display: grid; place-items: center; }
  .side-nav h1 i .ic { width: 17px; height: 17px; }
  .side-nav a { display: flex; align-items: center; gap: 11px; min-height: 40px; padding: 0 12px; border-radius: 10px; color: var(--label); font-size: 15px; letter-spacing: -.23px; }
  .side-nav a .ic { color: var(--blue); width: 20px; height: 20px; }
  .side-nav a:hover { background: var(--fill); }
  .side-nav a.on { background: var(--fill2); font-weight: 600; }
  .side-nav .grp { font-size: 12px; line-height: 16px; letter-spacing: 0; font-weight: 600; color: var(--label2); padding: 18px 12px 6px; }
  .side-nav .sp { flex: 1; min-height: 16px; }
  .side-nav .fresh { padding: 0 12px; min-height: 32px; }
  .nav { padding-top: 8px; }
  .large { padding-top: 6px; }
  .cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .cols.main { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .cols > div:first-child > :not(.hdr):not(.foot) { margin-right: calc(var(--gap) / 2); }
  .cols > div:last-child > :not(.hdr):not(.foot) { margin-left: calc(var(--gap) / 2); }
  .cols > div:last-child > .hdr { padding-left: 24px; }
  .cols > div:last-child > .foot { margin-left: 24px; }
  .sheet-wrap { align-items: center; padding: 24px; }
  .sheet { border-radius: 14px; max-height: min(720px, calc(100vh - 48px)); animation: alert .25s cubic-bezier(.2, .8, .2, 1); }
  .sheet-wrap.out .sheet { animation: fade .2s ease-in reverse forwards; }
  .grab { visibility: hidden; margin-bottom: 0; }
  .toast { top: 18px; }
  a.row:hover, button.row:hover { background: var(--fill); }
  .only-mobile { display: none !important; }
}
@media (max-width: 1023px) { .only-desktop { display: none !important; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ------------------------------------------------------------ Liquid Glass (estilo iOS 26)
 * Superfícies translúcidas sobre um fundo com cor (para o blur ter o que mostrar),
 * borda clara fina, brilho no topo e sombra suave. Cartões ~24px, controles em cápsula.
 * Sem transparência (preferência do sistema, alto contraste ou navegador sem
 * backdrop-filter): as mesmas peças em cor sólida.
 */
:root {
  --bg: #eef0f6;
  --glass: rgba(255, 255, 255, .58);
  --glass-strong: rgba(255, 255, 255, .78);
  --glass-edge: rgba(255, 255, 255, .85);
  --glass-hi: rgba(255, 255, 255, .9);
  --glass-shadow: 0 10px 30px rgba(30, 40, 80, .10), 0 1px 2px rgba(30, 40, 80, .06);
  --glass-blur: blur(22px) saturate(180%);
  --r-card: 24px;
  --r-kpi: 22px;
  --tabbar-h: 62px;
  --wash-1: rgba(10, 132, 255, .16);
  --wash-2: rgba(94, 92, 230, .14);
  --wash-3: rgba(48, 209, 88, .10);
}
html[data-theme=dark] {
  --bg: #05060a;
  --bg2: #15161c;
  --glass: rgba(255, 255, 255, .06);
  --glass-strong: rgba(28, 29, 36, .72);
  --glass-edge: rgba(255, 255, 255, .12);
  --glass-hi: rgba(255, 255, 255, .16);
  --glass-shadow: 0 12px 34px rgba(0, 0, 0, .45), 0 1px 2px rgba(0, 0, 0, .35);
  --bar: rgba(20, 21, 28, .55);
  --thumb: rgba(255, 255, 255, .18);
  --wash-1: rgba(10, 132, 255, .22);
  --wash-2: rgba(94, 92, 230, .18);
  --wash-3: rgba(48, 209, 88, .10);
}
body {
  background:
    radial-gradient(60rem 40rem at 110% -10%, var(--wash-1), transparent 60%),
    radial-gradient(50rem 36rem at -20% 30%, var(--wash-2), transparent 60%),
    radial-gradient(40rem 30rem at 80% 110%, var(--wash-3), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

.card, .list, .kpi, .tl, .sk {
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--glass-shadow);
  border-radius: var(--r-card);
}
.kpi { border-radius: var(--r-kpi); padding: 14px 16px; }
.card { padding: 18px; }
.sk { box-shadow: none; }
.row + .row::before { border-top-color: var(--sep); }

/* controles em cápsula */
.seg { border-radius: 999px; padding: 3px; background: var(--glass); border: 1px solid var(--glass-edge); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.seg button { min-height: 38px; border-radius: 999px; font-size: 14px; }
.seg-thumb { top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / var(--n)); border-radius: 999px; box-shadow: inset 0 1px 0 var(--glass-hi), 0 3px 10px rgba(0, 0, 0, .18); }
.chip { min-height: 38px; padding: 8px 15px; background: var(--glass); border: 1px solid var(--glass-edge); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.chip.on { background: var(--label); color: var(--bg); border-color: transparent; }
.chip.filter { border-color: transparent; }
.btn { border-radius: 999px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 6px 18px rgba(10, 132, 255, .28); }
.btn.tint, .btn.gray, .btn.danger { box-shadow: inset 0 1px 0 var(--glass-hi); }
.btn.sm { min-height: 44px; }
.search { height: 44px; border-radius: 999px; padding: 0 14px; }
.pill { border-radius: 999px; }

/* nav e tab bar flutuante */
.nav.scrolled { background: var(--bar); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.tabbar {
  left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right));
  bottom: calc(var(--sab) + 8px);
  padding: 4px; gap: 2px;
  border: 1px solid var(--glass-edge); border-radius: 999px;
  background: var(--bar);
  -webkit-backdrop-filter: blur(26px) saturate(190%); backdrop-filter: blur(26px) saturate(190%);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 14px 40px rgba(0, 0, 0, .35);
}
.tabbar a { height: calc(var(--tabbar-h) - 10px); min-width: 44px; border-radius: 999px; font-size: 11px; transition: background-color .2s, color .2s; }
.tabbar a.on { background: var(--fill2); }
.app { padding-bottom: calc(var(--tabbar-h) + var(--sab) + 32px); }

/* sheets e alertas */
.sheet { border-radius: 28px 28px 0 0; background: var(--glass-strong); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%); border: 1px solid var(--glass-edge); border-bottom: 0; }
.alert { border-radius: 24px; }
.toast { border-radius: 999px; border: 1px solid var(--glass-edge); }

/* campos ≥16px (o iOS não dá zoom) */
.row.field .in, .fin, .search input { font-size: 16px; }

/* botão (i) das dicas: ícone pequeno, área de toque de 44px */
.k:has(> .tip) { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.tip { position: relative; flex: none; width: 20px; height: 20px; display: grid; place-items: center; color: var(--label2); border-radius: 50%; }
.tip::after { content: ""; position: absolute; inset: -12px; }
.tip .ic { width: 18px; height: 18px; stroke-width: 1.8; }

/* filtros da tela de níveis */
.ffilters { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 12px; padding: 16px; }
.ff { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ff > span { font-size: 13px; line-height: 18px; letter-spacing: -.08px; color: var(--label2); padding-left: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin {
  width: 100%; min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--glass-edge); background: var(--fill); color: var(--label); outline: none;
  -webkit-appearance: none; appearance: none;
}
.fin:focus { box-shadow: 0 0 0 2px var(--blue); }
.fin::placeholder { color: var(--label2); }
.fin::-webkit-search-cancel-button { -webkit-appearance: none; }
select.fin { padding-right: 34px; background: var(--fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%238e8e93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1.5 1.5 6 6l4.5-4.5'/%3E%3C/svg%3E") right 14px center / 12px 8px no-repeat; text-overflow: ellipsis; }
.camp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* tabela larga (desktop) */
.card.tbl { padding: 0; overflow: hidden; }
.tbl-scroll { overflow-x: auto; }
.mtable { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 19px; letter-spacing: -.15px; font-variant-numeric: tabular-nums; }
.mtable th, .mtable td { padding: 11px 12px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--sep); }
.mtable th { font-size: 12px; line-height: 16px; letter-spacing: 0; font-weight: 600; color: var(--label2); background: var(--bg2); }
.mtable th button { color: inherit; font-weight: inherit; min-height: 28px; }
.mtable th button.on { color: var(--label); }
.mtable .n { text-align: right; }
.mtable td.n.up { color: var(--green-ink); }
.mtable td.n.down { color: var(--red-ink); }
.mtable .st { display: flex; align-items: center; gap: 8px; color: var(--label2); font-size: 13px; }
.mtable .nm { max-width: 320px; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.mtable .nm a, .mtable .nm button { color: var(--label); font-weight: 500; }
.mtable .nm a:hover, .mtable .nm button:hover { color: var(--blue); }
.mtable tbody tr:hover { background: var(--fill); }
.mtable tbody tr.hi { animation: hi 2.4s ease-out; }
.mtable tfoot td { font-weight: 700; border-bottom: 0; }
.mtable th:nth-child(2), .mtable td:nth-child(2) { position: sticky; left: 0; z-index: 1; background: var(--bg2); }
.mtable tbody tr:hover td:nth-child(2) { background: var(--bg3); }

/* dashboard */
.hero-card { padding: 20px; }
.kpis.dash { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpis.dash .kpi b { font-size: 24px; line-height: 30px; }
.donut { position: relative; width: 180px; height: 180px; margin: 12px auto 6px; }
.donut svg { width: 100%; height: 100%; transform: rotate(0deg); }
.donut-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-c small { font-size: 13px; color: var(--label2); }
.donut-c b { font-size: 28px; line-height: 32px; font-weight: 700; }
.legend.center { justify-content: center; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; }
.legend.center b { color: var(--label); }
.bar-row + .bar-row { margin-top: 12px; }
.k + .bar-row { margin-top: 12px; }
.bar-h { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; line-height: 19px; letter-spacing: -.15px; }
.bar-h > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-h > span:last-child { flex: none; color: var(--label2); }
.bar-h b { color: var(--label); font-weight: 600; }
.card .none { margin-top: 10px; color: var(--label2); font-size: 15px; }

@media (min-width: 700px) {
  .kpis.dash { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .camp-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ffilters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .kpis.dash { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cols.three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); padding: 0 var(--side); }
  .cols.three > div > * { margin-left: 0 !important; margin-right: 0 !important; }
  .side-nav { background: var(--bar); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border-right: 1px solid var(--glass-edge); }
  .side-nav a { border-radius: 999px; min-height: 44px; }
  .sheet { border-radius: 28px; border-bottom: 1px solid var(--glass-edge); }
}

/* Início no grid do dashboard da UTMify: Resumo, duas linhas de KPI e, embaixo,
   pagamento + dia da semana à esquerda e o funil horizontal à direita (altura dos dois) */
.ut { display: grid; gap: var(--gap); margin: 0 var(--side) var(--gap); }
.ut .card { margin: 0; }
.card.ut-card { background: rgba(13, 20, 48, .74); border-color: #1d2549; border-radius: 28px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 14px 34px rgba(0, 0, 0, .35); }
.ut-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 17px; line-height: 22px; font-weight: 700; letter-spacing: -.2px; color: #eef0fd; }
.ut-h.big { font-size: 20px; }
.ut-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.ut-field { display: grid; gap: 2px; min-width: 0; padding: 9px 13px; text-align: left; font: inherit; color: #eef0fd; background: rgba(255, 255, 255, .035); border: 1px solid #232c55; border-radius: 16px; cursor: pointer; }
.ut-field small { font-size: 12px; line-height: 16px; font-weight: 600; color: #9299c5; }
.ut-field span { font-size: 15px; line-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ut-kpis { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
.ut-kpi { grid-column: span 4; min-width: 0; padding: 14px 16px; }
.ut-kpi.w6 { grid-column: span 12; }
.ut-kpi.w3 { grid-column: span 6; }
.ut-kpi .ut-k { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 13px; line-height: 18px; font-weight: 600; color: #b9bfe0; white-space: nowrap; }
.ut-kpi .ut-k .tip, .ut-h .tip { color: #6c7399; }
.ut-kpi b { display: block; margin-top: 4px; font-size: 21px; line-height: 28px; font-weight: 700; letter-spacing: -.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ut-kpi.w6 b { font-size: 30px; line-height: 36px; }
.ut-kpi small { display: block; margin-top: 2px; font-size: 12px; color: #8a91b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ut-kpi.lucro .ut-k, .ut-kpi.lucro b { color: #3ddc5c; }
.ut-kpi.lucro.neg .ut-k, .ut-kpi.lucro.neg b { color: var(--red); }
.ut-bottom { display: grid; gap: var(--gap); }
.ut-left { display: grid; gap: var(--gap); align-content: start; }
.ut-right { display: flex; min-width: 0; }
.ut-right .card.fx { flex: 1; margin: 0; }
.ut-donut .donut { width: 170px; height: 170px; margin: 14px auto 10px; }
.ut-donut .donut-c small { color: #b9bfe0; }
.wk { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; height: 210px; margin-top: 14px; }
.wk-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-width: 0; height: 100%; }
.wk-p { margin-bottom: 6px; font-size: 12px; line-height: 14px; font-weight: 700; color: #dfe3ff; white-space: nowrap; }
.wk-bar { display: block; width: 100%; max-width: 46px; min-height: 2px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #3b4dff, #1f2bff); box-shadow: 0 6px 18px rgba(31, 43, 255, .35); }
.wk-d { margin-top: 8px; font-size: 12px; line-height: 14px; color: #8a91b8; }
.fx-col > .card.fx { min-height: 460px; }
@media (min-width: 700px) {
  .ut-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ut-kpi.w6 { grid-column: span 6; }
  .ut-kpi.w3 { grid-column: span 3; }
  .ut-kpi { grid-column: span 2; }
}
@media (max-width: 699px) {
  .ut-kpi.w2 { grid-column: span 4; padding: 12px 12px; }
  .ut-kpi.w2 b { font-size: 19px; }
  .card.ut-card { border-radius: 24px; }
}
@media (min-width: 1024px) {
  .ut-bottom { grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); align-items: stretch; }
  .ut-kpi { padding: 16px 20px; }
  .ut-kpi.w6 b { font-size: 34px; line-height: 40px; }
  .ut-kpi.w3 b, .ut-kpi.w2 b { font-size: 24px; line-height: 30px; }
}

/* fallback sólido: sem transparência ou com contraste alto */
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  :root { --glass: #ffffff; --glass-strong: #ffffff; --bar: #f8f8fa; --glass-edge: rgba(60, 60, 67, .29); }
  html[data-theme=dark] { --glass: #1c1c1e; --glass-strong: #1c1c1e; --bar: #161618; --glass-edge: rgba(235, 235, 245, .3); }
  body { background: var(--bg); }
  .card, .list, .kpi, .tl, .seg, .chip, .tabbar, .nav.scrolled, .sheet, .side-nav, .toast, .alert { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
}
@media (prefers-contrast: more) {
  .card, .list, .kpi, .tl, .seg, .chip, .tabbar, .fin { border-width: 1.5px; }
  html[data-theme=dark] { --label2: rgba(235, 235, 245, .82); }
  :root:not([data-theme=dark]) { --label2: rgba(60, 60, 67, .85); }
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  :root { --glass: #ffffff; --glass-strong: #ffffff; --bar: #f8f8fa; }
  html[data-theme=dark] { --glass: #1c1c1e; --glass-strong: #1c1c1e; --bar: #161618; }
}
