/* JB BUSCAS — tema neon (verde-limão + ciano sobre preto), seguindo a identidade da logo */
:root {
  color-scheme: dark;
  /* Marca */
  --lime: #9EE52A;
  --lime-600: #B4F24F;
  --lime-ink: #071006;
  --lime-glow: rgba(158, 229, 42, .45);
  --cyan: #22C7F2;
  --cyan-600: #5FD8F7;
  --cyan-glow: rgba(34, 199, 242, .4);
  --steel: #C9D3D7;
  /* Superfícies */
  --bg: #040708;
  --surface: #0A1114;
  --surface-2: #0E171B;
  --surface-3: #132026;
  --border: #1A282E;
  --border-strong: #263B44;
  --text: #DCE6E9;
  --heading: #F3F8F9;
  --muted: #8FA4AC;
  --faint: #5E737B;
  /* Aliases usados pelos componentes */
  --purple: var(--lime);
  --purple-600: var(--lime-600);
  --purple-50: rgba(158, 229, 42, .08);
  --purple-100: rgba(158, 229, 42, .28);
  --navy-950: #020405;
  --navy-900: var(--heading);
  --navy-800: #0E171B;
  --navy-700: #132026;
  /* Estados */
  --green: #2BD46F;
  --green-bg: rgba(43, 212, 111, .1);
  --green-border: rgba(43, 212, 111, .38);
  --amber: #F2B544;
  --amber-bg: rgba(242, 181, 68, .1);
  --amber-border: rgba(242, 181, 68, .35);
  --red: #FF6464;
  --red-bg: rgba(255, 100, 100, .1);
  --red-border: rgba(255, 100, 100, .38);
  --blue: var(--cyan);
  --blue-bg: rgba(34, 199, 242, .1);
  --blue-border: rgba(34, 199, 242, .38);
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .02) inset, 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, .6);
  --sidebar: 252px;
  --font-tech: "Bahnschrift", "DIN Alternate", "Segoe UI", system-ui, sans-serif;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(900px 500px at 100% -10%, rgba(34, 199, 242, .06), transparent 60%),
    radial-gradient(900px 500px at 0% 110%, rgba(158, 229, 42, .05), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  font-size: 14px; line-height: 1.45;
}
::selection { background: rgba(158, 229, 42, .35); color: #fff; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--cyan-600); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; color: var(--heading); font-family: var(--font-tech); letter-spacing: .01em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
svg.i.sm { width: 15px; height: 15px; }
svg.i.fill { fill: currentColor; stroke: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.na { color: var(--faint); font-style: italic; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.mt { margin-top: 16px; }
.mt-s { margin-top: 8px; }
.hidden { display: none !important; }
code { background: var(--surface-3); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; color: var(--lime); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #35525e; }

/* ---------- Layout ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); background: linear-gradient(180deg, #060B0D 0%, #030506 100%); color: var(--muted);
  position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 40; transition: transform .2s ease;
  border-right: 1px solid var(--border);
}
.sidebar::after {
  content: ""; position: absolute; top: 0; right: -1px; bottom: 0; width: 1px;
  background: linear-gradient(180deg, transparent, var(--lime-glow) 30%, var(--cyan-glow) 70%, transparent);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px; color: #fff; }
.brand-logo {
  display: block; width: 100%; aspect-ratio: 1525 / 1017; max-height: 150px;
  background: url("/img/logo-jb-buscas-v3-recorte.webp") center / contain no-repeat;
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 7px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--lime) 0 50%, var(--cyan) 50% 100%); color: var(--lime-ink);
  font-family: var(--font-tech); font-weight: 800; font-size: 15px;
}
.brand b { display: block; font-family: var(--font-tech); font-size: 15px; letter-spacing: .14em; }
.brand span { display: block; font-size: 10.5px; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }
.nav { padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav .label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em; color: var(--faint); padding: 14px 10px 6px; font-family: var(--font-tech); }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 6px; color: #B5C4CA; font-weight: 500;
  border: 1px solid transparent; position: relative;
}
.nav a:hover { background: rgba(34, 199, 242, .06); text-decoration: none; color: #fff; border-color: rgba(34, 199, 242, .15); }
.nav a.active {
  background: linear-gradient(90deg, rgba(158, 229, 42, .14), rgba(158, 229, 42, .02)); color: var(--lime);
  border-color: rgba(158, 229, 42, .25); box-shadow: inset 3px 0 0 var(--lime), 0 0 18px rgba(158, 229, 42, .08);
}
.nav a.active svg { filter: drop-shadow(0 0 6px var(--lime-glow)); }
.sidebar-foot { padding: 12px 14px 16px; border-top: 1px solid var(--border); font-size: 12.5px; }
.sidebar-foot .who { color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot button { margin-top: 8px; width: 100%; justify-content: center; }

.main { margin-left: var(--sidebar); flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 58px; background: rgba(6, 10, 12, .82); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px; gap: 12px; position: sticky; top: 0; z-index: 30;
}
.topbar .title { font-weight: 650; color: var(--heading); font-size: 13px; font-family: var(--font-tech); letter-spacing: .14em; text-transform: uppercase; }
.menu-btn { display: none; }
.content { padding: 24px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { text-shadow: 0 0 24px rgba(158, 229, 42, .15); }
.page-head p { color: var(--muted); margin-top: 4px; }
.backdrop { display: none; }

/* ---------- Cards ---------- */
.card { background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); position: relative; }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .12em; }
.grid { display: grid; gap: 16px; }
.grid.kpis { grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { padding: 14px 16px; overflow: hidden; }
.kpi::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, var(--lime), var(--cyan)); opacity: .35; }
.kpi .k-label { color: var(--muted); font-size: 11.5px; display: flex; align-items: center; gap: 6px; text-transform: uppercase; letter-spacing: .08em; font-family: var(--font-tech); }
.kpi .k-label svg { color: var(--cyan); }
.kpi .k-value { font-size: 28px; font-weight: 700; color: var(--heading); margin-top: 4px; font-variant-numeric: tabular-nums; font-family: var(--font-tech); }
.kpi .k-sub { font-size: 12px; color: var(--faint); margin-top: 2px; }
.kpi.accent::before { opacity: 1; height: 3px; box-shadow: 0 0 14px var(--lime-glow); }
.kpi.accent .k-value { color: var(--lime); text-shadow: 0 0 18px rgba(158, 229, 42, .35); }

/* ---------- Formulários ---------- */
label.f { display: flex; flex-direction: column; gap: 6px; font-weight: 550; font-size: 13px; color: var(--steel); }
label.f .hint, .hint { font-weight: 400; font-size: 12px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  font: inherit; color: var(--text); background: #060B0D; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 9px 11px; width: 100%; min-height: 40px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type=date]::-webkit-calendar-picker-indicator { filter: invert(.8); }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(158, 229, 42, .15), 0 0 16px rgba(158, 229, 42, .15); }
select option { background: var(--surface); color: var(--text); }
input[type=checkbox], input[type=radio] { accent-color: var(--lime); width: 16px; height: 16px; margin: 0; flex: none; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; user-select: none; }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 16px; }
.c12 { grid-column: span 12; } .c8 { grid-column: span 8; } .c6 { grid-column: span 6; } .c4 { grid-column: span 4; } .c3 { grid-column: span 3; }
.seg { display: inline-flex; background: #060B0D; border: 1px solid var(--border-strong); border-radius: 8px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg label { padding: 7px 12px; border-radius: 5px; cursor: pointer; font-weight: 600; font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; text-transform: uppercase; letter-spacing: .06em; font-family: var(--font-tech); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: rgba(158, 229, 42, .12); color: var(--lime); box-shadow: inset 0 0 0 1px rgba(158, 229, 42, .45), 0 0 14px rgba(158, 229, 42, .15); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--lime); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 650; color: var(--steel); font-size: 13.5px; margin-bottom: 8px; padding: 0; }
.section-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .16em; color: var(--cyan); margin: 4px 0 10px; display: flex; align-items: center; gap: 8px; font-family: var(--font-tech); }
.section-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--blue-border), transparent); }

