/* BRJ · Vendas das Promotoras — editorial creme & âmbar-mel */

/* o atributo hidden sempre esconde (classes com display: flex/grid/block venciam a UA) */
[hidden] { display: none !important; }

:root {
  --paper: #f6f5f8;
  --card: #ffffff;
  --ink: #211d26;
  --ink-2: #5c5866;
  --muted: #8a8590;
  --hair: #e7e4ec;
  --accent: #960090;
  --accent-deep: #6a0066;
  --accent-soft: #f3ddf1;
  --good: #0ca30c;
  --bad: #d03b3b;
  --radius: 14px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Hanken Grotesk", "Segoe UI", system-ui, sans-serif;
  --shadow: 0 1px 2px rgba(33,29,38,.05), 0 8px 24px -12px rgba(33,29,38,.18);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background:
    radial-gradient(1200px 500px at 85% -10%, #efe7f4 0%, transparent 60%),
    var(--paper);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
.view[hidden] { display: none !important; }

/* ---------- fields & buttons ---------- */
.field { display: block; margin-bottom: 14px; position: relative; }
.field[hidden] { display: none; }
.field > span, .field-label {
  display: block; font-size: 12px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-2); margin-bottom: 6px;
}
.field textarea {
  width: 100%; padding: 12px 14px; font: inherit; font-size: 16px;
  border: 1px solid var(--hair); border-radius: 10px; background: var(--card);
  color: var(--ink); outline: none; resize: vertical;
}
.field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.foto-links a { color: var(--accent); font-weight: 600; text-decoration: none; margin-right: 6px; }
.field input, .field select, .select-big, .select-slim {
  width: 100%; padding: 12px 14px; font: inherit; font-size: 16px;
  border: 1px solid var(--hair); border-radius: 10px; background: var(--card);
  color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .select-big:focus, .select-slim:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.btn {
  font: inherit; font-weight: 700; font-size: 16px; border: none; cursor: pointer;
  padding: 13px 22px; border-radius: 12px; transition: transform .08s, background .15s, opacity .2s;
}
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--accent); color: #ffffff; }
.btn-primary:hover { background: var(--accent-deep); }
.btn-primary:disabled { opacity: .55; cursor: wait; }
.btn-block { width: 100%; }
.btn-outline { background: transparent; border: 1px solid var(--accent); color: var(--accent); }
.btn-outline:hover { background: var(--accent-soft); }
.btn-ghost {
  font: inherit; font-size: 14px; font-weight: 600; background: none; border: none;
  color: var(--ink-2); cursor: pointer; padding: 6px 10px; border-radius: 8px;
}
.btn-ghost:hover { background: rgba(33,29,38,.06); color: var(--ink); }
.form-error { color: var(--bad); font-size: 14px; margin: 10px 0 0; }
.form-ok { color: #006300; font-size: 14px; margin: 10px 0 0; }
.empty { color: var(--muted); font-size: 14px; text-align: center; padding: 18px 0; }
.muted { color: var(--muted); font-size: 13px; }

/* ---------- login ---------- */
.view-login {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px;
}
.login-card {
  width: 100%; max-width: 380px; background: var(--card);
  border: 1px solid var(--hair); border-radius: 22px; padding: 36px 30px 30px;
  box-shadow: var(--shadow);
}
.brand-mark {
  font-family: var(--font-display); font-weight: 700; font-size: 20px;
  width: 54px; height: 54px; display: grid; place-items: center;
  background: var(--accent); color: #ffffff; border-radius: 16px;
  margin-bottom: 22px;
}
.login-title {
  font-family: var(--font-display); font-weight: 600; font-size: 34px;
  line-height: 1.06; margin: 0 0 4px;
}
.login-title em { font-style: italic; color: var(--accent); }
.login-sub {
  color: var(--muted); font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
  margin: 0 0 28px;
}

/* ---------- promotora (mobile-first) ---------- */
.view-promotora { max-width: 560px; margin: 0 auto; padding: 0 16px 40px; }

/* abas da promotora: só a seção ativa aparece ([hidden] continua valendo dentro dela) */
.p-body [data-psec] { display: none; }
.p-body.ptab-registrar [data-psec="registrar"],
.p-body.ptab-roteiro [data-psec="roteiro"],
.p-body.ptab-anteriores [data-psec="anteriores"] { display: block; }
/* menu no TOPO: gruda ao rolar, nada fica por cima dele */
.p-tabbar {
  position: sticky; top: 0; z-index: 60;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  background: linear-gradient(to bottom, var(--paper) 82%, rgba(246, 245, 248, 0));
  padding: 8px 0 14px;
  margin-bottom: 4px;
}
.p-tabbar button {
  position: relative; cursor: pointer; font: inherit;
  background: var(--card); border: 1px solid var(--hair); border-radius: 12px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: var(--muted);
  padding: 10px 4px;
  box-shadow: var(--shadow);
}
.p-tabbar button.on {
  color: var(--accent-deep, var(--accent)); background: var(--accent-soft);
  border-color: var(--accent);
}
.p-tab-ico { font-size: 16px; line-height: 1; }
.p-tab-badge {
  background: var(--bad); color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 999px; min-width: 16px; height: 16px; line-height: 16px;
  padding: 0 4px; text-align: center;
}
@media (max-width: 400px) {
  .p-tabbar button { font-size: 11.5px; gap: 4px; padding: 9px 2px; }
  .p-tab-ico { font-size: 14px; }
}
.p-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 2px 16px;
}
.p-hello { margin: 0; font-size: 15px; color: var(--ink-2); }
.p-hello strong { color: var(--ink); font-weight: 700; }
.p-date { margin: 2px 0 0; font-size: 13px; color: var(--muted); text-transform: capitalize; }
.select-big { font-weight: 600; }

.sale-card, .today-card {
  background: var(--card); border: 1px solid var(--hair);
  border-radius: var(--radius); padding: 20px 18px; margin-top: 16px;
  box-shadow: var(--shadow);
}
.card-title {
  font-family: var(--font-display); font-weight: 600; font-size: 20px; margin: 0 0 14px;
}
.prod-search { position: relative; }
.prod-results {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 30;
  background: var(--card); border: 1px solid var(--hair); border-radius: 12px;
  margin-top: 6px; max-height: 280px; overflow-y: auto; box-shadow: var(--shadow);
}
.prod-results button {
  display: block; width: 100%; text-align: left; background: none; border: none;
  border-bottom: 1px solid var(--hair); padding: 11px 14px; font: inherit; font-size: 14px;
  cursor: pointer; color: var(--ink);
}
.prod-results button:last-child { border-bottom: none; }
.prod-results button:hover { background: var(--accent-soft); }
.prod-results .pr-code { color: var(--muted); font-size: 12px; display: block; }
.prod-selected {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--accent-soft); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px;
}
.prod-selected-name { margin: 0; font-weight: 700; font-size: 14px; }
.prod-selected-meta { margin: 2px 0 0; font-size: 12px; color: var(--ink-2); }

