/* Poppins no próprio servidor (licença em fonts/OFL.txt): sem depender do Google Fonts para pintar a tela. */
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/poppins-400-latin-ext.woff2?v=Cx_KtCwYtpvP) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/poppins-400-latin.woff2?v=fZNFnYZYW_zb) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url(/assets/fonts/poppins-500-latin-ext.woff2?v=r1_aFqGRaeAp) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url(/assets/fonts/poppins-500-latin.woff2?v=zTbeIErKLV-i) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url(/assets/fonts/poppins-600-latin-ext.woff2?v=ux8tWC5_ulhq) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url(/assets/fonts/poppins-600-latin.woff2?v=9OgNnf03TQKY) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url(/assets/fonts/poppins-700-latin-ext.woff2?v=zP2H9p7wDYEd) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url(/assets/fonts/poppins-700-latin.woff2?v=kzjmX8B3NVx6) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* ===== Tokens ===== */
:root {
  color-scheme: light;
  --page: #f4f9fd; --surface: #ffffff; --surface-2: #f2f8fd;
  --ink: #0b2545; --ink-2: #3e4d5e; --ink-3: #566779;
  --line: #dceaf5; --line-2: #e9f2fa; --grid: #e6f0f8; --track: #e6f0f8;
  --accent: #0077b6; --accent-2: #0099dc; --accent-soft: #e6f4fb; --on-accent: #ffffff;
  --navy: #0b2545; --on-navy: #f4f9fd; --on-navy-2: #b9d3ea;
  --good: #1e7a46; --good-bg: #e6f3ea; --bad: #b3261e; --bad-bg: #fbe9e7; --warn: #8a4e06; --warn-bg: #fdf0dc;
  --nps-p: #0077b6; --nps-n: #a9b8c6; --nps-d: #b3261e;
  --cat-1: #0077b6; --cat-2: #eb6834; --cat-3: #1baf7a; --cat-4: #eda100; --cat-5: #a9b8c6;
  --funnel-1: #a7ddf4; --funnel-2: #6cc6ee; --funnel-3: #2bafe6; --funnel-4: #0099dc; --funnel-5: #0077b6;
  --hero: #0077b6;
  --shadow-1: 0 1px 2px rgba(11, 37, 69, .04), 0 8px 24px rgba(11, 37, 69, .05);
  --shadow-2: 0 2px 6px rgba(11, 37, 69, .08), 0 18px 40px rgba(11, 37, 69, .12);
  --glass: rgba(255, 255, 255, .82); --glass-solid: rgba(255, 255, 255, .97);
  --radius: 20px; --radius-sm: 12px;
  --ease: cubic-bezier(.22, .8, .24, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #07162a; --surface: #0d2138; --surface-2: #122a45;
    --ink: #eaf4fc; --ink-2: #bcd3e6; --ink-3: #8faac4;
    --line: #1c3653; --line-2: #15304b; --grid: #1c3653; --track: #173250;
    --accent: #5cc4f0; --accent-2: #2bafe6; --accent-soft: rgba(92, 196, 240, .14); --on-accent: #06203f;
    --navy: #041223; --on-navy: #eaf4fc; --on-navy-2: #a9c6de;
    --good: #5fd38d; --good-bg: rgba(95, 211, 141, .14); --bad: #ff8a80; --bad-bg: rgba(255, 138, 128, .14); --warn: #f6b955; --warn-bg: rgba(246, 185, 85, .14);
    --nps-p: #2bafe6; --nps-n: #5f7792; --nps-d: #ff8a80;
    --cat-1: #3987e5; --cat-2: #d95926; --cat-3: #199e70; --cat-4: #c98500; --cat-5: #5f7792;
    --funnel-1: #a7ddf4; --funnel-2: #6cc6ee; --funnel-3: #2bafe6; --funnel-4: #0099dc; --funnel-5: #0077b6;
    --hero: #0077b6;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-2: 0 2px 6px rgba(0, 0, 0, .35), 0 18px 40px rgba(0, 0, 0, .45);
    --glass: rgba(13, 33, 56, .82); --glass-solid: rgba(13, 33, 56, .97);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #07162a; --surface: #0d2138; --surface-2: #122a45;
  --ink: #eaf4fc; --ink-2: #bcd3e6; --ink-3: #8faac4;
  --line: #1c3653; --line-2: #15304b; --grid: #1c3653; --track: #173250;
  --accent: #5cc4f0; --accent-2: #2bafe6; --accent-soft: rgba(92, 196, 240, .14); --on-accent: #06203f;
  --navy: #041223; --on-navy: #eaf4fc; --on-navy-2: #a9c6de;
  --good: #5fd38d; --good-bg: rgba(95, 211, 141, .14); --bad: #ff8a80; --bad-bg: rgba(255, 138, 128, .14); --warn: #f6b955; --warn-bg: rgba(246, 185, 85, .14);
  --nps-p: #2bafe6; --nps-n: #5f7792; --nps-d: #ff8a80;
  --cat-1: #3987e5; --cat-2: #d95926; --cat-3: #199e70; --cat-4: #c98500; --cat-5: #5f7792;
  --funnel-1: #a7ddf4; --funnel-2: #6cc6ee; --funnel-3: #2bafe6; --funnel-4: #0099dc; --funnel-5: #0077b6;
  --hero: #0077b6;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .35), 0 18px 40px rgba(0, 0, 0, .45);
  --glass: rgba(13, 33, 56, .82); --glass-solid: rgba(13, 33, 56, .97);
}

/* ===== Base ===== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h, 60px) + 58px); }
body { margin: 0; font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif; background: var(--page); color: var(--ink); line-height: 1.5; -webkit-font-smoothing: antialiased; transition: background .3s, color .3s; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; cursor: pointer; color: inherit; }
a { color: var(--accent); }
.hidden { display: none !important; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.mt { margin-top: 12px; }
.mb { margin-bottom: 14px; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 6px; }

/* ===== Animations ===== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.94); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes shimmer { 100% { transform: translateX(100%); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
@keyframes float { 0%, 100% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(24px, -30px, 0) scale(1.08); } }
@keyframes indeterminate { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.reveal.in { opacity: 1; transform: none; }

/* ===== Topbar ===== */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--glass); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1240px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 10px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand .logo { width: 36px; height: 36px; border-radius: 11px; background: var(--hero); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; box-shadow: 0 4px 12px rgba(0, 119, 182, .28); }
.brand .titles { min-width: 0; }
.brand .name { font-weight: 700; letter-spacing: -.01em; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand .sub { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spacer { flex: 1; }
.updated { display: none; }
.container { max-width: 1240px; margin: 0 auto; padding: 18px 16px 64px; }
#progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; overflow: hidden; opacity: 0; transition: opacity .2s; pointer-events: none; }
#progress::before { content: ''; position: absolute; inset: 0; width: 40%; background: linear-gradient(90deg, transparent, var(--accent-2), var(--accent)); animation: indeterminate 1.1s ease-in-out infinite; }
#progress.on { opacity: 1; }

/* ===== Buttons & inputs ===== */
.btn { white-space: nowrap; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 11px; padding: 8px 14px; font-weight: 550; font-size: 14px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background .18s, border-color .18s, transform .18s var(--ease), box-shadow .18s; }
.btn:hover { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn.primary { background: var(--hero); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(0, 119, 182, .28); }
.btn.primary:hover { box-shadow: 0 8px 22px rgba(0, 119, 182, .38); filter: brightness(1.06); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
.btn.icon { width: 38px; height: 38px; padding: 0; border-radius: 50%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; }
input[type=password], input[type=date], input[type=text], input[type=search], select { font: inherit; font-size: 14px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink); transition: border-color .18s, box-shadow .18s; }
input:focus, select:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-2) 25%, transparent); outline: none; }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2371829b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
input[type=date] { color-scheme: inherit; }

/* ===== Cards ===== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: 20px; transition: box-shadow .25s var(--ease), transform .25s var(--ease), border-color .25s; }
.card h2 { font-size: 17px; font-weight: 700; letter-spacing: -.015em; }
.card .sub { color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.section { margin-top: 22px; }
/* Seções fora da tela: o navegador só monta e desenha o conteúdo quando elas chegam perto (e guarda a altura real depois). */
.card.lazy { content-visibility: auto; contain-intrinsic-size: auto 420px; }
.section > .card > .head { margin-bottom: 16px; }
.head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 14px; }
.grid.kpis { grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 24px; }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.grid .wide { grid-column: 1 / -1; }
.error { color: var(--bad); font-size: 13.5px; min-height: 18px; }
.banner { background: var(--warn-bg); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); color: var(--warn); border-radius: 12px; padding: 10px 14px; font-size: 13.5px; margin-top: 14px; animation: fadeUp .5s var(--ease) both; }
.alert { background: var(--bad-bg); color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 30%, transparent); border-radius: 12px; padding: 14px 16px; margin-top: 16px; font-size: 14px; animation: pop .35s var(--ease) both; }

/* ===== Auth (login) ===== */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 900px) { .auth { grid-template-columns: 1.1fr 1fr; } }
.auth-brand { position: relative; overflow: hidden; background: var(--hero); color: #fff; padding: 36px 32px; display: none; flex-direction: column; justify-content: space-between; }
@media (min-width: 900px) { .auth-brand { display: flex; padding: 56px; } }
.auth-brand h2 { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.1; letter-spacing: -.03em; max-width: 14ch; position: relative; z-index: 1; }
.auth-brand p { opacity: .85; max-width: 38ch; margin-top: 16px; position: relative; z-index: 1; }
.auth-brand .mark { display: flex; align-items: center; gap: 12px; font-weight: 700; position: relative; z-index: 1; }
.auth-brand .mark .logo { width: 38px; height: 38px; border-radius: 12px; background: rgba(255, 255, 255, .18); display: grid; place-items: center; backdrop-filter: blur(6px); }
.auth-brand ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; position: relative; z-index: 1; }
.auth-brand li { display: flex; gap: 10px; align-items: center; font-size: 14.5px; opacity: .92; }
.auth-brand li::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #a7ddf4; box-shadow: 0 0 0 4px rgba(167, 221, 244, .22); flex: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(50px); opacity: .5; animation: float 14s ease-in-out infinite; }
.blob.b1 { width: 340px; height: 340px; background: #5cc4f0; top: -90px; right: -60px; }
.blob.b2 { width: 280px; height: 280px; background: #0b2545; bottom: -80px; left: -40px; animation-delay: -5s; }
.blob.b3 { width: 200px; height: 200px; background: #0099dc; bottom: 30%; right: 12%; animation-delay: -9s; opacity: .35; }
.auth-panel { display: grid; place-items: center; padding: 24px 16px; background: var(--page); position: relative; }
.auth-card { width: 100%; max-width: 400px; animation: fadeUp .7s var(--ease) both; }
.auth-card .logo-m { width: 52px; height: 52px; border-radius: 15px; background: var(--hero); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 20px; margin-bottom: 20px; box-shadow: 0 8px 22px rgba(0, 119, 182, .28); }
@media (min-width: 900px) { .auth-card .logo-m { display: none; } }
.auth-card h1 { font-size: 26px; letter-spacing: -.03em; }
.auth-card form { margin-top: 26px; display: grid; gap: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink-2); }
.pw-wrap { position: relative; }
.pw-wrap input { width: 100%; padding: 12px 44px 12px 14px; font-size: 15px; }
.pw-wrap .eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: none; color: var(--ink-3); border-radius: 8px; display: grid; place-items: center; }
.pw-wrap .eye:hover { background: var(--accent-soft); color: var(--accent); }
.pw-wrap .eye svg { width: 19px; height: 19px; }
.shake { animation: shake .45s; }
.btn.block { width: 100%; padding: 12px; font-size: 15px; }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.theme-fab { position: absolute; top: 14px; right: 14px; }

/* ===== Filters ===== */
.filters { padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg-btn { border: 0; background: transparent; padding: 7px 13px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); transition: background .2s, color .2s, box-shadow .2s; }
.seg-btn:hover { color: var(--accent); }
.seg-btn[aria-pressed=true] { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgba(15, 40, 90, .15), 0 0 0 1px var(--line); }
.custom-panel { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; width: 100%; padding-top: 12px; border-top: 1px dashed var(--line); animation: fadeUp .35s var(--ease) both; }
.period-note { font-size: 13px; color: var(--ink-3); width: 100%; }

/* ===== Section nav ===== */
.subnav { position: sticky; top: var(--topbar-h, 60px); z-index: 20; margin: 14px -16px 0; padding: 8px 16px; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
/* Celular e tablet: o desfoque atrás da barra do topo e do menu de seções é refeito a cada quadro da rolagem e pesa nos
   aparelhos mais simples. Neles as barras ficam quase opacas, sem desfoque. */
@media (hover: none) and (pointer: coarse) { .topbar, .subnav { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--glass-solid); } }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { flex: none; text-decoration: none; color: var(--ink-2); font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; transition: background .2s, color .2s; }
@media (hover: hover) { .subnav a:hover { background: var(--accent-soft); color: var(--accent); } }
.subnav a.active { background: var(--accent); color: var(--on-accent); }

/* ===== Hero / diagnóstico ===== */
.hero { padding: 0; overflow: hidden; display: grid; grid-template-columns: 1fr; }
@media (min-width: 960px) { .hero { grid-template-columns: 300px 1fr; } }
.hero-main { background: linear-gradient(160deg, var(--hero) 0%, #005f93 100%); color: #fff; padding: 22px 22px 78px; position: relative; overflow: hidden; }
.hero-main::after { content: ''; position: absolute; width: 220px; height: 220px; border-radius: 50%; right: -80px; top: -90px; background: radial-gradient(circle, rgba(255, 255, 255, .16), transparent 70%); pointer-events: none; }
.hero-main .eyebrow { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; opacity: .8; font-weight: 600; }
.hero-main .big { font-size: 32px; font-weight: 750; letter-spacing: -.03em; margin: 6px 0 2px; line-height: 1.1; }
.hero-main .lbl { opacity: .85; font-size: 13.5px; }
.hero-main .chip { display: inline-flex; gap: 4px; align-items: center; margin-top: 12px; font-size: 12.5px; font-weight: 650; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .18); }
.hero-main .chip.up::before { content: '↑'; } .hero-main .chip.down::before { content: '↓'; }
.hero-spark { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 64px; }
.hero-spark .hs-line { fill: none; stroke: #fff; stroke-width: 1.75; stroke-linejoin: round; opacity: .95; }
.hero-spark .hs-a { stop-color: #fff; stop-opacity: .28; } .hero-spark .hs-b { stop-color: #fff; stop-opacity: 0; }
.hero-side { padding: 20px 22px; display: grid; gap: 16px; align-content: start; }
.diag-title { display: flex; align-items: center; gap: 8px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 700; margin-bottom: 6px; }
.diag-ico { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); }
.diag-ico svg { width: 14px; height: 14px; }
.hero p.text { font-size: 14.5px; color: var(--ink-2); max-width: 78ch; line-height: 1.55; }
/* Indicadores com meta: blocos lado a lado, cor de status só na faixa e no selo (sempre com texto). */
.goals { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 10px; }
.gt { position: relative; padding: 12px 14px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); overflow: hidden; }
.gt::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--line); }
.gt.ok::before { background: var(--good); } .gt.off::before { background: var(--warn); }
.gt-label { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.gt-value { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; font-size: 19px; font-weight: 700; color: var(--ink); margin: 2px 0 6px; letter-spacing: -.01em; }
.gt-badge { font-size: 11px; font-weight: 650; padding: 1px 8px; border-radius: 999px; letter-spacing: 0; }
.gt.ok .gt-badge { background: var(--good-bg); color: var(--good); } .gt.off .gt-badge { background: var(--warn-bg); color: var(--warn); }
.gt-meter { height: 4px; border-radius: 99px; background: var(--track); overflow: hidden; margin-bottom: 6px; }
.gt-meter i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--good); transition: width 1s var(--ease); }
.gt.off .gt-meter i { background: var(--warn); }
.gt-meta { font-size: 11.5px; color: var(--ink-3); }

