:root {
  --bg: #0A0A0A;
  --card: #141414;
  --card-2: #1b1b1b;
  --glass: rgba(255, 255, 255, .045);
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --accent: #F27405;
  --accent-2: #FF7A00;
  --accent-soft: rgba(242, 116, 5, .14);
  --text: #FFFFFF;
  --muted: #A0A0A0;
  --ok: #3ddc84;
  --info: #5aa9ff;
  --bad: #ff5d5d;
  --wait: #FFB020;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --sidebar-w: 260px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: Inter, "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(900px 500px at 85% -10%, rgba(242, 116, 5, .13), transparent 60%),
    radial-gradient(700px 400px at -10% 110%, rgba(242, 116, 5, .07), transparent 60%);
  background-attachment: fixed;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; text-decoration: none; }
svg { display: block; flex: none; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 8px; }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .25s ease; }
.app.collapsed { --sidebar-w: 78px; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 18px 14px;
  display: flex; flex-direction: column; gap: 6px;
  background: rgba(14, 14, 14, .72); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-right: 1px solid var(--line); overflow-x: hidden; overflow-y: auto; scrollbar-width: none;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 18px; min-height: 64px; justify-content: center; }
.brand-logo { width: 100%; max-width: 178px; height: auto; object-fit: contain; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: linear-gradient(145deg, var(--accent-2), #c25a00); box-shadow: 0 6px 18px rgba(242, 116, 5, .35);
}
.brand-name { font-weight: 800; letter-spacing: .12em; font-size: 15px; white-space: nowrap; }
.brand-name small { display: block; font-weight: 500; letter-spacing: .02em; color: var(--muted); font-size: 11px; }
.brand-mini { display: none; width: 38px; height: auto; }
.top-mark { display: none; height: 34px; width: auto; }
.app.collapsed .brand-name, .app.collapsed .brand-logo.wide, .app.collapsed .nav-label, .app.collapsed .sidebar .nav-badge { display: none; }
.app.collapsed .brand-mini { display: block; }
.app.collapsed .brand { justify-content: center; padding-inline: 0; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--muted);
  font-weight: 500; font-size: 14px; width: 100%; text-align: left; position: relative; transition: .18s;
}
.app.collapsed .nav-item { justify-content: center; padding-inline: 0; }
.nav-item:hover { background: var(--glass); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-2); box-shadow: inset 0 0 0 1px rgba(242, 116, 5, .35); }
.nav-badge { margin-left: auto; font-size: 11px; font-weight: 700; background: var(--accent); color: #111; padding: 1px 8px; border-radius: 99px; }
.side-spacer { flex: 1; }
.side-foot { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 4px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: 16px 28px; background: rgba(10, 10, 10, .72); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.top-title { min-width: 0; }
.top-title h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.top-title p { color: var(--muted); font-size: 13px; }
.top-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.search {
  display: flex; align-items: center; gap: 8px; background: var(--glass); border: 1px solid var(--line); border-radius: 12px;
  padding: 0 12px; height: 42px; min-width: 240px; color: var(--muted);
}
.search input { background: none; border: 0; outline: 0; width: 100%; color: var(--text); }
.search:focus-within { border-color: var(--accent); }
.icon-btn {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--glass);
  border: 1px solid var(--line); color: var(--text); transition: .18s;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent-2); }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  background: linear-gradient(145deg, var(--accent-2), #8a3f00); border: 2px solid rgba(255, 255, 255, .15);
}
.top-profile { display: none; }
.msearch-btn { display: none; }
.mob-only { display: none; }
.content { padding: 24px 28px 48px; outline: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px;
  border-radius: 12px; font-weight: 600; font-size: 14px; border: 1px solid var(--line-2); background: var(--glass);
  transition: transform .15s, box-shadow .2s, border-color .2s, background .2s; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(145deg, var(--accent-2), var(--accent)); color: #140900; border-color: transparent; box-shadow: 0 8px 22px rgba(242, 116, 5, .32); }
.btn.primary:hover { box-shadow: 0 10px 28px rgba(242, 116, 5, .5); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.danger { color: var(--bad); border-color: rgba(255, 93, 93, .35); }
.btn.ghost { background: transparent; }

/* ---------- Cards / glass ---------- */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .012)), var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0;
}
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h2 { font-size: 15px; font-weight: 700; }
.card-head .sub { color: var(--muted); font-size: 12px; margin-left: auto; }
.eyebrow { text-transform: uppercase; font-size: 11px; letter-spacing: .12em; color: var(--muted); font-weight: 600; }