/* miniatura de produto (Shopify) */
.prod-thumb {
  width: 40px; height: 40px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--hair); background: #fff; flex: none; display: block;
}
.prod-thumb-vazio { display: inline-block; }
.prod-results button.prod-opt { display: flex; align-items: center; gap: 10px; }
.prod-opt .prod-opt-txt { min-width: 0; flex: 1; }
td .prod-thumb { margin: 0 auto; }
.ean-cell { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.pill.marca-lanox { background: #e6eefc; color: #123a8f; }
.pill.marca-biovegetais { background: #e2f4e2; color: #1a6b1a; }
.pill.marca-trihair { background: var(--accent-soft); color: var(--accent-deep); }
.qty-row { margin: 14px 0 18px; }
.qty-stepper { display: flex; align-items: stretch; gap: 8px; }
.qty-stepper button {
  width: 52px; font-size: 24px; font-weight: 600; border: 1px solid var(--hair);
  background: var(--card); border-radius: 10px; cursor: pointer; color: var(--accent);
}
.qty-stepper button:active { background: var(--accent-soft); }
.qty-stepper input {
  flex: 1; text-align: center; font-size: 22px; font-weight: 700; font-family: inherit;
  border: 1px solid var(--hair); border-radius: 10px; background: var(--card);
  padding: 10px 0; -moz-appearance: textfield;
}
.qty-stepper input::-webkit-outer-spin-button, .qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }

.today-head { display: flex; align-items: baseline; justify-content: space-between; }
.today-total { font-size: 13px; font-weight: 700; color: var(--accent); }
.today-list { list-style: none; margin: 6px 0 0; padding: 0; }
.today-list li {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid var(--hair);
}
.today-list .btn-ghost { min-height: 40px; }
.today-list li:last-child { border-bottom: none; }
.tl-info { flex: 1; min-width: 0; }
.tl-name { margin: 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-meta { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.tl-qty { font-weight: 700; font-size: 15px; color: var(--accent); white-space: nowrap; }
.tl-del {
  background: none; border: none; color: var(--muted); cursor: pointer; font-size: 18px;
  min-width: 44px; min-height: 44px; border-radius: 10px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.tl-del:hover { color: var(--bad); background: rgba(208,59,59,.08); }

/* ---------- admin ---------- */
.view-admin { min-height: 100vh; }
.a-topbar {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 14px 22px; border-bottom: 1px solid var(--hair);
  background: #ffffff; backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 40;
}
.a-brand {
  font-family: var(--font-display); font-weight: 600; font-size: 17px;
  display: flex; align-items: center; gap: 10px;
}
.brand-chip {
  background: var(--accent); color: #ffffff; font-size: 13px; font-weight: 700;
  padding: 5px 9px; border-radius: 9px; font-family: var(--font-body);
}
.a-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.a-actions { display: flex; gap: 4px; align-items: center; }
.a-actions .ico { display: none; }
.a-tabs button {
  font: inherit; font-size: 14px; font-weight: 600; border: none; background: none;
  color: var(--ink-2); padding: 8px 14px; border-radius: 999px; cursor: pointer;
}
.a-tabs button:hover { background: rgba(33,29,38,.06); }
.a-tabs button.on { background: var(--accent); color: #ffffff; }
.a-page { padding: 22px; max-width: 1240px; margin: 0 auto; }

.filters-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button {
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--hair); background: var(--card); color: var(--ink-2);
  padding: 7px 14px; border-radius: 999px;
}
.chips button.on { background: var(--accent); border-color: var(--accent); color: #ffffff; }
.chips-wrap { max-height: 168px; overflow-y: auto; }
.hist-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hist-list li { font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.hist-list .hist-quem { font-weight: 700; color: var(--ink); }
.qty-mini { gap: 4px; flex: none; }
.qty-mini button { width: 34px; font-size: 18px; height: 34px; }
.qty-mini input { width: 48px; flex: none; font-size: 15px; text-align: center; padding: 4px; }
.finalizado-banner { background: #e2f4e2; border: 1px solid #b7e0b7; border-radius: 12px; padding: 12px 14px; }
.finalizado-banner .prod-selected-name { margin: 0; color: #1a6b1a; }
.finalizado-banner .prod-selected-meta { margin: 4px 0 0; color: #3a7a3a; }
.custom-range { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.custom-range[hidden] { display: none; }
.custom-range label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.custom-range input[type="date"] {
  font: inherit; font-size: 14px; color: var(--ink);
  border: 1px solid var(--hair); background: var(--card); border-radius: 10px; padding: 7px 10px;
}
.custom-range input[type="date"]:focus { outline: none; border-color: var(--accent); }
.select-slim { width: auto; min-width: 180px; padding: 8px 12px; font-size: 14px; }
.grow-input { flex: 1; min-width: 220px; }

.kpi-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px; margin-bottom: 18px;
}
.kpi {
  background: var(--card); border: 1px solid var(--hair); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.kpi-label { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); }
.kpi-value { margin: 6px 0 0; font-family: var(--font-display); font-weight: 600; font-size: 30px; }
.kpi-delta { display: inline-block; margin-top: 4px; font-size: 12.5px; font-weight: 700; }
.kpi-delta.up { color: var(--good); }
.kpi-delta.down { color: var(--bad); }
.kpi-delta.flat { color: var(--muted); }

.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.chart-card {
  background: var(--card); border: 1px solid var(--hair); border-radius: var(--radius);
  padding: 16px 18px 10px; box-shadow: var(--shadow); min-width: 0;
}
.chart-card.wide { grid-column: 1 / -1; }
.chart-card h3 { margin: 0 0 10px; font-size: 15px; font-weight: 700; }
.chart-card h3 .unit { color: var(--muted); font-weight: 500; font-size: 12px; }
.chart-box { position: relative; height: 260px; }
.chart-box.tall { height: 320px; }
@media (max-width: 860px) { .chart-grid { grid-template-columns: 1fr; } }

.split { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.panel {
  background: var(--card); border: 1px solid var(--hair); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); min-width: 0;
}
.panel h3 { margin: 0 0 14px; font-family: var(--font-display); font-weight: 600; font-size: 19px; }
.panel.grow { overflow-x: auto; }

.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--hair); border-radius: var(--radius); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-2); padding: 12px 14px; border-bottom: 1px solid var(--hair); white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table tbody tr:hover { background: rgba(150,0,144,.05); }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.pill.ok { background: #e2f4e2; color: #006300; }
.pill.off { background: #f1ede6; color: var(--muted); }
.pill.late { background: var(--urgente-bg, #f8e8e5); color: var(--bad); }
.pill.rec { background: var(--accent-soft); color: var(--accent-deep); }
.pill.acao { background: #fdeede; color: #9a5b00; }
.pill.promo-tipo { background: #e6eefc; color: #123a8f; }
tr.atrasado td { background: rgba(208,59,59,.06); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.ag-obs { margin: 4px 0 0; font-size: 13px; color: var(--ink-2); line-height: 1.35; white-space: pre-line; }

/* ---------- calendário da agenda (estilo iOS) ---------- */
.ag-viewbar { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.cal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.cal-head h3 { font-family: var(--font-display); font-weight: 700; font-size: 22px; }
.cal-nav {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--hair);
  background: var(--card); color: var(--accent); font-size: 20px; line-height: 1; cursor: pointer;
}
.cal-nav:hover { background: var(--accent-soft); }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px; }
.cal-dow span { text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cell {
  min-height: 96px; border: 1px solid var(--hair); border-radius: 10px; overflow: hidden;
  background: var(--card); cursor: pointer; padding: 4px; display: flex; flex-direction: column;
  gap: 2px; font: inherit; text-align: left;
}
.cal-cell.vazia { border: none; background: none; cursor: default; }
.cal-cell .cal-num {
  align-self: center; font-size: 13px; font-weight: 600; color: var(--ink);
  width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.cal-cell:hover:not(.vazia) { border-color: var(--accent); }
.cal-cell.hoje .cal-num { background: #e0322e; color: #fff; border-radius: 999px; font-weight: 700; }
.cal-evs { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow: hidden; }
.cal-ev {
  font-size: 10.5px; font-weight: 600; line-height: 1.5; padding: 1px 6px; border-radius: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-ev.promo { background: var(--accent-soft); color: var(--accent-deep); }
.cal-ev.acao { background: #fde3c2; color: #8a4b00; }
.cal-ev.niver { background: #ffe3ef; color: #a3145f; }
.cal-ev.feriado { background: #e2f4e2; color: #006300; }
.cal-cell.feriado .cal-num { color: #0a7a0a; font-weight: 700; }
.pill.feriado-pill { background: #e2f4e2; color: #006300; }
.cal-more { font-size: 10px; font-weight: 700; color: var(--muted); padding: 0 6px; }
.cal-legenda { display: flex; gap: 16px; margin-top: 12px; font-size: 12px; color: var(--ink-2); }
.cal-legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
.cal-legenda .dot-promo { background: var(--accent-soft); border: 1px solid var(--accent); }
.cal-legenda .dot-acao { background: #fde3c2; border: 1px solid #d98200; }
.cal-legenda .dot-niver { background: #ffe3ef; border: 1px solid #d13c86; }
.cal-legenda .dot-feriado { background: #e2f4e2; border: 1px solid #1d8a1d; }
@media (max-width: 560px) {
  .cal-head h3 { font-size: 19px; }
  .cal-grid, .cal-dow { gap: 2px; }
  .cal-cell { min-height: 74px; border-radius: 8px; padding: 3px; }
  .cal-cell .cal-num { font-size: 12px; width: 20px; height: 20px; }
  .cal-ev { font-size: 9px; padding: 1px 4px; border-radius: 4px; }
}

/* ---------- pedidos (vendas agrupadas) & comprovante ---------- */
.pedido-row { cursor: pointer; }
.pedido-row .seta { color: var(--muted); font-size: 12px; margin-right: 8px; transition: transform .15s; display: inline-block; }
.pedido-row.aberto .seta { transform: rotate(180deg); }
.pedido-det td { background: rgba(150,0,144,.045); padding: 6px 14px 14px; }
.pedido-det .table { font-size: 13px; }
.pedido-det .table td { border-bottom: 1px solid var(--hair); background: none; padding: 8px 10px; }
.modal {
  position: fixed; inset: 0; display: grid; place-items: center;
  background: rgba(33,29,38,.45); z-index: 95; padding: 20px;
}
.modal[hidden] { display: none !important; }
.modal-card {
  width: 100%; max-width: 420px; background: var(--card); border-radius: 20px;
  padding: 26px 24px; box-shadow: var(--shadow); max-height: 85vh; overflow-y: auto;
}

/* ---------- toast & loading ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--paper); font-size: 14px; font-weight: 600;
  padding: 12px 22px; border-radius: 999px; z-index: 100; box-shadow: var(--shadow);
  animation: toast-in .25s ease;
}
.toast.err { background: var(--bad); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }
.loading {
  position: fixed; inset: 0; display: grid; place-items: center;
  background: rgba(255,255,255,.6); z-index: 90;
}
/* display:grid acima vence o [hidden] do navegador — sem esta regra o overlay
   fica SEMPRE visível bloqueando todos os cliques da página */
.loading[hidden], .toast[hidden] { display: none !important; }
.spinner {
  width: 34px; height: 34px; border: 3px solid var(--accent-soft);
  border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Lojas / clientes (v51) ---------- */
.cli-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.cli-search { position: relative; flex: 1; min-width: 240px; }
.cli-search-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 15px; opacity: .55; pointer-events: none; }
.cli-search input {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 15px; padding: 13px 40px 13px 42px;
  border: 1px solid var(--hair); border-radius: 14px; background: var(--card); color: var(--ink); outline: none;
  box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s;
}
.cli-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cli-search input::-webkit-search-cancel-button { display: none; }
.cli-search-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px;
  border: none; border-radius: 50%; background: transparent; color: var(--muted); font-size: 20px; cursor: pointer;
}
.cli-search-clear:hover { background: rgba(33,29,38,.06); color: var(--ink); }
.cli-filters { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.cli-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.cli-toggle input { accent-color: var(--accent); width: 16px; height: 16px; }
.cli-filters .muted { margin-left: auto; }
.cli-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.cli-card {
  background: var(--card); border: 1px solid var(--hair); border-radius: 16px; padding: 16px 16px 12px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; min-width: 0;
}
.cli-card.off { opacity: .62; }
.cli-card-top { display: flex; align-items: flex-start; gap: 10px; }
.cli-fantasia { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.25; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cli-razao { margin: 0; font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.cli-cnpj { margin: 0; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink); }
.cli-cnpj b { font-weight: 700; color: var(--muted); font-size: 11px; letter-spacing: .06em; margin-right: 6px; }
.cli-meta { margin: 0; font-size: 13px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.cli-meta span { white-space: nowrap; }
.cli-meta a { color: var(--accent); text-decoration: none; font-weight: 600; }
.cli-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.pill.seg { background: #e6eefc; color: #123a8f; }
.pill.rede { background: #fdeede; color: #9a5b00; }
.cli-actions { display: flex; gap: 4px; justify-content: flex-end; border-top: 1px solid var(--hair); margin-top: 6px; padding-top: 6px; }
.cli-empty { grid-column: 1 / -1; }
.cli-more { grid-column: 1 / -1; text-align: center; }
mark.hl { background: #fff1a8; color: inherit; padding: 0 1px; border-radius: 3px; }
@media (max-width: 560px) {
  .cli-grid { grid-template-columns: 1fr; }
  .cli-head .btn { width: 100%; }
  .cli-filters .muted { margin-left: 0; }
}

/* ---------- barra do painel no celular (v52): marca + ações em cima, abas roláveis embaixo ---------- */
@media (max-width: 760px) {
  .a-topbar { gap: 8px 10px; padding: 10px 14px 0; }
  .a-brand { font-size: 16px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .a-actions { margin-left: auto; }
  .a-actions .btn-ghost { padding: 6px 8px; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
  .a-actions .ico { display: inline; font-size: 15px; line-height: 1; }
  #a-ver-promotora .txt { display: none; }
  #a-logout .ico { display: none; }
  .a-tabs {
    order: 10; flex: none; width: calc(100% + 28px); margin: 0 -14px; padding: 4px 14px 8px;
    flex-wrap: nowrap; gap: 2px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    scroll-snap-type: x proximity;
  }
  .a-tabs::-webkit-scrollbar { display: none; }
  .a-tabs button { white-space: nowrap; flex: none; font-size: 14px; padding: 8px 13px; scroll-snap-align: center; }
  .a-page { padding: 14px; }
}

/* carteira / supervisor da loja (v53) */
.pill.sup { background: #efe6f8; color: #4d1d7a; }
.cli-sup { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); margin: 0; }
.cli-sup select { font: inherit; font-size: 12px; padding: 4px 8px; border: 1px solid var(--hair); border-radius: 8px; background: var(--card); color: var(--ink); max-width: 100%; }
#lojas-carteira { max-width: 220px; }

/* seleção múltipla + vínculo em lote (v53) */
.cli-card { position: relative; }
.cli-check { width: 20px; height: 20px; accent-color: var(--accent); flex: none; margin: 2px 0 0; cursor: pointer; }
.cli-card.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cli-bulk {
  position: sticky; bottom: 12px; z-index: 30; margin-top: 16px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 16px; box-shadow: var(--shadow);
}
.cli-bulk-n { font-weight: 700; font-size: 14px; margin-right: 4px; }
.cli-bulk .btn-ghost { color: var(--paper); opacity: .85; }
.cli-bulk .btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; opacity: 1; }
.cli-bulk select { margin-left: auto; min-width: 180px; }
@media (max-width: 560px) {
  .cli-bulk select { margin-left: 0; flex: 1; }
  .cli-bulk .btn { width: 100%; }
}