/* ===== KPI ===== */
.kpi { padding: 18px; position: relative; overflow: hidden; }
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.kpi .label { font-size: 13px; color: var(--ink-2); font-weight: 550; display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 28px; font-weight: 720; letter-spacing: -.03em; margin-top: 8px; line-height: 1.1; }
.kpi .note { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.kpi .spark { position: absolute; right: 14px; top: 12px; width: 84px; height: 30px; opacity: .95; }
.spark path { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.delta .vs { font-weight: 550; opacity: .85; }
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 650; margin-top: 10px; padding: 3px 9px; border-radius: 999px; }
.delta.good { color: var(--good); background: var(--good-bg); } .delta.bad { color: var(--bad); background: var(--bad-bg); }
.delta.flat { color: var(--ink-2); background: var(--line-2); }
.tip { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 700; cursor: help; position: relative; margin-left: 5px; vertical-align: middle; flex: none; line-height: 1; user-select: none; }
.tip::before { content: ''; position: absolute; inset: -9px; } /* área de toque maior no celular */
.tip:hover, .tip:focus-visible { background: var(--accent); color: var(--on-accent); outline: none; }

/* ===== Funil ===== */

/* ===== Charts ===== */
.chart { position: relative; min-height: 120px; }
.chart svg { display: block; overflow: visible; max-width: 100%; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; stroke-dasharray: 2 4; }
.chart .grid-line.base { stroke-dasharray: none; stroke: var(--line); }
.chart .axis-label { fill: var(--ink-3); font-size: 11px; font-family: inherit; font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; transition: stroke-dashoffset 1.3s var(--ease); }
.chart .line.prev { stroke: var(--ink-3); stroke-width: 1.5; stroke-dasharray: 4 4; opacity: .7; transition: none; }
.chart .area { stroke: none; opacity: 0; transition: opacity .9s .5s; }
.chart.drawn .area { opacity: 1; }
.chart .stop-a { stop-color: var(--accent); stop-opacity: .22; } .chart .stop-b { stop-color: var(--accent); stop-opacity: 0; }
.chart .dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart .dot.prev { fill: var(--ink-3); }
.chart .cross { stroke: var(--line); stroke-width: 1; }
.tooltip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2); border-radius: 10px; padding: 0; font-size: 12.5px; z-index: 10; white-space: nowrap; min-width: 168px; animation: pop .12s var(--ease) both; overflow: hidden; }
.tt-head { padding: 7px 12px; border-bottom: 1px solid var(--line-2); font-weight: 600; color: var(--ink); text-transform: capitalize; }
.tt-row { display: flex; align-items: center; gap: 8px; padding: 6px 12px 0; color: var(--ink-2); }
.tt-row:last-child { padding-bottom: 8px; }
.tt-row span { flex: 1; }
.tt-row b { font-size: 13px; color: var(--ink); font-weight: 650; }
.tt-key { width: 10px; height: 3px; border-radius: 2px; background: var(--accent); flex: none; }
.tt-key.prev { background: repeating-linear-gradient(90deg, var(--ink-3) 0 3px, transparent 3px 5px); }
.tt-delta { padding: 6px 12px 8px; font-size: 11.5px; font-weight: 600; }
.tt-delta.good { color: var(--good); } .tt-delta.bad { color: var(--bad); } .tt-delta.flat { color: var(--ink-3); }

/* Cartão de gráfico com resumo no topo (rótulo, valor do período e variação), como no Tremor. */
.cc { min-width: 0; }
.cc-label { font-size: 13px; color: var(--ink-3); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.cc-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 2px 0 10px; }
.cc-value { font-size: 24px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); line-height: 1.2; }
.cc-row .delta { font-size: 12.5px; }
.cc-row .delta .vs { display: none; }
.cc-note { font-size: 12.5px; color: var(--ink-3); }
.chart-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 16px; font-size: 12.5px; color: var(--ink-2); margin: -4px 0 14px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend i { width: 14px; height: 3px; border-radius: 2px; background: var(--accent); }
.chart-legend i.prev { background: repeating-linear-gradient(90deg, var(--ink-3) 0 3px, transparent 3px 5px); }
.sub-chart { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.sub-chart .cc-label { margin-bottom: 8px; }

/* Lista de barras (BarList): rótulo dentro da barra, valor à direita. */
.blist { display: grid; gap: 6px; }
.bl-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 13.5px; }
.bl-bar { position: relative; height: 32px; border-radius: 6px; overflow: hidden; }
.bl-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent-soft); border-radius: 6px; transition: width 1s var(--ease); transition-delay: calc(var(--i, 0) * 60ms); }
.bl-fill.strong { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.bl-text { position: relative; display: block; padding: 0 10px; line-height: 32px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.bl-val { color: var(--ink-2); font-variant-numeric: tabular-nums; text-align: right; }
.bl-val b { color: var(--ink); font-weight: 600; }
.bl-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin: 0 0 8px; }

/* Barra segmentada (composição) com legenda em lista. */
.cbar { display: flex; gap: 2px; height: 10px; border-radius: 999px; overflow: hidden; margin: 6px 0 12px; background: var(--track); }
.cbar span { width: 0; min-width: 0; transition: width 1s var(--ease); }
.cbar span.on { min-width: 3px; }
.clegend { display: grid; gap: 2px; }
.cl-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; font-size: 13.5px; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.cl-row:last-child { border-bottom: 0; }
.cl-row i { width: 10px; height: 10px; border-radius: 3px; }
.cl-row .num { text-align: right; }
.cl-row .muted { min-width: 52px; }
.k-1 { background: var(--cat-1); } .k-2 { background: var(--cat-2); } .k-3 { background: var(--cat-3); } .k-4 { background: var(--cat-4); } .k-5 { background: var(--cat-5); }

/* Escala do NPS (−100 a 100) com as faixas de referência e o marcador da loja. */
.nps-scale { margin: 14px 0 6px; }
.ns-bar { position: relative; display: flex; gap: 2px; height: 8px; }
.ns-bar span { border-radius: 2px; }
.ns-bar span:first-child { border-radius: 999px 2px 2px 999px; } .ns-bar span:last-child { border-radius: 2px 999px 999px 2px; }
.ns-crit { flex: 100; background: var(--bad); opacity: .55; } .ns-ok { flex: 50; background: var(--warn); opacity: .55; }
.ns-good { flex: 25; background: var(--accent-2); opacity: .6; } .ns-exc { flex: 25; background: var(--good); opacity: .65; }
.ns-mark { position: absolute; top: -5px; width: 4px; height: 18px; margin-left: -2px; border-radius: 2px; background: var(--ink); box-shadow: 0 0 0 2px var(--surface); left: var(--p, 50%); }
.ns-ticks { position: relative; height: 16px; font-size: 11px; color: var(--ink-3); margin-top: 6px; font-variant-numeric: tabular-nums; }
.ns-ticks span { position: absolute; transform: translateX(-50%); }
.ns-ticks span:first-child { transform: none; } .ns-ticks span:last-child { transform: translateX(-100%); }
.nps-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.attn { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 600; color: var(--warn); background: var(--warn-bg); border-radius: 999px; padding: 1px 8px; vertical-align: 1px; }

/* ===== Tables & bars ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 650; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
th.r, td.r { text-align: right; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s; }
tbody tr:hover td { background: var(--accent-soft); }
.bar-row { display: grid; grid-template-columns: 150px 1fr 100px; gap: 10px; align-items: center; margin: 9px 0; font-size: 13.5px; }
.bar-track { background: var(--track); border-radius: 6px; height: 14px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 0 6px 6px 0; transition: width 1s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.bar-fill.alt { background: var(--accent-2); }
.nps-stack { display: flex; height: 24px; border-radius: 8px; overflow: hidden; gap: 2px; margin: 12px 0; }
.nps-stack div { min-width: 2px; width: 0; transition: width 1s var(--ease); }
.nps-p { background: var(--nps-p); } .nps-n { background: var(--nps-n); } .nps-d { background: var(--nps-d); }
.nps-score { font-size: 38px; font-weight: 750; letter-spacing: -.03em; display: flex; align-items: center; gap: 10px; }
.pill { display: inline-block; padding: 2px 11px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--accent-soft); color: var(--accent); }
.pill.LOW { background: var(--good-bg); color: var(--good); } .pill.MEDIUM { background: var(--warn-bg); color: var(--warn); } .pill.HIGH { background: var(--bad-bg); color: var(--bad); }
.stat { padding: 2px 0; }
.stat .v { font-size: 24px; font-weight: 720; letter-spacing: -.025em; }
.stat .l { font-size: 12.5px; color: var(--ink-3); }
.mech-legend { margin-top: 12px; font-size: 12.5px; color: var(--ink-2); display: grid; gap: 5px; }
.toggle { background: none; border: 0; color: var(--accent); font-size: 13px; padding: 0; text-decoration: underline; }
details summary { cursor: pointer; color: var(--accent); font-weight: 600; }

/* ===== Skeleton ===== */
.skel { position: relative; overflow: hidden; background: var(--track); border-radius: 12px; }
.skel::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent); transform: translateX(-100%); animation: shimmer 1.3s infinite; }
:root[data-theme="dark"] .skel::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .07), transparent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .skel::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .07), transparent); } }
.skel.h1 { height: 220px; border-radius: var(--radius); } .skel.h2 { height: 118px; border-radius: var(--radius); } .skel.h3 { height: 300px; border-radius: var(--radius); }
/* Aba do master carregando pela primeira vez (WhatsApp, Integrações). */
.tab-wait { display: grid; gap: 14px; }
.loading .content { opacity: .55; transition: opacity .2s; pointer-events: none; }