/* ---------- Home / bento ---------- */
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: start; }
.b-hero { grid-column: span 5; }
.b-metrics { grid-column: span 7; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.b-list { grid-column: span 8; }
.b-side { grid-column: span 4; display: flex; flex-direction: column; gap: 16px; }
.bento > * { min-width: 0; }

.hero { position: relative; overflow: hidden; display: flex; gap: 20px; align-items: center; }
.hero::after {
  content: ""; position: absolute; inset: auto -40px -60px auto; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 116, 5, .28), transparent 65%); pointer-events: none;
}
.ring { position: relative; width: 112px; height: 112px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: #262626; }
.ring .bar { stroke: var(--accent-2); stroke-linecap: round; transition: stroke-dasharray .6s ease; filter: drop-shadow(0 0 6px rgba(255, 122, 0, .5)); }
.ring .ring-txt { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .ring-txt b { font-size: 26px; line-height: 1; font-weight: 800; }
.ring .ring-txt span { font-size: 11px; color: var(--muted); }
.hero-info { min-width: 0; position: relative; z-index: 1; }
.hero-info h2 { font-size: 20px; font-weight: 700; margin: 4px 0 8px; }
.hero-next { color: var(--muted); font-size: 13px; }
.hero-next b { color: var(--text); font-weight: 600; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--accent-2); font-weight: 600; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 0 rgba(255, 122, 0, .7); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(255, 122, 0, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 122, 0, 0); } }
.mini-stats { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.metric { padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.metric .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); }
.metric b { font-size: 28px; font-weight: 800; line-height: 1.1; }
.metric span { color: var(--muted); font-size: 12px; }