/* Chips e seletor de cidades */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(158, 229, 42, .1); color: var(--lime); border: 1px solid rgba(158, 229, 42, .35); border-radius: 999px; padding: 3px 6px 3px 10px; font-size: 12.5px; font-weight: 550; }
.chip button { border: 0; background: transparent; color: inherit; padding: 2px; min-height: 0; cursor: pointer; display: grid; place-items: center; border-radius: 50%; box-shadow: none; }
.chip button:hover { background: rgba(158, 229, 42, .2); }
.chip.suggest { background: transparent; color: var(--muted); border-style: dashed; border-color: var(--border-strong); cursor: pointer; padding: 3px 10px; }
.chip.suggest:hover { color: var(--cyan); border-color: var(--cyan); }
.combo { position: relative; }
.combo-list { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0; max-height: 260px; overflow-y: auto; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 4px; }
.combo-list button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 5px; cursor: pointer; font: inherit; min-height: 0; color: var(--text); text-transform: none; letter-spacing: 0; box-shadow: none; }
.combo-list button:hover, .combo-list button.on { background: rgba(158, 229, 42, .1); color: var(--lime); }

/* ---------- Botões (neon) ---------- */
button, .btn {
  font: inherit; font-family: var(--font-tech); font-weight: 600; font-size: 12.5px; letter-spacing: .07em; text-transform: uppercase;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: var(--radius-sm); border: 1px solid rgba(34, 199, 242, .45); background: rgba(34, 199, 242, .06); color: #BFEFFC;
  padding: 8px 14px; min-height: 38px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
button:hover, .btn:hover { background: rgba(34, 199, 242, .14); border-color: var(--cyan); color: #fff; text-decoration: none; box-shadow: 0 0 16px var(--cyan-glow); }
button:active, .btn:active { transform: translateY(1px); }
button:focus-visible, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn-primary {
  background: linear-gradient(135deg, #B8F25C 0%, var(--lime) 45%, #6FCB12 100%); border-color: var(--lime); color: var(--lime-ink); font-weight: 700;
  box-shadow: 0 0 14px rgba(158, 229, 42, .28), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn-primary:hover { background: linear-gradient(135deg, #C9F87A 0%, var(--lime-600) 50%, #82DA1F 100%); border-color: var(--lime-600); color: var(--lime-ink); box-shadow: 0 0 24px var(--lime-glow), inset 0 1px 0 rgba(255, 255, 255, .4); }
.btn-big { min-height: 50px; padding: 0 28px; font-size: 15px; letter-spacing: .12em; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); box-shadow: none; }
.btn-ghost:hover { background: rgba(34, 199, 242, .07); border-color: rgba(34, 199, 242, .25); color: #fff; box-shadow: none; }
.btn-danger { color: var(--red); border-color: var(--red-border); background: var(--red-bg); }
.btn-danger:hover { background: rgba(255, 100, 100, .18); border-color: var(--red); color: #FFB3B3; box-shadow: 0 0 16px rgba(255, 100, 100, .35); }
.btn-sm { min-height: 30px; padding: 4px 10px; font-size: 11.5px; }
.btn-icon { min-height: 32px; width: 32px; padding: 0; }
.btn-wa { background: var(--green-bg); border-color: var(--green-border); color: var(--green); }
.btn-wa:hover { background: rgba(43, 212, 111, .2); border-color: var(--green); color: #8CF0B4; box-shadow: 0 0 16px rgba(43, 212, 111, .35); }
.btn-wa svg.i { width: 16px; height: 16px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--muted); border: 1px solid var(--border-strong); white-space: nowrap; letter-spacing: .02em; }
.badge.green { background: var(--green-bg); color: var(--green); border-color: var(--green-border); }
.badge.amber { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-border); }
.badge.red { background: var(--red-bg); color: var(--red); border-color: var(--red-border); }
.badge.blue { background: var(--blue-bg); color: var(--cyan); border-color: var(--blue-border); }
.badge.purple { background: rgba(158, 229, 42, .1); color: var(--lime); border-color: rgba(158, 229, 42, .35); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: currentColor; box-shadow: 0 0 8px currentColor; }

/* ---------- Tabela de empresas ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.toolbar .search-in { max-width: 280px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-strong); border-radius: 999px; padding: 4px 11px; font-size: 12.5px; font-weight: 550; color: var(--muted); cursor: pointer; background: #060B0D; user-select: none; }
.filter-pill:hover { border-color: rgba(34, 199, 242, .5); color: var(--text); }
.filter-pill input { position: absolute; opacity: 0; pointer-events: none; }
.filter-pill:has(input:checked) { background: rgba(158, 229, 42, .1); border-color: var(--lime); color: var(--lime); box-shadow: 0 0 12px rgba(158, 229, 42, .18); }
.filter-pill:has(input:focus-visible) { outline: 2px solid var(--lime); }
.selbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; background: linear-gradient(90deg, rgba(158, 229, 42, .07), rgba(34, 199, 242, .04)); border-bottom: 1px solid var(--border); }
.selbar .count { font-weight: 700; color: var(--lime); margin-right: 6px; font-family: var(--font-tech); letter-spacing: .06em; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; }
table.data th { position: sticky; top: 0; background: #081013; text-align: left; font-size: 11px; font-weight: 650; color: var(--cyan); text-transform: uppercase; letter-spacing: .1em; padding: 10px 12px; border-bottom: 1px solid var(--border-strong); white-space: nowrap; font-family: var(--font-tech); }
table.data th button.sort { border: 0; background: transparent; padding: 0; min-height: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; gap: 4px; box-shadow: none; }
table.data th button.sort:hover { color: #fff; }
table.data th button.sort.on { color: var(--lime); }
table.data td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data tr:hover td { background: rgba(34, 199, 242, .035); }
table.data tr.sel td { background: rgba(158, 229, 42, .07); }
table.data tr.dup td { opacity: .6; }
td.cname { min-width: 190px; }
td.cname .nm { font-weight: 650; color: var(--heading); }
td.cname .nm a { color: inherit; }
td.cname .nm a:hover { color: var(--lime); }
td.cname .sub { margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px; }
td.legal { min-width: 180px; max-width: 260px; font-size: 13px; }
td.legal a { color: var(--text); }
td.legal a:hover { color: var(--cyan); }
td.addr { min-width: 200px; max-width: 300px; color: var(--muted); font-size: 13px; }
td.site { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.copy { border: 0; background: transparent; color: var(--faint); padding: 3px; min-height: 0; border-radius: 5px; box-shadow: none; }
.copy:hover { color: var(--lime); background: rgba(158, 229, 42, .1); box-shadow: none; }
.wa-cell { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.wa-status { font-size: 11.5px; color: var(--faint); }
.wa-status.ok { color: var(--green); }
.actions { display: flex; gap: 4px; justify-content: flex-end; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty svg.i { width: 36px; height: 36px; color: var(--cyan); margin-bottom: 8px; filter: drop-shadow(0 0 8px var(--cyan-glow)); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; flex-wrap: wrap; }

/* ---------- Progresso ---------- */
.progress { height: 8px; background: #060B0D; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--lime), var(--cyan)); border-radius: 999px; transition: width .4s ease; box-shadow: 0 0 12px var(--lime-glow); }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius-sm); background: var(--blue-bg); color: #A9E9FA; border: 1px solid var(--blue-border); font-size: 13px; }
.notice.amber { background: var(--amber-bg); color: #F7D58E; border-color: var(--amber-border); }
.notice.red { background: var(--red-bg); color: #FFB3B3; border-color: var(--red-border); }
.notice.green { background: var(--green-bg); color: #95EDB9; border-color: var(--green-border); }
.notice svg.i { margin-top: 1px; }
.tasks { max-height: 320px; overflow-y: auto; }
.tasks table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tasks td, .tasks th { padding: 7px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.tasks th { font-size: 11px; color: var(--cyan); text-transform: uppercase; letter-spacing: .08em; background: #081013; position: sticky; top: 0; font-family: var(--font-tech); }
details.box { border: 1px solid var(--border); border-radius: var(--radius-sm); background: #070D10; }
details.box > summary { cursor: pointer; padding: 10px 14px; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
details.box > summary::-webkit-details-marker { display: none; }
details.box[open] > summary { border-bottom: 1px solid var(--border); }

/* ---------- Detalhe ---------- */
dl.fields { display: grid; grid-template-columns: 210px 1fr; margin: 0; }
dl.fields dt, dl.fields dd { padding: 9px 0; border-bottom: 1px solid var(--border); margin: 0; }
dl.fields dt { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; font-family: var(--font-tech); }
dl.fields dd { word-break: break-word; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 8px 0 8px 18px; border-left: 2px solid var(--border-strong); position: relative; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 13px; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 8px var(--lime-glow); }

/* ---------- Listas ---------- */
.list-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; color: inherit; transition: border-color .15s, box-shadow .15s; }
.list-card:hover { border-color: rgba(158, 229, 42, .5); text-decoration: none; color: inherit; box-shadow: 0 0 22px rgba(158, 229, 42, .12); }
.list-card .stats { display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.list-card .stats b { color: var(--heading); font-size: 16px; display: block; font-family: var(--font-tech); }
.status-tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border); }
select.status-select { min-height: 32px; padding: 4px 8px; font-size: 12.5px; width: auto; }

/* ---------- Gráficos ---------- */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 8px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .bar span.v { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bars .bar div { width: 100%; max-width: 26px; background: linear-gradient(180deg, var(--lime), #5DA90E); border-radius: 3px 3px 0 0; min-height: 2px; box-shadow: 0 0 10px rgba(158, 229, 42, .3); }
.bars .bar div.alt { background: linear-gradient(180deg, var(--cyan), #0E7FA0); box-shadow: 0 0 10px rgba(34, 199, 242, .3); }
.bars .bar small { font-size: 10px; color: var(--faint); }
.hbars { display: flex; flex-direction: column; gap: 9px; }
.hbar { display: grid; grid-template-columns: 130px 1fr 40px; gap: 10px; align-items: center; font-size: 13px; }
.hbar .track { height: 10px; background: #060B0D; border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.hbar .track div { height: 100%; background: linear-gradient(90deg, var(--lime), var(--cyan)); border-radius: 999px; }
.hbar b { text-align: right; font-variant-numeric: tabular-nums; color: var(--heading); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- Modal e avisos ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .72); backdrop-filter: blur(3px); z-index: 100; display: grid; place-items: center; padding: 16px; animation: fade .12s ease; }
.modal { background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow-lg), 0 0 40px rgba(34, 199, 242, .08); width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal.wide { max-width: 820px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-body { padding: 18px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.toasts { position: fixed; bottom: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 36px); }
.toast { background: #0B1418; border: 1px solid var(--blue-border); color: #fff; padding: 11px 16px; border-radius: 8px; box-shadow: var(--shadow-lg), 0 0 18px rgba(34, 199, 242, .15); font-size: 13.5px; display: flex; gap: 8px; align-items: center; animation: up .18s ease; max-width: 420px; }
.toast.error { border-color: var(--red); color: #FFC9C9; box-shadow: var(--shadow-lg), 0 0 18px rgba(255, 100, 100, .25); }
.toast.success { border-color: var(--lime); color: #DDF8B8; box-shadow: var(--shadow-lg), 0 0 18px rgba(158, 229, 42, .25); }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(8px); opacity: 0; } }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(158, 229, 42, .2); border-top-color: var(--lime); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { padding: 40px; display: flex; gap: 10px; justify-content: center; align-items: center; color: var(--muted); }

/* ---------- Login: só a logo e os campos, sobre o mesmo preto (#000) do fundo da logo ---------- */
.auth-page {
  min-height: 100vh; min-height: 100dvh; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 16px 40px; gap: 4px;
}
/* Logo original: sem fundo (transparente), sem margem e sem sombra */
.auth-logo { display: block; width: min(640px, 100%); height: auto; margin: 0; padding: 0; background: none; border: 0; box-shadow: none; filter: none; }
.auth-box { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 12px; }
.auth-box input[type=text], .auth-box input[type=email], .auth-box input[type=password] {
  background: #000; border-color: #1E3A2A; min-height: 46px; font-size: 15px; text-align: center;
}
.auth-box input:focus { border-color: var(--lime); }
.auth-box .btn-big { width: 100%; }
.auth-link { text-align: center; color: var(--muted); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-family: var(--font-tech); text-transform: uppercase; letter-spacing: .08em; font-size: 12.5px; }
.tabs a:hover { color: #fff; text-decoration: none; }
.tabs a.on { color: var(--lime); border-bottom-color: var(--lime); text-shadow: 0 0 12px var(--lime-glow); }
pre.log { white-space: pre-wrap; word-break: break-word; font-size: 11.5px; margin: 4px 0 0; color: var(--muted); max-height: 120px; overflow: auto; }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
  .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .c3 { grid-column: span 6; } .c4 { grid-column: span 6; } .c8 { grid-column: span 12; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .65); z-index: 35; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .content { padding: 16px; }
  .grid.two, .grid.three { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .c6, .c4, .c3 { grid-column: span 12; }
  dl.fields { grid-template-columns: 1fr; }
  dl.fields dt { border-bottom: 0; padding-bottom: 0; }
  .toolbar .search-in { max-width: none; }
  .hbar { grid-template-columns: 100px 1fr 34px; }
  /* Tabela vira cartões */
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
  table.data thead { display: none; }
  table.data tr { border-bottom: 8px solid var(--bg); padding: 12px 14px; position: relative; }
  table.data td { border: 0; padding: 4px 0; max-width: none; display: grid; grid-template-columns: 104px 1fr; gap: 8px; align-items: start; }
  table.data td::before { content: attr(data-label); font-size: 11px; font-weight: 650; color: var(--cyan); text-transform: uppercase; letter-spacing: .06em; padding-top: 2px; font-family: var(--font-tech); }
  table.data td.cname, table.data td.sel-cell { display: block; }
  table.data td.cname::before, table.data td.sel-cell::before, table.data td.actions-cell::before { content: none; }
  table.data td.sel-cell { position: absolute; top: 14px; right: 14px; width: auto; padding: 0; }
  table.data td.cname { padding-right: 32px; padding-bottom: 8px; }
  table.data td.actions-cell { display: block; padding-top: 8px; }
  table.data td.actions-cell .actions { justify-content: flex-start; flex-wrap: wrap; }
  td.site { white-space: normal; word-break: break-all; }
  .page-head h1 { font-size: 20px; }
  .modal-bg { padding: 0; place-items: end center; }
  .modal { max-height: 92vh; border-radius: 14px 14px 0 0; }
}
@media print {
  .sidebar, .topbar, .toolbar, .selbar, .pager, .no-print { display: none !important; }
  .main { margin: 0; }
}

/* ======================================================================
   Modo aplicativo (celular e tablet)
   ====================================================================== */
.tabbar, .top-mark { display: none; }
html { -webkit-tap-highlight-color: transparent; }

@media (max-width: 900px) {
  body { overscroll-behavior-y: none; background: #000; }
  /* Barra superior compacta, com a marca JB */
  .topbar {
    height: calc(54px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0;
    background: rgba(0, 0, 0, .88); gap: 10px;
  }
  .menu-btn { display: none; }
  .top-mark {
    display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; flex: none;
    background: #000; border: 1px solid rgba(34, 199, 242, .35); font: 900 15px/1 "Arial Black", var(--font-tech); text-decoration: none;
    box-shadow: 0 0 14px rgba(158, 229, 42, .18);
  }
  .top-mark .j { color: var(--lime); } .top-mark .b { color: var(--cyan); }
  .topbar .title { font-size: 12.5px; letter-spacing: .12em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top-new { width: 38px; height: 38px; min-height: 38px; padding: 0; border-radius: 10px; }
  .top-new .lbl { display: none; }
  .top-new svg.i { width: 18px; height: 18px; }

  /* Conteúdo com espaço para a barra inferior */
  .content { padding: 14px 12px calc(88px + env(safe-area-inset-bottom)); }
  .page-head { margin-bottom: 14px; gap: 10px; }
  .page-head > .row { width: 100%; }
  .page-head > .row > .btn, .page-head > .row > button { flex: 1; }
  .page-head p { font-size: 13px; }

  /* Barra de navegação inferior */
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: rgba(3, 6, 7, .94); backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
  }
  .tabbar::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--lime-glow), var(--cyan-glow), transparent); }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; border-radius: 12px;
    color: var(--faint); font: 600 10.5px/1.1 var(--font-tech); letter-spacing: .04em; text-decoration: none; text-transform: uppercase;
  }
  .tabbar a svg.i { width: 22px; height: 22px; }
  .tabbar a:active { background: rgba(255, 255, 255, .05); }
  .tabbar a.on { color: var(--lime); background: rgba(158, 229, 42, .08); }
  .tabbar a.on svg { filter: drop-shadow(0 0 6px var(--lime-glow)); }

  /* Menu lateral vira gaveta acima da barra inferior */
  .sidebar { width: min(300px, 86vw); padding-top: env(safe-area-inset-top); bottom: calc(64px + env(safe-area-inset-bottom)); border-radius: 0 18px 18px 0; }
  body.nav-open .backdrop { bottom: calc(64px + env(safe-area-inset-bottom)); }
  .toasts { bottom: calc(80px + env(safe-area-inset-bottom)); left: 12px; right: 12px; max-width: none; }
  .toast { max-width: none; }
}

@media (max-width: 760px) {
  /* Toque confortável e sem zoom automático do iPhone (fonte >= 16px nos campos) */
  input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
    font-size: 16px; min-height: 46px; border-radius: 10px;
  }
  button, .btn { min-height: 44px; border-radius: 10px; }
  .btn-sm { min-height: 38px; padding: 6px 12px; }
  .btn-big { width: 100%; min-height: 54px; }
  h1, .page-head h1 { font-size: 21px; }

  /* Cartões e indicadores */
  .card { border-radius: 16px; }
  .card-pad { padding: 16px; }
  .card-head { padding: 12px 16px; }
  .grid { gap: 12px; }
  .grid.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 12px 14px; }
  .kpi .k-value { font-size: 24px; }
  .kpi .k-label { font-size: 10.5px; }

  /* Filtros e abas em faixa deslizável (sem quebrar linha) */
  .filters, .status-tabs, .tabs, .seg { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .filters::-webkit-scrollbar, .status-tabs::-webkit-scrollbar, .tabs::-webkit-scrollbar, .seg::-webkit-scrollbar { display: none; }
  .filter-pill, .status-tabs > *, .seg label { flex: none; }
  .filter-pill { padding: 8px 14px; font-size: 13px; }
  .toolbar { padding: 12px; gap: 10px; }
  .toolbar .search-in { flex: 1 1 100%; }
  .toolbar .filters { flex: 1 1 100%; margin: 0 -12px; padding: 0 12px; }
  .seg { display: flex; width: 100%; }
  .seg label { flex: 1; justify-content: center; padding: 10px 8px; }

  /* Seleção vira barra de ações compacta */
  .selbar { position: sticky; top: calc(54px + env(safe-area-inset-top)); z-index: 20; padding: 10px 12px; gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; backdrop-filter: blur(10px); background: rgba(8, 14, 16, .94); }
  .selbar::-webkit-scrollbar { display: none; }
  .selbar > * { flex: none; }
  .selbar > span[style*="flex:1"] { display: none; }

  /* Empresas como cartões de aplicativo */
  table.data tr {
    border: 1px solid var(--border); border-bottom: 1px solid var(--border); border-radius: 16px; margin: 0 10px 10px; padding: 14px;
    background: linear-gradient(180deg, var(--surface-2), var(--surface));
  }
  table.data tbody { padding-top: 10px; }
  table.data tr.sel { border-color: rgba(158, 229, 42, .55); box-shadow: 0 0 18px rgba(158, 229, 42, .12); }
  table.data tr.sel td, table.data tr:hover td { background: transparent; }
  table.data td { grid-template-columns: 92px 1fr; padding: 5px 0; font-size: 14px; }
  table.data td.cname .nm { font-size: 16px; }
  table.data td.cname:has(.nm:empty) { padding-bottom: 2px; }
  table.data td.sel-cell input { width: 22px; height: 22px; }
  table.data td.actions-cell { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 12px; }
  table.data td.actions-cell .actions { gap: 6px; }
  table.data td.actions-cell .actions > * { flex: 1 1 auto; }
  table.data td.addr, table.data td.legal { max-width: none; }
  .wa-cell .row .btn-wa { flex: 1; }
  .pager { padding: 12px; }
  .pager > .row { width: 100%; }
  .pager > .row > * { flex: 1; }

  /* Detalhes e formulários */
  dl.fields dd { padding-top: 2px; }
  .modal-foot > * { flex: 1; }
  .modal-head { padding: 14px 16px; }
  .modal-body { padding: 16px; }
  .modal::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--border-strong); margin: 8px auto 0; }
  .hbar { grid-template-columns: 96px 1fr 34px; }
  details.box > summary { padding: 12px 14px; }

  /* Login no celular: logo ocupa a largura e campos grandes */
  .auth-page { justify-content: flex-start; padding-top: calc(28px + env(safe-area-inset-top)); }
  .auth-box input[type=text], .auth-box input[type=email], .auth-box input[type=password] { min-height: 52px; }
}

/* Aplicativo instalado (tela cheia) */
@media (display-mode: standalone) {
  body { user-select: none; -webkit-user-select: none; }
  input, textarea, td, dd, .phone, p { user-select: text; -webkit-user-select: text; }
}

/* ---------- Correções de largura no celular ---------- */
/* As caixas de seleção ocultas ficam presas ao próprio filtro (antes escapavam da faixa deslizável e alargavam a página) */
.filter-pill, .seg label { position: relative; }
.filter-pill input, .seg input { inset: 0; width: 100%; height: 100%; margin: 0; }

@media (max-width: 900px) {
  /* Trava de segurança: nada empurra a tela para os lados (clip mantém a barra de ações fixa funcionando) */
  html, body, .main { overflow-x: clip; }
  .main { min-width: 0; max-width: 100vw; }
}

@media (max-width: 760px) {
  /* Botões do topo das páginas: compactos, lado a lado, sem estourar a largura */
  .page-head > .row { display: flex; flex-wrap: wrap; gap: 8px; }
  .page-head > .row > * { flex: 1 1 0; }
  .page-head > .row > .btn, .page-head > .row > button {
    min-width: 0; min-height: 42px; padding: 6px 8px; font-size: 11px; letter-spacing: .04em;
    white-space: normal; line-height: 1.15; text-align: center;
  }
  .page-head > .row > .btn svg.i, .page-head > .row > button svg.i { width: 16px; height: 16px; }
  .page-head > .row > input { flex: 1 1 100%; width: 100% !important; }
  .page-head > .row > .badge { flex: 0 0 100%; justify-content: center; padding: 5px 8px; }
  .card-head { flex-wrap: wrap; }
  .card-head > * { min-width: 0; }
}

/* ======================================================================
   Resultados no celular: cartões de empresa
   ====================================================================== */
.mcards { display: flex; flex-direction: column; gap: 12px; padding: 12px; }
.mcard {
  background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--border); border-radius: 18px;
  overflow: hidden; position: relative;
}
.mcard::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, var(--lime), var(--cyan)); opacity: .35; }
.mcard.sel { border-color: rgba(158, 229, 42, .6); box-shadow: 0 0 20px rgba(158, 229, 42, .14); }
.mcard.sel::before { opacity: 1; }
.mcard.dup { opacity: .65; }
.mc-head { display: flex; gap: 12px; padding: 14px 14px 10px; align-items: flex-start; }
.mc-check { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border: 1px solid var(--border-strong); border-radius: 10px; background: #060B0D; margin-top: 2px; }
.mc-check input { width: 20px; height: 20px; }
.mc-id { min-width: 0; flex: 1; }
.mc-name { display: block; font: 700 17px/1.25 var(--font-tech); color: var(--heading); letter-spacing: .01em; word-break: break-word; }
.mc-name:hover { color: var(--lime); text-decoration: none; }
.mc-legal { font-size: 12.5px; color: var(--muted); margin-top: 2px; word-break: break-word; }
.mc-meta { font-size: 12.5px; color: var(--cyan); margin-top: 4px; word-break: break-word; }
.mc-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.mc-body { padding: 4px 14px 10px; display: flex; flex-direction: column; }
.mc-line { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 14px; }
.mc-line > svg.i { color: var(--cyan); margin-top: 2px; flex: none; }
.mc-line > svg.i.fill { color: var(--green); }
.mc-val { flex: 1; min-width: 0; word-break: break-word; }
.mc-val b { color: var(--heading); font-weight: 650; font-variant-numeric: tabular-nums; }
.mc-line .copy { margin: -4px -4px -4px 0; width: 34px; height: 34px; display: grid; place-items: center; }
.mc-note { margin-top: 6px; padding: 10px 12px; border-radius: 12px; background: rgba(158, 229, 42, .06); border: 1px solid rgba(158, 229, 42, .2); font-size: 13px; }
.mc-note svg.i { color: var(--lime); }
.mc-status { padding: 0 14px 10px; }
.mc-status select { width: 100%; }
.mc-actions { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; padding: 12px 14px 14px; border-top: 1px solid var(--border); background: rgba(0, 0, 0, .25); }
.mc-actions > .btn, .mc-actions > button, .mc-more > summary {
  min-height: 46px; padding: 6px 4px; flex-direction: column; gap: 3px; font-size: 10.5px; letter-spacing: .04em; border-radius: 12px; white-space: nowrap;
}
.mc-actions svg.i { width: 18px; height: 18px; }
.mc-off { opacity: .35; pointer-events: none; }
.mc-more { position: relative; }
.mc-more > summary { list-style: none; width: 46px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.mc-more > summary::-webkit-details-marker { display: none; }
.mc-more[open] > summary { border-color: var(--lime); color: var(--lime); }
.mc-menu {
  position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 25; min-width: 240px; padding: 6px;
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
}
.mc-menu a, .mc-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px; min-height: 44px; border: 0; border-radius: 10px; background: transparent;
  color: var(--text); font: 500 14px/1.2 system-ui, sans-serif; text-transform: none; letter-spacing: 0; text-align: left; box-shadow: none; justify-content: flex-start;
}
.mc-menu a:hover, .mc-menu button:hover { background: rgba(34, 199, 242, .08); color: #fff; text-decoration: none; box-shadow: none; }
.mc-menu svg.i { color: var(--cyan); }

@media (max-width: 760px) {
  /* Barra de busca dos resultados: busca na largura toda, ordenação e quantidade lado a lado */
  .toolbar .tb-end { flex: 1 1 100%; margin-left: 0 !important; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
  .toolbar .tb-end select { width: 100% !important; }
  .toolbar .tb-end #pg-size { width: auto !important; }
  .selbar .count { font-size: 12px; }
  .pager > span { width: 100%; text-align: center; font-size: 12.5px; }
}

/* Resumo da pesquisa (números) */
.stat-grid { display: flex; flex-wrap: wrap; gap: 14px 28px; }
.stat-l { font-size: 12px; color: var(--muted); }
.stat-v { font: 700 22px/1.2 var(--font-tech); color: var(--heading); font-variant-numeric: tabular-nums; }
.stat:first-child .stat-v { color: var(--lime); text-shadow: 0 0 14px rgba(158, 229, 42, .3); }
@media (max-width: 760px) {
  .stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stat { background: #060B0D; border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; min-width: 0; }
  .stat:first-child { grid-column: span 3; display: flex; align-items: baseline; justify-content: space-between; border-color: rgba(158, 229, 42, .35); }
  .stat-l { font-size: 10.5px; line-height: 1.2; text-transform: uppercase; letter-spacing: .04em; font-family: var(--font-tech); }
  .stat-v { font-size: 18px; }
  .stat:first-child .stat-v { font-size: 26px; }
}
@media (max-width: 760px) {
  /* Barra de seleção: contador em cima, botões dividindo a largura (nada cortado) */
  .selbar { flex-wrap: wrap; overflow: visible; row-gap: 8px; }
  .selbar .count { flex: 1 1 100%; margin: 0; }
  .selbar > button { flex: 1 1 0; min-width: 0; padding: 6px 4px; font-size: 10.5px; letter-spacing: .03em; }
  .selbar > button svg.i { width: 14px; height: 14px; }
}

/* Consulta de CNPJ */
.cnpj-form { display: flex; gap: 8px; }
.cnpj-form input { flex: 1; min-width: 0; font-size: 17px; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.cnpj-form button { flex: none; }
.cnpj-fields { grid-template-columns: 170px 1fr; }
.cnpj-fields dd .copy { vertical-align: middle; }
.cnae-list { margin: 0; padding: 10px 14px 12px 32px; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 760px) {
  .cnpj-form { flex-direction: column; }
  .cnpj-form button { width: 100%; min-height: 48px; }
  .cnpj-fields { grid-template-columns: 1fr; }
}

/* ---------- Todas as empresas da cidade: listas por segmento ---------- */
.glist { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.gcard {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: 14px; background: linear-gradient(180deg, var(--surface-2), var(--surface));
}
.gcard.sel { border-color: rgba(158, 229, 42, .6); box-shadow: 0 0 18px rgba(158, 229, 42, .12); }
.g-main { min-width: 0; }
.g-name { font: 650 15.5px/1.3 var(--font-tech); color: var(--heading); word-break: break-word; }
.g-sub { font-size: 12px; color: var(--cyan); margin-top: 2px; }
.g-stats { font-size: 13px; color: var(--muted); margin-top: 6px; }
.g-stats b { color: var(--lime); font-family: var(--font-tech); font-size: 15px; }
.g-bar { height: 5px; border-radius: 999px; background: #060B0D; border: 1px solid var(--border); margin-top: 8px; overflow: hidden; max-width: 360px; }
.g-bar div { height: 100%; background: linear-gradient(90deg, var(--lime), var(--cyan)); }
.g-actions { display: flex; gap: 8px; }
.g-more { display: flex; justify-content: center; padding: 6px 0 4px; }
.list-link { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); }
.list-link:hover { border-color: var(--lime); text-decoration: none; color: #fff; }
.mode-seg { width: 100%; }
.mode-seg label { flex: 1; justify-content: center; padding: 10px 12px; }
@media (max-width: 760px) {
  .gcard { grid-template-columns: auto 1fr; gap: 10px 12px; padding: 14px; border-radius: 16px; }
  .g-actions { grid-column: 1 / -1; }
  .g-actions > * { flex: 1; }
  .g-bar { max-width: none; }
  .mode-seg label { font-size: 11px; padding: 10px 6px; }
}

/* DDD ao lado do nome da cidade */
.combo-list .ddd { color: var(--cyan); font-variant-numeric: tabular-nums; font-weight: 600; }
.combo-list button.on .ddd, .combo-list button:hover .ddd { color: var(--lime); }
.ddd-big { color: var(--cyan); font-weight: 600; }
.greet { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: #060B0D; }
.greet.on { border-color: rgba(158, 229, 42, .55); box-shadow: 0 0 14px rgba(158, 229, 42, .12); }
.greet-msg { color: var(--lime); font-weight: 600; }

/* ---------- Buscar empresa pelo telefone ---------- */
.mb { margin-bottom: 16px; }
.phone-hero {
  border-color: rgba(158, 229, 42, .45);
  background: radial-gradient(500px 160px at 0% 0%, rgba(158, 229, 42, .10), transparent 70%), radial-gradient(500px 160px at 100% 100%, rgba(34, 199, 242, .08), transparent 70%), linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: 0 0 26px rgba(158, 229, 42, .10);
}
.phone-hero-title { display: flex; align-items: center; gap: 8px; color: var(--lime); font-size: 17px; letter-spacing: .02em; margin-bottom: 4px; }
.phone-search { display: flex; gap: 10px; margin-top: 10px; }
.phone-search-in { flex: 1; min-width: 0; position: relative; display: flex; align-items: center; }
.phone-search-in > svg.i { position: absolute; left: 14px; color: var(--lime); pointer-events: none; }
.phone-search-in input {
  padding-left: 44px; min-height: 52px; font-size: 20px; letter-spacing: .06em; font-variant-numeric: tabular-nums;
  border-color: rgba(158, 229, 42, .45); background: #000;
}
.phone-search button { min-height: 52px; padding: 0 22px; font-size: 14px; }
.pcard .mc-actions .btn-primary { color: var(--lime-ink); }
.top-phone { border-color: rgba(158, 229, 42, .5); color: var(--lime); background: rgba(158, 229, 42, .08); }
.top-phone:hover { color: #fff; border-color: var(--lime); box-shadow: 0 0 14px var(--lime-glow); }
@media (max-width: 900px) {
  .top-phone { width: 38px; height: 38px; min-height: 38px; padding: 0; border-radius: 10px; }
  .top-phone .lbl { display: none; }
  .top-phone svg.i { width: 18px; height: 18px; }
}
@media (max-width: 760px) {
  .phone-search { flex-direction: column; }
  .phone-search button { width: 100%; }
  .phone-search-in input { font-size: 19px; }
}

/* ---------- Logo em destaque no Painel (movimento constante) ---------- */
.logo-hero { position: relative; display: grid; place-items: center; margin: 0 0 14px; padding: 14px 0 10px; }
.logo-hero::before {
  content: ""; position: absolute; width: min(560px, 96%); aspect-ratio: 1525 / 1017; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(158, 229, 42, .16) 0%, rgba(34, 199, 242, .09) 45%, transparent 100%);
  animation: lhAura 7s ease-in-out infinite;
}
.lh-stage { position: relative; width: min(440px, 88vw); aspect-ratio: 1525 / 1017; animation: lhFloat 6s ease-in-out infinite; }
.lh-img { display: block; width: 100%; height: auto; animation: lhGlow 4s ease-in-out infinite; }
/* Reflexo de luz recortado no formato da logo (não passa sobre o fundo transparente) */
.lh-shine {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
  -webkit-mask: url("/img/logo-jb-buscas-v3-recorte.webp") center / contain no-repeat;
  mask: url("/img/logo-jb-buscas-v3-recorte.webp") center / contain no-repeat;
  background: linear-gradient(110deg, transparent 38%, rgba(255, 255, 255, .55) 50%, transparent 62%) no-repeat;
  background-size: 260% 100%;
  animation: lhShine 4.5s ease-in-out infinite;
}
@keyframes lhFloat { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-12px) rotate(-.6deg); } }
@keyframes lhGlow {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(158, 229, 42, .55)) drop-shadow(0 0 22px rgba(158, 229, 42, .25)); }
  50% { filter: drop-shadow(0 0 10px rgba(34, 199, 242, .6)) drop-shadow(0 0 28px rgba(34, 199, 242, .3)); }
}
@keyframes lhShine { 0% { background-position: 160% 0; } 55%, 100% { background-position: -60% 0; } }
@keyframes lhAura { 0%, 100% { transform: scale(.92); opacity: .75; } 50% { transform: scale(1.06); opacity: 1; } }
@media (max-width: 760px) { .lh-stage { width: min(300px, 80vw); } }
/* Quem ativou "reduzir movimento" no sistema vê a logo parada */
@media (prefers-reduced-motion: reduce) { .lh-stage, .lh-img, .lh-shine, .logo-hero::before { animation: none; } }

/* ---------- Cliques no WhatsApp ---------- */
.wa-mark {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  color: var(--green); background: var(--green-bg); border: 1px solid var(--green-border); line-height: 1.3; max-width: 100%;
}
.wa-mark.none { display: none; }
.wa-mark b { color: #fff; }
.mcard.wa-called { border-color: var(--green-border); }
.mcard.wa-called::before { background: linear-gradient(90deg, var(--green), var(--cyan)); opacity: .9; }
table.data tr.wa-called td:first-child { box-shadow: inset 3px 0 0 var(--green); }
.wh-items { display: flex; flex-direction: column; }
.wh-item { display: grid; grid-template-columns: 150px 1fr auto; gap: 14px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.wh-when { display: flex; flex-direction: column; font-size: 13px; }
.wh-when b { color: var(--heading); font-variant-numeric: tabular-nums; }
.wh-when span { color: var(--lime); font-weight: 600; }
.wh-name { font-weight: 650; color: var(--heading); }
@media (max-width: 760px) {
  .wh-item { grid-template-columns: 1fr; gap: 6px; padding: 14px; }
  .wh-when { flex-direction: row; gap: 8px; }
  .wh-item .btn-wa { width: 100%; }
}

/* Selo "Chamado no WhatsApp" ao lado do nome (prévia da lista) */
.wa-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  color: #06140B; background: linear-gradient(135deg, #5BE38F, var(--green)); border: 1px solid #7DF0A9; max-width: 100%; white-space: normal; line-height: 1.3;
  box-shadow: 0 0 12px rgba(43, 212, 111, .35); letter-spacing: .01em;
}
.wa-chip svg.i { width: 13px; height: 13px; }
.wa-chip.none { display: none; }
.list-card .stats .stat-wa b { color: var(--green); }
.wa-chip svg.i { flex: none; }


/* Lista em texto para WhatsApp */
.tx-out { width: 100%; min-height: 260px; font: 13px/1.55 ui-monospace, "Cascadia Mono", Consolas, monospace; white-space: pre; overflow: auto; resize: vertical; }

/* ---------- Cidades e habitantes (mapa do Brasil) ---------- */
.pop-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.pop-map-card { position: sticky; top: 74px; }
.br-map svg { display: block; width: 100%; height: auto; max-height: 62vh; margin: 0 auto; }
.br-map path.uf { stroke: #040708; stroke-width: 1.2px; vector-effect: non-scaling-stroke; cursor: pointer; transition: fill .15s, opacity .15s; outline: none; }
.br-map path.lv1 { fill: rgba(34, 199, 242, .16); }
.br-map path.lv2 { fill: rgba(34, 199, 242, .32); }
.br-map path.lv3 { fill: rgba(34, 199, 242, .5); }
.br-map path.lv4 { fill: rgba(158, 229, 42, .55); }
.br-map path.lv5 { fill: rgba(158, 229, 42, .85); }
.br-map path.uf:hover, .br-map path.uf:focus-visible { fill: var(--cyan-600); }
.br-map path.uf.on { fill: var(--lime); filter: drop-shadow(0 0 .35px var(--lime)); }
.br-map .uf-labels text { font: 700 1.05px/1 var(--font-tech); fill: #fff; text-anchor: middle; dominant-baseline: middle; paint-order: stroke; stroke: rgba(0, 0, 0, .8); stroke-width: .2px; cursor: pointer; }
.br-map .uf-labels text.on { fill: #071006; stroke: rgba(255, 255, 255, .4); }
.uf-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.uf-chips button { min-height: 32px; min-width: 42px; padding: 4px 8px; font: 650 12.5px/1 var(--font-tech); letter-spacing: .04em; }
.uf-chips button.on { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
.pop-legend { display: flex; align-items: center; gap: 4px; margin-top: 12px; font-size: 11.5px; color: var(--muted); }
.pop-legend i { width: 22px; height: 10px; border-radius: 3px; }
.pop-legend span:first-child { margin-right: 4px; } .pop-legend span:last-child { margin-left: 4px; }
.pop-legend .lv1 { background: rgba(34, 199, 242, .16); } .pop-legend .lv2 { background: rgba(34, 199, 242, .32); }
.pop-legend .lv3 { background: rgba(34, 199, 242, .5); } .pop-legend .lv4 { background: rgba(158, 229, 42, .55); } .pop-legend .lv5 { background: rgba(158, 229, 42, .85); }
.pop-head h2 { font-size: 16px; }
.pop-rows { display: flex; flex-direction: column; }
.pop-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.pop-row:last-child { border-bottom: 0; }
.pop-row .pos { font: 650 13px/1 var(--font-tech); color: var(--faint); text-align: right; font-variant-numeric: tabular-nums; }
.pop-name { font-weight: 600; color: var(--heading); word-break: break-word; }
.pop-name .ddd { color: var(--cyan); font-weight: 600; font-variant-numeric: tabular-nums; }
.pop-bar { height: 4px; border-radius: 999px; background: #060B0D; margin-top: 6px; overflow: hidden; }
.pop-bar div { height: 100%; background: linear-gradient(90deg, var(--lime), var(--cyan)); }
.pop-num { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.pop-num b { font: 700 15px/1 var(--font-tech); color: var(--lime); font-variant-numeric: tabular-nums; }
.porte { font-size: 10.5px; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--muted); white-space: nowrap; }
.porte.p5 { color: var(--lime); border-color: rgba(158, 229, 42, .5); }
.porte.p4 { color: var(--cyan); border-color: rgba(34, 199, 242, .5); }
.porte.p3 { color: var(--heading); }
.combo-list .hab { color: var(--muted); font-size: 12px; }
@media (max-width: 900px) {
  .pop-grid { grid-template-columns: 1fr; }
  .pop-map-card { position: static; }
  .br-map svg { max-height: 46vh; }
}
@media (max-width: 760px) {
  .pop-row { grid-template-columns: 32px minmax(0, 1fr) auto; gap: 8px 10px; padding: 10px 12px; }
  .pop-row .btn-sm { grid-column: 2 / -1; justify-self: start; }
  .uf-chips button { min-width: 40px; min-height: 36px; }
}
.tx-fields { flex-wrap: wrap; }
.tx-fields label { flex: 1 1 auto; }

/* Escolha do segmento: um campo só (escrever ou escolher na lista) */
.seg-combo { position: relative; }
.seg-combo input { padding-right: 44px; }
.seg-combo-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; min-height: 38px; padding: 0; display: grid; place-items: center; background: transparent; border: 0; box-shadow: none; color: var(--muted); }
.seg-combo-list { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px); max-height: min(360px, 55vh); overflow-y: auto; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow-lg); overscroll-behavior: contain; }
.seg-group { position: sticky; top: 0; z-index: 1; padding: 8px 14px 6px; font: 650 11px/1.2 var(--font-tech); letter-spacing: .08em; text-transform: uppercase; color: var(--cyan); background: var(--surface-3); border-bottom: 1px solid var(--border); }
.seg-item { padding: 12px 14px; min-height: 44px; display: flex; align-items: center; font-size: 14px; color: var(--text); border-bottom: 1px solid var(--border); cursor: pointer; user-select: none; }
.seg-item:last-child { border-bottom: 0; }
.seg-item:hover, .seg-item.active { background: var(--surface-2); color: #fff; }
.seg-item.on { color: var(--lime); font-weight: 600; }
.seg-item.free { color: var(--cyan); }
@media (max-width: 760px) {
  .seg-combo input { font-size: 16px; } /* evita o zoom automático do iPhone */
  .seg-item { min-height: 48px; font-size: 15px; }
}



/* Cidades próximas (raio em km) */
.near-title { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.near-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin-top: 12px; }
.near-form select { width: auto; min-width: 130px; }
.near-city { position: relative; }
.near-city .combo-list { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px); }
.near-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 16px 0 8px; }
.near-head .ddd { color: var(--cyan); }
.near-rows { border: 1px solid var(--border); border-radius: 12px; max-height: 560px; overflow-y: auto; }
.pop-num .km { font: 650 12px/1 var(--font-tech); color: var(--cyan); font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .near-form { grid-template-columns: 1fr; }
  .near-form select { width: 100%; }
  .near-form input { font-size: 16px; }
  .near-sort { width: 100%; }
  .near-sort label { flex: 1; justify-content: center; }
  .near-rows { max-height: none; }
}

/* Distância entre cidades (por rodovia) */
.dist-form { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto; gap: 10px; align-items: center; margin-top: 12px; }
.dist-swap { min-height: 40px; width: 40px; padding: 0; display: grid; place-items: center; }
.dist-result { margin-top: 16px; padding: 16px; border: 1px solid var(--border-strong); border-radius: 14px; background: #060B0D; }
.dist-route { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--heading); }
.dist-km { font: 700 34px/1.1 var(--font-tech); color: var(--lime); margin-top: 8px; font-variant-numeric: tabular-nums; }
.dist-km span { font-size: 14px; color: var(--muted); font-weight: 500; }
.dist-sub { color: var(--cyan); margin-top: 4px; }
@media (max-width: 760px) {
  .dist-form { grid-template-columns: 1fr auto; }
  .dist-form .near-city:first-child { grid-column: 1; }
  .dist-swap { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .dist-form .near-city:nth-of-type(2) { grid-column: 1; }
  .dist-form #dist-go { grid-column: 1 / -1; min-height: 48px; }
  .dist-form input { font-size: 16px; }
  .dist-km { font-size: 30px; }
}

/* Telefone clicável para WhatsApp: só sublinhado, sem destaque */
a.tel-wa { color: inherit; font-weight: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a.tel-wa:hover { color: inherit; text-decoration-thickness: 2px; }
.wa-preview { padding: 10px 12px; border: 1px dashed var(--border-strong); border-radius: 10px; }
.wa-preview #wa-prev { margin-top: 4px; white-space: pre-wrap; color: var(--heading); }