/* ===== Master ===== */
.summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
@media (max-width: 1100px) { .summary { grid-template-columns: repeat(3, minmax(0, 1fr)); } .summary .card:last-of-type { grid-column: span 2; } }
/* resumo: ícone ao lado do rótulo, número em destaque, barra da proporção sempre no rodapé do cartão */
.summary .card { padding: 16px 18px; display: flex; flex-direction: column; }
.summary .sum-h { display: flex; align-items: center; gap: 8px; }
.summary .ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.summary .ico svg { width: 16px; height: 16px; }
.summary .sum-l { font-size: 13px; font-weight: 600; color: var(--ink-2); line-height: 1.25; }
.summary .v { font-size: 30px; font-weight: 750; letter-spacing: -.03em; line-height: 1.1; margin-top: 10px; }
.summary .v.txt { font-size: 22px; line-height: 1.25; margin-top: 12px; }
.summary .sum-d { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; line-height: 1.35; }
.summary .sum-bar { height: 4px; border-radius: 999px; background: var(--line-2); margin-top: auto; overflow: hidden; flex: none; }
.summary .card:has(.sum-bar) .sum-d { margin-bottom: 10px; }
.summary .sum-bar span { display: block; height: 100%; width: var(--p, 0%); border-radius: inherit; background: var(--accent); transition: width .8s var(--ease); }
.summary .card.warn .ico { background: var(--warn-bg); color: var(--warn); }
.summary .card.warn .v { color: var(--warn); }
.summary .card.good .ico { background: var(--good-bg); color: var(--good); }
.tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.tools input[type=search] { flex: 1; min-width: 200px; max-width: 380px; padding-left: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371829b' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 12px center; }
.client-row td { vertical-align: middle; }
.client-row { animation: fadeUp .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
.who { display: flex; align-items: center; gap: 12px; }
.avatar { width: 38px; height: 38px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: grid; place-items: center; flex: none; font-size: 14px; }
.badge { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; padding: 3px 10px; border-radius: 999px; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.on { background: var(--good-bg); color: var(--good); } .badge.off { background: var(--line-2); color: var(--ink-2); } .badge.warn { background: var(--warn-bg); color: var(--warn); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.modal-back { position: fixed; inset: 0; background: rgba(8, 16, 32, .55); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; z-index: 80; animation: fadeUp .25s ease both; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 26px; max-width: 470px; width: 100%; min-width: 0; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-2); animation: pop .3s var(--ease) both; }
.modal h2 { font-size: 19px; margin-bottom: 8px; letter-spacing: -.02em; }
.pw { display: block; margin: 16px 0; padding: 16px; background: var(--accent-soft); border-radius: 12px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 17px; word-break: break-all; user-select: all; border: 1px dashed var(--accent-2); color: var(--ink); }
.modal .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 90; }
.toast { background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow-2); animation: fadeUp .35s var(--ease) both; }
.toast.bad { background: var(--bad); color: #fff; }

@media (max-width: 640px) {
  .brand .name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.2; font-size: 15px; }
  .topbar-inner { gap: 8px; padding: 8px 12px; }
  .topbar-inner .btn:not(.icon) { padding: 6px 10px; font-size: 13px; }
  .bar-row { grid-template-columns: 96px 1fr 76px; }
  .kpi .value { font-size: 25px; }
  .hero-main .big { font-size: 30px; }
  .kpi .spark { width: 70px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; } .f-shape, .f-conv { opacity: 1; transform: none; animation: none; }
}
.muted-w { opacity: .7; position: relative; z-index: 1; }

/* ===== Logo LP Mídias ===== */
.logo-mark { width: 40px; height: 40px; border-radius: 12px; background: #fff; display: grid; place-items: center; overflow: hidden; flex: none; padding: 3px; box-shadow: 0 0 0 1px var(--line), 0 4px 12px rgba(0, 119, 182, .16); }
.logo-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
/* Logo de cada tema: a do escuro é a mesma marca com o "L" claro e sem o fundo branco (logo-*-dark.png). */
/* Só esconde a versão do outro tema: a que fica mantém o próprio display (e as regras de tela dela). */
:root[data-theme="light"] .only-dark, :root[data-theme="dark"] .only-light { display: none !important; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .only-dark { display: none !important; } }
.logo-wide.only-dark { background: none; box-shadow: none; padding: 6px 0; }
:root[data-theme="dark"] .logo-mark { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); box-shadow: 0 0 0 1px var(--line); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .only-light { display: none !important; }
  :root:not([data-theme="light"]) .logo-mark { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); box-shadow: 0 0 0 1px var(--line); }
}
.logo-chip { display: inline-grid; place-items: center; background: #fff; border-radius: 16px; padding: 9px 18px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.logo-chip img { height: 46px; width: auto; display: block; }
.auth-brand .mark { flex-direction: column; align-items: flex-start; gap: 12px; }
.mark-txt { opacity: .88; font-weight: 600; font-size: 14px; letter-spacing: .02em; }
.logo-wide { height: 42px; width: auto; display: block; margin-bottom: 22px; background: #fff; border-radius: 12px; padding: 6px 12px; box-shadow: 0 0 0 1px var(--line), var(--shadow-1); }
@media (min-width: 900px) { .logo-wide { display: none; } }

/* ===== Extras ===== */
.updated-m { display: block; line-height: 1.55; font-size: 12.5px; color: var(--ink-3); margin: 0 2px 10px; }
.updated-m::before { content: ''; display: inline-block; vertical-align: middle; margin: -2px 8px 0 2px; width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px var(--good-bg); flex: none; }
.updated-m:empty { display: none; }
.updated-m b { color: var(--ink-2); font-weight: 650; }
.updated-m.stale { color: var(--warn); }
.updated-m.stale::before { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }
.updated-m .late { font-weight: 700; margin-left: 4px; }
.kpi-cap { display: none; }
.chart svg { touch-action: pan-y; }
.seg.mini { width: auto; }
.seg.mini .seg-btn { padding: 5px 12px; font-size: 13px; }
.head .seg { align-self: center; }
.table-scroll { max-height: 340px; overflow-y: auto; border: 1px solid var(--line-2); border-radius: 12px; margin-top: 10px; }
.table-scroll th { position: sticky; top: 0; background: var(--surface); }

/* ===== Mobile ===== */
@media (max-width: 640px) {
  html { scroll-padding-top: calc(var(--topbar-h, 60px) + 10px); }
  .container { padding: 12px 12px 56px; padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); padding-bottom: max(56px, env(safe-area-inset-bottom)); }
  .topbar-inner { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  /* seções do painel da loja: barra no rodapé, como as abas do master (rola para o lado quando não cabem) */
  .subnav { position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 40; margin: 0; gap: 2px; padding: 6px max(8px, env(safe-area-inset-left)) max(6px, env(safe-area-inset-bottom)); background: var(--glass-solid); border-top: 1px solid var(--line); border-bottom: 0; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .subnav a { padding: 9px 13px; border-radius: 12px; }
  .subnav a.active { background: var(--accent-soft); color: var(--accent); }
  body:has(.subnav:not(.hidden)) .container { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  body:has(.subnav:not(.hidden)) .toasts { bottom: calc(70px + env(safe-area-inset-bottom)); }
  /* menu do tema: alinhado à borda da tela (preso ao botão, saía cortado à esquerda) */
  .topbar-inner { position: relative; }
  .topbar .theme-menu { position: static; }
  .topbar .theme-pop { right: max(12px, env(safe-area-inset-right)); top: calc(100% - 4px); }
  .card { padding: 14px; border-radius: 16px; }
  .card.hero { padding: 0; }
  .section { margin-top: 14px; }
  .card h2 { font-size: 16px; }
  .card .sub { font-size: 12.5px; }
  .section > .card > .head { margin-bottom: 12px; }
  .btn { min-height: 40px; }
  select, input[type=date], input[type=text], input[type=password], input[type=search] { font-size: 16px; }
  .filters { padding: 10px; gap: 8px; }
  .filters .seg { display: flex; flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; }
  .filters .seg::-webkit-scrollbar { display: none; }
  .filters .seg-btn { flex: 1 0 auto; min-height: 36px; padding: 6px 8px; font-size: 13px; }
  #month, #customToggle { flex: 1 1 0; min-width: 0; min-height: 40px; }
  .filters .btn { font-size: 13px; padding: 6px 10px; }
  #customToggle { flex: none; }
  .filters select { padding-left: 10px; padding-right: 28px; background-position: right 10px center; }
  .custom-panel input[type=date] { flex: 1 1 130px; min-width: 0; }
  .custom-panel .btn { width: 100%; }
  .grid.kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; }
  .kpi .label { font-size: 12.5px; }
  .kpi .value, .stat .v { white-space: nowrap; }
  .kpi .value { font-size: clamp(15px, 4.7vw, 20px); }
  .kpi .value.long, .stat .v.long { font-size: clamp(13px, 4vw, 17px); }
  .kpi .value.xlong, .stat .v.xlong { font-size: clamp(12px, 3.5vw, 15px); }
  .kpi .note { font-size: 11.5px; }
  .kpi .spark { display: none; }
  .kpi:hover { transform: none; }
  .delta { font-size: 12px; padding: 3px 8px; }
  .delta .vs { display: none; }
  .kpi-cap { display: block; margin: 0 2px 8px; }
  .stat .v { font-size: clamp(15px, 4.7vw, 20px); }
  .hero-main { padding: 18px 18px 70px; }
  .hero-side { padding: 16px 18px; gap: 14px; }
  .goals { grid-template-columns: 1fr 1fr; gap: 8px; }
  .gt { padding: 10px 12px; }
  .gt-value { font-size: 17px; }
  .grid.two { gap: 20px; }
  .grid.three { gap: 18px; }
  .tooltip { font-size: 12px; }
  .updated-m { font-size: 12px; line-height: 1.45; margin-bottom: 8px; }
  .cgrid { grid-template-columns: 1fr; }
  .ccard .cv { font-size: 30px; }
  /* tabelas empilhadas: cada linha vira um cartão em 2 colunas (rótulo em cima, valor embaixo) */
  table.stack thead { display: none; }
  table.stack, table.stack tbody { display: block; width: 100%; }
  table.stack tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; background: var(--surface-2); }
  table.stack td { display: block; border: 0; padding: 0; text-align: left; min-width: 0; font-size: 14px; }
  table.stack td::before { content: attr(data-label); display: block; color: var(--ink-3); font-size: 11.5px; font-weight: 500; margin-bottom: 1px; white-space: nowrap; }
  table.stack td:first-child { grid-column: 1 / -1; font-size: 15px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
  table.stack td:first-child::before, table.stack td.act::before { content: none; }
  table.stack td.wide, table.stack td.act { grid-column: 1 / -1; }
  table.stack td.act { padding-top: 4px; }
  table.stack tbody tr:hover td { background: none; }
  .row-actions .btn { flex: 1 1 calc(50% - 6px); }
  /* modais como "bottom sheet" */
  .modal-back { align-items: end; padding: 0; }
  .modal { max-width: none; border-radius: 22px 22px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); animation: fadeUp .3s var(--ease) both; }
  .modal .row .btn { flex: 1; }
  .toasts { bottom: calc(18px + env(safe-area-inset-bottom)); width: calc(100% - 24px); }
  .toast { text-align: center; }
  .summary { grid-template-columns: 1fr 1fr; gap: 10px; }
  /* 5 cartões em 2 colunas: o último (atualização dos dados) ocupa a linha inteira */
  .summary .card:last-of-type { grid-column: 1 / -1; }
  .tools input[type=search] { max-width: none; }
  .auth-panel { padding: 20px 16px calc(24px + env(safe-area-inset-bottom)); align-items: start; padding-top: 12vh; }
}

details.names { margin-top: 4px; }
details.names ul { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--ink-2); max-height: 180px; overflow-y: auto; }
details.names li { margin: 2px 0; }

/* ===== Grupos de lojas ===== */
.stores { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.store { display: flex; flex-direction: column; gap: 14px; text-decoration: none; color: inherit; }
.store:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.store .go { color: var(--accent); font-weight: 650; font-size: 13.5px; margin-top: auto; }
.store-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.store-kpis .v { font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.store-kpis .delta { margin-top: 4px; }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.mini-chip { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.check-list { max-height: 360px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; padding: 6px; display: grid; gap: 2px; }
.check { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; font-size: 14px; cursor: pointer; }
.check:hover { background: var(--accent-soft); }
.check input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.field input[type=text] { width: 100%; }
@media (max-width: 640px) { .store-kpis .v { font-size: 16px; } }

/* ===== Master: separação com/sem senha ===== */
.tools .seg { margin-left: auto; }
tr.group-head td { background: var(--surface-2); font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); padding: 10px 12px; border-bottom: 1px solid var(--line); }
tr.group-head .count { margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); font-size: 12px; }
tr.group-head.ok td { color: var(--good); } tr.group-head.ok .count { background: var(--good-bg); color: var(--good); }
tr.group-head.no td { color: var(--warn); } tr.group-head.no .count { background: var(--warn-bg); color: var(--warn); }
.mech-legend .detail p { margin: 6px 0 0; }
.mech-legend .detail { margin: 4px 0 8px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; }
@media (max-width: 640px) {
  .tools .seg { margin-left: 0; width: 100%; display: flex; overflow-x: auto; scrollbar-width: none; }
  .tools .seg-btn { flex: 1 0 auto; }
  table.stack tr.group-head { display: block; border: 0; background: none; padding: 4px 2px 0; margin: 6px 0 8px; }
  table.stack tr.group-head td { display: block; border: 0; padding: 0; background: none; font-size: 12.5px; }
  table.stack tr.group-head td::before { content: none; }
}

/* ===== Balão do "?" (fixo na tela, nunca corta) ===== */
.tip-pop { position: fixed; z-index: 120; background: var(--ink); color: var(--surface); padding: 10px 12px; border-radius: 11px; font-size: 13px; font-weight: 450; line-height: 1.45; text-align: left; box-shadow: var(--shadow-2); opacity: 0; pointer-events: none; transform: translateY(4px); transition: opacity .15s, transform .15s var(--ease); overflow-wrap: anywhere; }
.tip-pop.on { opacity: 1; transform: none; }
.tip-pop::after { content: ''; position: absolute; top: -5px; left: var(--ax, 20px); width: 10px; height: 10px; background: var(--ink); transform: translateX(-50%) rotate(45deg); border-radius: 2px; }
.tip-pop.up::after { top: auto; bottom: -5px; }

/* ===== Nome da loja em destaque ===== */
.company { display: flex; align-items: center; gap: 16px; background: var(--hero); color: #fff; border-radius: var(--radius); padding: 20px 24px; margin-bottom: 16px; box-shadow: var(--shadow-1); position: relative; overflow: hidden; animation: fadeUp .5s var(--ease) both; }
.company::after { content: ''; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .18), transparent 70%); pointer-events: none; }
.company-avatar { width: 58px; height: 58px; border-radius: 17px; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .35); display: grid; place-items: center; font-size: 22px; font-weight: 750; letter-spacing: -.02em; flex: none; backdrop-filter: blur(4px); }
.company-text { min-width: 0; position: relative; z-index: 1; }
.company-eyebrow { font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; opacity: .82; }
.company-name { font-size: clamp(22px, 4.2vw, 34px); font-weight: 780; letter-spacing: -.03em; line-height: 1.12; margin: 3px 0 2px; overflow-wrap: anywhere; }
.company-meta { font-size: 13px; opacity: .85; }
.company-meta:empty { display: none; }
@media (max-width: 640px) {
  .company { padding: 12px 14px; gap: 12px; margin-bottom: 10px; border-radius: 16px; }
  .company-avatar { width: 40px; height: 40px; border-radius: 12px; font-size: 15px; }
  .company-eyebrow { display: none; }
  .company-name { font-size: 19px; margin: 0; }
  .company-meta { font-size: 12px; }
}