.date-strip { scrollbar-width: none; display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x proximity; margin-bottom: 4px; }
.date-chip {
  scroll-snap-align: center; flex: none; width: 56px; padding: 10px 0; border-radius: 14px; text-align: center;
  background: var(--card); border: 1px solid var(--line); transition: .18s; position: relative;
}
.date-chip small { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.date-chip b { display: block; font-size: 18px; font-weight: 700; margin-top: 2px; }
.date-chip .dot { position: absolute; left: 50%; bottom: 5px; transform: translateX(-50%); width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.date-chip.today small { color: var(--accent-2); }
.date-chip.active { background: linear-gradient(160deg, var(--accent-2), var(--accent)); border-color: transparent; color: #140900; box-shadow: 0 8px 20px rgba(242, 116, 5, .35); }
.date-chip.active small { color: rgba(20, 9, 0, .75); }
.date-chip.active .dot { background: #140900; }

.shortcuts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.shortcut {
  text-align: left; padding: 14px; border-radius: var(--radius); background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); display: flex; flex-direction: column; gap: 10px; transition: .2s; position: relative;
}
.shortcut:hover { border-color: var(--accent); transform: translateY(-2px); }
.shortcut .ico { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); }
.shortcut b { font-size: 14px; display: block; }
.shortcut span { font-size: 12px; color: var(--muted); }
.shortcut .cnt { position: absolute; top: 12px; right: 12px; font-weight: 800; font-size: 18px; color: var(--accent-2); }

/* ---------- Lead list ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.group-title { display: flex; align-items: center; gap: 8px; margin: 10px 2px 2px; }
.group-title:first-child { margin-top: 0; }
.group-title .eyebrow { display: flex; align-items: center; gap: 8px; }
.group-title .n { background: var(--card-2); border: 1px solid var(--line); border-radius: 99px; padding: 0 8px; font-size: 11px; color: var(--muted); }
.lead {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px;
  border-radius: 14px; background: var(--card-2); border: 1px solid var(--line); transition: border-color .2s, opacity .2s, transform .2s;
}
.lead:hover { border-color: var(--line-2); }
.lead.late { border-color: rgba(255, 176, 32, .55); box-shadow: inset 3px 0 0 var(--wait); }
.lead.done { opacity: .72; }
.lead .av { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-weight: 700; background: #262626; border: 1px solid var(--line); }
.lead.st-aguardando .av { background: var(--accent-soft); color: var(--accent-2); border-color: rgba(242, 116, 5, .4); }
.lead-main { min-width: 0; }
.lead-name { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.lead-meta span { display: inline-flex; align-items: center; gap: 5px; }
.lead-time { text-align: right; }
.lead-time b { display: block; font-size: 18px; font-weight: 700; }
.lead-time small { color: var(--muted); font-size: 11px; }
.lead-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-top: 1px dashed var(--line); padding-top: 12px; }
.lead-actions .spacer { flex: 1; }
.compact .lead { padding: 9px 12px; }
.compact .lead .av { width: 34px; height: 34px; border-radius: 10px; font-size: 13px; }
.compact .lead-actions { padding-top: 8px; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; border: 1px solid; white-space: nowrap; }
.pill.aguardando { color: var(--wait); border-color: rgba(255, 176, 32, .4); background: rgba(255, 176, 32, .1); }
.pill.compareceu { color: var(--info); border-color: rgba(90, 169, 255, .4); background: rgba(90, 169, 255, .1); }
.pill.fechou { color: var(--ok); border-color: rgba(61, 220, 132, .4); background: rgba(61, 220, 132, .1); }
.pill.nao_venda { color: var(--bad); border-color: rgba(255, 93, 93, .4); background: rgba(255, 93, 93, .1); }
.pill.rem { color: var(--accent-2); border-color: rgba(242, 116, 5, .45); background: var(--accent-soft); }
.pill.neutral { color: var(--muted); border-color: var(--line-2); }

.seg { display: inline-flex; background: #0f0f0f; border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { height: 30px; padding: 0 11px; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; transition: .15s; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--accent); color: #140900; }
.seg button.on.s-compareceu { background: var(--info); }
.seg button.on.s-fechou { background: var(--ok); }
.seg button.on.s-nao_venda { background: var(--bad); color: #fff; }
.seg button.on.s-aguardando { background: var(--wait); }

.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty .ico { width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 16px; display: grid; place-items: center; background: var(--glass); border: 1px solid var(--line); color: var(--accent-2); }
.empty b { color: var(--text); display: block; margin-bottom: 4px; }

/* ---------- Follow-up templates ---------- */
.msg-box { grid-column: 1 / -1; background: #0f0f0f; border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 28px; padding: 0 11px; border-radius: 99px; font-size: 12px; font-weight: 600; border: 1px solid var(--line-2); color: var(--muted); transition: .15s; }
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-2); }
.msg-text { font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; background: rgba(255, 255, 255, .03); border-radius: 10px; padding: 10px 12px; border: 1px solid var(--line); }
.msg-text.none { color: var(--muted); font-style: italic; }
.sent-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.sent-toggle.on { color: var(--ok); }
.page-head { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.page-head .grow { flex: 1; min-width: 200px; }
.page-head h2 { font-size: 18px; }
.page-head p { color: var(--muted); font-size: 13px; }
.progressline { height: 6px; border-radius: 6px; background: #262626; overflow: hidden; }
.progressline i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 6px; transition: width .4s; }
.summary { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }

/* ---------- Calendar ---------- */
.cal-head { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.cal-head b { flex: 1; font-size: 15px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-grid .dow { font-size: 11px; color: var(--muted); padding: 4px 0; }
.cal-day { aspect-ratio: 1; border-radius: 10px; font-size: 13px; display: grid; place-items: center; position: relative; color: var(--text); transition: .15s; }
.cal-day.out { color: #4a4a4a; }
.cal-day:hover { background: var(--glass); }
.cal-day.today { box-shadow: inset 0 0 0 1px var(--accent); }
.cal-day.sel { background: var(--accent); color: #140900; font-weight: 700; }
.cal-day .d { position: absolute; bottom: 3px; display: flex; gap: 2px; }
.cal-day .d i { width: 4px; height: 4px; border-radius: 50%; background: var(--accent-2); }
.cal-day.sel .d i { background: #140900; }

/* ---------- Em andamento / controles ---------- */
.flow { display: flex; flex-direction: column; gap: 12px; }
.flow-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; font-size: 13px; }
.flow-row .progressline { grid-column: 1 / -1; }
.flow-row b { font-weight: 700; }
.toggle-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.toggle-row:last-child { border-bottom: 0; padding-bottom: 0; }
.toggle-row .t { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; }
.toggle-row .t small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.switch { position: relative; width: 46px; height: 26px; border-radius: 99px; background: #2a2a2a; border: 1px solid var(--line-2); transition: .2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #8a8a8a; transition: .2s; }
.switch[aria-checked="true"] { background: var(--accent); border-color: var(--accent-2); box-shadow: 0 0 16px rgba(255, 122, 0, .55); }
.switch[aria-checked="true"]::after { left: 22px; background: #fff; }

/* ---------- Modal ---------- */
.modal-root:empty { display: none; }
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .65); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; animation: fade .18s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: rgba(20, 20, 20, .96); border: 1px solid var(--line-2); border-radius: 20px; padding: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, .7); animation: rise .22s ease; }
.modal.wide { width: min(760px, 100%); }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }
.modal h3 { font-size: 18px; margin-bottom: 4px; }
.modal .lead-p { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea {
  background: #0f0f0f; border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px; min-height: 44px; outline: 0; width: 100%; color-scheme: dark;
}
.field textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.hint { font-size: 12px; color: var(--muted); }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; justify-content: flex-end; flex-wrap: wrap; }
.modal-actions .left { margin-right: auto; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; overflow-x: auto; }
.tabs button { flex: none; height: 34px; padding: 0 14px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); }
.tabs button.on { background: var(--accent-soft); color: var(--accent-2); border-color: var(--accent); }
.logo-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.logo-prev { height: 44px; max-width: 160px; background: #0f0f0f; border: 1px solid var(--line); border-radius: 10px; padding: 4px; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; z-index: 200; background: #222; border: 1px solid var(--accent); padding: 10px 18px; border-radius: 12px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow); transition: .25s; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Mobile bottom nav ---------- */
.bottomnav, .fab { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .b-hero, .b-metrics { grid-column: 1 / -1; }
  .b-list { grid-column: span 7; }
  .b-side { grid-column: span 5; }
  .shortcuts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .app { --sidebar-w: 78px; }
  .app .brand-name, .app .brand-logo.wide, .app .nav-label, .app .sidebar .nav-badge { display: none; }
  .brand-mini { display: block; }
  .app .brand { justify-content: center; padding-inline: 0; }
  .app .nav-item { justify-content: center; padding-inline: 0; }
  #collapse-btn { display: none; }
  .b-list, .b-side { grid-column: 1 / -1; }
  .b-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}
@media (max-width: 767px) {
  .app { display: block; }
  .sidebar { display: none; }
  .topbar { padding: 14px 16px; }
  .top-title h1 { font-size: 19px; }
  .top-mark { display: block; }
  .top-actions .btn.primary { display: none; }
  .topbar { flex-wrap: wrap; }
  .search { display: none; order: 10; flex-basis: 100%; min-width: 0; }
  .topbar.msearch .search { display: flex; }
  .msearch-btn { display: grid; }
  .top-profile { display: grid; }
  .set-btn { display: none; }
  .mob-only { display: block; }
  .content { padding: 16px 16px calc(112px + var(--safe-b)); }
  .bento { display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
  .b-metrics, .desk-only { display: none; }
  .hero { padding: 16px; gap: 16px; }
  .ring { width: 96px; height: 96px; }
  .shortcuts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .shortcut { flex-direction: row; align-items: center; gap: 12px; padding: 12px; }
  .shortcut > div:nth-child(2) { flex: 1; min-width: 0; }
  .shortcut .cnt { position: static; }
  .lead { gap: 10px 12px; padding: 12px; }
  .lead .av { width: 40px; height: 40px; }
  .lead-actions .seg { width: 100%; }
  .lead-actions .spacer { display: none; }
  .lead-actions .btn.sm { flex: 1; padding: 0 8px; }
  .lead-actions .seg button { flex: 1; justify-content: center; padding: 0 6px; font-size: 12px; }
  .form { grid-template-columns: 1fr; }
  .overlay { place-items: end center; padding: 0; }
  .modal { border-radius: 22px 22px 0 0; max-height: 92vh; padding-bottom: calc(22px + var(--safe-b)); }
  .bottomnav {
    display: flex; position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b)); z-index: 50; gap: 2px; padding: 8px;
    background: rgba(24, 24, 24, .78); backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid var(--line-2); border-radius: 24px; box-shadow: 0 16px 40px rgba(0, 0, 0, .65);
  }
  .bn-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px; border-radius: 16px; color: var(--muted); font-size: 10.5px; font-weight: 600; position: relative; transition: .18s; }
  .bn-item.active { color: var(--accent-2); background: var(--accent-soft); }
  .bn-item .nav-badge { position: absolute; top: 2px; right: 12%; font-size: 10px; padding: 0 6px; }
  .fab {
    display: grid; place-items: center; position: fixed; right: 18px; bottom: calc(100px + var(--safe-b)); z-index: 49; width: 54px; height: 54px; border-radius: 18px;
    background: linear-gradient(145deg, var(--accent-2), var(--accent)); color: #140900; box-shadow: 0 10px 26px rgba(242, 116, 5, .5);
  }
  .toast { bottom: calc(110px + var(--safe-b)); }
}
@media (max-width: 340px) {
  .hero { flex-direction: column; align-items: flex-start; }
  .lead-time b { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.date-strip::-webkit-scrollbar { display: none; }

.pill.nao_compareceu { color: #ff8f5d; border-color: rgba(255, 143, 93, .4); background: rgba(255, 143, 93, .1); }
.pill.cancelado { color: var(--muted); border-color: var(--line-2); background: rgba(255, 255, 255, .04); }
.lead.st-cancelado .lead-name { text-decoration: line-through; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin svg { animation: spin 1s linear infinite; }
.sync-err svg { color: var(--wait); }

/* ---------- Desempenho ---------- */
.b-perf { grid-column: 1 / -1; }
.perf-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; align-items: stretch; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kpi { background: var(--card-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi .ico { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); margin-bottom: 4px; }
.kpi b { font-size: 24px; font-weight: 800; line-height: 1.1; }
.kpi span { font-size: 12.5px; color: var(--text); font-weight: 600; }
.kpi small { font-size: 11.5px; color: var(--muted); }
.chart { background: var(--card-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; justify-content: flex-end; min-height: 150px; }
.bars { flex: 1; display: flex; align-items: flex-end; gap: 3px; min-height: 100px; }
.bars i { position: relative; flex: 1; min-width: 3px; border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg, var(--accent-2), var(--accent)); display: flex; justify-content: center; }
.bars i.future { background: #262626; }
.bars i.now { box-shadow: 0 0 0 2px rgba(255, 255, 255, .5); }
.bars em { position: absolute; top: -17px; font-style: normal; font-size: 10px; font-weight: 700; color: var(--muted); }
.bars-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }
.goal { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.goal .progressline { flex: 1; }
.goal span { font-size: 12.5px; color: var(--muted); white-space: nowrap; font-weight: 600; }
@media (max-width: 767px) {
  .perf-grid { grid-template-columns: 1fr; }
  .perf .card-head { flex-wrap: wrap; }
  .perf .card-head .seg { margin-left: auto; }
  .kpi b { font-size: 21px; }
}

.digest { display: flex; flex-direction: column; gap: 6px; }
.digest-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; font-size: 14px; }
.digest-row span { color: var(--muted); }
.digest-row b { text-align: right; font-weight: 700; }

.num-ico { display: inline-grid; place-items: center; border: 1.8px solid currentColor; border-radius: 7px; font-weight: 800; line-height: 1; flex: none; }

.daytabs { margin-bottom: 14px; display: flex; }
.daytabs button { flex: 1; justify-content: center; }
.page-head .seg button { min-width: 34px; justify-content: center; }
.daytabs button { white-space: nowrap; padding: 0 4px; font-size: 12px; }

/* ---------- Cartão compacto ---------- */
.lead { display: block; padding: 10px 12px; gap: 0; }
.lead-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.lead-name { font-size: 15px; }
.lead-time { display: flex; align-items: baseline; gap: 6px; text-align: right; flex: none; }
.lead-time b { display: inline; font-size: 16px; }
.lead-meta { margin-top: 2px; }
.lead-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin-top: 7px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.pill { padding: 2px 9px; font-size: 11.5px; }
.lead-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.btn.xs { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 9px; gap: 6px; }
.msg-box { margin-top: 8px; }
.compact .lead { padding: 7px 10px; }
.shortcut:last-child:nth-child(odd) { grid-column: 1 / -1; }
.kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 767px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .lead { padding: 10px 12px; } }

/* ---------- Menu recolhido: contador pequeno sobre o ícone ---------- */
.app.collapsed .sidebar .nav-badge { display: inline-block; position: absolute; top: 2px; right: 6px; margin: 0; font-size: 9px; padding: 0 5px; line-height: 15px; min-width: 15px; text-align: center; }
@media (max-width: 1024px) { .app .sidebar .nav-badge { display: inline-block; position: absolute; top: 2px; right: 6px; margin: 0; font-size: 9px; padding: 0 5px; line-height: 15px; min-width: 15px; text-align: center; } }

@media (max-width: 767px) { .lead-acts .btn.xs .t { display: none; } .lead-acts .btn.xs { padding: 0 9px; } }

/* ---------- Login ---------- */
#gate { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; padding: 16px; overflow: auto;
  background: var(--bg) radial-gradient(900px 500px at 85% -10%, rgba(242, 116, 5, .16), transparent 60%); }
.gate-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 14px; padding: 28px 24px; border-radius: 20px;
  background: rgba(20, 20, 20, .85); border: 1px solid var(--line-2); box-shadow: 0 30px 80px rgba(0, 0, 0, .7); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.gate-logo { width: 190px; max-width: 70%; height: auto; align-self: center; margin-bottom: 4px; }
.gate-card h1 { font-size: 22px; text-align: center; }
.gate-card > p:not(.hint) { color: var(--muted); font-size: 13px; text-align: center; }
body.gated .app, body.gated .modal-root { display: none; }

[hidden] { display: none !important; }
.account { flex-direction: row; align-items: center; gap: 12px; padding: 12px; background: var(--card-2); border: 1px solid var(--line); border-radius: 14px; }
.acc-av { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; flex: none; background: linear-gradient(145deg, var(--accent-2), #8a3f00); }
.acc-i { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.acc-i b { font-size: 15px; }
.acc-i small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.stack { display: flex; flex-direction: column; gap: 16px; }
[id^="sec-"] { scroll-margin-top: 84px; }

/* Celular: etiquetas sozinhas em cima, botões na linha de baixo */
@media (max-width: 767px) {
  .lead-line { flex-direction: column; align-items: stretch; gap: 8px; }
  .pills, .lead-acts { width: 100%; }
  .lead-acts { flex-wrap: nowrap; }
  .lead-acts .btn.xs { flex: 1; justify-content: center; padding: 0 6px; }
  .lead-acts .btn.xs .t { display: inline; }
}
