/* ============================================================
   Design tokens — identidade visual SME (Brand Guide oficial):
   Education Blue, Smart Blue, Transformation Blue e New Purple,
   aplicados ao painel de Marketing & Performance de leads.
   ============================================================ */
:root{
  --bg: #f2f3f7;
  --panel: #ffffff;
  --panel-soft: #f5f6fa;
  --ink: #1b2942;        /* Education Blue — texto principal */
  --ink-soft: #5b6478;
  --ink-faint: #9aa1b3;
  --line: #e8eaf1;

  --navy: #1b2942;       /* Education Blue */
  --blue: #404f9d;       /* Smart Blue — acento primário */
  --blue-2: #03b2cd;     /* Transformation Blue — acento secundário */
  --blue-2-ghost: #e0f7fb;
  --purple: #404f9d;     /* alias: acento primário (compat) */
  --purple-2: #03b2cd;   /* alias: acento secundário (compat) */
  --purple-ghost: #e9eaf6;
  --new-purple: #702784; /* New Purple — destaque terciário */
  --new-purple-ghost: #f3e7f6;
  --green: #17b579;
  --green-ghost: #e2f9ef;
  --red: #ef5a6f;
  --red-ghost: #fde9ec;
  --blue-ghost: #e9f1ff;

  --gradient-brand: linear-gradient(135deg, #1b2942 0%, #404f9d 55%, #702784 100%);

  --r-lg: 28px;
  --r-md: 18px;
  --r-sm: 12px;

  --shadow: 0 24px 48px -24px rgba(27,41,66,.14), 0 2px 8px -2px rgba(27,41,66,.07);
  --shadow-sm: 0 8px 20px -12px rgba(27,41,66,.18);

  --font-display: "Poppins", sans-serif;
  --font-body: "Poppins", sans-serif;
}

*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background:
    radial-gradient(1100px 550px at 92% -8%, #eef0fb 0%, transparent 60%),
    radial-gradient(800px 460px at -8% 8%, #eaf6f9 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  min-height:100%;
}

.wrap{
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 32px 80px;
}

/* ---------------- Topbar (banner com gradiente da marca) ---------------- */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  margin-bottom: 24px;
  background: var(--gradient-brand);
  border-radius: var(--r-lg);
  padding: 14px 22px;
  box-shadow: var(--shadow);
}
.brand{
  display:flex;
  align-items:center;
  gap:14px;
}
.brand-logo{
  height: 30px;
  width: auto;
  display:block;
  flex-shrink:0;
}
.brand-tagline{
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 11.5px;
  color: rgba(255,255,255,.72);
  letter-spacing: .01em;
  border-left: 1px solid rgba(255,255,255,.28);
  padding-left: 14px;
  line-height:1.3;
}
.brand-tagline strong{ color:#fff; font-weight:700; display:block; font-size:12.5px; }

.tabs{
  display:flex;
  align-items:center;
  gap:2px;
  background: rgba(255,255,255,.12);
  padding:5px;
  border-radius: 999px;
}
.tabs button{
  border:0; background:transparent;
  padding: 10px clamp(11px, 1.15vw, 16px);
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13.5px;
  color: rgba(255,255,255,.78);
  cursor:pointer;
  transition: all .18s ease;
  white-space: nowrap;
}
.tabs button.active{
  background: #fff;
  color: var(--navy);
}
.tabs button:not(.active):hover{ color: #fff; }

.top-actions{ display:flex; align-items:center; gap:14px; position:relative; }
.icon-btn{
  width:40px; height:40px;
  border-radius: 50%;
  background: rgba(255,255,255,.14);
  border:0;
  display:flex; align-items:center; justify-content:center;
  color: #fff;
  cursor:pointer;
  position:relative;
}

/* ---------------- Sino de notificações ---------------- */
.bell-badge{
  display:none;
  position:absolute; top:-2px; right:-2px;
  min-width:16px; height:16px; padding:0 3px;
  border-radius:999px;
  background: var(--red);
  color:#fff;
  font-size:9.5px; font-weight:800;
  align-items:center; justify-content:center;
  box-shadow: 0 0 0 2px var(--navy);
}
.notif-dropdown{
  display:none;
  position:absolute; top: calc(100% + 12px); right:0;
  width:280px;
  background:var(--panel);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  padding:8px;
  z-index:45;
}
.notif-dropdown.open{ display:block; }
.notif-head{
  font-family:var(--font-display); font-weight:800; font-size:12.5px; color:var(--ink);
  padding:8px 10px 10px;
}
.notif-list{ max-height:320px; overflow-y:auto; display:flex; flex-direction:column; gap:2px; }
.notif-item{ display:flex; align-items:center; gap:10px; padding:9px 10px; border-radius:10px; }
.notif-item:hover{ background:var(--panel-soft); }
.notif-item-mid{ min-width:0; }
.notif-item-name{ font-size:12.5px; font-weight:700; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.notif-item-meta{ font-size:11px; color:var(--ink-faint); font-weight:600; margin-top:1px; }

/* ---------------- Toasts de novo lead ---------------- */
#toast-stack{
  position:fixed; top:20px; right:20px;
  display:flex; flex-direction:column; gap:10px;
  z-index:100;
  pointer-events:none;
}
.toast{
  display:flex; align-items:flex-start; gap:10px;
  background:var(--panel);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  padding:12px 16px;
  min-width:230px;
  opacity:0; transform: translateX(30px);
  transition: opacity .25s ease, transform .25s ease;
}
.toast.show{ opacity:1; transform: translateX(0); }
.toast-dot{ width:9px; height:9px; border-radius:50%; margin-top:4px; flex-shrink:0; }
.toast-title{ font-size:10.5px; font-weight:800; text-transform:uppercase; letter-spacing:.04em; color:var(--ink-faint); }
.toast-name{ font-size:13px; font-weight:700; color:var(--ink); margin-top:1px; }
.toast-meta{ font-size:11.5px; color:var(--ink-soft); font-weight:600; margin-top:2px; }
.profile{
  display:flex; align-items:center; gap:10px;
  background: rgba(255,255,255,.14);
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
}
.avatar{
  width:32px; height:32px; border-radius:50%;
  background: linear-gradient(145deg, var(--blue-2), var(--blue));
  display:flex; align-items:center; justify-content:center;
  font-family: var(--font-display); font-weight:700; font-size:13px; color:#fff;
}
.profile-name{ font-size:13px; font-weight:700; line-height:1.2; color:#fff; }
.profile-role{ font-size:11px; color:rgba(255,255,255,.7); line-height:1.2; }

/* ---------------- Filter bar ---------------- */
.filterbar{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px;
  margin-bottom: 22px;
}
.filterbar .label{
  font-size:12.5px; font-weight:700; color:var(--ink-faint);
  text-transform:uppercase; letter-spacing:.06em;
  margin-right:4px;
}
.pillgroup{
  display:flex; background:var(--panel); border-radius:999px; padding:4px;
  box-shadow: var(--shadow-sm);
}
.pillgroup button{
  border:0; background:transparent; cursor:pointer;
  padding: 8px 15px; border-radius:999px;
  font-size:12.5px; font-weight:600; color:var(--ink-soft);
  transition: all .15s ease;
}
.pillgroup button.active{ background:var(--purple); color:#fff; }

.select-chip{
  position:relative;
}
.select-chip select{
  appearance:none;
  border:0; cursor:pointer;
  background:var(--panel);
  box-shadow: var(--shadow-sm);
  padding:10px 34px 10px 16px;
  border-radius:999px;
  font-family: var(--font-body);
  font-size:12.5px; font-weight:600; color:var(--ink);
}
.select-chip::after{
  content:"";
  position:absolute; right:14px; top:50%; translate: 0 -60%;
  width:7px; height:7px;
  border-right:2px solid var(--ink-faint); border-bottom:2px solid var(--ink-faint);
  transform: rotate(45deg);
  pointer-events:none;
}
.canal-filter{ position:relative; }
.canal-trigger{
  display:flex; align-items:center; gap:8px;
  border:0; cursor:pointer;
  background:var(--panel);
  box-shadow: var(--shadow-sm);
  padding:10px 16px;
  border-radius:999px;
  font-family: var(--font-body);
  font-size:12.5px; font-weight:600; color:var(--ink);
  white-space:nowrap;
}
.canal-trigger.active{ box-shadow: 0 0 0 2px var(--blue) inset, var(--shadow-sm); }
.canal-chev{ width:11px; height:11px; color:var(--ink-faint); display:flex; flex-shrink:0; }
.canal-chev svg{ width:100%; height:100%; }
.canal-panel{
  display:none;
  position:absolute; top: calc(100% + 10px); left:0;
  background:var(--panel);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  padding:10px;
  width:240px;
  max-height:320px;
  z-index:45;
}
.canal-panel.open{ display:flex; flex-direction:column; }
.canal-panel-head{ display:flex; gap:8px; padding:2px 4px 8px; border-bottom:1px solid var(--line); margin-bottom:6px; }
.canal-quick{ border:0; background:none; cursor:pointer; font-size:11.5px; font-weight:700; color:var(--blue); padding:2px 0; }
.canal-quick:hover{ text-decoration:underline; }
.canal-options{ overflow-y:auto; display:flex; flex-direction:column; gap:1px; }
.canal-option{
  display:flex; align-items:center; gap:9px;
  padding:8px 8px; border-radius:9px;
  font-size:12.5px; font-weight:600; color:var(--ink);
  cursor:pointer;
}
.canal-option:hover{ background:var(--panel-soft); }
.canal-option input{ margin:0; accent-color: var(--blue); }

.filter-spacer{ flex:1; }
.reset-link{
  font-size:12.5px; font-weight:700; color:var(--purple);
  background:none; border:0; cursor:pointer;
  padding:8px 4px;
}
.export-btn{
  display:inline-flex; align-items:center; gap:7px;
  border:0; cursor:pointer;
  background: var(--blue);
  color:#fff;
  padding:9px 16px;
  border-radius:999px;
  font-family:var(--font-body);
  font-size:12.5px; font-weight:700;
  box-shadow: var(--shadow-sm);
  transition: filter .15s ease, opacity .15s ease;
}
.export-btn:hover{ filter:brightness(1.08); }
.export-btn:disabled{ opacity:.65; cursor:not-allowed; }
.export-btn span{ width:14px; height:14px; display:flex; flex-shrink:0; }
.export-btn span svg{ width:100%; height:100%; }

/* ---------------- Date range picker ---------------- */
.daterange{ position:relative; }
.dr-trigger{
  display:flex; align-items:center; gap:9px;
  border:0; cursor:pointer;
  background:var(--panel);
  box-shadow: var(--shadow-sm);
  padding:9px 14px;
  border-radius:999px;
  font-family: var(--font-body);
  font-size:12.5px; font-weight:600; color:var(--ink);
  transition: box-shadow .15s ease;
}
.dr-trigger.active{ box-shadow: 0 0 0 2px var(--blue) inset, var(--shadow-sm); }
.dr-trigger-icon{ width:15px; height:15px; color:var(--blue); flex-shrink:0; display:flex; }
.dr-trigger-icon svg{ width:100%; height:100%; }
.dr-trigger-label{ white-space:nowrap; }
.dr-trigger-clear{
  width:16px; height:16px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  color:var(--ink-faint); font-size:14px; line-height:1;
  margin-left:2px;
}
.dr-trigger-clear:hover{ background:var(--panel-soft); color:var(--ink); }

.dr-panel{
  display:none;
  position:absolute; top: calc(100% + 10px); left:0;
  background:var(--panel);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding:18px;
  width:640px;
  max-width: 90vw;
  z-index:40;
}
.dr-panel.open{ display:block; }

.dr-panel-top{
  display:flex; align-items:center; gap:16px;
  padding-bottom:14px; margin-bottom:16px;
  border-bottom:1px solid var(--line);
}
.dr-toggle{
  display:flex; align-items:center; gap:8px;
  font-size:12.5px; font-weight:600; color:var(--ink);
  cursor:pointer;
}
.dr-toggle input{ position:absolute; opacity:0; width:0; height:0; }
.dr-toggle-track{
  width:34px; height:19px; border-radius:999px;
  background: var(--line);
  position:relative;
  transition: background .15s ease;
  flex-shrink:0;
}
.dr-toggle-thumb{
  position:absolute; top:2px; left:2px;
  width:15px; height:15px; border-radius:50%;
  background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.25);
  transition: left .15s ease;
}
.dr-toggle input:checked + .dr-toggle-track{ background: var(--blue); }
.dr-toggle input:checked + .dr-toggle-track .dr-toggle-thumb{ left:17px; }
.dr-today-link{
  font-size:12.5px; font-weight:700; color:var(--blue);
  background:none; border:0; cursor:pointer;
}
.dr-panel-top-actions{ margin-left:auto; display:flex; gap:8px; }
.dr-btn{
  border-radius:999px; padding:8px 18px;
  font-size:12.5px; font-weight:700;
  border:0; cursor:pointer;
}
.dr-btn-ghost{ background:var(--panel-soft); color:var(--ink-soft); }
.dr-btn-ghost:hover{ background:var(--line); }
.dr-btn-primary{ background:var(--blue); color:#fff; }
.dr-btn-primary:hover{ filter:brightness(1.08); }

.dr-body{ display:flex; gap:22px; align-items:flex-start; }
.dr-sidebar{
  display:flex; flex-direction:column; gap:2px;
  width:140px; flex-shrink:0;
  border-right:1px solid var(--line);
  padding-right:16px;
}
.dr-preset{
  text-align:left; border:0; background:none; cursor:pointer;
  padding:8px 8px; border-radius:10px;
  font-size:12.5px; font-weight:600; color:var(--ink-soft);
}
.dr-preset:hover{ background:var(--panel-soft); color:var(--ink); }
.dr-custom{ display:flex; flex-direction:column; gap:10px; margin-top:14px; }
.dr-custom label{ font-size:10.5px; font-weight:700; color:var(--ink-faint); display:flex; flex-direction:column; gap:4px; }
.dr-custom input{
  border:1px solid var(--line); border-radius:8px;
  padding:6px 8px; font-size:12.5px; font-family:var(--font-body); color:var(--ink);
  width:100%;
}

.dr-main{ flex:1; min-width:0; }
.dr-fields{ display:flex; gap:10px; margin-bottom:16px; }
.dr-field{
  flex:1; display:flex; align-items:center; gap:8px;
  border:1px solid var(--line); border-radius:10px;
  padding:8px 12px;
}
.dr-field-ico{ width:14px; height:14px; color:var(--ink-faint); flex-shrink:0; display:flex; }
.dr-field-ico svg{ width:100%; height:100%; }
.dr-field input{
  border:0; outline:0; width:100%;
  font-family:var(--font-body); font-size:12.5px; font-weight:600; color:var(--ink);
}

.dr-months{ display:flex; gap:20px; }
.dr-month{ flex:1; min-width:0; }
.dr-month-head{
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:10px;
}
.dr-month-label{
  font-family: var(--font-display); font-weight:800; font-size:12.5px;
  text-transform:none;
}
.dr-month-label::first-letter{ text-transform:uppercase; }
.dr-nav{
  width:24px; height:24px; border-radius:7px; border:0;
  background:var(--panel-soft);
  cursor:pointer; display:flex; align-items:center; justify-content:center;
  color: var(--ink-soft);
}
.dr-nav svg{ width:12px; height:12px; }
.dr-nav:hover{ color:var(--ink); }
.dr-nav-spacer{ width:24px; height:24px; }
.dr-weekdays{ display:grid; grid-template-columns:repeat(7,1fr); margin-bottom:4px; }
.dr-weekdays span{ font-size:9px; font-weight:800; color:var(--ink-faint); text-align:center; }
.dr-grid{ display:grid; grid-template-columns:repeat(7,1fr); gap:2px; }
.dr-cell{
  aspect-ratio:1;
  border:0; border-radius:8px;
  display:flex; align-items:center; justify-content:center;
  font-size:11px; font-weight:600; color:var(--ink);
  cursor:pointer; background:transparent;
}
.dr-cell.outside{ visibility:hidden; pointer-events:none; }
.dr-cell:not(.outside):hover{ background:var(--panel-soft); }
.dr-cell.is-today{ box-shadow: inset 0 0 0 1.5px var(--blue-2); }
.dr-cell.in-range{ background: var(--blue-ghost); border-radius:0; }
.dr-cell.selected{ background:var(--blue) !important; color:#fff; font-weight:800; }
.dr-cell.range-start{ border-radius:8px 0 0 8px; }
.dr-cell.range-end{ border-radius:0 8px 8px 0; }

/* ---------------- KPI row ---------------- */
.kpi-row{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:16px;
  margin-bottom: 18px;
}
.kpi-card{
  background: var(--panel);
  border-radius: var(--r-md);
  padding: 20px 20px 18px;
  box-shadow: var(--shadow-sm);
  position:relative;
  overflow:hidden;
}
.kpi-card .kpi-icon{
  width:34px; height:34px; border-radius:10px;
  display:flex; align-items:center; justify-content:center;
  margin-bottom: 14px;
}
.kpi-icon svg{ width:17px; height:17px; }
.kpi-label{ font-size:12px; color:var(--ink-soft); font-weight:600; margin-bottom:6px; }
.kpi-value{ font-family: var(--font-display); font-size:26px; font-weight:800; letter-spacing:-.02em; line-height:1; }
.kpi-sub{ display:flex; align-items:center; gap:6px; margin-top:10px; }
.pill{
  display:inline-flex; align-items:center; gap:3px;
  font-size:11px; font-weight:700;
  padding: 3px 8px; border-radius:999px;
}
.pill.up{ background:var(--green-ghost); color:var(--green); }
.pill.down{ background:var(--red-ghost); color:var(--red); }
.pill.flat{ background:var(--panel-soft); color:var(--ink-faint); }
.kpi-sub span.ctx{ font-size:11px; color:var(--ink-faint); }

/* ---------------- Grid layout ---------------- */
.grid-main{
  display:grid;
  grid-template-columns: 2fr 1fr;
  gap:18px;
  margin-bottom: 18px;
}
.grid-bottom{
  display:grid;
  grid-template-columns: 1fr 1.3fr;
  gap:18px;
  margin-bottom:18px;
}

.card{
  background: var(--panel);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 24px;
}
.card-head{
  display:flex; align-items:flex-start; justify-content:space-between;
  margin-bottom: 18px;
  gap:12px;
}
.card-title{ font-family: var(--font-display); font-size:17px; font-weight:800; letter-spacing:-.01em; }
.card-desc{ font-size:12px; color:var(--ink-faint); margin-top:3px; font-weight:500; }

/* ---------------- Evolution card ---------------- */
.evo-top{
  display:flex; align-items:flex-start; justify-content:space-between; gap:16px;
  flex-wrap:wrap;
}
.evo-stats{ display:flex; gap:34px; flex-wrap:wrap; }
.evo-stat .n{ font-family:var(--font-display); font-size:30px; font-weight:800; letter-spacing:-.02em; }
.evo-stat .l{ font-size:12px; color:var(--ink-soft); font-weight:600; margin-top:2px; }
.evo-chart-wrap{ margin-top: 18px; position:relative; }
.evo-tooltip{
  position:absolute; transform: translate(-50%,-115%);
  background: var(--ink); color:#fff;
  padding:7px 12px; border-radius:10px;
  font-size:12px; font-weight:700;
  pointer-events:none; white-space:nowrap;
  box-shadow: 0 10px 20px -8px rgba(0,0,0,.35);
  opacity:0; transition: opacity .1s ease;
  z-index:5;
}
.evo-tooltip .sub{ font-weight:500; color:#c9c6da; font-size:10.5px; margin-top:1px;}
svg.chart{ display:block; width:100%; height:auto; overflow: visible; }
.axis-label{ font-size:10px; fill: var(--ink-faint); font-family: var(--font-body); font-weight:600; }

/* ---------------- Channels / side card ---------------- */
.chan-total{ font-family:var(--font-display); font-size:30px; font-weight:800; letter-spacing:-.02em; margin-top:2px;}
.chan-total-label{ font-size:12px; color:var(--ink-soft); font-weight:600; }
.chan-icons{ display:flex; gap:10px; margin: 16px 0 20px; }
.chan-icon-card{
  flex:1;
  border-radius:16px;
  padding:12px 14px;
  display:flex; flex-direction:column; gap:8px;
}
.chan-icon-card .ico{ width:26px; height:26px; border-radius:8px; display:flex; align-items:center; justify-content:center; }
.chan-icon-card .val{ font-family:var(--font-display); font-weight:800; font-size:17px; }
.chan-icon-card .lbl{ font-size:10.5px; color:var(--ink-soft); font-weight:600; }

.weekday-chart{ display:flex; align-items:flex-end; justify-content:space-between; gap:8px; height:130px; margin-top:6px; }
.wk-col{ flex:1; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; height:100%; gap:8px; }
.wk-bar-track{ width:100%; max-width:26px; flex:1; display:flex; align-items:flex-end; border-radius:8px; overflow:hidden; background: var(--panel-soft); }
.wk-bar{ width:100%; border-radius:8px 8px 0 0; background: linear-gradient(180deg, var(--blue-2), var(--blue)); transition: height .4s ease; }
.wk-bar.best{ background: linear-gradient(180deg, var(--blue-2), var(--new-purple)); }
.wk-lbl{ font-size:10.5px; color:var(--ink-faint); font-weight:700; }

/* ---------------- Profile / cargo list ---------------- */
.rank-list{ display:flex; flex-direction:column; gap:14px; }
.rank-row{ display:flex; align-items:center; gap:12px; }
.rank-avatar{
  width:40px; height:40px; border-radius:12px;
  display:flex; align-items:center; justify-content:center;
  font-family:var(--font-display); font-weight:800; font-size:14px; color:#fff;
  flex-shrink:0;
}
.rank-mid{ flex:1; min-width:0; }
.rank-name{ font-size:13.5px; font-weight:700; }
.rank-bar-track{ height:6px; border-radius:99px; background:var(--panel-soft); margin-top:6px; overflow:hidden;}
.rank-bar{ height:100%; border-radius:99px; background: linear-gradient(90deg, var(--purple), var(--purple-2)); }
.rank-value{ font-family:var(--font-display); font-weight:800; font-size:14.5px; flex-shrink:0; }

/* ---------------- Evolution body: chart + calendar side by side ---------------- */
.evo-body{
  display:flex;
  gap:24px;
  margin-top:18px;
  flex-wrap:wrap;
  align-items:flex-start;
}
.evo-chart-col{ flex:1 1 380px; min-width:280px; }
.evo-cal-col{ width:264px; flex-shrink:0; }

.cal-card-inner{
  background: var(--panel-soft);
  border-radius: 20px;
  padding: 16px;
}
.cal-head{
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom: 12px;
}
.cal-month-label{
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13.5px;
  text-transform: capitalize;
}
.cal-nav-btn{
  width:26px; height:26px; border-radius:8px; border:0;
  background:#fff; box-shadow: var(--shadow-sm);
  cursor:pointer; display:flex; align-items:center; justify-content:center;
  color: var(--ink-soft);
}
.cal-nav-btn svg{ width:13px; height:13px; }
.cal-nav-btn:disabled{ opacity:.3; cursor:not-allowed; }
.cal-nav-btn:not(:disabled):hover{ color: var(--ink); }

.cal-weekdays{
  display:grid; grid-template-columns:repeat(7,1fr);
  margin-bottom: 6px;
}
.cal-weekdays span{
  font-size:9.5px; font-weight:800; color: var(--ink-faint);
  text-align:center; letter-spacing:.02em;
}
.cal-grid{
  display:grid; grid-template-columns:repeat(7,1fr);
  gap:4px;
}
.cal-cell{
  aspect-ratio:1;
  border-radius:9px;
  display:flex; align-items:center; justify-content:center;
  position:relative;
  font-size:11px; font-weight:700; color: var(--ink);
  cursor:pointer;
  background:#fff;
  border: 1.5px solid transparent;
  transition: background .12s ease, color .12s ease;
}
.cal-cell.outside{ visibility:hidden; pointer-events:none; }
.cal-cell.is-today{ border-color: var(--purple-2); }
.cal-cell.has-leads:hover{ border-color: var(--purple-2); }
.cal-cell .dot{
  position:absolute; bottom:4px;
  width:4px; height:4px; border-radius:50%;
  background: var(--purple);
}
.cal-cell.heat-1{ background: #dde1f2; }
.cal-cell.heat-2{ background: #b7c0e6; }
.cal-cell.heat-3{ background: #7986c4; color:#fff; }
.cal-cell.heat-3 .dot{ background:#fff; }
.cal-cell.selected{
  background: var(--purple) !important;
  color:#fff;
}
.cal-cell.selected .dot{ background:#fff; }

.cal-day-summary{ margin-top:16px; }
.cal-day-summary .ds-label{
  font-size:11px; color: var(--ink-faint); font-weight:700;
  text-transform:uppercase; letter-spacing:.04em;
  margin-bottom:4px;
}
.cal-day-summary .ds-total{
  font-family: var(--font-display); font-weight:800; font-size:24px;
  letter-spacing:-.02em;
  margin-bottom: 10px;
}
.ds-row{
  display:flex; align-items:center; gap:8px;
  font-size:12px; font-weight:600; color: var(--ink-soft);
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
}
.ds-row:last-child{ border-bottom:0; }
.ds-row .badge-dot{ width:7px; height:7px; border-radius:50%; flex-shrink:0; }
.ds-row .ds-name{ flex:1; }
.ds-row .ds-count{ font-weight:800; color: var(--ink); }

/* ---------------- Campaign ranking ---------------- */
.camp-list{ display:flex; flex-direction:column; gap:12px; }
.camp-row{
  display:flex; align-items:center; gap:12px;
  padding:10px 12px;
  border-radius:14px;
  background: var(--panel-soft);
}
.camp-rank{
  width:26px; height:26px; border-radius:8px;
  background:#fff; box-shadow: var(--shadow-sm);
  display:flex; align-items:center; justify-content:center;
  font-size:11.5px; font-weight:800; color:var(--ink-soft);
  flex-shrink:0;
}
.camp-mid{ flex:1; min-width:0; }
.camp-name{ font-size:12.5px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.camp-score{ font-size:11px; color:var(--ink-faint); font-weight:600; margin-top:1px; }
.camp-count{ font-family:var(--font-display); font-weight:800; font-size:14px; flex-shrink:0; }

/* ---------------- View switching ---------------- */
.view{ display:none; }
.view.active{ display:block; }

/* ---------------- Campaign full list (Campanhas tab) ---------------- */
.camp-full-list{
  display:flex; flex-direction:column; gap:8px;
  max-height: 560px; overflow-y:auto; padding-right:4px;
}
.camp-full-list::-webkit-scrollbar{ width:6px; }
.camp-full-list::-webkit-scrollbar-thumb{ background:var(--line); border-radius:99px; }

/* ---------------- LP performance list ---------------- */
.lp-list{ display:flex; flex-direction:column; gap:10px; }
.lp-row{
  padding:12px 14px; border-radius:14px; background:var(--panel-soft);
}
.lp-row-top{ display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
.lp-name{ font-size:13px; font-weight:700; }
.lp-count{ font-family:var(--font-display); font-weight:800; font-size:14px; }
.lp-bar-track{ height:8px; border-radius:99px; background:#fff; overflow:hidden; display:flex; }
.lp-bar-seg{ height:100%; }
.lp-legend{ display:flex; gap:14px; margin-top:6px; font-size:10.5px; color:var(--ink-faint); font-weight:600; }
.lp-legend span{ display:inline-flex; align-items:center; gap:4px; }
.lp-legend .dot{ width:6px; height:6px; border-radius:50%; display:inline-block; }

/* ---------------- Qualificação por canal (table) ---------------- */
.qual-table{ width:100%; border-collapse:collapse; }
.qual-table thead th{
  text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:.05em;
  color: var(--ink-faint); font-weight:700; padding: 0 10px 12px;
  border-bottom: 1px solid var(--line);
}
.qual-table tbody td{ padding: 12px 10px; font-size:13px; border-bottom: 1px solid var(--line); }
.qual-table tbody tr:last-child td{ border-bottom:0; }
.qual-bar-track{ height:8px; width:100%; max-width:140px; border-radius:99px; background:var(--panel-soft); overflow:hidden; }
.qual-bar{ height:100%; border-radius:99px; background: linear-gradient(90deg, var(--blue), var(--blue-2)); }

/* ---------------- Table card ---------------- */
.table-card{ margin-top:2px; }
.leads-table{ width:100%; border-collapse:collapse; }
.leads-table thead th{
  text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:.05em;
  color: var(--ink-faint); font-weight:700; padding: 0 14px 12px;
  border-bottom: 1px solid var(--line);
}
.leads-table tbody td{
  padding: 13px 14px;
  font-size:13px;
  border-bottom: 1px solid var(--line);
  vertical-align:middle;
}
.leads-table tbody tr:last-child td{ border-bottom:0; }
.leads-table tbody tr:hover{ background: var(--panel-soft); }
.cell-lead{ font-weight:700; }
.cell-company{ color:var(--ink-soft); font-size:12.5px; }
.badge{
  display:inline-flex; align-items:center; gap:5px;
  padding:4px 10px; border-radius:999px;
  font-size:11px; font-weight:700;
}
.badge-dot{ width:6px; height:6px; border-radius:50%; }
.score-chip{
  font-family: var(--font-display); font-weight:800; font-size:12.5px;
  padding:3px 9px; border-radius:8px; display:inline-block;
}
.table-foot{
  display:flex; align-items:center; justify-content:space-between;
  margin-top:16px; font-size:12px; color:var(--ink-faint); font-weight:600;
}

/* ---------------- Busca de lead (modal) ---------------- */
#lead-search{ display:none; }
#lead-search.open{ display:block; }
.ls-backdrop{
  position:fixed; inset:0;
  background: rgba(27,41,66,.45);
  z-index:90;
}
.ls-modal{
  position:fixed; top:90px; left:50%; translate:-50% 0;
  width:560px; max-width:92vw; max-height: calc(100vh - 140px);
  background:var(--panel);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  z-index:91;
  display:flex; flex-direction:column;
  overflow:hidden;
}
.ls-search-row{
  display:flex; align-items:center; gap:10px;
  padding:16px 18px;
  border-bottom:1px solid var(--line);
  flex-shrink:0;
}
.ls-search-ico{ width:17px; height:17px; color:var(--ink-faint); flex-shrink:0; display:flex; }
.ls-search-ico svg{ width:100%; height:100%; }
.ls-search-row input{
  flex:1; border:0; outline:0;
  font-family:var(--font-body); font-size:14px; font-weight:600; color:var(--ink);
}
.ls-close{
  width:26px; height:26px; border-radius:50%; border:0;
  background:var(--panel-soft); color:var(--ink-soft);
  font-size:16px; line-height:1; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0;
}
.ls-body{ padding:10px; overflow-y:auto; }
.ls-hint{ padding:26px 16px; text-align:center; font-size:13px; color:var(--ink-faint); font-weight:600; }
.ls-results{ display:flex; flex-direction:column; gap:3px; }
.ls-result{
  display:flex; align-items:center; justify-content:space-between; gap:14px;
  width:100%; border:0; background:none; cursor:pointer;
  padding:11px 12px; border-radius:12px;
  text-align:left;
}
.ls-result:hover{ background:var(--panel-soft); }
.ls-result-name{ font-size:13.5px; font-weight:700; color:var(--ink); }
.ls-result-company{ font-size:12px; color:var(--ink-soft); font-weight:500; margin-top:1px; }
.ls-result-meta{ display:flex; flex-direction:column; align-items:flex-end; gap:5px; flex-shrink:0; }
.ls-result-date{ font-size:11px; color:var(--ink-faint); font-weight:600; white-space:nowrap; }

.ls-back{
  display:flex; align-items:center; gap:6px;
  border:0; background:none; cursor:pointer;
  color:var(--blue); font-size:12.5px; font-weight:700;
  padding:8px 6px 14px;
}
.ls-back svg{ width:14px; height:14px; }
.ls-detail-head{ display:flex; align-items:center; gap:14px; padding:0 6px 16px; }
.ls-detail-name{ font-family:var(--font-display); font-size:16px; font-weight:800; }
.ls-detail-company{ font-size:12.5px; color:var(--ink-soft); font-weight:600; margin-top:2px; }
.ls-fields{ display:flex; flex-direction:column; padding:0 6px; }
.ls-field{
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:11px 0;
  border-top:1px solid var(--line);
  font-size:13px;
}
.ls-field-l{ color:var(--ink-faint); font-weight:600; flex-shrink:0; }
.ls-field-v{ color:var(--ink); font-weight:700; text-align:right; }

/* ---------------- Verba & CPL (lançamento semanal) ---------------- */
.wap-form-grid{
  display:grid; grid-template-columns:repeat(3,1fr); gap:16px;
  margin-bottom:18px;
}
.wap-form-grid label{
  display:flex; flex-direction:column; gap:6px;
  font-size:11.5px; font-weight:700; color:var(--ink-faint);
}
.wap-form-grid input{
  border:1px solid var(--line); border-radius:10px;
  padding:10px 12px; font-size:13px; font-family:var(--font-body); font-weight:600; color:var(--ink);
}
.wap-preview{
  display:flex; gap:24px;
  background:var(--panel-soft); border-radius:14px;
  padding:14px 18px; margin-bottom:18px;
}
.wap-preview div{ display:flex; flex-direction:column; gap:3px; }
.wap-preview span{ font-size:11px; font-weight:700; color:var(--ink-faint); text-transform:uppercase; letter-spacing:.04em; }
.wap-preview strong{ font-family:var(--font-display); font-size:18px; font-weight:800; color:var(--ink); }
.wap-form-actions{ display:flex; gap:10px; }
.wap-msg{ margin-top:12px; font-size:12.5px; font-weight:700; }

.wap-chart-legend{ display:flex; gap:18px; margin-bottom:6px; }
.wap-chart-legend .wap-legend-item{
  display:inline-flex; align-items:center; gap:7px;
  font-size:12px; font-weight:700; color:var(--ink-soft);
}
.wap-chart-legend .dot, .wap-chart-tooltip .dot{
  width:8px; height:8px; border-radius:50%; flex-shrink:0; display:inline-block;
}
.wap-chart-wrap{ position:relative; margin-top:6px; }
.wap-chart-wrap-wide{ max-width:none; }
.wap-chart-tooltip{
  position:absolute; transform: translate(-50%,-115%);
  background: var(--ink); color:#fff;
  padding:8px 12px; border-radius:10px;
  font-size:12px; font-weight:700;
  pointer-events:none; white-space:nowrap;
  box-shadow: 0 10px 20px -8px rgba(0,0,0,.35);
  opacity:0; transition: opacity .1s ease;
  z-index:5;
}
.wap-chart-tooltip .sub{ font-weight:500; color:#c9c6da; font-size:10.5px; margin-bottom:4px; }
.wap-chart-tooltip div{ display:flex; align-items:center; gap:6px; }
.wap-chart-tooltip div + div{ margin-top:3px; }
.wap-chart-empty{ padding:40px 0; text-align:center; color:var(--ink-faint); font-size:12.5px; font-weight:600; }

/* ---------------- Tabela de leads (aba dedicada) ---------------- */
.lt-pagination{
  display:flex; align-items:center; justify-content:space-between;
  margin-top:16px; font-size:12px; color:var(--ink-faint); font-weight:600;
}
.lt-page-btns{ display:flex; gap:8px; }
.lt-row:hover{ background:var(--panel-soft); }

.lt-head-actions{ display:flex; align-items:center; gap:10px; flex-shrink:0; }
.lt-search-field{
  display:flex; align-items:center; gap:9px;
  background: var(--panel-soft);
  border: 1.5px solid transparent;
  border-radius: 999px;
  padding: 10px 16px;
  width: 320px;
  flex-shrink: 0;
  transition: border-color .15s ease, background .15s ease;
}
.lt-search-field:focus-within{
  border-color: var(--blue);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}
.lt-search-ico{ width:15px; height:15px; color:var(--ink-faint); flex-shrink:0; display:flex; }
.lt-search-ico svg{ width:100%; height:100%; }
.lt-search-field:focus-within .lt-search-ico{ color:var(--blue); }
.lt-search-field input{
  flex:1; min-width:0; border:0; outline:0; background:none;
  font-family:var(--font-body); font-size:13px; font-weight:600; color:var(--ink);
}
.lt-search-field input::placeholder{ color:var(--ink-faint); font-weight:500; }
.lt-search-clear{
  width:18px; height:18px; border-radius:50%; border:0;
  background:var(--line); color:var(--ink-soft);
  font-size:13px; line-height:1; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0;
}
.lt-search-clear:hover{ background:var(--ink-faint); color:#fff; }

@media (max-width: 760px){
  .lt-search-field{ width:100%; }
}

/* ---------------- Footer note ---------------- */
.footnote{
  margin-top: 28px;
  text-align:center;
  font-size:11.5px;
  color: var(--ink-faint);
  line-height:1.6;
}
.footnote-logo{
  display:block;
  height: 22px;
  width:auto;
  margin: 0 auto 12px;
  opacity:.55;
}
.footnote code{
  background: var(--panel);
  padding:2px 7px;
  border-radius:6px;
  font-size:11px;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 1180px){
  .kpi-row{ grid-template-columns: repeat(2,1fr); }
  .grid-main{ grid-template-columns: 1fr; }
  .grid-bottom{ grid-template-columns: 1fr; }
  .evo-cal-col{ width:100%; }
}
@media (max-width: 760px){
  .wrap{ padding: 18px 14px 60px; }
  .topbar{ flex-wrap:wrap; }
  .tabs{ order:3; width:100%; overflow-x:auto; justify-content:flex-start; }
  .kpi-row{ grid-template-columns: 1fr 1fr; }
  .grid-bottom{ grid-template-columns: 1fr; }
  .evo-stats{ gap:20px; }
  .leads-table{ font-size:12px; }
  .cell-company{ display:none; }
}

/* Skeleton / loading */
.skel{
  background: linear-gradient(90deg, var(--panel-soft) 25%, #eeecf7 37%, var(--panel-soft) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 8px;
}
@keyframes shimmer{
  0%{ background-position: 100% 50%; }
  100%{ background-position: 0 50%; }
}

/* ---------------- Alerta de sincronização (token do Meta etc.) ---------------- */
.sync-alert{
  margin:14px 0; padding:14px 18px; border-radius:12px;
  background:var(--red-ghost); color:var(--red);
  border:1px solid var(--red); font-size:13px; font-weight:600; line-height:1.5;
}
.sync-alert strong{ font-weight:800; }
.sync-alert .sync-detail{ display:block; margin-top:4px; font-weight:500; opacity:.85; font-size:12px; }

/* ---------------- Verba por origem: linhas expansíveis ---------------- */
.wap-origem-row.has-camps{ cursor:pointer; }
.wap-origem-row.has-camps:hover td{ background:var(--panel-soft); }
.wap-caret{ display:inline-block; width:12px; color:var(--ink-faint); }
.wap-camp-count{ font-size:11px; font-weight:500; color:var(--ink-faint); margin-left:6px; }
.wap-camp-row td{ background:var(--panel-soft); font-size:12px; }

/* ---------------- Tela de acesso (entrar / recuperar senha / criar senha) ---------------- */
.login-overlay{
  position:fixed; inset:0; z-index:9999; overflow-y:auto; display:flex; align-items:center; justify-content:center; padding:20px;
  background:
    radial-gradient(900px 520px at 12% 8%, rgba(3,178,205,.30), transparent 60%),
    radial-gradient(820px 540px at 92% 96%, rgba(112,39,132,.42), transparent 60%),
    var(--gradient-brand);
}
.login-card{
  width:100%; max-width:410px; margin:auto; background:var(--panel); border-radius:26px; padding:34px 30px 22px;
  display:flex; flex-direction:column; gap:16px; box-shadow:0 30px 80px rgba(10,14,35,.45);
  animation:loginRise .45s cubic-bezier(.2,.7,.2,1) backwards;
}
.login-card form{ display:flex; flex-direction:column; gap:16px; }
.login-logo{ height:34px; width:auto; align-self:flex-start; }
.login-title{ font-family:var(--font-display); font-size:26px; font-weight:800; color:var(--ink); letter-spacing:-.02em; margin-top:6px; }
.login-sub{ font-size:13.5px; color:var(--ink-soft); margin-top:-10px; line-height:1.5; }
.login-card label{ display:flex; flex-direction:column; gap:7px; font-size:12px; font-weight:700; color:var(--ink-soft); }
.login-card input{
  width:100%; height:48px; border:1px solid var(--line); border-radius:14px; padding:0 14px;
  font:inherit; font-size:16px; color:var(--ink); background:var(--panel-soft);
}
.login-card input:focus{ outline:2px solid var(--blue); outline-offset:0; background:#fff; }
.login-pass-wrap{ position:relative; display:block; }
.login-pass-wrap input{ padding-right:50px; }
.login-eye{
  position:absolute; right:6px; top:50%; transform:translateY(-50%); width:38px; height:38px; border:0; background:transparent;
  color:var(--ink-faint); cursor:pointer; border-radius:11px; display:flex; align-items:center; justify-content:center;
}
.login-eye:hover{ color:var(--ink); background:var(--line); }
.login-eye svg{ width:20px; height:20px; }
.login-link{ align-self:flex-start; border:0; background:none; padding:0; font:inherit; font-size:12.5px; font-weight:700; color:var(--blue); cursor:pointer; }
.login-link:hover{ text-decoration:underline; }
.login-msg{ font-size:12.5px; font-weight:600; line-height:1.45; padding:10px 12px; border-radius:12px; }
.login-msg.error{ color:var(--red); background:var(--red-ghost); }
.login-msg.ok{ color:#0f7a54; background:var(--green-ghost); }
.login-btn{
  height:50px; border:0; border-radius:14px; background:var(--gradient-brand); color:#fff;
  font:inherit; font-size:15px; font-weight:700; cursor:pointer; box-shadow:0 10px 24px rgba(64,79,157,.35);
}
.login-btn:disabled{ opacity:.65; cursor:default; box-shadow:none; }
.login-foot{ text-align:center; font-size:11.5px; color:var(--ink-faint); }
@keyframes loginRise{ from{ opacity:0; transform:translateY(18px); } to{ opacity:1; transform:none; } }
@media (prefers-reduced-motion: reduce){ .login-card{ animation:none; } }
@media (max-width: 760px){
  /* no celular a saída fica no menu "Mais" */
  #logout-btn{ display:none !important; }
}

/* ---------------- Orgânicos ---------------- */
/* na aba Orgânicos a barra mostra Período + Produto direcionado; nas demais, o filtro de produto some */
.filterbar .org-only{ display:none; }
body.on-organicos #kpi-row,
body.on-organicos .filterbar .canal-filter:not(.org-only),
body.on-organicos .filterbar .label:not(:first-child):not(.org-only){ display:none; }
body.on-organicos .filterbar .canal-filter.org-only{ display:block; }
body.on-organicos .filterbar .label.org-only{ display:inline; }

.org-chip{ display:inline-block; padding:4px 10px; border-radius:99px; font-size:12px; font-weight:700; white-space:nowrap; }
.org-chip.ok{ background:var(--green-ghost); color:var(--green); }
.org-chip.warn{ background:#fdf3dc; color:#b9820f; }
.org-chip.bad{ background:var(--red-ghost); color:var(--red); }

.org-meta-top{ display:flex; justify-content:space-between; align-items:flex-end; gap:16px; flex-wrap:wrap; }
.org-meta-num{ font-family:var(--font-display); font-size:42px; font-weight:800; letter-spacing:-.02em; color:var(--ink); }
.org-meta-of{ font-size:15px; font-weight:600; color:var(--ink-soft); }
.org-meta-pct{ font-family:var(--font-display); font-size:20px; font-weight:800; color:var(--blue); }
.org-meta-track{ position:relative; height:16px; background:var(--panel-soft); border-radius:99px; margin:14px 0 6px; }
.org-meta-bar{ height:100%; border-radius:99px; background:linear-gradient(90deg, var(--blue), var(--blue-2)); }
.org-meta-tick{ position:absolute; top:-3px; bottom:-3px; width:3px; margin-left:-1px; border-radius:2px; background:var(--ink); }
.org-meta-stats{ display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-top:16px; }
.org-meta-stats span{ display:block; font-size:11px; font-weight:700; color:var(--ink-faint); text-transform:uppercase; letter-spacing:.04em; margin-bottom:3px; }
.org-meta-stats strong{ font-family:var(--font-display); font-size:19px; font-weight:800; color:var(--ink); }

.org-avatar{ width:76px; height:76px; border-radius:50%; margin:0 auto 10px; display:flex; align-items:center; justify-content:center; color:#fff; font-family:var(--font-display); font-weight:800; font-size:24px; overflow:hidden; }
.org-avatar img{ width:100%; height:100%; object-fit:cover; }
.org-name{ font-weight:700; font-size:13px; color:var(--ink-soft); }
.org-count{ font-family:var(--font-display); font-size:36px; font-weight:800; color:var(--ink); line-height:1.1; margin:4px 0; }
.org-share{ font-size:12px; color:var(--ink-faint); margin-bottom:12px; }
.org-bar-track{ height:8px; background:var(--panel-soft); border-radius:99px; overflow:hidden; }
.org-bar{ height:100%; border-radius:99px; }

@media (max-width:760px){
  .org-meta-stats{ grid-template-columns:1fr 1fr; }
  .org-avatar{ width:56px; height:56px; font-size:18px; }
  .pod-1 .org-avatar{ width:64px; height:64px; font-size:20px; }
  .org-count{ font-size:26px; }
  .pod-block{ font-size:24px; }
}

.org-rank-table{ margin-top:18px; }
.org-mini{ display:inline-flex; align-items:center; justify-content:center; width:26px; height:26px; border-radius:50%; margin-right:6px;
  color:#fff; font-size:10px; font-weight:800; vertical-align:middle; }
.org-total-row td{ background:var(--panel-soft); font-weight:700; }

/* Pódio (1º no centro, 2º à esquerda, 3º à direita) */
.org-podium{ display:grid; grid-template-columns:repeat(3,1fr); gap:14px; align-items:end; max-width:780px; margin:6px auto 0; }
.pod-col{ display:flex; flex-direction:column; text-align:center; }
.pod-person{ padding:0 4px 12px; }
.pod-crown{ width:30px; height:30px; margin:0 auto 4px; color:#e0a020; }
.pod-crown svg{ width:100%; height:100%; }
.pod-block{ border-radius:14px 14px 0 0; display:flex; align-items:flex-start; justify-content:center; padding-top:12px;
  color:#fff; font-family:var(--font-display); font-weight:800; font-size:34px; text-shadow:0 1px 2px rgba(0,0,0,.18); }
.pod-1 .pod-block{ height:150px; background:linear-gradient(180deg,#f2c14e,#e0a020); }
.pod-2 .pod-block{ height:108px; background:linear-gradient(180deg,#cfd4de,#9aa1b3); }
.pod-3 .pod-block{ height:78px;  background:linear-gradient(180deg,#dcab7d,#b9773f); }
.pod-1 .org-avatar{ width:88px; height:88px; font-size:28px; box-shadow:0 0 0 4px #f2c14e55; }

/* aviso até o navegador liberar o áudio */
.sound-hint{
  position:fixed; left:16px; bottom:16px; z-index:60; pointer-events:none;
  background:var(--ink); color:#fff; font-size:12px; font-weight:600;
  padding:9px 16px; border-radius:999px; opacity:.92; box-shadow:0 6px 20px rgba(0,0,0,.25);
}

/* células de UTM nas tabelas de leads */
.cell-utm{ max-width:200px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--ink-soft); font-size:12.5px; }

/* foto da pessoa na tabela do ranking (no lugar das iniciais) */
.org-mini-img{ width:34px; height:34px; object-fit:cover; background:var(--panel-soft); }

/* ---------------- Navegação mobile: cabeçalho compacto + barra flutuante + folha "Mais" ---------------- */
.mobile-nav, .mobile-sheet, .mobile-sheet-backdrop, .mobile-page{ display:none; }

@media (max-width: 760px){
  /* cabeçalho: uma linha só, arredondado, fixo no topo */
  .topbar{
    position:sticky; top:8px; z-index:45;
    flex-wrap:nowrap; gap:10px; padding:11px 14px; margin-bottom:6px;
    border-radius:30px; box-shadow:0 10px 28px rgba(64,79,157,.28);
  }
  .brand{ gap:10px; min-width:0; }
  .brand-logo{ height:22px; }
  .brand-tagline{ padding-left:10px; }
  .brand-tagline{ display:none; }
  .tabs{ display:none; }
  .top-actions{ gap:10px; margin-left:auto; flex-shrink:0; }
  .icon-btn{ width:38px; height:38px; }
  .profile{ padding:0; background:none; gap:6px; }
  .profile > div:not(.avatar){ display:none; }
  .avatar{ width:38px; height:38px; box-shadow:0 0 0 3px rgba(255,255,255,.28); }

  /* título da seção logo abaixo do cabeçalho */
  .mobile-page{ display:block; padding:14px 4px 4px; }
  .mobile-page h1{ margin:0; font-family:var(--font-display); font-weight:800; font-size:26px; letter-spacing:-.02em; color:var(--ink); line-height:1.15; }
  .mobile-page p{ margin:6px 0 0; font-size:13.5px; color:var(--ink-soft); line-height:1.45; }

  /* barra de baixo, flutuante */
  .wrap{ padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }
  .mobile-nav{
    display:flex; position:fixed; left:12px; right:12px; bottom:calc(12px + env(safe-area-inset-bottom, 0px)); z-index:40;
    background:var(--panel); border-radius:32px; padding:7px;
    box-shadow:0 12px 36px rgba(27,41,66,.22), 0 2px 8px rgba(27,41,66,.08);
  }
  .mobile-nav button{
    flex:1; min-width:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px;
    border:0; background:transparent; font-family:var(--font-body); font-size:10px; font-weight:700; letter-spacing:-.01em;
    color:var(--ink-soft); padding:9px 1px 8px; border-radius:24px; cursor:pointer; -webkit-tap-highlight-color:transparent;
    transition:background .18s ease, color .18s ease;
  }
  .mn-ico{ display:flex; width:24px; height:24px; }
  .mn-ico svg{ width:100%; height:100%; }
  .mn-label{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%; }
  .mobile-nav button.active{
    background:var(--gradient-brand); color:#fff;
    box-shadow:0 8px 18px rgba(64,79,157,.4);
  }

  /* folha "Mais" */
  .mobile-sheet-backdrop{
    display:block; position:fixed; inset:0; z-index:55; background:rgba(16,19,28,.45);
    opacity:0; pointer-events:none; transition:opacity .2s ease;
  }
  .mobile-sheet-backdrop.open{ opacity:1; pointer-events:auto; }
  .mobile-sheet{
    display:block; position:fixed; left:12px; right:12px; bottom:calc(12px + env(safe-area-inset-bottom, 0px)); z-index:56;
    background:var(--panel); border-radius:28px; padding:10px 14px 14px;
    box-shadow:0 -4px 40px rgba(27,41,66,.28);
    transform:translateY(calc(100% + 40px)); transition:transform .26s ease;
  }
  .mobile-sheet.open{ transform:translateY(0); }
  .ms-grip{ width:40px; height:4px; border-radius:4px; background:var(--line); margin:0 auto 12px; }
  .ms-title{ font-family:var(--font-display); font-weight:800; font-size:16px; color:var(--ink); margin:0 4px 8px; }
  .ms-item{
    width:100%; display:flex; align-items:center; gap:14px; text-align:left;
    border:0; background:transparent; font-family:var(--font-body); color:var(--ink);
    padding:12px 8px; border-radius:18px; cursor:pointer; -webkit-tap-highlight-color:transparent;
  }
  .ms-item + .ms-item{ margin-top:2px; }
  .ms-item.active{ background:var(--panel-soft); }
  .ms-ico{ width:42px; height:42px; border-radius:14px; background:var(--panel-soft); color:var(--blue); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
  .ms-ico svg{ width:22px; height:22px; }
  .ms-item.active .ms-ico{ background:var(--gradient-brand); color:#fff; }
  .ms-item strong{ display:block; font-size:14px; font-weight:700; }
  .ms-item small{ display:block; font-size:12px; color:var(--ink-soft); margin-top:2px; line-height:1.35; }

  /* avisos que ficavam colados embaixo sobem acima da barra */
  .sound-hint{ bottom:calc(98px + env(safe-area-inset-bottom, 0px)); left:16px; right:16px; text-align:center; border-radius:16px; }
}

/* ---- conteúdo largo não pode esticar a página no celular ----
   Colunas "1fr" crescem até caber o item mais largo (nomes longos, tabelas); com minmax(0,1fr)
   respeitam a tela. Antes, a barra fixa de baixo ficava mais larga que o celular e o "Mais" sumia. */
@media (max-width: 1180px){
  .grid-main, .grid-bottom{ grid-template-columns:minmax(0,1fr); }
  .grid-main > *, .grid-bottom > *{ min-width:0; }
  .kpi-row{ grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px){
  .wrap{ overflow-x:clip; }
  .card{ min-width:0; max-width:100%; }
  .table-card{ overflow-x:auto; }

  /* o conteúdo esmaece atrás da barra, e a barra aparece com um fade ao abrir */
  body::after{
    content:''; position:fixed; left:0; right:0; bottom:0; z-index:39; pointer-events:none;
    height:calc(130px + env(safe-area-inset-bottom, 0px));
    background:linear-gradient(to top, #f2f3f7 38%, rgba(242,243,247,0));
  }
  .mobile-nav{ animation:mnIn .45s ease .1s both; }
}
@keyframes mnIn{ from{ opacity:0; transform:translateY(20px); } to{ opacity:1; transform:none; } }

/* ---------------- Seletor de datas no celular: folha que sobe de baixo ---------------- */
.dr-backdrop{ display:none; }
.dr-nav-m{ display:none; }

@media (max-width: 760px){
  body.dr-open{ overflow:hidden; }

  .dr-backdrop{
    position:fixed; inset:0; z-index:55; background:rgba(16,19,28,.45);
    opacity:0; pointer-events:none; transition:opacity .2s ease; display:block;
  }
  .dr-panel.open + .dr-backdrop{ opacity:1; pointer-events:auto; }

  .dr-panel{
    position:fixed; left:12px; right:12px; top:auto; bottom:calc(12px + env(safe-area-inset-bottom, 0px));
    width:auto; max-width:none; max-height:calc(100dvh - 90px); overflow-y:auto; overscroll-behavior:contain;
    z-index:56; border-radius:28px; padding:10px 16px 0;
    box-shadow:0 -4px 40px rgba(27,41,66,.28);
  }
  .dr-panel.open{ display:grid; grid-template-columns:1fr auto; column-gap:12px; animation:drUp .24s ease both; }
  .dr-panel::before{ content:''; grid-column:1 / -1; width:40px; height:4px; border-radius:4px; background:var(--line); margin:0 auto 12px; }

  /* topo: "Intervalo de datas" e "Ir para hoje"; os botões vão para o rodapé fixo */
  .dr-panel-top{ display:contents; }
  .dr-toggle{ align-self:center; }
  .dr-today-link{ align-self:center; white-space:nowrap; padding:8px 0; }
  .dr-panel-top-actions{
    order:99; grid-column:1 / -1; position:sticky; bottom:0; z-index:2;
    margin:0 -16px; padding:12px 16px calc(14px + env(safe-area-inset-bottom, 0px)); background:var(--panel); border-top:1px solid var(--line);
    display:grid; grid-template-columns:1fr 2fr; gap:10px;
  }
  .dr-panel-top-actions .dr-btn{ padding:13px 0; font-size:14px; border-radius:14px; }

  .dr-body{ grid-column:1 / -1; flex-direction:column; gap:12px; margin-top:12px; }

  /* atalhos viram uma fila de botões rolável */
  .dr-sidebar{
    flex-direction:row; width:auto; gap:8px; border-right:0; padding-right:0;
    overflow-x:auto; scrollbar-width:none; margin:0 -16px; padding:2px 16px;
  }
  .dr-sidebar::-webkit-scrollbar{ display:none; }
  .dr-preset{ flex:none; white-space:nowrap; padding:9px 14px; border-radius:999px; background:var(--panel-soft); font-size:13px; }
  .dr-preset:active{ background:var(--blue); color:#fff; }
  .dr-custom{ flex:none; flex-direction:row; align-items:flex-end; gap:8px; margin:0; }
  .dr-custom label{ width:118px; }
  .dr-custom input{ font-size:16px; padding:9px 10px; }

  .dr-fields{ margin-bottom:12px; }
  .dr-field{ padding:11px 12px; border-radius:14px; }
  .dr-field input{ font-size:16px; }

  /* um mês por vez, com setas dos dois lados */
  .dr-months{ display:block; }
  .dr-month:nth-child(2){ display:none; }
  .dr-month-head{ margin-bottom:12px; }
  .dr-nav-spacer{ display:none; }
  .dr-nav-m{ display:flex; }
  .dr-nav{ width:36px; height:36px; border-radius:11px; }
  .dr-nav svg{ width:16px; height:16px; }
  .dr-month-label{ font-size:15px; }
  .dr-weekdays span{ font-size:11px; padding-bottom:4px; }
  .dr-grid{ gap:3px; }
  .dr-cell{ aspect-ratio:auto; height:42px; font-size:14px; border-radius:12px; }
  .dr-cell.range-start{ border-radius:12px 0 0 12px; }
  .dr-cell.range-end{ border-radius:0 12px 12px 0; }
  .dr-cell.range-start.range-end{ border-radius:12px; }
}
@keyframes drUp{ from{ opacity:0; transform:translateY(24px); } to{ opacity:1; transform:none; } }

/* o conteúdo da folha nunca pode passar da largura dela: a fila de atalhos rola DENTRO da folha
   (antes, com align-items:flex-start, ela ficava do tamanho de todos os botões somados e alargava tudo) */
@media (max-width: 760px){
  .dr-panel{ overflow-x:hidden; }
  .dr-body{ align-items:stretch; min-width:0; }
  .dr-main{ width:100%; min-width:0; }
  .dr-sidebar{ min-width:0; }
}
@media (max-width: 380px){
  /* telas bem estreitas: o ícone dos campos de data sai para a data caber inteira */
  .dr-field{ padding:11px 10px; }
  .dr-field-ico{ display:none; }
  .dr-fields{ gap:8px; }
}


/* ---------------- Transições suaves ao trocar de seção ---------------- */
@keyframes viewIn{ from{ opacity:0; transform:translateY(12px); } to{ opacity:1; transform:none; } }
@keyframes mnPop{ 0%{ transform:scale(.78); } 60%{ transform:scale(1.12); } 100%{ transform:scale(1); } }

/* a seção que entra aparece com fade + subida; os blocos entram em cascata (só depois da 1ª troca) */
body.anim-ready .view.active > *{ animation:viewIn .38s cubic-bezier(.2,.7,.2,1) backwards; }
body.anim-ready .view.active > *:nth-child(2){ animation-delay:.04s; }
body.anim-ready .view.active > *:nth-child(3){ animation-delay:.08s; }
body.anim-ready .view.active > *:nth-child(4){ animation-delay:.12s; }
body.anim-ready .view.active > *:nth-child(5){ animation-delay:.16s; }
body.anim-ready .view.active > *:nth-child(n+6){ animation-delay:.2s; }

/* menu de cima (computador): o fundo branco do item ativo desliza */
.tabs{ position:relative; }
.tabs > button{ position:relative; z-index:1; }
.tab-pill{
  position:absolute; left:0; top:0; width:0; height:0; border-radius:999px; background:#fff;
  box-shadow:0 2px 10px rgba(16,19,28,.16); opacity:0; pointer-events:none;
  transition:transform .34s cubic-bezier(.4,0,.2,1), width .34s cubic-bezier(.4,0,.2,1), opacity .2s ease;
}
.tabs.has-pill .tab-pill{ opacity:1; }
.tabs.has-pill button.active{ background:transparent; }

/* barra de baixo (celular): o pill de degradê desliza e o ícone dá um pulinho */
.mn-pill{ display:none; }
@media (max-width: 760px){
  .mobile-nav > button{ position:relative; z-index:1; }
  .mn-pill{
    display:block; position:absolute; left:0; top:0; width:0; height:0; border-radius:24px;
    background:var(--gradient-brand); box-shadow:0 8px 18px rgba(64,79,157,.4); opacity:0; pointer-events:none;
    transition:transform .38s cubic-bezier(.4,0,.2,1), width .38s cubic-bezier(.4,0,.2,1), opacity .2s ease;
  }
  .mobile-nav.has-pill .mn-pill{ opacity:1; }
  .mobile-nav.has-pill button.active{ background:transparent; box-shadow:none; }
  body.anim-ready .mobile-nav.has-pill button.active .mn-ico{ animation:mnPop .38s cubic-bezier(.3,1.5,.5,1); }
}

/* quem desativa animações no sistema não vê movimento */
@media (prefers-reduced-motion: reduce){
  body.anim-ready .view.active > *{ animation:none !important; }
  .tab-pill, .mn-pill{ transition:none !important; }
  body.anim-ready .mobile-nav.has-pill button.active .mn-ico{ animation:none !important; }
}

/* filtro de Origem (TB / JK / GB): só na aba Leads Orgânicos */
body:not(.on-tabelaorg) .filterbar .canal-filter.org-tab-only,
body:not(.on-tabelaorg) .filterbar .label.org-tab-only{ display:none; }

/* ---------------- Matrizes de classificação (Qualificação) ---------------- */
.qm-section{ display:grid; gap:18px; margin-top:18px; }
.qm-scroll{ overflow-x:auto; }
.qm{ width:100%; min-width:640px; border-collapse:separate; border-spacing:6px; font-size:13.5px; }
.qm th{ font-size:12px; font-weight:700; text-align:center; padding:4px 6px 8px; color:var(--ink); }
.qm th.qm-rl{ text-align:left; white-space:nowrap; padding-right:12px; font-size:13px; }
.qm td{ text-align:center; padding:13px 6px; border-radius:12px; font-weight:700; }
.qm td small{ display:block; font-weight:500; font-size:11px; opacity:.85; margin-top:2px; }
.qm-alto{ background:rgba(23,181,121,.16); color:#0e8a5b; }
.qm-pot{ background:rgba(64,79,157,.16); color:#404f9d; }
.qm-med{ background:rgba(224,160,32,.2); color:#9a6a00; }
.qm-baixo{ background:rgba(239,90,111,.15); color:#d23a52; }
.qm-none{ background:repeating-linear-gradient(45deg,var(--line),var(--line) 4px,transparent 4px,transparent 8px); color:var(--ink-faint); }
.qm-key{ display:flex; flex-wrap:wrap; gap:8px 18px; margin-top:12px; font-size:12.5px; color:var(--ink-soft); }
.qm-key span{ display:inline-flex; align-items:center; gap:6px; }
.qm-sw{ width:12px; height:12px; border-radius:4px; display:inline-block; }
.qm-note{ margin-top:12px; padding:11px 14px; border-radius:12px; background:rgba(224,160,32,.12); font-size:12.5px; line-height:1.5; color:var(--ink); }
.qm-note strong{ color:#a86f00; }

/* ---------------- Troca de área (Marketing <-> Cobrança) e botão Sair ---------------- */
.area-switch{
  position:relative; width:40px; height:40px; border-radius:50%; flex:none;
  display:flex; align-items:center; justify-content:center;
  background:rgba(255,255,255,.14); color:#fff; text-decoration:none;
  border:1px solid rgba(255,255,255,.22);
  transition:background .2s ease, transform .2s ease;
}
.area-switch svg{ width:18px; height:18px; flex:none; transition:transform .3s ease; }
.area-switch span{
  position:absolute; top:calc(100% + 10px); left:50%; transform:translate(-50%,-4px);
  background:#fff; color:var(--navy); font-size:12px; font-weight:700; white-space:nowrap;
  padding:6px 12px; border-radius:10px; box-shadow:0 10px 24px rgba(27,41,66,.22);
  opacity:0; pointer-events:none; transition:opacity .18s ease, transform .18s ease; z-index:80;
}
.area-switch:hover, .area-switch:focus-visible{ background:rgba(255,255,255,.28); }
.area-switch:hover svg{ transform:translateX(2px); }
.area-switch:hover span, .area-switch:focus-visible span{ opacity:1; transform:translate(-50%,0); }
.area-switch:active{ transform:scale(.94); }
.profile-out{
  width:30px; height:30px; margin-left:2px; border-radius:50%; border:0; cursor:pointer;
  background:rgba(255,255,255,.14); color:#fff; display:flex; align-items:center; justify-content:center;
  transition:background .2s ease;
}
.profile-out svg{ width:15px; height:15px; }
.profile-out:hover{ background:rgba(255,255,255,.28); }
@media (max-width:760px){ .area-switch{ display:none; } }

/* o topo precisa caber em telas de computador sem estourar: tira primeiro o que é só complemento */
@media (min-width: 761px){ .brand-tagline{ display:none; } }
@media (min-width: 761px) and (max-width: 1400px){
  .profile{ padding-right:6px; }
  .profile > div:not(.avatar){ display:none; }
}