/* ===== Perfil de clientes ===== */
.cintro { color: var(--ink-2); font-size: 14px; margin-bottom: 14px; max-width: 70ch; }
.cinsight { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--warn-bg); color: var(--ink); margin-bottom: 18px; font-size: 14px; line-height: 1.5; border: 1px solid transparent; }
.cinsight.good { background: var(--good-bg); }
.cinsight .cico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); color: var(--warn); flex: none; }
.cinsight.good .cico { color: var(--good); }
.cinsight .cico svg { width: 18px; height: 18px; }
.cinsight:not(.good) .cico { animation: ring 2.8s ease-in-out infinite; transform-origin: 50% 20%; }
@keyframes ring { 0%, 70%, 100% { transform: rotate(0); } 76% { transform: rotate(14deg); } 82% { transform: rotate(-12deg); } 88% { transform: rotate(8deg); } 94% { transform: rotate(-4deg); } }
.cgroup + .cgroup { margin-top: 22px; }
.chead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 10px; }
.chead h3 { font-size: 15.5px; letter-spacing: -.01em; }
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.ccard { --tone: var(--accent); --tone-bg: var(--accent-soft); border: 1px solid var(--line); border-top: 4px solid var(--tone); border-radius: 16px; padding: 16px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; transition: transform .22s var(--ease), box-shadow .22s; }
.ccard:hover { transform: translateY(-3px); box-shadow: var(--shadow-1); }
.tone-new { --tone: var(--accent); --tone-bg: var(--accent-soft); }
.tone-recurring { --tone: var(--good); --tone-bg: var(--good-bg); }
.tone-reactivated { --tone: #7b5fd0; --tone-bg: rgba(123, 95, 208, .14); }
.tone-alert { --tone: var(--warn); --tone-bg: var(--warn-bg); }
.tone-churn { --tone: var(--bad); --tone-bg: var(--bad-bg); }
.ctop { display: flex; align-items: center; gap: 10px; }
.ccard .cico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--tone-bg); color: var(--tone); flex: none; transition: transform .25s var(--ease); }
.ccard:hover .cico { transform: scale(1.1) rotate(-6deg); }
.ccard .cico svg { width: 18px; height: 18px; }
.ctitle { font-weight: 680; font-size: 14.5px; }
.ccard .cv { font-size: 34px; font-weight: 780; letter-spacing: -.03em; line-height: 1.05; color: var(--ink); }
.cbar { height: 8px; border-radius: 999px; background: var(--track); overflow: hidden; }
.cbar-fill { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--tone); transition: width 1s var(--ease); }
.cwhat { font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }
.cact { font-size: 12.8px; color: var(--ink-2); line-height: 1.45; margin-top: auto; padding: 9px 11px; border-radius: 10px; background: var(--tone-bg); }
.cact b { color: var(--tone); }
@media (prefers-reduced-motion: reduce) { .cinsight:not(.good) .cico { animation: none; } .ccard, .ccard .cico { transition: none; } }

/* ===== Acessos (master) ===== */
.access-info { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; line-height: 1.4; }
.access-info.never { color: var(--warn); font-weight: 600; }
.access-info.idle { color: var(--warn); }
.access-info b { font-weight: 650; }
.modal:has(.hist) { max-width: 760px; }
.hist { max-height: 55vh; overflow: auto; margin-top: 10px; }
.hist table { width: 100%; font-size: 13px; }
.hist th { position: sticky; top: 0; background: var(--surface); }

/* ===== Promoções: quem banca os descontos ===== */
.mb-s { margin-bottom: 10px; }
.promo-hero { display: flex; gap: 16px; align-items: flex-start; padding: 20px 22px; border-radius: 16px; background: var(--navy); color: var(--on-navy); margin-bottom: 14px; position: relative; overflow: hidden; }
.promo-hero::after { content: ''; position: absolute; right: -50px; bottom: -90px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .16), transparent 70%); pointer-events: none; }
.ph-ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .3); flex: none; }
.ph-ico svg { width: 22px; height: 22px; }
.ph-title { font-size: clamp(17px, 2.3vw, 21px); font-weight: 720; letter-spacing: -.02em; line-height: 1.3; }
.ph-hl { display: inline-block; padding: 0 8px; border-radius: 8px; background: var(--accent-2); color: #0b2545; font-weight: 800; }
.promo-hero.free .ph-hl { background: #8fe0b0; color: #0b2545; }
.ph-sub { margin-top: 6px; font-size: 13.5px; line-height: 1.5; opacity: .9; max-width: 80ch; }
.promo-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; align-items: stretch; }
.promo-stats { display: grid; gap: 14px; }
.promo-grid > .card { display: flex; flex-direction: column; }
.promo-grid > .card .donut { flex: 1; align-content: center; }
.donut { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut-chart { position: relative; width: 150px; height: 150px; flex: none; }
.donut-svg { width: 100%; height: 100%; display: block; }
.donut-track { fill: none; stroke: var(--track); stroke-width: 18; }
.donut-seg { fill: none; stroke-width: 18; transition: stroke-dasharray 1.1s var(--ease); }
.s-loja { stroke: #f5a524; background: #f5a524; }
.s-ifood { stroke: var(--accent-2); background: var(--accent-2); }
.s-ext { stroke: var(--nps-n); background: var(--nps-n); }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-center b { font-size: 22px; font-weight: 780; letter-spacing: -.02em; }
.donut-center span { font-size: 11.5px; color: var(--ink-3); }
.donut-legend { flex: 1; min-width: 200px; display: grid; gap: 4px; }
.dl-row { display: grid; grid-template-columns: 12px 1fr auto 58px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.dl-row:last-child { border-bottom: 0; }
.dl-row .dot { width: 12px; height: 12px; border-radius: 4px; }
.dl-pct { color: var(--ink-3); font-size: 12.5px; text-align: right; }
@media (max-width: 860px) { .promo-grid { grid-template-columns: 1fr; } .promo-stats { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); } }
@media (max-width: 640px) {
  .promo-hero { padding: 16px; gap: 12px; }
  .ph-ico { width: 38px; height: 38px; }
  .donut { justify-content: center; }
  .donut-legend { min-width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .donut-seg { transition: none; } }

/* ===== Histórico mensal ===== */
.monthly td.r .mcell { display: inline-grid; justify-items: end; gap: 5px; min-width: 140px; }
.mbar { display: block; width: 140px; height: 6px; border-radius: 999px; background: var(--track); overflow: hidden; }
.mbar-fill { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--accent-2); transition: width .9s var(--ease); transition-delay: calc(var(--i, 0) * 60ms); }
.monthly .delta { white-space: nowrap; }
@media (max-width: 640px) { .monthly td.r .mcell { min-width: 0; justify-items: start; } .mbar { width: 110px; } }
.monthly .delta { margin-top: 0; }

/* ===== Abas de lojas (acesso de grupo) ===== */
.store-tabs { margin-bottom: 14px; animation: fadeUp .4s var(--ease) both; }
.store-tabs-label { font-size: 12.5px; font-weight: 650; color: var(--ink-3); letter-spacing: .02em; margin-bottom: 8px; }
.store-tabs-row { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.store-tab { display: inline-flex; align-items: center; gap: 10px; flex: none; max-width: 300px; padding: 9px 14px 9px 9px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-1); transition: transform .18s var(--ease), border-color .18s, background .18s; }
.store-tab:hover { transform: translateY(-1px); border-color: var(--accent-2); }
.store-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.store-tab[aria-selected="true"] { background: var(--hero); color: #fff; border-color: transparent; }
.st-av { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-size: 12.5px; font-weight: 750; background: var(--accent-soft); color: var(--accent); flex: none; }
.store-tab[aria-selected="true"] .st-av { background: rgba(255, 255, 255, .2); color: #fff; }
.st-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
@media (max-width: 640px) { .store-tab { max-width: 240px; font-size: 13.5px; } }
@media (prefers-reduced-motion: reduce) { .store-tabs { animation: none; } .store-tab { transition: none; } }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--accent); cursor: pointer; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.store-tab.all .st-av { font-size: 16px; }
.share-bars .bar-row { grid-template-columns: minmax(120px, 280px) 1fr auto; }
@media (max-width: 640px) { .share-bars .bar-row { grid-template-columns: 1fr; gap: 4px; } }
.hist-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.hist-actions select { width: auto; min-width: 0; }
.icon-x { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--bad); font-size: 17px; line-height: 1; cursor: pointer; }
.icon-x:hover { background: var(--bad-bg); border-color: transparent; }
.updated-m .next { color: var(--ink-3); }
.updated-m .tip { margin-left: 6px; }
.schedule-note { grid-column: 1 / -1; margin: -4px 2px 0; }
.behind-note { grid-column: 1 / -1; margin-top: 0; line-height: 1.5; }
.schedule-note summary { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.schedule-note p { margin: 4px 0 0; }

/* ===== Master: cartões de loja ===== */
.store-list { display: grid; gap: 8px; margin-bottom: 18px; }
.list-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; margin: 10px 2px 0; }
.list-head .count { padding: 1px 8px; border-radius: 999px; font-size: 12px; }
.list-head.ok { color: var(--good); } .list-head.ok .count { background: var(--good-bg); }
.list-head.no { color: var(--warn); } .list-head.no .count { background: var(--warn-bg); }
.sc { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-1); animation: fadeUp .45s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 40ms); transition: border-color .2s, box-shadow .2s; }
.sc:hover { border-color: var(--accent-2); }
.sc.inactive { opacity: .72; }
/* linha compacta: tocar abre os detalhes e as ações */
.sc.open { border-color: var(--accent-2); box-shadow: var(--shadow-2); }
.sc-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 12px 16px; background: none; border: 0; border-radius: inherit; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.sc-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sc-title { min-width: 0; display: block; }
.sc-title b { font-size: 15px; letter-spacing: -.01em; display: block; overflow-wrap: anywhere; line-height: 1.3; }
.sc-sub { display: flex; flex-wrap: wrap; gap: 2px 6px; font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.sc-note + .sc-note::before { content: '·'; margin-right: 6px; color: var(--ink-3); font-weight: 400; }
.sc-note.warn { color: var(--warn); font-weight: 600; }
.sc-note.off { color: var(--ink-2); font-weight: 600; }
.sc-chev { width: 9px; height: 9px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: translateY(-2px) rotate(45deg); transition: transform .2s var(--ease); margin-right: 4px; }
.sc.open .sc-chev { transform: translateY(2px) rotate(-135deg); }
.sc-body { display: grid; gap: 12px; padding: 14px 16px 16px; border-top: 1px solid var(--line-2); animation: fadeUp .25s var(--ease) backwards; }
.sc-body[hidden] { display: none; }
.sc-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.more { position: relative; margin-left: auto; }
.more-btn { min-width: 40px; font-size: 18px; line-height: 1; }
.more-list { position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 30; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-2); padding: 6px; display: none; }
.more.open .more-list { display: grid; animation: pop .15s var(--ease) both; }
.more-list button { text-align: left; background: none; border: 0; padding: 9px 12px; border-radius: 8px; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; }
.more-list button:hover:not(:disabled) { background: var(--surface-2); }
.more-list button.danger { color: var(--bad); }
.more-list button:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 640px) {
  .sc-row { padding: 11px 12px; gap: 10px; }
  .sc-row .avatar { width: 34px; height: 34px; border-radius: 10px; font-size: 13px; }
  .sc-actions > .btn { flex: 1 1 0; }
  .more { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .sc { animation: none; } }
.avatar.group { background: var(--hero); color: #fff; font-size: 17px; }
.list-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 22px 2px 12px; }
.list-title h2 { font-size: 18px; letter-spacing: -.02em; }
.list-title .sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
@media (max-width: 640px) { .list-title .btn { width: 100%; } }

/* ===== Funil (formato de funil, animado) ===== */
.funnel { display: grid; max-width: 760px; margin: 4px auto 0; }
.f-step { display: grid; justify-items: center; }
.f-shape { width: 100%; height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: #fff; opacity: 0; transform: scaleX(.55) translateY(10px); transform-origin: 50% 50%; }
.funnel.in .f-shape { animation: funnelIn .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 140ms); }
.f-shape.light { color: #0b2545; }
.f-val { font-size: 22px; font-weight: 700; line-height: 1.05; }
.f-lbl { font-size: 12.5px; font-weight: 500; opacity: .9; }
.f-conv { padding: 6px 0; opacity: 0; }
.funnel.in .f-conv { animation: chipIn .45s ease both; animation-delay: calc(var(--i, 0) * 140ms + 80ms); }
.f-conv span { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--ink-2); }
.f-total { display: grid; justify-items: end; padding: 8px 12px; border-radius: 14px; background: var(--accent-soft); }
.f-total b { font-size: 20px; color: var(--accent); line-height: 1.1; }
.f-total span { font-size: 11.5px; color: var(--ink-2); }
@keyframes funnelIn { from { opacity: 0; transform: scaleX(.55) translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes chipIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) { .f-shape { height: 58px; } .f-val { font-size: 19px; } .f-lbl { font-size: 11.5px; } }
@media (prefers-reduced-motion: reduce) { .f-shape, .f-conv { opacity: 1; transform: none; } .funnel.in .f-shape, .funnel.in .f-conv { animation: none; } }

/* ===== Menu lateral (computador) ===== */
.sidenav { display: none; }
.side-logo { height: 38px; width: auto; align-self: flex-start; margin: 2px 6px 4px; }
.side-block { display: grid; gap: 4px; }
.side-cap { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 0 10px 4px; }
.side-list { display: grid; gap: 2px; }
.side-item { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 10px; border-radius: 12px; border: 0; background: none; color: var(--ink-2); font: inherit; font-size: 14px; font-weight: 600; text-align: left; text-decoration: none; cursor: pointer; transition: background .15s, color .15s; }
.side-item:hover { background: var(--accent-soft); color: var(--accent); }
.side-item.active, .side-item[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.side-item.side-store { min-height: 48px; }
.side-dot { width: 6px; height: 6px; border-radius: 3px; background: var(--line); flex: none; }
.side-item.active .side-dot { background: var(--accent); }
.side-av { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--track); color: var(--ink-2); font-size: 12.5px; font-weight: 700; flex: none; }
.side-av.all { background: var(--navy); color: #5cc4f0; font-size: 15px; }
.side-item[aria-current="page"] .side-av:not(.all) { background: var(--accent); color: #fff; }
.side-name { min-width: 0; line-height: 1.3; }
.side-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.side-foot .btn:not(.icon) { flex: 1; height: 44px; }
@media (min-width: 1180px) {
  .app { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
  .sidenav { display: flex; flex-direction: column; gap: 24px; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 26px 16px; background: var(--surface); border-right: 1px solid var(--line); }
  .app-main .topbar { display: none; }
  .app-main .subnav, .app-main .store-tabs { display: none !important; }
  html { scroll-padding-top: 24px; }
  .app-main .container { max-width: 1180px; padding: 30px 40px 64px; }
  /* Cabeçalho da loja: texto, sem cartão */
  .company { background: none; color: var(--ink); box-shadow: none; padding: 0 0 0 2px; margin-bottom: 8px; overflow: visible; }
  .company::after, .company-avatar { display: none; }
  .company-eyebrow { color: var(--accent); opacity: 1; }
  .company-name { font-size: 38px; }
  .company-meta { color: var(--ink-3); opacity: 1; }
}

/* ===== Perfil de clientes: seletor de mês e mês a mês ===== */
.cpicker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 14px; }
.cpick-l { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.cselect { min-width: 230px; font-weight: 600; }
.cmonths { margin-top: 22px; }
.chead-t { font-size: 15.5px; letter-spacing: -.01em; margin-bottom: 8px; }
.cmonths tr.on td { background: var(--accent-soft); }
.cmonths tr.on .link-btn { text-decoration: none; }
@media (max-width: 640px) { .cselect { min-width: 0; flex: 1; } .cpick-l { width: 100%; } }

/* Mais vendidos (Cardápio Web): duas colunas independentes, iFood e cardápio próprio. */
.top-col { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--surface); min-width: 0; }
.top-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.top-head h3 { margin: 0; font-size: 15.5px; }
.top-total { text-align: right; display: flex; flex-direction: column; font-size: 14px; white-space: nowrap; }
.top-list { list-style: none; margin: 6px 0 0; padding: 0; }
.top-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.top-row:last-child { border-bottom: 0; }
.top-rank { width: 24px; height: 24px; border-radius: 999px; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--accent-soft); color: var(--accent); }
.top-row:nth-child(-n+3) .top-rank { background: var(--accent); color: var(--on-accent); }
.top-name { min-width: 0; font-size: 13.5px; }
.top-name b { font-weight: 600; overflow-wrap: anywhere; }
.top-name .pill { margin-left: 6px; font-size: 11px; padding: 1px 8px; }
.top-name .bar-track { height: 6px; margin-top: 5px; }
.top-num { text-align: right; font-size: 13.5px; white-space: nowrap; }
.bar-fill.own { background: linear-gradient(90deg, #f5a524, #f7b955); }
.top-empty { margin: 14px 0 4px; }
.top-note { margin: 12px 0 0; }
.top-col.collapsed .top-more { display: none; }
.top-toggle { margin-top: 12px; }
.top-list.cols .top-row { break-inside: avoid; }
@media (min-width: 900px) { .top-list.cols { column-count: 2; column-gap: 28px; } }

/* Abas de canal: iFood × cardápio próprio (dados separados, nunca somados). */
.channel-tabs { display: grid; grid-template-columns: repeat(var(--tabs, 2), minmax(0, 1fr)); gap: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 5px; margin: 0 0 12px; }
.channel-tab { display: flex; align-items: center; gap: 10px; text-align: left; border: 0; background: transparent; color: var(--ink-2); border-radius: 10px; padding: 9px 14px; font: inherit; cursor: pointer; transition: background .2s, color .2s, box-shadow .2s; }
.channel-tab b { display: block; font-size: 14.5px; font-weight: 650; color: inherit; }
.channel-tab .ch-sub { display: block; font-size: 12px; color: var(--ink-3); }
.channel-tab .ch-dot { width: 10px; height: 10px; border-radius: 999px; flex: none; background: var(--accent); }
.channel-tab.proprio .ch-dot { background: #f5a524; }
.channel-tab.meta .ch-dot { background: #7c5cff; }
.channel-tab:hover { color: var(--accent); }
.channel-tab[aria-selected=true] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(15, 40, 90, .15), 0 0 0 1px var(--line); }
@media (max-width: 520px) {
  .channel-tabs { padding: 4px; gap: 4px; margin-bottom: 8px; border-radius: 12px; }
  .channel-tab { padding: 7px 6px; gap: 6px; justify-content: center; text-align: center; border-radius: 9px; }
  .channel-tab b { font-size: 13px; line-height: 1.25; }
  .channel-tab .ch-dot { width: 8px; height: 8px; }
  .channel-tab .ch-sub { display: none; }
}
/* Barras com valor "pedidos · faturamento": coluna do valor fixa, para as barras ficarem do mesmo tamanho. */
.own-bars .bar-row { grid-template-columns: minmax(96px, 200px) 1fr 172px; }
.own-bars .bar-row > .r { white-space: nowrap; }
@media (max-width: 640px) { .own-bars .bar-row { grid-template-columns: 1fr; gap: 4px; } .own-bars .bar-row > .r { text-align: left; } }

/* ===== Master no celular: nada cortado ===== */
@media (max-width: 640px) {
  .summary .card { padding: 12px 14px; }
  .summary .ico { width: 26px; height: 26px; }
  .summary .ico svg { width: 15px; height: 15px; }
  .summary .v { font-size: 25px; margin-top: 8px; }
  .summary .v.txt { font-size: 19px; margin-top: 8px; }
  /* celular: resumo enxuto (rótulo e número); os detalhes ficam nos filtros e na lista */
  .summary { gap: 8px; margin-bottom: 14px; }
  .summary .card { padding: 10px 12px; border-radius: 14px; }
  .summary .ico { display: none; }
  .summary .sum-l { font-size: 12px; }
  .summary .v { font-size: 22px; margin-top: 2px; }
  .summary .card:not(:last-of-type) .sum-d, .summary .sum-bar { display: none; }
  .summary .card:last-of-type { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
  .summary .card:last-of-type .sum-h { flex-basis: 100%; }
  .summary .card:last-of-type .v.txt { font-size: 16px; margin-top: 0; }
  .summary .card:last-of-type .sum-d { margin: 0; }
}
/* corpo do modal rola; título e botões ficam sempre visíveis (a margem negativa evita cortar o contorno de foco) */
.modal-body { overflow-y: auto; overscroll-behavior: contain; min-height: 0; flex: 1 1 auto; padding: 0 4px 4px; margin: 0 -4px -4px; }
.field .check { display: flex; margin: 0; font-weight: 500; color: var(--ink); }
.more-title { display: none; }
@media (max-width: 640px) {
  .modal { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
  .modal .check-list { max-height: none; }
  /* filtros em 2 colunas, todos visíveis */
  .tools .seg { display: grid; grid-template-columns: 1fr 1fr; overflow: visible; }
  .tools .seg-btn { white-space: normal; line-height: 1.25; padding: 8px 6px; }
  /* rodapé do cartão: "Ver dashboard", "Baixar PDF" e "⋯" sempre na mesma linha */
  .sc-actions > .btn { min-width: 0; white-space: normal; text-align: center; line-height: 1.2; padding: 8px 6px; }
  /* menu "⋯" abre como painel no rodapé, com o nome da loja */
  .more.open::before { content: ''; position: fixed; inset: 0; z-index: 84; background: rgba(8, 16, 32, .45); animation: fadeUp .2s ease both; }
  .more-list { position: fixed; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); min-width: 0; z-index: 85; border-radius: 18px; padding: 8px; max-height: calc(100dvh - 24px); overflow-y: auto; }
  .more.open .more-list { animation: fadeUp .25s var(--ease) both; }
  .more-list button { padding: 14px; font-size: 15px; }
  .more-title { display: block; padding: 8px 14px 10px; font-size: 13px; font-weight: 650; color: var(--ink-3); border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
  /* histórico de acessos: cada registro vira um bloco (data e evento, aparelho, IP) */
  .hist { max-height: none; overflow: visible; }
  .hist table, .hist tbody { display: block; }
  .hist thead { display: none; }
  .hist tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; position: relative; padding: 10px 40px 10px 2px; border-bottom: 1px solid var(--line-2); }
  .hist td { padding: 0; border: 0; font-size: 13px; color: var(--ink-2); }
  .hist tbody tr:hover td { background: none; }
  .hist td.h-date { font-weight: 650; color: var(--ink); }
  .hist td.h-ev { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); }
  .hist td.h-store, .hist td.h-dev, .hist td.h-ip { flex-basis: 100%; }
  .hist td.h-ip { color: var(--ink-3); font-size: 12px; overflow-wrap: anywhere; }
  .hist td.h-ip::before { content: 'IP '; }
  .hist td.r { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); }
  .hist-actions select { flex: 1; }
}

.hist tr.sec-bad td.h-ev { color: var(--warn); font-weight: 600; }
.sec-bk { margin: -4px 0 12px; }

/* login: contato com a LP Mídias pelo WhatsApp */
.auth-help { display: grid; gap: 10px; justify-items: center; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.wa-btn { gap: 10px; font-weight: 600; padding: 11px 16px; }
.wa-btn .wa-ico { color: #1da851; flex: none; }
.wa-btn:hover { border-color: #1da851; background: color-mix(in srgb, #25d366 10%, var(--surface)); }

/* login: nome do painel acima do "Bem-vindo" */
.auth-eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
@media (max-width: 400px) { #back .bk-txt { display: none; } }

/* ---------- Aba "Anúncios Meta" ---------- */
/* Funil do Meta: mesmo desenho do funil do iFood, com uma faixa por etapa (rampa de um só tom, do claro ao escuro). */
.mfun { max-width: 720px; }
.mfun-note { text-align: center; margin: 0 0 10px; }
.mfun .f-shape { color: #0b2545; }
.mfun .f-shape.m0 { background: #cdeefb; } .mfun .f-shape.m1 { background: #a7ddf4; } .mfun .f-shape.m2 { background: #79cbef; }
.mfun .f-shape.m3 { background: #45b8e9; } .mfun .f-shape.m4 { background: #0080bd; color: #fff; }
.mfun .f-shape.m5 { background: #006ca3; color: #fff; } .mfun .f-shape.m6 { background: #005686; color: #fff; }
.mfun .f-conv { text-align: center; }
.mfun .f-conv span { flex-wrap: wrap; justify-content: center; }
.mfun .f-conv i { font-style: normal; color: var(--ink-3); }
@media (max-width: 640px) { .mfun .f-shape { height: 54px; } .mfun .f-conv span { font-size: 11.5px; padding: 3px 9px; } }

.cmp-card { display: grid; gap: 14px; }
.cmp-big { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.cmp-big b { font-size: 34px; font-weight: 750; letter-spacing: -.02em; color: var(--ink); }
.cmp-big span { color: var(--ink-2); font-size: 14.5px; }
.cmp-rows { display: grid; gap: 2px; }
.cmp-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.cmp-row:last-child { border-bottom: 0; }
.src-tag { font-size: 11px; font-weight: 650; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.src-tag.meta { background: color-mix(in srgb, #7c5cff 16%, transparent); color: #5b3fd6; }
.src-tag.proprio { background: color-mix(in srgb, #f5a524 18%, transparent); color: #8a5300; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .src-tag.meta { color: #b9a8ff; } :root:not([data-theme="light"]) .src-tag.proprio { color: #f6c46b; } }
:root[data-theme="dark"] .src-tag.meta { color: #b9a8ff; } :root[data-theme="dark"] .src-tag.proprio { color: #f6c46b; }

/* Motivos de cancelamento (cardápio próprio) */
.reasons { display: grid; gap: 8px; align-content: start; min-width: 0; }
.reasons .bl-val { white-space: nowrap; }
.reasons .bl-bar { height: auto; min-height: 32px; }
.reasons .bl-text { white-space: normal; line-height: 1.3; padding: 7px 10px; }

/* ===== Painel master: plataformas de cada loja ===== */
.pf-ifood { --pf: var(--accent); } .pf-cardapioweb { --pf: #f5a524; } .pf-meta { --pf: #7c5cff; }
.sc-row.has-side { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.pf-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.pf { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line);
  font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--surface); white-space: nowrap; }
.pf i { width: 8px; height: 8px; border-radius: 50%; background: var(--pf); flex: none; }
.pf.ok { color: var(--ink); background: color-mix(in srgb, var(--pf) 10%, var(--surface)); border-color: color-mix(in srgb, var(--pf) 38%, transparent); }
.pf.stale, .pf.nodata { color: var(--warn); background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.pf.stale b { font-weight: 800; }
.pf.off { color: var(--ink-3); background: transparent; border-style: dashed; font-weight: 500; }
.pf.off i { background: transparent; border: 1.5px solid var(--ink-3); width: 7px; height: 7px; }
.sc-note.grp { color: var(--accent); font-weight: 600; }
#pfFilter { width: auto; min-width: 210px; }
@media (max-width: 860px) {
  .sc-row.has-side { grid-template-columns: auto minmax(0, 1fr) auto; }
  .sc-row.has-side .pf-row { grid-column: 2 / -1; grid-row: 2; justify-content: flex-start; }
  .sc-row.has-side .sc-chev { grid-column: 3; grid-row: 1; }
}
@media (max-width: 640px) { #pfFilter { flex: 1 1 100%; } .pf { padding: 2px 8px; font-size: 11.5px; } }
.pf-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin: -4px 2px 12px; }
.pf-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.pf-legend .pf { font-size: 11px; padding: 1px 8px; }

/* ===== Relatório no WhatsApp (painel master) ===== */
.row-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row-inline select { flex: 1 1 140px; min-width: 0; }
.report-form .field .check { padding: 4px 0; }
.report-form input[type=time] { font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink); }
.wa-preview > div { min-height: 1.42em; }
.wa-tpl { display: block; width: 100%; min-height: 220px; resize: vertical; font: inherit; font-size: 14px; line-height: 1.5; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink); }
.wa-tpl:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-2) 25%, transparent); outline: none; }
@media (max-width: 640px) { .wa-tpl { font-size: 16px; } }
.wa-vars { margin-top: 10px; }
.wa-vars summary { font-size: 13.5px; }
.wa-vg { margin-top: 10px; }
.wa-vg-t { display: block; font-size: 12px; font-weight: 650; color: var(--ink-2); margin-bottom: 6px; }
.wa-vg-l { display: flex; flex-wrap: wrap; gap: 6px; }
.wa-var { font: inherit; font-size: 12.5px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.wa-var:hover { border-color: var(--accent-2); color: var(--accent); }
.wa-vg.off .wa-var { opacity: .55; }
.wa-err { color: var(--bad); }

/* ===== Quadro do relatório: abas à esquerda, prévia como no WhatsApp à direita ===== */
.modal:has(.rp) { max-width: 1080px; }
.rp { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.rp-main { min-width: 0; }
.rp-content { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: -6px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.rp-content-t { font-size: 13px; font-weight: 650; color: var(--ink-2); }
.rp-content .seg-btn:disabled { opacity: .4; cursor: not-allowed; }
.rp-what { display: grid; gap: 2px; border: 1px solid var(--line); border-radius: 14px; padding: 6px 8px; background: var(--surface-2); }
.rp-what .check { align-items: flex-start; }
.rp-what .check input { margin-top: 2px; }
.rp-what .check > span { line-height: 1.35; }
.rp-srcs { display: flex; flex-wrap: wrap; gap: 2px 6px; padding-left: 30px; transition: opacity .2s; }
.rp-srcs.off { opacity: .45; }
.rp-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; position: sticky; top: 0; background: var(--surface); z-index: 2; overflow-x: auto; scrollbar-width: none; }
.rp-tab { border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink-3); padding: 10px 12px; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.rp-tab:hover { color: var(--ink); }
.rp-tab[aria-selected=true] { color: var(--accent); border-bottom-color: var(--accent); }
.rp-tab:focus-visible, .rp-day:focus-visible, .rp-preset:focus-visible, .rp-switch:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.rp-count:not(:empty) { font-size: 11px; font-weight: 700; background: var(--accent-soft); color: var(--accent); padding: 1px 7px; border-radius: 999px; }
.rp-tab.only-narrow { display: none; }
.rp-preview { position: sticky; top: 0; min-width: 0; }

.rp-sched { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--surface-2); margin-top: 8px; }
.rp .rp-sched-h { display: flex; align-items: center; gap: 12px; cursor: pointer; margin: 0; font-size: 14px; font-weight: 500; color: var(--ink); }
.rp input[type=time] { font: inherit; font-size: 14px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink); }
.rp-sched-h > span { display: flex; flex-direction: column; line-height: 1.3; font-size: 14px; font-weight: 500; color: var(--ink); }
.rp-sched-h .muted { font-size: 12.5px; font-weight: 400; }
.rp-sched-b { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; padding-left: 52px; transition: opacity .2s; }
.rp-sched-b .muted { font-size: 13px; }
.rp-sched-b select { flex: 0 1 120px; }
.rp-sched.off .rp-sched-b { opacity: .45; }
.rp-switch { appearance: none; -webkit-appearance: none; width: 40px; height: 24px; border-radius: 999px; background: var(--line); position: relative; flex: none; cursor: pointer; margin: 0; transition: background .2s; }
.rp-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .2s var(--ease); }
.rp-switch:checked { background: var(--accent); }
.rp-switch:checked::after { transform: translateX(16px); }
.rp-days { display: inline-flex; gap: 4px; }
.rp-day { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); font: inherit; font-size: 13px; font-weight: 650; color: var(--ink-2); cursor: pointer; padding: 0; }
.rp-day:hover { border-color: var(--accent-2); }
.rp-day[aria-pressed=true] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.rp-next { margin-top: 12px; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 12px 12px 0; font-size: 13.5px; display: grid; gap: 3px; color: var(--ink); }
.rp-next-t { font-size: 12px; font-weight: 650; color: var(--accent); }
.rp-next-row { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 2px 10px; align-items: start; text-align: left; font: inherit; font-size: 13.5px; color: var(--ink); background: none; border: 0; border-radius: 8px; padding: 5px 6px; margin: 0 -6px; cursor: pointer; }
.rp-next-row:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.rp-next-row.cur .rp-next-k { color: var(--accent); }
.rp-next-k { font-weight: 650; color: var(--ink-2); }
.rp-next-warn { margin-top: 6px; font-size: 12.5px; color: var(--warn); }
@media (max-width: 640px) { .rp-next-row { grid-template-columns: minmax(0, 1fr); } }

.rp-presets { display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.rp-preset { text-align: left; display: flex; flex-direction: column; gap: 5px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font: inherit; color: var(--ink); cursor: pointer; transition: border-color .15s, background .15s; }
.rp-preset b { font-size: 13.5px; }
.rp-preset > span:last-child { font-size: 11.5px; color: var(--ink-3); line-height: 1.35; }
.rp-preset:hover { border-color: var(--accent-2); }
.rp-preset[aria-pressed=true] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.rp-level { display: flex; gap: 3px; }
.rp-level i { width: 12px; height: 4px; border-radius: 2px; background: var(--line); }
.rp-level i.on { background: var(--accent); }
.rp-tplhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.rp-tplhead label { margin: 0 !important; }
.rp-tplstate { font-size: 12.5px; color: var(--ink-3); }
.rp-tplstate.dirty { color: var(--warn); font-weight: 600; }
.btn.pulse { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-2) 35%, transparent); }

.rp-pvhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.rp-pvtitle { font-size: 13px; font-weight: 650; color: var(--ink-2); }
.wa-phone { --wa-bg: #efeae2; --wa-head: #f0f2f5; --wa-out: #d9fdd3; --wa-ink: #111b21; --wa-sub: #667781; --wa-dots: rgba(0, 0, 0, .045);
  border-radius: 24px; overflow: hidden; border: 7px solid #1f2c34; background: var(--wa-bg); box-shadow: var(--shadow-2); }
:root[data-theme="dark"] .wa-phone { --wa-bg: #0b141a; --wa-head: #202c33; --wa-out: #005c4b; --wa-ink: #e9edef; --wa-sub: #8696a0; --wa-dots: rgba(255, 255, 255, .03); border-color: #2a3942; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wa-phone { --wa-bg: #0b141a; --wa-head: #202c33; --wa-out: #005c4b; --wa-ink: #e9edef; --wa-sub: #8696a0; --wa-dots: rgba(255, 255, 255, .03); border-color: #2a3942; } }
.wa-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--wa-head); color: var(--wa-ink); }
.wa-av { width: 34px; height: 34px; border-radius: 50%; background: #dfe5e7; color: #8696a0; display: grid; place-items: center; flex: none; }
.wa-av svg { width: 18px; height: 18px; }
.wa-ht { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.wa-ht b, .wa-ht span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-ht b { font-size: 14px; font-weight: 600; }
.wa-ht span { font-size: 12px; color: var(--wa-sub); }
.wa-chat { height: min(48vh, 460px); overflow-y: auto; overscroll-behavior: contain; padding: 14px 14px 18px 10px; background-color: var(--wa-bg);
  background-image: radial-gradient(circle at 1px 1px, var(--wa-dots) 1px, transparent 0); background-size: 14px 14px; display: flex; flex-direction: column; align-items: flex-end; }
.wa-bubble { position: relative; max-width: 94%; background: var(--wa-out); color: var(--wa-ink); border-radius: 10px 0 10px 10px; padding: 7px 9px 20px 10px; font-size: 13.5px; line-height: 1.42; box-shadow: 0 1px .5px rgba(11, 20, 26, .13); overflow-wrap: anywhere; transition: opacity .2s; }
.wa-bubble::before { content: ''; position: absolute; top: 0; right: -8px; border-left: 8px solid var(--wa-out); border-bottom: 10px solid transparent; }
.wa-time { position: absolute; right: 8px; bottom: 4px; font-size: 11px; color: var(--wa-sub); display: flex; gap: 3px; align-items: center; }
.wa-ticks { color: #53bdeb; letter-spacing: -3px; padding-right: 3px; }
.wa-bubble.typing { display: flex; gap: 4px; padding: 12px 14px; }
.wa-bubble.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--wa-sub); animation: waDot 1.1s infinite; }
.wa-bubble.typing i:nth-child(2) { animation-delay: .15s; } .wa-bubble.typing i:nth-child(3) { animation-delay: .3s; }
.wa-bubble.err { background: var(--wa-head); color: var(--bad); padding-bottom: 8px; }
.wa-bubble.err::before { border-left-color: var(--wa-head); }
.wa-chat.loading .wa-bubble:not(.typing) { opacity: .55; }
@keyframes waDot { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.rp-pvnote { margin: 8px 2px 0; }
.rp-actions { display: flex; gap: 8px; margin: 12px 0 6px; flex-wrap: wrap; }
.rp-actions .btn { flex: 1 1 auto; }

@keyframes waPulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--bad) 55%, transparent); } 50% { box-shadow: 0 0 0 4px transparent; } }
.wa-events { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 0; max-height: 50vh; overflow-y: auto; }
.wa-events li { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0 8px 2px; position: relative; font-size: 14px; }
.wa-events li:not(:last-child)::after { content: ''; position: absolute; left: 7px; top: 24px; bottom: -8px; width: 2px; background: var(--line); }
.wa-ev-dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 4px; flex: none; background: var(--good); box-shadow: 0 0 0 3px var(--good-bg); }
.wa-events li.down .wa-ev-dot { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); }
.wa-ev-d { display: block; }
@media (prefers-reduced-motion: reduce) { .wa-bubble.typing i, .st-pill.bad i { animation: none; } .rp-switch::after { transition: none; } }

@media (max-width: 1020px) {
  .rp-presets { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
@media (max-width: 860px) {
  .rp { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .rp-content { margin-bottom: 10px; }
  .rp-content .seg { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; }
  .rp-content .seg-btn { flex: 1 0 auto; }
  .rp-tab.only-narrow { display: inline-flex; }
  .rp-preview { display: none; position: static; }
  .rp[data-tab=previa] .rp-preview { display: block; }
  .wa-chat { height: auto; min-height: 280px; max-height: none; }
}
@media (max-width: 640px) {
  .rp-tab { padding: 10px 10px; font-size: 13.5px; }
  .rp-sched-b { padding-left: 0; }
  .rp input[type=time] { font-size: 16px; }
  .rp-presets { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 64%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
  .rp-preset { scroll-snap-align: start; }
  .wa-phone { border-width: 0; border-radius: 16px; }
}

/* Prévia: formatação do WhatsApp */
.wa-preview code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; background: rgba(0, 0, 0, .06); border-radius: 4px; padding: 0 3px; }
.wa-preview .wa-q { border-left: 3px solid rgba(0, 0, 0, .25); padding-left: 8px; opacity: .9; }
.wa-preview .wa-li { padding-left: 14px; position: relative; }
.wa-preview .wa-li::before { content: '•'; position: absolute; left: 3px; }

/* Histórico do relatório */
.rp-hist-top { margin: 0 0 10px; }
.hist td.h-x { width: 34px; text-align: right; }
.icon-x { width: 28px; height: 28px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--ink-3); font-size: 18px; line-height: 1; cursor: pointer; }
.icon-x:hover, .icon-x:focus-visible { color: var(--bad); border-color: var(--line); background: var(--bad-bg); }

/* Reconectar o WhatsApp (QR code) */
.wa-steps { margin: 0 0 14px 18px; padding: 0; display: grid; gap: 4px; font-size: 14px; color: var(--ink-2); }
.wa-qr { width: 280px; max-width: 100%; aspect-ratio: 1; margin: 0 auto 8px; border-radius: 16px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; padding: 8px; }
.wa-qr-img { width: 100%; height: auto; image-rendering: pixelated; }
.wa-qr-wait { font-size: 13px; color: #566779; text-align: center; padding: 12px; }
.wa-qr-wait.err { color: #b3261e; }
.wa-qr-modal .wa-vars input { flex: 1 1 180px; min-width: 0; }
.wa-pair { margin-top: 12px; display: grid; gap: 4px; justify-items: center; padding: 12px; border-radius: 12px; background: var(--accent-soft); }
.wa-pair span { font-size: 12.5px; color: var(--ink-2); }
.wa-pair b { font-size: 26px; letter-spacing: .12em; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--ink); }

/* Listas escondíveis do master */
.list-title-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.fold-row { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 14px; border: 1px dashed var(--line); background: var(--surface); font: inherit; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.fold-row b { color: var(--accent); font-size: 13.5px; }
.fold-row:hover { border-color: var(--accent-2); }
button.list-head { border: 0; background: none; font-family: inherit; cursor: pointer; padding: 4px 2px; width: 100%; text-align: left; }
.lh-chev { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin: -3px 2px 0 0; transition: transform .2s; flex: none; }
button.list-head[aria-expanded=false] .lh-chev { transform: rotate(-45deg); margin-top: 0; }
@media (max-width: 640px) { .list-title-btns { width: 100%; } .list-title-btns .btn { flex: 1; } .list-title .fold-btn { width: auto; } }
@media (prefers-reduced-motion: reduce) { .lh-chev { transition: none; } }

/* Quadro do relatório: mensagem do semanal ou do mensal */
.rp-period { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); }
.rp-period > span:first-child { font-size: 13px; font-weight: 650; color: var(--ink-2); }

/* ===== Cartão aberto (master): faixas Acesso, Plataformas e Relatório; título e ações à esquerda, conteúdo à direita ===== */
.sc-body { padding: 0; gap: 0; }
.sc.open .sc-sub, .sc.open .pf-row { display: none; }
.sc-band { display: grid; grid-template-columns: 172px minmax(0, 1fr); gap: 10px 28px; align-items: start; padding: 16px 18px; }
.sc-band + .sc-band { border-top: 1px solid var(--line-2); }
.sc-band-h { display: grid; gap: 10px; justify-items: start; }
.sc-band-h h3 { margin: 3px 0 0; font-size: 14px; font-weight: 650; letter-spacing: -.01em; color: var(--ink); }
.sc-band-acts { display: grid; gap: 6px; width: 100%; }
.sc-band-b { display: grid; gap: 10px; min-width: 0; }
.sc-band-note { margin: 0; font-size: 12.5px; color: var(--ink-3); }
.sc-body > .sc-actions { padding: 12px 18px; border-top: 1px solid var(--line-2); background: var(--surface-2); border-radius: 0 0 16px 16px; }
/* fatos de acesso: lado a lado */
.acct { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px 20px; }
.acct-row { display: grid; gap: 1px; align-content: start; min-width: 0; }
.acct-l { font-size: 12px; color: var(--ink-3); }
.acct-v { font-size: 14px; font-weight: 650; color: var(--ink); overflow-wrap: anywhere; }
.acct-d { font-size: 12.5px; color: var(--ink-3); line-height: 1.35; }
.acct-row.good .acct-v { color: var(--good); }
.acct-row.warn .acct-v, .acct-row.warn .acct-d { color: var(--warn); }
.acct-row.muted .acct-v { color: var(--ink-3); font-weight: 600; }
/* listas (plataformas, relatório, lojas do grupo): linhas com divisória, sem caixa */
.pl { display: grid; }
.pl-row { display: grid; grid-template-columns: 28px 128px minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; min-height: 44px; padding: 7px 0; }
.pl-row:first-child { padding-top: 0; }
.pl-row + .pl-row { border-top: 1px solid var(--line-2); }
.pl-row:has(.pl-txt:empty) .pl-name { grid-column: 2 / 4; color: var(--ink); }
.pl-mark { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 10.5px; font-weight: 800; color: var(--ink); background: color-mix(in srgb, var(--pf, var(--accent)) 18%, var(--surface)); }
.pl-mark svg { width: 15px; height: 15px; }
.pl-mark.wa { color: var(--accent); background: var(--accent-soft); }
.pl-mark.store { font-size: 10px; color: var(--accent); background: var(--accent-soft); }
.pl-name { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.pl-txt { display: grid; gap: 1px; min-width: 0; }
.pl-val { font-size: 14px; font-weight: 650; color: var(--ink); }
.pl-det { font-size: 12.5px; color: var(--ink-3); line-height: 1.35; }
.pl-act { justify-self: end; }
.pl-row.off .pl-mark { color: var(--ink-3); background: var(--line-2); }
.pl-row.off .pl-val { color: var(--ink-3); font-weight: 600; }
.pl-row.stale .pl-mark, .pl-row.nodata .pl-mark { color: var(--warn); background: var(--warn-bg); }
.pl-row.stale .pl-val, .pl-row.nodata .pl-val { color: var(--warn); }
.pl-foot { padding-top: 10px; border-top: 1px solid var(--line-2); }
.pf-facts { display: flex; flex-wrap: wrap; gap: 8px 28px; flex: 1 1 auto; min-width: 0; }
.pf-fact { display: grid; gap: 2px; min-width: 0; }
.pf-l { font-size: 11.5px; color: var(--ink-3); }
.pf-v { display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; font-size: 13px; font-weight: 600; color: var(--ink); min-width: 0; }
.pf-name { overflow-wrap: anywhere; }
.pf-tag { font-size: 11.5px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.pf-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--good); }
.pf-dot.warn { background: var(--warn); } .pf-dot.bad { background: var(--bad); }
.pf-when { font-weight: 500; color: var(--ink-3); }
.pf-when.warn { color: var(--warn); font-weight: 600; } .pf-when.bad { color: var(--bad); font-weight: 600; }
@media (max-width: 860px) {
  .sc-band { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px; }
  .sc-band-h { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
  .sc-band-h h3 { margin: 0; }
  .sc-band-acts { display: flex; width: auto; }
  .sc-body > .sc-actions { padding: 12px 14px; }
}
@media (max-width: 640px) {
  .pl-row { grid-template-columns: 28px minmax(0, 1fr) auto; grid-template-areas: "m n a" "m t t"; align-items: start; }
  .pl-row > .pl-mark { grid-area: m; } .pl-name { grid-area: n; align-self: center; } .pl-txt { grid-area: t; } .pl-act { grid-area: a; }
  .pl-row:has(.pl-txt:empty) .pl-name { grid-column: auto; }
  .acct { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Marcar todos do grupo */
.rp-mention { margin-top: 10px; }
.rp-mention-test { font-size: 13px; padding: 2px 0 4px; }

/* ===== Situação do sistema no master: a frase de situação e os quadros (segurança, WhatsApp, integrações) ===== */
.status-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin: -6px 0 20px; }
.sys-verdict { --tone: var(--good); --tone-bg: var(--good-bg); grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 16px;
  background: color-mix(in srgb, var(--tone-bg) 70%, var(--surface)); border: 1px solid color-mix(in srgb, var(--tone) 28%, transparent); }
.sys-verdict.warn { --tone: var(--warn); --tone-bg: var(--warn-bg); }
.sys-verdict.bad { --tone: var(--bad); --tone-bg: var(--bad-bg); }
.sys-verdict > i { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--tone); box-shadow: 0 0 0 5px color-mix(in srgb, var(--tone) 18%, transparent); }
.sys-txt { display: grid; gap: 1px; min-width: 0; flex: 1; }
.sys-txt b { font-size: 16px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.sys-txt span { font-size: 13px; color: var(--ink-2); }
.sys-txt span:empty { display: none; }
.sys-at { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.st-card { --tone: var(--good); --tone-bg: var(--good-bg); display: flex; flex-direction: column; min-width: 0; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.st-card.warn, .st-pill.warn { --tone: var(--warn); --tone-bg: var(--warn-bg); }
.st-card.bad, .st-pill.bad { --tone: var(--bad); --tone-bg: var(--bad-bg); }
.st-card.off, .st-pill.off { --tone: var(--ink-3); --tone-bg: var(--line-2); }
.st-card.bad { background: color-mix(in srgb, var(--bad-bg) 55%, var(--surface)); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.st-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 32px; }
.st-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--tone-bg); color: var(--tone); }
.st-ico svg { width: 16px; height: 16px; }
.st-head h3 { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -.01em; color: var(--ink); }
.st-pill { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--tone-bg); color: var(--tone); }
.st-pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-pill.bad i { animation: waPulse 1.6s infinite; }
.st-note { margin: 10px 0 2px; font-size: 13px; line-height: 1.45; color: var(--tone); font-weight: 500; }
.st-facts { margin: 10px 0 0; display: grid; }
.st-fact { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 8px 0; border-top: 1px solid var(--line-2); font-size: 13px; }
.st-fact dt { color: var(--ink-3); flex: none; }
.st-fact dd { margin: 0; text-align: right; font-weight: 600; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.st-fact dd .pf-dot { display: inline-block; margin-right: 7px; vertical-align: 1px; }
.st-fact.warn dd { color: var(--warn); } .st-fact.bad dd, .st-bad { color: var(--bad); } .st-fact.muted dd { color: var(--ink-3); font-weight: 500; }
.st-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 12px; }
.pf-dot.off { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-3); }
@media (max-width: 860px) {
  .status-board { margin-top: -4px; }
  .sys-verdict { flex-wrap: wrap; gap: 10px 12px; padding: 12px 14px; }
  .sys-at { flex-basis: 100%; padding-left: 26px; }
  .st-acts .btn { flex: 1 1 auto; min-height: 44px; }
}

/* ===== Menu do tema: automático (igual ao aparelho), claro ou escuro ===== */
.theme-menu { position: relative; display: inline-flex; }
.theme-pop { position: absolute; top: calc(100% + 8px); right: 0; z-index: 90; width: max-content; min-width: 230px; display: grid; gap: 2px; padding: 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2); animation: pop .18s var(--ease) both; }
.side-foot .theme-pop { top: auto; bottom: calc(100% + 8px); left: 0; right: auto; }
.theme-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.theme-opt:hover { background: var(--surface-2); }
.theme-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.theme-opt[aria-checked="true"] { background: var(--accent-soft); }
.theme-ico, .theme-tick { display: grid; place-items: center; flex: none; }
.theme-ico svg, .theme-tick svg { width: 17px; height: 17px; }
.theme-tick { color: var(--accent); }
.theme-txt { flex: 1; display: grid; font-size: 14px; font-weight: 600; }
.theme-txt small { font-size: 12px; font-weight: 500; color: var(--ink-3); }
@media (prefers-reduced-motion: reduce) { .theme-pop { animation: none; } }

/* ===== Abas do painel master ===== */
.mtabs { position: sticky; top: 61px; z-index: 29; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 0 max(16px, calc((100% - 1240px) / 2 + 16px)); background: var(--glass); border-bottom: 1px solid var(--line); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); }
.topbar:has(+ .mtabs) { border-bottom-color: transparent; }
.mtabs::-webkit-scrollbar { display: none; }
.mtabs a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px 11px; color: var(--ink-3); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; border-radius: 10px 10px 0 0; }
.mtabs a:hover { color: var(--ink); background: var(--surface-2); }
.mtabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.mtabs a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.mt-ico { display: inline-grid; place-items: center; }
.mt-ico svg { width: 17px; height: 17px; }
.mtab[hidden] { display: none; }
.mtab > :first-child { margin-top: 0; }
.mtab .list-title:first-child { margin-top: 4px; }
@media (max-width: 640px) {
  /* Celular: as abas viram a barra do rodapé (ícone e nome curto). */
  .mtabs { position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 40; justify-content: space-around; gap: 0; padding: 4px 4px max(4px, env(safe-area-inset-bottom)); background: var(--glass-solid); border-top: 1px solid var(--line); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); }
  .topbar:has(+ .mtabs) { border-bottom-color: var(--line); }
  .mtabs a { flex: 1 1 0; flex-direction: column; gap: 3px; padding: 7px 2px 6px; font-size: 11px; border-bottom: 0; border-radius: 12px; min-width: 0; }
  .mtabs a span:last-child { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .mtabs a[aria-current="page"] { background: var(--accent-soft); }
  .mt-ico svg { width: 20px; height: 20px; }
  body:has(.mtabs) .container { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}

/* ===== Aba Segurança ===== */
.sec-full { margin-top: 14px; }
.sec-h { font-size: 17px; margin: 0 0 10px; }

/* ===== Aba Integrações ===== */
.in-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.in-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-1); padding: 16px; min-width: 0; }
.in-card .st-ico { background: var(--line-2); color: var(--ink-3); }
.in-card.on .st-ico { background: var(--accent-soft); color: var(--accent); }
.in-head { display: flex; align-items: flex-start; gap: 12px; }
.in-t { flex: 1; min-width: 0; }
.in-t h3 { margin: 0; font-size: 16px; font-weight: 650; }
.in-t p { margin: 2px 0 0; font-size: 13px; color: var(--ink-3); line-height: 1.4; }
.in-sw { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); cursor: pointer; flex: none; padding-top: 2px; }
.in-card.on .in-sw { color: var(--accent); }
.in-body { margin-top: 12px; display: grid; gap: 0; }
.in-field { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line-2); }
.in-l { font-size: 13px; color: var(--ink-3); }
.in-v { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; font-size: 13.5px; }
.in-key { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; }
.in-key input { flex: 1 1 180px; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.in-mask { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 600; letter-spacing: .04em; margin-right: 4px; }
.in-model { font-weight: 600; overflow-wrap: anywhere; }
.in-v select { max-width: 100%; }
.in-urlrow { display: flex; gap: 8px; width: 100%; }
.in-url { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.in-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; background: var(--surface-2); border-radius: 6px; padding: 1px 5px; }
.in-ok { display: inline-flex; align-items: center; gap: 5px; color: var(--good); font-weight: 600; }
.in-ok svg { width: 15px; height: 15px; }
.in-warn { color: var(--warn); font-weight: 600; overflow-wrap: anywhere; }
.in-note { margin: 4px 0 2px; font-size: 12.5px; color: var(--ink-3); }
.in-ver { width: 110px; }
.in-errs { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--warn); }
.in-test { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.in-test-out { font-size: 13px; color: var(--ink-3); }
.in-test-out.good { color: var(--good); font-weight: 600; } .in-test-out.bad { color: var(--bad); font-weight: 600; }
.in-gsw { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line-2); cursor: pointer; }
.in-gsw > span { display: grid; gap: 2px; }
.in-gsw b { font-size: 14px; } .in-gsw small { font-size: 12.5px; color: var(--ink-3); }
.in-urlrow .btn svg { width: 15px; height: 15px; }
@media (max-width: 860px) { .in-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .in-field { grid-template-columns: 1fr; gap: 6px; } }

/* ===== Escolher modelo (OpenRouter) ===== */
.modal:has(.mp) { max-width: 620px; }
.mp { display: grid; gap: 10px; min-height: 0; }
.mp-search { width: 100%; }
.mp-list { display: grid; gap: 4px; max-height: min(56vh, 520px); overflow-y: auto; padding: 2px; }
.mp-item { display: grid; gap: 2px; text-align: left; padding: 9px 11px; border-radius: 12px; border: 1px solid transparent; background: none; font: inherit; color: var(--ink); cursor: pointer; }
.mp-item:hover { background: var(--surface-2); }
.mp-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.mp-item.on { border-color: var(--accent); background: var(--accent-soft); }
.mp-item.def { border-style: dashed; border-color: var(--line); }
.mp-name { font-weight: 650; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.mp-id { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }
.mp-meta { font-size: 12px; color: var(--ink-2); }
.mp-free { font-size: 11px; font-weight: 650; color: var(--good); background: var(--good-bg); border-radius: 999px; padding: 1px 7px; }

/* ===== Aba WhatsApp: transcrição ===== */
.cw-head { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-1); padding: 16px; margin-top: 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 20px; align-items: start; }
.cw-t { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.cw-t .st-ico { background: var(--accent-soft); color: var(--accent); }
.cw-t h2 { margin: 0; font-size: 17px; }
.cw-t .sub { margin: 2px 0 0; font-size: 13px; color: var(--ink-3); max-width: 62ch; }
.cw-master { border-top: 0; padding: 0; min-width: 240px; }
.cw-facts { grid-column: 1 / -1; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.cw-facts > div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.cw-facts dt { font-size: 12px; color: var(--ink-3); }
.cw-facts dd { margin: 2px 0 0; font-size: 17px; font-weight: 700; color: var(--ink); }
.cw-facts .bad dd { color: var(--bad); }
.cw-miss { grid-column: 1 / -1; margin: 0; font-size: 13px; color: var(--warn); font-weight: 600; background: var(--warn-bg); border-radius: 12px; padding: 10px 12px; }
.cw-miss a { color: inherit; }
.list-title-btns input[type=search] { width: 220px; max-width: 100%; }
.cw-list { display: grid; gap: 8px; }
.cw-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.cw-row.on { box-shadow: inset 3px 0 0 var(--accent); }
.cw-name { display: grid; gap: 2px; min-width: 0; }
.cw-name b { font-size: 14.5px; overflow-wrap: anywhere; }
.cw-sub { font-size: 12.5px; color: var(--ink-3); }
.cw-last { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); min-width: 0; }
.cw-acts { display: flex; align-items: center; gap: 14px; }
.cw-sw { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
/* Tela média: as chaves descem para uma linha própria e o nome do grupo não fica espremido */
@media (max-width: 1100px) and (min-width: 761px) {
  .cw-row { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
  .cw-acts { grid-column: 1 / -1; }
}
.cw-empty { padding: 12px 2px; }
.cw-log { margin-top: 16px; }
.cw-log h3 { margin: 0 0 10px; font-size: 15px; }
.cw-log td { font-size: 13px; vertical-align: top; }
.cw-det { color: var(--ink-3); }
.cw-model { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; color: var(--ink-3); overflow-wrap: anywhere; }
.cg-st { font-weight: 650; } .cg-st.good { color: var(--good); } .cg-st.bad { color: var(--bad); } .cg-st.muted { color: var(--ink-3); }
.pf-dot.muted { background: var(--ink-3); }
@media (max-width: 760px) {
  .cw-head { grid-template-columns: 1fr; }
  .cw-master { min-width: 0; }
  .cw-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cw-row { grid-template-columns: 1fr; gap: 8px; }
  .cw-acts { justify-content: space-between; }
  .list-title-btns input[type=search] { width: 100%; }
}

/* Janela de configuração do grupo */
.modal:has(.cg) { max-width: 720px; }
.cg { display: grid; gap: 0; }
.cg-limit { display: inline-flex; align-items: center; gap: 8px; }
.cg-num { width: 90px; }
.cg-pr { padding: 12px 0; border-top: 1px solid var(--line-2); display: grid; gap: 6px; }
/* Prompts gerais dos áudios (topo da aba WhatsApp): fechado até alguém abrir */
.cw-gen { margin-top: 14px; padding: 0; }
.cw-gen > summary { padding: 14px 16px; cursor: pointer; }
.cw-gen > summary b { font-size: 15px; }
.cw-gen > summary .sub { display: block; margin-left: 18px; }
.cw-gen[open] > summary { border-bottom: 1px solid var(--line-2); }
.cw-gen > .cg-pr, .cw-all, .cw-gen-act { margin: 0 16px; }
.cw-gen > .cg-pr:first-of-type { border-top: 0; }
.cw-gen-act { display: flex; justify-content: flex-end; padding: 12px 0 16px; }
.cw-lp { margin: 0 16px; padding: 12px 0 6px; }
.cw-lp > .in-note { margin: 0 0 6px; }
.cg-pr-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cg-pr-h .btn { margin-left: auto; }
.cg-tag { font-size: 11.5px; font-weight: 600; color: var(--ink-3); background: var(--surface-2); border-radius: 999px; padding: 1px 8px; }
.cg textarea, .cg input[type=number], .cg input[type=text], .cg input[type=time] { font: inherit; font-size: 14px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink); }
.cg textarea:focus, .cg input[type=number]:focus, .cg input[type=time]:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-2) 25%, transparent); outline: none; }
.cg-prompt { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.5; resize: vertical; min-height: 140px; }
.cg-recent { padding-top: 10px; border-top: 1px solid var(--line-2); font-size: 13px; }
.cg-recent ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); }

/* Grupos: duas chaves gerais, a última transcrição e o último resumo, e a janela com abas */
.cw-sws { display: grid; gap: 10px; min-width: 260px; }
.cw-last { flex-direction: column; align-items: flex-start; gap: 3px; }
.cw-l { display: inline-flex; align-items: center; gap: 7px; }
.cw-l.muted { color: var(--ink-3); }
.cw-acts { flex-wrap: wrap; justify-content: flex-end; }
.cg-tabs { margin: 4px 0 6px; align-self: start; }
.cg-pane[hidden] { display: none; }
.cg-lead { margin: 6px 0 4px; }
.cg .in-field input[type=text] { width: 100%; }
.cg-time { width: 120px; }
.cg-sw { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.cg-run { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.cg-out { margin-top: 10px; }
.cg-phone { padding: 14px; border-radius: 16px; }
.cg-phone .wa-bubble { max-width: 100%; }
@media (max-width: 760px) {
  .cw-sws { min-width: 0; }
  .cw-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .cw-acts > .btn { grid-column: 1 / -1; }
  .cw-sw { justify-content: space-between; background: var(--surface-2); border-radius: 12px; padding: 8px 10px; }
}

/* Botão e janela "Baixar PDF" do painel da loja (a versão de impressão fica no print.css, só para imprimir) */
#printRoot { display: none; }
.pdf-btn { margin-left: auto; }
@media (max-width: 640px) { .pdf-btn { flex: none; margin-left: 0; min-height: 40px; } .pdf-verb { display: none; } }
.pdf-opts { display: grid; gap: 8px; margin: 4px 0 12px; }
.pdf-opt { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.pdf-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pdf-opt input { margin-top: 3px; }
.pdf-opt b { display: block; font-size: 14px; }
.pdf-opt span { font-size: 12.5px; color: var(--ink-3); }
.pdf-per { font-size: 13.5px; margin-bottom: 6px; }
