:root {
  --bg: #ffffff;
  --bg-2: #ffffff;
  --side: #ffffff;
  --ink: #141414;
  --muted: #6b6b73;
  --line: rgba(20, 20, 20, 0.12);
  --accent: #e10600;
  --accent-2: #a80500;
  --accent-soft: #ff3b30;
  --danger: #e10600;
  --ok: #1a7f4b;
  --shadow: 0 12px 28px rgba(20, 20, 20, 0.06);
  --radius: 18px;
  --font: "Outfit", system-ui, sans-serif;
  --display: "Cormorant Garamond", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --side-w: 280px;
  --chip-bg: #ffffff;
  --chip-ink: #141414;
  --chip-on: #ffffff;
  --chip-on-bg: #e10600;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.shell {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 480px at 12% -8%, rgba(225, 6, 0, 0.05), transparent 55%),
    linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  min-height: 100vh;
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

.sidebar, .content { position: relative; z-index: 1; }

.mobile-bar,
.nav-scrim,
.menu-close {
  display: none;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  background: #ffffff;
  border-right: 1px solid var(--line);
  box-shadow: 8px 0 32px rgba(225, 6, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.side-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.side-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 10px;
  text-decoration: none;
  color: inherit;
  cursor: default;
}
.side-brand:hover,
.side-brand:focus,
.side-brand:active {
  text-decoration: none;
  color: inherit;
  background: transparent;
  outline: none;
}
.side-brand strong {
  display: block;
  font-family: var(--display);
  font-size: 1.25rem;
}
.mark {
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent-soft), var(--accent-2));
  color: #ffffff; font-family: var(--display); font-weight: 700; font-size: 1.45rem;
  box-shadow: 0 10px 24px rgba(225, 6, 0, 0.35);
}
.mark-sm {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  font-size: 1.15rem;
}
.eyebrow {
  margin: 0; text-transform: uppercase; letter-spacing: 0.16em;
  font-size: 0.68rem; color: var(--accent); font-weight: 600;
}

.side-nav { display: grid; gap: 8px; }
.nav-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid transparent;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.nav-item:hover { background: rgba(20,20,20,0.03); transform: translateX(2px); }
.nav-item.active {
  background: rgba(225, 6, 0,0.12);
  border-color: rgba(225, 6, 0,0.28);
}
.nav-ico {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(20,20,20,0.03);
  border: 1px solid var(--line);
  color: var(--accent);
}
.nav-ico svg { width: 18px; height: 18px; }
.nav-item em { display: block; font-style: normal; font-weight: 700; }
.nav-item small { display: block; color: var(--muted); font-size: 0.75rem; margin-top: 2px; }

.side-foot {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  color: var(--muted);
}
.logout-btn { width: 100%; font-size: 0.8rem; padding: 8px; }
.side-vendor {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.9);
  margin-bottom: 8px;
}
.side-vendor strong {
  font-family: var(--display);
  font-size: 1.05rem;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
.coming-soon {
  padding: 28px 24px;
  max-width: 640px;
}
.coming-soon h2 {
  margin: 8px 0 10px;
  font-family: var(--display);
}
.coming-soon p:last-child {
  margin: 0;
  color: var(--muted);
}

/* —— Catálogos —— */
.catalog-head { margin-bottom: 8px; }
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 22px);
  padding: 8px 0 40px;
  animation: rise .45s ease both;
}
.catalog-grid-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 16px;
  color: var(--muted);
}
.catalog-card {
  position: relative;
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  text-align: left;
  color: inherit;
  display: grid;
  gap: 12px;
}
.catalog-open {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
  display: grid;
  gap: 12px;
  transition: transform .28s cubic-bezier(.2,.8,.2,1);
}
.catalog-card:hover .catalog-open { transform: translateY(-4px); }
.catalog-open:focus-visible {
  outline: 2px solid rgba(225, 6, 0,.7);
  outline-offset: 4px;
  border-radius: 8px;
}
.catalog-share {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(20, 20, 20, 0.08);
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  display: none;
  place-items: center;
  padding: 0;
  box-shadow: 0 6px 18px rgba(20, 20, 20, 0.12);
  transition: transform .2s ease, box-shadow .2s ease, color .2s ease;
}
.catalog-share svg {
  width: 17px;
  height: 17px;
  display: block;
}
.catalog-share:hover {
  color: var(--accent);
  box-shadow: 0 8px 22px rgba(225, 6, 0, 0.16);
  background: #ffffff;
  border-color: rgba(225, 6, 0, 0.2);
}
.catalog-share:active { transform: scale(0.95); }
.catalog-share.is-busy {
  opacity: 0.55;
  pointer-events: none;
}
/* Desktop / mouse: botão de compartilhar visível */
@media (hover: hover) and (pointer: fine) {
  .catalog-share { display: grid; }
}
.catalog-card.is-pressing .catalog-cover {
  transform: scale(0.98);
  transition: transform .2s ease;
}
.catalog-cover {
  position: relative;
  aspect-ratio: 3 / 2;
  border-radius: 6px;
  overflow: hidden;
  background:
    linear-gradient(160deg, rgba(255,255,255,.05), transparent 42%),
    #0e1311;
  box-shadow:
    0 1px 0 rgba(20,20,20,0.04) inset,
    0 14px 32px rgba(0,0,0,.32);
  transition: box-shadow .28s ease;
}
.catalog-card:hover .catalog-cover {
  box-shadow:
    0 1px 0 rgba(20,20,20,0.05) inset,
    0 18px 40px rgba(0,0,0,.4);
}
.catalog-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  transform: scale(1);
  transition: transform .55s cubic-bezier(.2,.8,.2,1), opacity .35s ease;
  opacity: 0;
}
.catalog-cover img.is-ready { opacity: 1; }
.catalog-card:hover .catalog-cover img { transform: scale(1.02); }
.catalog-cover::after {
  content: none;
}
.catalog-meta { display: grid; gap: 0; min-width: 0; }
.catalog-meta strong {
  font-family: var(--display);
  font-size: clamp(1.2rem, 1.6vw, 1.45rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Reader fullscreen */
.reader {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: end center;
}
.reader[hidden] { display: none !important; }
.reader-scrim {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 6, 0.72);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity .32s ease;
}
.reader.is-open .reader-scrim { opacity: 1; }
.reader-sheet {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  height: min(100dvh, 100%);
  background: #f5f5f6;
  border-radius: 22px 22px 0 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  transform: translateY(108%);
  transition: transform .42s cubic-bezier(.2,.85,.2,1);
  box-shadow: 0 -20px 80px rgba(0,0,0,.45);
  overflow: hidden;
}
.reader.is-open .reader-sheet { transform: translateY(0); }
.reader-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px 10px;
  background: linear-gradient(#ffffff, rgba(255,255,255,.96));
  border-bottom: 1px solid var(--line);
}
.reader-close {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(20,20,20,0.03);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.reader-close span,
.reader-close span::before {
  display: block;
  width: 14px;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  position: relative;
}
.reader-close span { transform: rotate(45deg); }
.reader-close span::before {
  content: "";
  position: absolute;
  inset: 0;
  transform: rotate(90deg);
}
.reader-titles {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.reader-titles strong {
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reader-titles span {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reader-page {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}
.reader-scroll {
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: y proximity;
  background: #070a09;
}
.reader-pages {
  display: grid;
  gap: 10px;
  padding: 12px 12px 48px;
  max-width: 820px;
  margin: 0 auto;
}
.reader-page-slot {
  position: relative;
  width: 100%;
  background: #111613;
  border-radius: 2px;
  overflow: hidden;
  min-height: 42vh;
  scroll-snap-align: start;
  box-shadow: 0 10px 30px rgba(0,0,0,.28);
}
.reader-page-slot img {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0;
  transition: opacity .25s ease;
  background: #111613;
}
.reader-page-slot img.is-ready { opacity: 1; }
.reader-page-slot.is-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(100deg, transparent 30%, rgba(20,20,20,0.03) 50%, transparent 70%),
    #111613;
  background-size: 200% 100%;
  animation: catalogShimmer 1.2s ease infinite;
}
@keyframes catalogShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.reader-hint {
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
  padding: 8px 12px 14px;
  letter-spacing: 0.02em;
  background: #f5f5f6;
}
body.reader-open { overflow: hidden; }
body.reader-open .sidebar,
body.reader-open .mobile-bar,
body.reader-open .nav-scrim { pointer-events: none; }

@media (max-width: 1100px) {
  .catalog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .catalog-meta strong { font-size: 1.15rem; }
  .reader-sheet {
    width: 100%;
    border-radius: 18px 18px 0 0;
  }
  .reader-pages { padding: 8px 8px 56px; gap: 8px; }
}

.clients-page-panel {
  padding: 18px;
}

.content {
  padding: 28px clamp(16px, 3vw, 40px) 48px;
  min-width: 0;
}

.hero {
  min-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 820px;
  animation: rise .55s ease both;
}
.hero h1, .page-head h1 {
  margin: 8px 0 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.2rem, 4.5vw, 3.8rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.lede {
  margin: 18px 0 28px;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 54ch;
  line-height: 1.55;
}
.lede code { color: var(--accent); font-family: var(--mono); font-size: 0.9em; }

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 22px;
  animation: rise .4s ease both;
}
.page-meta { text-align: right; display: grid; gap: 6px; color: var(--muted); }

.live {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ok); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
}
.live::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(111,191,138,.55); }
  70% { box-shadow: 0 0 0 10px rgba(111,191,138,0); }
  100% { box-shadow: 0 0 0 0 rgba(111,191,138,0); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes softIn {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.mono { font-family: var(--mono); font-size: 0.8rem; }

/* —— Entrada (sessão bloqueada) —— */
html:not(.boot-session) body.is-locked {
  grid-template-columns: 1fr;
}
html:not(.boot-session) body.is-locked .sidebar {
  display: none;
}
html:not(.boot-session) body.is-locked .content {
  min-height: 100vh;
  padding: 0;
}
html:not(.boot-session) body.is-locked #appRoot {
  display: none !important;
}
html:not(.boot-session) body.is-locked #vendorGate {
  display: grid;
}

/* Sessão já no localStorage: mostrar app na troca de página (sem flash do login) */
html.boot-session body.is-locked #appRoot {
  display: block !important;
}
html.boot-session body.is-locked #vendorGate {
  display: none !important;
}
html.boot-session body.is-locked #sideNav {
  display: grid !important;
}
html.boot-session body.is-locked #sideVendor {
  display: block !important;
}
html.boot-session body.is-locked #btnLogout {
  display: block !important;
}

.entry {
  display: none;
  place-items: center;
  min-height: 100vh;
  width: 100%;
  padding: clamp(28px, 6vw, 72px);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(900px 480px at 18% 12%, rgba(225, 6, 0, 0.12), transparent 58%),
    radial-gradient(700px 420px at 88% 78%, rgba(255, 59, 48, 0.08), transparent 55%),
    linear-gradient(165deg, #ffffff 0%, #fafafa 48%, #f5f5f6 100%);
  animation: softIn .55s ease both;
}
.entry::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, transparent 40%, rgba(225, 6, 0, 0.03) 50%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.entry-inner {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 0;
}
.entry-logo {
  display: grid;
  place-items: center;
  margin-bottom: 8px;
}
.entry-logo .mark {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  font-size: 2.2rem;
  box-shadow: 0 14px 36px rgba(225, 6, 0, 0.4);
}
.entry-brand {
  margin: 8px 0 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.8rem, 9vw, 4.2rem);
  letter-spacing: 0.08em;
  line-height: 0.95;
  background: linear-gradient(180deg, #ff4a3d, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 10px 22px rgba(225, 6, 0, 0.22));
}
.entry-line {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}
.entry-vendors {
  display: none;
}
.entry-auth {
  margin-top: 18px;
  width: min(320px, 100%);
  display: grid;
  gap: 14px;
  justify-items: stretch;
  text-align: left;
  animation: rise .35s ease both;
}
.entry-auth[hidden],
#loginForm[hidden],
#registerForm[hidden],
#regProgress[hidden],
#entryModes[hidden],
.entry-modes[hidden],
.reg-step[hidden] {
  display: none !important;
}
.entry-modes {
  margin-top: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  width: min(320px, 100%);
  padding: 4px;
  border-radius: 999px;
  background: rgba(225, 6, 0, 0.06);
}
.entry-mode {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.entry-mode.is-on {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 2px 10px rgba(225, 6, 0, 0.16);
}
.reg-progress {
  display: flex;
  gap: 8px;
  justify-content: center;
  width: min(320px, 100%);
  margin-top: 18px;
}
.reg-progress span {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.1);
}
.reg-progress span.is-on {
  background: linear-gradient(90deg, var(--accent-soft), var(--accent-2));
  box-shadow: 0 0 12px rgba(225, 6, 0, 0.45);
}
.reg-progress span.is-done {
  background: var(--accent);
}
.reg-hint {
  margin: 0 0 4px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
}
.reg-note {
  margin: 0 0 8px;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--muted);
}
.onboard-progress {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}
.onboard-bar {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
}
.onboard-bar-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c8102e, #e10600);
  transition: width 0.35s ease;
}
.onboard-pct {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.onboard-msg {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--muted);
  min-height: 2.4em;
}
.onboard-stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--muted);
}
.onboard-stats span {
  color: var(--ink);
  font-weight: 600;
}
.reg-link {
  margin: 0 0 8px;
  font-size: 0.85rem;
  word-break: break-all;
  color: var(--ink);
  background: rgba(225, 6, 0, 0.05);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(225, 6, 0, 0.12);
}
.reg-step {
  display: grid;
  gap: 14px;
}
.reg-step[hidden] {
  display: none !important;
}
.reg-actions {
  display: grid;
  gap: 8px;
}
.reg-back {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 8px;
}
.reg-back:hover { color: var(--accent); }
.entry-field {
  display: grid;
  gap: 8px;
}
.entry-field > span {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.entry-input {
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  outline: none;
  width: 100%;
  box-shadow: 0 6px 18px rgba(225, 6, 0, 0.06);
}
.entry-input:focus {
  border-color: rgba(225, 6, 0, 0.55);
  box-shadow: 0 0 0 3px rgba(225, 6, 0, 0.12), 0 8px 22px rgba(225, 6, 0, 0.12);
}
.entry-submit {
  width: 100%;
  margin-top: 4px;
  justify-content: center;
}
.pin-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin: 0;
  text-align: center;
}

/* —— Filters —— */
.filters {
  display: grid;
  grid-template-columns: 1.4fr auto;
  gap: 14px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(20, 20, 20, 0.04);
  margin-bottom: 22px;
  animation: rise .45s ease both;
  position: relative;
  z-index: 40;
  overflow: visible;
}
.filters.is-open { z-index: 80; }
.filters label, .f-status, .f-date { display: grid; gap: 8px; }
.f-label, .filters label > span {
  font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600;
}
.f-hint { text-transform: none; letter-spacing: 0; color: var(--accent-2); font-weight: 500; font-size: 0.7rem; }
.date-note { margin: 4px 0 0; color: var(--muted); font-size: 0.72rem; }
.filters input, .filters select, .btn, .table-tools select, .date-campo select {
  font: inherit; color: var(--ink);
  background: #ffffff; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; outline: none;
}
.filters input:focus, .filters select:focus, .date-campo select:focus { border-color: rgba(225, 6, 0,.55); }
.filter-actions { display: flex; align-items: end; gap: 8px; }

.status-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  min-height: 42px; align-items: center;
}
.status-chip {
  appearance: none; cursor: pointer;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit; font-size: 0.78rem; font-weight: 700;
  background: var(--chip-bg);
  color: var(--chip-ink);
  transition: transform .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
  box-shadow: 0 1px 0 rgba(0,0,0,.15);
}
.status-chip:hover { transform: translateY(-1px); }
.status-chip.on {
  background: var(--chip-on-bg);
  color: var(--chip-on);
  box-shadow: 0 6px 18px rgba(225, 6, 0,.25);
}
.status-chip .n {
  margin-left: 6px; opacity: 0.7; font-family: var(--mono); font-size: 0.72rem; font-weight: 500;
}

/* Date shell */
.date-shell { position: relative; }
.date-trigger {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  font: inherit; color: var(--ink); text-align: left;
  background: #ffffff; border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 14px; cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.date-trigger[aria-expanded="true"], .date-trigger:hover {
  border-color: rgba(225, 6, 0,.5);
  box-shadow: 0 0 0 3px rgba(225, 6, 0,.1);
}
.date-ico { width: 20px; height: 20px; color: var(--accent); flex: 0 0 auto; }
.date-ico svg { width: 100%; height: 100%; display: block; }
.date-trigger #dateLabel { flex: 1; font-size: 0.9rem; }
.date-chev { color: var(--muted); font-size: 0.75rem; }
.date-pop {
  position: absolute; z-index: 90; top: calc(100% + 8px); left: 0; right: 0;
  min-width: 280px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 0 28px 60px rgba(225, 6, 0, 0.12), 0 0 0 1px rgba(225, 6, 0,.12);
  animation: rise .2s ease both;
}
.date-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.date-presets button {
  appearance: none; cursor: pointer;
  border: 1px solid var(--line); background: rgba(20,20,20,0.03);
  color: var(--ink); border-radius: 999px; padding: 6px 10px;
  font: inherit; font-size: 0.75rem; font-weight: 600;
}
.date-presets button:hover { border-color: rgba(225, 6, 0,.45); color: var(--accent); }
.date-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.date-fields label, .date-campo { display: grid; gap: 6px; font-size: 0.72rem; color: var(--muted); }
.date-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

.btn { cursor: pointer; transition: transform .15s ease, border-color .15s ease; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn:hover { transform: translateY(-1px); }
.btn.primary {
  background: var(--accent);
  color: #ffffff;
  border: 1px solid var(--accent);
  font-weight: 700;
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(225, 6, 0, 0.18);
}
.btn.ghost {
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.ghost:hover {
  border-color: rgba(225, 6, 0, 0.35);
  color: var(--accent);
}

.empty-state { margin-bottom: 22px; animation: softIn .4s ease both; }
.empty-card {
  padding: 48px 28px; text-align: center;
  border-radius: var(--radius); border: 1px dashed rgba(225, 6, 0,.35);
  background: rgba(225, 6, 0,.05);
}
.empty-card h2 { font-family: var(--display); margin: 8px 0 10px; font-size: 1.8rem; }
.empty-card p { color: var(--muted); margin: 0; }

.kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
  position: relative;
  z-index: 1;
}
.kpi {
  padding: 18px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #ffffff;
  min-height: 110px;
  min-width: 0;
  overflow: hidden;
  animation: rise .5s ease both;
  position: relative;
  container-type: inline-size;
  container-name: kpi;
}
.kpi.clickable { cursor: pointer; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.kpi.clickable:hover { transform: translateY(-2px); border-color: rgba(225, 6, 0,.35); }
.kpi.clickable::after {
  content: "";
  position: absolute; top: 12px; right: 12px;
  width: 9px; height: 9px; border-radius: 50%;
  border: 1.5px solid var(--muted);
  opacity: .5;
  transition: background .15s ease, border-color .15s ease, opacity .15s ease;
}
.kpi.clickable.on {
  border-color: rgba(225, 6, 0,.35);
  box-shadow: 0 8px 22px rgba(20, 20, 20, 0.06);
  background: #fff8f7;
}
.kpi.clickable.on::after {
  background: var(--accent);
  border-color: var(--accent);
  opacity: 1;
}
.kpi span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding-right: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi strong {
  display: block;
  margin-top: 10px;
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.15;
  font-size: clamp(0.95rem, 11cqi, 1.55rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.kpi em {
  display: block;
  margin-top: 6px;
  font-style: normal;
  color: var(--accent-2);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 22px;
}
.grid-2 .span-2 { grid-column: 1 / -1; }
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(23,30,27,.8);
  padding: 18px;
  box-shadow: var(--shadow);
}
.panel > header h2 { margin: 0; font-family: var(--display); font-size: 1.25rem; }
.panel > header p { margin: 4px 0 14px; color: var(--muted); font-size: 0.85rem; }

.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr auto; gap: 10px; align-items: center; }
.bar-row .label { font-size: 0.82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; border-radius: 999px; background: rgba(20,20,20,0.04); overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.bar-row .value { font-family: var(--mono); font-size: 0.75rem; color: var(--ink); }

.rank { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.rank-item {
  display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center;
  padding: 10px 12px; border-radius: 12px; background: rgba(0,0,0,0.2); border: 1px solid var(--line);
}
.rank-item .n { font-family: var(--mono); color: var(--accent); }
.rank-item .name { font-size: 0.88rem; }
.rank-item .val { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }

.table-panel { overflow: visible; position: relative; z-index: 2; }
.table-head, .pager {
  display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap;
}
.table-title { min-width: min(100%, 520px); flex: 1; }
.table-title h2 { margin: 0; font-family: var(--display); font-size: 1.25rem; }
.table-meta-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 8px;
}
#tableMeta {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  flex: 1;
  min-width: 180px;
}
.table-ingest-meta {
  margin: 0;
  width: 100%;
  flex-basis: 100%;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Status filter in Pedidos title */
.status-shell { position: relative; z-index: 25; }
.status-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; color: var(--ink); cursor: pointer;
  background: #ffffff; border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.status-trigger:hover, .status-trigger[aria-expanded="true"] {
  border-color: rgba(225, 6, 0,.5);
  box-shadow: 0 0 0 3px rgba(225, 6, 0,.1);
}
.status-trigger-label {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--accent); font-weight: 700;
}
.status-trigger strong { font-size: 0.88rem; font-weight: 700; }
.status-pop {
  position: absolute; z-index: 40; top: calc(100% + 8px); left: 0;
  min-width: 260px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 0 28px 60px rgba(225, 6, 0, 0.12);
  animation: rise .2s ease both;
}
.status-options { display: grid; gap: 8px; margin: 10px 0 12px; }
.status-opt {
  appearance: none; cursor: pointer; text-align: left;
  border: 1px solid var(--line);
  background: #fff1f0;
  color: #1c241f;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit; font-size: 0.86rem; font-weight: 700;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.status-opt:hover { transform: translateY(-1px); }
.status-opt.on {
  background: var(--accent);
  color: #1a1206;
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(225, 6, 0,.28);
}
.status-opt[data-status="Incluída"].on { background: #f3e2c0; color: #4a3208; }
.status-opt[data-status="Faturada com NF"].on { background: #d8f0e0; color: #124028; }
.status-opt[data-status="Remessa"].on { background: #d9e6f5; color: #123055; }
.status-opt[data-status="Cancelada"].on { background: #f6ddd8; color: #5c1e16; }
.table-faturado {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(20, 20, 20, 0.06);
  white-space: nowrap;
}
.table-faturado span {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.table-faturado strong {
  font-family: var(--display);
  font-size: 1.05rem;
  color: var(--ink);
  font-weight: 700;
}
.table-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.table-tools label { display: grid; gap: 4px; font-size: 0.75rem; color: var(--muted); }

/* Pedidos month filter */
.pedidos-controls {
  display: grid;
  gap: 14px;
  margin: 14px 0 4px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(20, 20, 20, 0.04);
}
.month-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}
.month-year {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--display); font-size: 1.15rem; font-weight: 700;
}
.month-year button {
  appearance: none; cursor: pointer;
  width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid var(--line); background: #ffffff;
  color: var(--ink); font: inherit; font-size: 1rem;
}
.month-year button:hover { border-color: rgba(225, 6, 0,.45); color: var(--accent); }
.month-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
.month-chip {
  appearance: none; cursor: pointer;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  border-radius: 12px;
  padding: 10px 8px;
  font: inherit; font-size: 0.8rem; font-weight: 700;
  transition: transform .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.month-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(225, 6, 0, 0.35);
  color: var(--accent);
}
.month-chip.on {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 6px 16px rgba(225, 6, 0, 0.22);
}
.month-meta {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 12px;
  align-items: end;
}
.campo-pills {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.campo-pill {
  appearance: none; cursor: pointer;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit; font-size: 0.78rem; font-weight: 600;
}
.campo-pill.on {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}
.pedidos-search input {
  width: 100%;
  font: inherit; color: var(--ink);
  background: #ffffff; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; outline: none;
}
.pedidos-search input:focus { border-color: rgba(225, 6, 0,.55); }
.cnpj-import { display: grid; gap: 8px; align-content: end; }
.cnpj-upload {
  justify-self: start;
  cursor: pointer;
  padding: 10px 12px !important;
  font-size: 0.8rem;
}
#cnpjImportMsg { margin: 0; color: var(--accent-2); font-size: 0.72rem; }
.month-clear {
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--line);
}
.month-clear.on-active {
  border-color: rgba(225, 6, 0,.45);
  color: var(--accent);
}

.table-wrap { overflow: auto; margin-top: 12px; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; min-width: 980px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 0.86rem; }
th { color: var(--muted); font-weight: 600; background: #ffffff; position: sticky; top: 0; }
td.num { font-family: var(--mono); font-size: 0.8rem; }

/* Cliente: menu Rastreio / Boletos */
.client-action { position: relative; min-width: 190px; }
.client-name-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 280px;
  padding: 5px 8px;
  margin: -5px -8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: color .15s ease, background .15s ease;
}
.client-name-btn:hover {
  color: var(--accent);
  background: rgba(225, 6, 0,.09);
}
.client-name-btn span { color: var(--accent); font-size: .68rem; flex: 0 0 auto; }
.client-action-menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 8px);
  left: 0;
  min-width: 150px;
  padding: 7px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(225, 6, 0, 0.12);
  animation: rise .16s ease both;
}
.client-action-menu button {
  appearance: none;
  width: 100%;
  padding: 10px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: .82rem;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}
.client-action-menu button:hover {
  background: rgba(225, 6, 0,.12);
  color: var(--accent);
}

/* Rastreio / Boletos modal — tema claro */
.track-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
}
.track-modal[hidden] { display: none !important; }
.track-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 20, 0.28);
  backdrop-filter: blur(10px);
}
.track-modal-panel {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(90vh, 920px);
  overflow: auto;
  border-radius: 22px;
  border: 1px solid rgba(20, 20, 20, 0.08);
  background: #f5f5f7;
  box-shadow:
    0 2px 8px rgba(20, 20, 20, 0.04),
    0 28px 72px rgba(20, 20, 20, 0.14);
  animation: rise .22s ease both;
  color: var(--ink);
}
.track-modal-head,
.track-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(1.4) blur(16px);
  -webkit-backdrop-filter: saturate(1.4) blur(16px);
}
.track-modal-head {
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 2;
}
.track-modal-foot {
  border-top: 1px solid var(--line);
  position: sticky;
  bottom: 0;
}
.track-modal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.track-modal-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 6px 16px rgba(225, 6, 0, 0.2);
}
.track-eyebrow {
  margin: 0 0 2px;
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}
.track-modal-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.2rem;
  color: var(--ink);
}
.track-close {
  appearance: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}
.track-close:hover {
  border-color: rgba(225, 6, 0,.45);
  color: var(--accent);
}
.track-modal-body { padding: 16px 20px 20px; }
.track-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 4px 0 20px;
}
.track-chip {
  padding: 14px 14px;
  border-radius: 16px;
  border: 1px solid rgba(20, 20, 20, 0.06);
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(20, 20, 20, 0.04), 0 8px 20px rgba(20, 20, 20, 0.04);
  min-width: 0;
}
.track-chip span {
  display: block;
  font-size: .64rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #86868b;
  margin-bottom: 6px;
  font-weight: 600;
}
.track-chip strong {
  display: block;
  font-size: .95rem;
  line-height: 1.3;
  color: #1d1d1f;
  font-weight: 600;
  word-break: break-word;
}
.track-chip.status strong { color: var(--accent); }
.track-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-family: var(--display);
  font-size: 1.05rem;
  color: var(--ink);
}
.track-section-title svg { color: var(--accent); flex: 0 0 auto; }
.track-error {
  color: var(--accent);
  background: #fff5f4;
  border: 1px solid rgba(225, 6, 0, 0.15);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 0.88rem;
  line-height: 1.4;
}
.track-empty {
  color: var(--muted);
  font-size: 0.9rem;
}
.boleto-files { display: grid; gap: 10px; margin-top: 14px; }
.boleto-share-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(20, 20, 20, 0.06);
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(20, 20, 20, 0.04), 0 8px 20px rgba(20, 20, 20, 0.04);
}
.boleto-share-box strong { display: block; color: var(--ink); }
.boleto-share-box p { margin: 4px 0 0; color: var(--muted); font-size: 0.82rem; }
.boleto-share-btn {
  flex: 0 0 auto;
  background: var(--accent) !important;
  color: #ffffff !important;
  border-color: var(--accent) !important;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 650;
}
@media (max-width: 720px) {
  .track-modal { padding: 10px; align-items: end; }
  .track-modal-panel {
    width: 100%;
    max-height: min(92vh, 920px);
    border-radius: 20px 20px 12px 12px;
  }
  .track-summary {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .track-chip.status { grid-column: 1 / -1; }
  .track-chip { padding: 12px; border-radius: 14px; }
  .track-modal-head, .track-modal-foot, .track-modal-body {
    padding-left: 16px;
    padding-right: 16px;
  }
  .track-close, .boleto-share-btn { min-height: 44px; }
}
.track-loading,
.track-error-block {
  display: grid;
  gap: 12px;
  place-items: center;
  text-align: center;
  padding: 42px 16px;
  color: var(--muted);
}
.track-loading[hidden],
.track-error[hidden],
#trackContent[hidden],
#boletoContent[hidden] {
  display: none !important;
}
.track-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(225, 6, 0,.2);
  border-top-color: var(--accent);
  animation: track-spin .8s linear infinite;
}
@keyframes track-spin { to { transform: rotate(360deg); } }
.track-timeline {
  display: grid;
  gap: 0;
  position: relative;
  padding-left: 8px;
}
.track-event {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  padding: 12px 0 16px;
  position: relative;
}
.track-event:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 28px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, rgba(225, 6, 0,.55), rgba(225, 6, 0,.08));
}
.track-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #1a221e;
  border: 1px solid rgba(225, 6, 0,.45);
  color: var(--accent);
  box-shadow: 0 0 0 4px rgba(225, 6, 0,.08);
  z-index: 1;
}
.track-event:first-child .track-dot {
  background: linear-gradient(145deg, #ff8a80, var(--accent));
  color: #1a1206;
  border-color: transparent;
}
.track-event-body {
  padding: 2px 4px 0 0;
  min-width: 0;
}
.track-event-body time {
  display: block;
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--muted);
  margin-bottom: 4px;
}
.track-event-body strong {
  display: block;
  font-size: .95rem;
  color: var(--ink);
}
.track-event-body p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .82rem;
}
.track-empty {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 14px;
}
.boleto-files {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
.boleto-share-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid rgba(225, 6, 0,.35);
  background: linear-gradient(135deg, rgba(225, 6, 0,.14), rgba(61,155,122,.1));
}
.boleto-share-box strong {
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
}
.boleto-share-box p {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
}
.boleto-share-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .track-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .track-chip.status { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .track-summary { grid-template-columns: 1fr; }
  .track-modal { padding: 12px; }
  .boleto-share-box { align-items: stretch; flex-direction: column; }
}

/* Status badges in table — high contrast */
.badge {
  display: inline-block; padding: 5px 10px; border-radius: 999px;
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.01em;
  background: #fff1f0; color: #141414;
  border: 1px solid rgba(28,36,31,.12);
}
.badge.fat { background: #d8f0e0; color: #124028; border-color: rgba(18,64,40,.15); }
.badge.can { background: #f6ddd8; color: #5c1e16; border-color: rgba(92,30,22,.15); }
.badge.inc { background: #f3e2c0; color: #4a3208; border-color: rgba(74,50,8,.15); }
.badge.rem { background: #d9e6f5; color: #123055; border-color: rgba(18,48,85,.15); }

.pager { margin-top: 14px; }

/* Gestão de clientes (Bruno) */
.clients-admin-btn {
  border-radius: 12px !important;
  padding: 10px 14px !important;
  border: 1px solid rgba(225, 6, 0, 0.35) !important;
  color: var(--accent) !important;
  font-weight: 600;
}
.clients-admin-btn:hover {
  border-color: var(--accent) !important;
  background: rgba(225, 6, 0, 0.08) !important;
}
.clients-modal-panel {
  width: min(1080px, 100%);
  max-height: min(92vh, 980px);
}
.clients-modal-body {
  display: grid;
  gap: 16px;
  padding-top: 14px !important;
}
.clients-toolbar {
  display: block;
  margin-bottom: 14px;
}
.clients-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 420px;
}
.vendas-toolbar .clients-search-row {
  max-width: min(720px, 100%);
}
.clients-search-input {
  flex: 1;
  min-width: 0;
  height: 40px;
  appearance: none;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  padding: 0 14px;
  font: inherit;
  font-size: 0.94rem;
}
.clients-search-input:focus {
  outline: none;
  border-color: rgba(225, 6, 0, 0.45);
  box-shadow: 0 0 0 3px rgba(225, 6, 0, 0.08);
}
.clients-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.82rem;
  min-width: 1.5rem;
  text-align: right;
}
.clients-empty {
  text-align: center;
  padding: 36px 16px;
  color: var(--muted);
}
.clients-razao {
  font-weight: 600;
  max-width: 28ch;
}
.clients-page-panel {
  padding: 18px 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(20, 20, 20, 0.04);
}
.clients-search {
  display: grid;
  gap: 6px;
}
.clients-search input {
  width: 100%;
  appearance: none;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  padding: 10px 14px;
  font: inherit;
}
.clients-search input:focus {
  outline: none;
  border-color: rgba(225, 6, 0, 0.55);
  box-shadow: 0 0 0 3px rgba(225, 6, 0, 0.12);
}
.clients-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.clients-toolbar-actions .mono {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0;
}
.clients-table-wrap {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: auto;
  max-height: min(58vh, 560px);
  background: #ffffff;
}
.clients-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: #ffffff;
}
.clients-table th,
.clients-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  background: #ffffff;
  color: var(--ink);
}
.clients-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #ffffff;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}
.clients-table tbody tr:hover td {
  background: #fff8f7;
}
.clients-table td.num {
  font-family: var(--mono);
  font-size: 0.82rem;
  white-space: nowrap;
}
.clients-table td.clients-actions {
  text-align: right;
  white-space: nowrap;
  vertical-align: middle;
  width: 1%;
}
.clients-actions .btn.tiny {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 6px;
}
.clients-actions .btn.tiny:first-child {
  margin-left: 0;
}
.btn.tiny {
  padding: 7px 10px !important;
  border-radius: 10px !important;
  font-size: 0.78rem !important;
  border: 1px solid var(--line);
  line-height: 1.2;
  background: #ffffff;
  color: var(--ink);
}
.btn.tiny.danger {
  color: var(--accent) !important;
  border-color: rgba(225, 6, 0, 0.35) !important;
  background: #ffffff !important;
}
.btn.tiny.danger:hover {
  background: #fff1f0 !important;
  color: var(--accent-2) !important;
}
.client-vendor-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: 600;
}
.clients-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}
.clients-hint code {
  color: var(--accent);
}
.client-form-panel {
  width: min(560px, 100%);
}
.client-form {
  display: grid;
  gap: 18px;
  padding-top: 16px !important;
  padding-bottom: 22px !important;
}
.client-form-grid {
  display: grid;
  gap: 14px;
}
.client-form-grid label {
  display: grid;
  gap: 6px;
}
.client-form-grid label span {
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.client-form-grid input,
.client-form-grid select {
  appearance: none;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  padding: 12px 14px;
  font: inherit;
}
.client-form-grid input:focus,
.client-form-grid select:focus {
  outline: none;
  border-color: rgba(225, 6, 0, 0.55);
  box-shadow: 0 0 0 3px rgba(225, 6, 0, 0.12);
}
.client-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.page-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 14px;
}
.page-meta-actions .btn:not(.primary) {
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 11px 16px;
  border-radius: 12px;
  font-weight: 600;
}
.page-meta-actions .btn:disabled {
  opacity: 0.65;
  cursor: wait;
}
#ingestRefreshMsg {
  font-size: 0.78rem;
  color: var(--muted);
  max-width: 280px;
  text-align: right;
}

@media (max-width: 1100px) {
  body.shell {
    grid-template-columns: 1fr;
  }
  .mobile-bar {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 80;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    padding: 10px 14px;
    background: rgba(12, 17, 15, 0.92);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
  }
  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
  }
  .mobile-brand strong {
    font-family: var(--display);
    font-size: 1.15rem;
    letter-spacing: -0.02em;
  }
  .mobile-vendor {
    margin-left: auto;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
    max-width: 36vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .menu-toggle {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.9);
    color: var(--ink);
    cursor: pointer;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    padding: 0;
  }
  .menu-toggle-lines,
  .menu-toggle-lines::before,
  .menu-toggle-lines::after {
    display: block;
    width: 16px;
    height: 1.6px;
    background: currentColor;
    border-radius: 2px;
    position: relative;
    transition: transform .25s ease, opacity .2s ease;
  }
  .menu-toggle-lines::before,
  .menu-toggle-lines::after {
    content: "";
    position: absolute;
    left: 0;
  }
  .menu-toggle-lines::before { top: -5px; }
  .menu-toggle-lines::after { top: 5px; }

  .nav-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 120;
    background: rgba(4, 7, 6, 0.55);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .28s ease;
  }
  body.nav-open .nav-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(304px, 86vw);
    height: 100dvh;
    z-index: 130;
    transform: translateX(-105%);
    transition: transform .34s cubic-bezier(.2,.85,.2,1);
    border-right: 1px solid var(--line);
    box-shadow: 20px 0 60px rgba(0,0,0,.35);
    padding: 18px 14px 20px;
    gap: 22px;
  }
  body.nav-open .sidebar {
    transform: translateX(0);
  }
  .menu-close {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.9);
    color: var(--ink);
    cursor: pointer;
    flex: 0 0 auto;
    margin-top: 6px;
  }
  .menu-close span,
  .menu-close span::before {
    display: block;
    width: 14px;
    height: 1.5px;
    background: currentColor;
    border-radius: 2px;
    position: relative;
  }
  .menu-close span { transform: rotate(45deg); }
  .menu-close span::before {
    content: "";
    position: absolute;
    inset: 0;
    transform: rotate(90deg);
  }
  .side-nav {
    grid-template-columns: 1fr;
    width: 100%;
    gap: 6px;
  }
  .nav-item small { display: none; }
  .nav-item {
    padding: 11px;
  }
  .side-foot {
    margin-top: auto;
    width: 100%;
  }

  html:not(.boot-session) body.is-locked .mobile-bar,
  html:not(.boot-session) body.is-locked .nav-scrim {
    display: none !important;
  }
  body.nav-open {
    overflow: hidden;
  }

  .filters { grid-template-columns: 1fr 1fr; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-2 .span-2 { grid-column: auto; }
  .month-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .month-meta { grid-template-columns: 1fr; }
  .month-bar { grid-template-columns: 1fr; }
  .clients-toolbar { margin-bottom: 12px; }
  .clients-search-row { max-width: none; gap: 8px; }
  .clients-search-input {
    height: 44px;
    font-size: 16px; /* evita zoom iOS */
    border-radius: 14px;
    padding: 0 16px;
  }
  .clients-count { font-size: 0.8rem; }
  .clients-page-panel {
    padding: 14px 12px 16px;
    border-radius: 16px;
    box-shadow: none;
  }
  .clients-table th,
  .clients-table td {
    padding: 12px 10px;
    font-size: 0.86rem;
  }
  .page-head h1 { font-size: clamp(1.85rem, 8vw, 2.4rem); }
  .page-head .lede { font-size: 0.95rem; margin: 10px 0 0; }
  .btn.primary {
    min-height: 44px;
    padding: 11px 16px;
    border-radius: 14px;
  }
  .btn.tiny {
    min-height: 36px;
    padding: 8px 12px !important;
    border-radius: 12px !important;
  }
  .catalog-share {
    width: 44px;
    height: 44px;
    top: 12px;
    right: 12px;
  }
}
@media (max-width: 640px) {
  .filters, .kpis { grid-template-columns: 1fr; }
  .entry-auth { width: min(100%, 320px); }
  .page-head { flex-direction: column; align-items: start; }
  .page-meta { text-align: left; justify-content: flex-start; }
  .month-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mobile-brand strong { font-size: 1.05rem; }
}

/* —— Vendas —— */
.vendas-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.vendas-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}
.vendas-vendor-filter {
  display: grid;
  gap: 6px;
  min-width: 160px;
}
.vendas-vendor-filter select {
  appearance: none;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  padding: 11px 14px;
  font: inherit;
}
.vendas-row-actions {
  text-align: right;
  white-space: nowrap;
}
.vendas-row-actions .btn.tiny {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  vertical-align: middle;
}
.venda-share-sheet {
  z-index: 200;
  align-items: end;
  justify-items: center;
  padding: 0;
}
body.venda-share-open .mobile-bar {
  z-index: 0;
}
body.venda-share-open .content {
  z-index: 90;
}
.venda-share-panel {
  position: relative;
  z-index: 2;
  width: min(420px, 100%);
  margin: 0 auto;
  border-radius: 18px 18px 0 0;
  border: 1px solid rgba(225, 6, 0,.35);
  border-bottom: 0;
  background: #151a17;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -12px 40px rgba(0,0,0,.35);
}
.venda-share-sheet .track-modal-backdrop {
  z-index: 0;
}
.venda-share-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.venda-share-head h2 {
  margin: 2px 0 0;
  font-size: 1.15rem;
  font-family: var(--display);
}
.venda-share-actions {
  display: grid;
  gap: 10px;
}
.venda-share-opt {
  width: 100%;
  justify-content: center;
  padding: 14px 16px;
  border-radius: 12px;
  font-weight: 650;
}
.venda-form-panel { padding: 18px 20px; }
.venda-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.venda-form-grid label {
  display: grid;
  gap: 6px;
  font-size: 0.82rem;
}
.venda-form-grid label span { color: var(--muted); }
.venda-form-grid input,
.venda-form-grid select,
.venda-form-grid textarea {
  width: 100%;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.9);
  color: inherit;
}
.venda-obs { grid-column: 1 / -1; }
.venda-totals {
  display: flex;
  gap: 24px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.venda-totals strong {
  display: block;
  font-family: var(--display);
  font-size: 1.25rem;
}
.venda-itens-panel { padding: 18px 20px; margin-top: 18px; }
.venda-itens-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.venda-itens-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.15rem;
}
.venda-itens-list { display: grid; gap: 10px; }
.venda-item-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  transition: border-color .15s ease;
}
.venda-item-card:hover { border-color: rgba(225, 6, 0,.45); }
.venda-item-card.is-readonly {
  cursor: default;
  opacity: .9;
  pointer-events: none;
}
.venda-item-ref {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--gold);
}
.venda-item-desc { font-weight: 600; }
.venda-item-meta { font-size: 0.82rem; color: var(--muted); }
.venda-item-grade {
  margin-top: 8px;
  display: grid;
  gap: 4px;
}
.venda-item-grade-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: baseline;
  font-size: 0.78rem;
  line-height: 1.3;
}
.venda-item-cor {
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.venda-item-tams {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.74rem;
}
.venda-item-val { text-align: right; font-weight: 700; }
.venda-cliente-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  margin-top: 12px;
}
.venda-produto-panel {
  width: min(980px, calc(100vw - 20px)) !important;
  height: min(560px, calc(100dvh - 20px));
  max-height: calc(100dvh - 20px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.venda-produto-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(168px, 220px);
  gap: 14px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding-top: 12px !important;
  padding-bottom: 16px !important;
}
.venda-produto-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.venda-produto-list {
  display: grid;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  margin-top: 4px;
  align-content: start;
}
.venda-produto-bag {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  border-left: 1px solid var(--line);
  padding-left: 12px;
}
.venda-produto-bag-title {
  margin: 0 0 8px;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  flex-shrink: 0;
}
.venda-produto-bag-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 0 1 auto;
  min-height: 0;
  /* altura exata de 6 cards definida em JS (fitVendaProdutoBagScroll) */
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(225, 6, 0,.45) transparent;
  padding-right: 2px;
}
.venda-produto-bag-list::-webkit-scrollbar {
  width: 5px;
}
.venda-produto-bag-list::-webkit-scrollbar-thumb {
  background: rgba(225, 6, 0,.4);
  border-radius: 999px;
}
.venda-produto-bag-list::-webkit-scrollbar-track {
  background: transparent;
}
.venda-produto-bag-empty {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
  font-family: var(--mono);
  line-height: 1.35;
}
.venda-produto-bag-item {
  display: grid;
  gap: 2px;
  width: 100%;
  max-width: 100%;
  flex: 0 0 auto;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.9);
  color: inherit;
  text-align: left;
  cursor: pointer;
  font-size: 0.7rem;
  line-height: 1.25;
  overflow: hidden;
  box-sizing: border-box;
}
.venda-produto-bag-item:hover {
  border-color: rgba(225, 6, 0,.45);
  background: rgba(225, 6, 0,.06);
}
.venda-produto-bag-line {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.venda-produto-bag-ref {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.74rem;
  color: var(--gold, #d4a24c);
}
.venda-produto-bag-sep {
  color: var(--muted);
  font-weight: 400;
}
.venda-produto-bag-desc {
  font-family: inherit;
  font-weight: 500;
  font-size: 0.68rem;
  color: rgba(200, 210, 205, 0.72);
}
.venda-produto-bag-meta {
  color: var(--muted);
  font-size: 0.66rem;
}
.venda-produto-bag-tot {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
}
.venda-pick-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  text-align: left;
  width: 100%;
  color: inherit;
}
.venda-pick-row:hover { border-color: rgba(225, 6, 0,.45); }
.venda-grade-wrap {
  overflow-x: auto;
  overflow-y: visible;
  margin-top: 8px;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}
.venda-grade-panel.clients-modal-panel {
  width: min(560px, calc(100vw - 20px));
}
.venda-grade-panel.clients-modal-panel:not(.is-few-cols) {
  width: min(720px, calc(100vw - 16px));
}
.venda-grade-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  table-layout: fixed;
}
/* max-content + min-width:100% → preenche o modal; se passar, scroll horizontal */
.venda-grade-table.cols-scroll {
  table-layout: auto;
  width: max-content;
  min-width: 100%;
}
.venda-grade-table th,
.venda-grade-table td {
  border: 1px solid var(--line);
  padding: 4px;
  text-align: center;
  vertical-align: middle;
}
.venda-grade-table th {
  background: rgba(20,20,20,0.03);
  font-weight: 600;
}
.grade-corner,
.grade-cor-cell {
  width: 4.6rem;
  max-width: 4.6rem;
  text-align: left !important;
  padding-left: 6px !important;
}
.grade-tam,
.grade-qty {
  width: 3.1rem;
  max-width: 3.1rem;
}
.grade-tam.has-faixa {
  width: 4.2rem;
  max-width: 4.6rem;
  vertical-align: bottom;
}
.grade-tam-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  line-height: 1.15;
}
.grade-tam-letra {
  font-weight: 700;
  font-size: 0.85em;
}
.grade-tam-faixa {
  font-size: 0.62em;
  font-weight: 500;
  color: #8a9290;
  white-space: nowrap;
}
.venda-grade-table.cols-1 .grade-tam,
.venda-grade-table.cols-1 .grade-qty {
  width: auto;
  max-width: none;
}
.venda-grade-table.cols-fit .grade-corner,
.venda-grade-table.cols-fit .grade-cor-cell {
  width: 5rem;
  max-width: 5rem;
}
/* Desktop: preenche a largura do modal; muitos tamanhos → scroll horizontal */
.venda-grade-table.is-desktop {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  font-size: 0.8rem;
}
.venda-grade-table.is-desktop th,
.venda-grade-table.is-desktop td {
  padding: 3px 4px;
}
.venda-grade-table.is-desktop .grade-corner,
.venda-grade-table.is-desktop .grade-cor-cell {
  width: 7.5rem;
  max-width: 9.5rem;
  white-space: nowrap;
  padding-left: 8px !important;
  padding-right: 8px !important;
  position: sticky;
  left: 0;
  z-index: 2;
  background: #151a17;
}
.venda-grade-table.is-desktop thead .grade-corner {
  background: #1a211d;
  z-index: 3;
}
.venda-grade-table.is-desktop .grade-cor-nome {
  font-size: 0.78rem;
  max-width: 8.5rem;
}
.venda-grade-table.is-desktop .grade-tam,
.venda-grade-table.is-desktop .grade-qty {
  width: auto;
  min-width: 2.8rem;
  max-width: none;
  padding-left: 3px;
  padding-right: 3px;
}
.venda-grade-table.is-desktop .grade-tam.has-faixa {
  min-width: 4rem;
}
.venda-grade-table.is-desktop.cols-1 .grade-tam,
.venda-grade-table.is-desktop.cols-1 .grade-qty {
  min-width: 4rem;
}
.venda-grade-table.is-desktop input {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  display: block;
  padding: 4px 2px;
  font-size: 0.8rem;
  box-sizing: border-box;
}
.venda-grade-table.is-desktop.cols-1 input {
  max-width: 100%;
}
/* Muitos tamanhos: células com largura mínima; tabela cresce e o wrap faz scroll */
.venda-grade-table.is-desktop.cols-scroll {
  table-layout: auto;
  width: max-content;
  min-width: 100%;
}
.venda-grade-table.is-desktop.cols-scroll .grade-tam,
.venda-grade-table.is-desktop.cols-scroll .grade-qty {
  width: auto;
  min-width: 2.8rem;
  max-width: none;
}
.venda-grade-table.is-desktop.cols-scroll input {
  width: 100%;
  min-width: 2.4rem;
  max-width: 100%;
}
.venda-grade-panel.clients-modal-panel.is-desktop-fit {
  width: min(640px, calc(100vw - 24px));
  max-width: min(760px, calc(100vw - 24px));
  min-width: min(300px, calc(100vw - 24px));
}
.venda-grade-table input {
  width: 100%;
  max-width: 3rem;
  box-sizing: border-box;
  padding: 5px 2px;
  text-align: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.9);
  color: inherit;
  font-size: 0.85rem;
}
.venda-grade-table.cols-1 input {
  max-width: 5rem;
}
.venda-grade-table input:focus {
  outline: none;
  border-color: rgba(225, 6, 0,.65);
  background: rgba(225, 6, 0,.08);
}
.grade-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 3rem;
  min-height: 36px;
  margin: 0 auto;
  border: 0;
  border-radius: 8px;
  background: rgba(20,20,20,0.03);
  color: inherit;
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: background .12s ease, transform .08s ease;
}
.venda-grade-table.cols-1 .grade-cell {
  max-width: 5.5rem;
  min-height: 42px;
}
.grade-cell.has-qty {
  background: rgba(225, 6, 0,.18);
  color: var(--gold);
}
.grade-cell:active { transform: scale(0.96); }
.grade-empty { color: var(--muted); opacity: .45; }
.grade-cor-nome {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.venda-grade-summary {
  display: flex;
  gap: 24px;
  margin-top: 14px;
  font-size: 0.9rem;
}
.venda-grade-meta { margin-bottom: 8px; color: var(--muted); }
.venda-qty-panel {
  width: min(300px, calc(100vw - 40px)) !important;
  max-width: calc(100vw - 40px);
}
.venda-qty-field {
  display: grid;
  gap: 8px;
}
.venda-qty-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 16px;
  font-size: 1.35rem;
  font-family: var(--mono);
  text-align: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(20,20,20,0.03);
  color: inherit;
}
.venda-qty-hint {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.78rem;
}
#vendaQtyModal {
  z-index: 140;
  padding: 16px;
}

@media (max-width: 768px) {
  .track-modal {
    padding: 10px;
  }
  .venda-grade-panel.is-mobile-grade {
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    display: flex;
    flex-direction: column;
  }
  .venda-grade-panel.is-mobile-grade .track-modal-head {
    padding: 10px 12px;
  }
  .venda-grade-panel.is-mobile-grade .track-modal-head h2 {
    font-size: 1rem;
    line-height: 1.2;
  }
  .venda-grade-body {
    padding: 8px 10px 4px;
    overflow: auto;
    flex: 1;
  }
  .venda-grade-meta {
    margin-bottom: 4px;
    font-size: 0.7rem;
  }
  .venda-grade-table.is-mobile {
    font-size: 0.7rem;
    width: max-content;
    min-width: 0;
    table-layout: auto;
  }
  .venda-grade-table.is-mobile.cols-scroll,
  .venda-grade-table.is-mobile.cols-fit {
    table-layout: auto;
    width: max-content;
    min-width: 0;
  }
  .venda-grade-table.is-mobile th,
  .venda-grade-table.is-mobile td {
    padding: 2px;
  }
  .grade-corner,
  .grade-cor-cell {
    width: 5.6rem;
    max-width: 5.6rem;
    padding-left: 4px !important;
  }
  .venda-grade-table.cols-fit .grade-corner,
  .venda-grade-table.cols-fit .grade-cor-cell {
    width: 6.2rem;
    max-width: 6.2rem;
  }
  .venda-grade-table.is-mobile .grade-corner,
  .venda-grade-table.is-mobile .grade-cor-cell {
    width: 6.4rem;
    max-width: 6.4rem;
    position: sticky;
    left: 0;
    z-index: 2;
    background: #151a17;
  }
  .venda-grade-table.is-mobile thead .grade-corner {
    background: #1a211d;
    z-index: 3;
  }
  .venda-grade-table.is-mobile .grade-cor-nome {
    white-space: normal;
    line-height: 1.2;
    font-size: 0.62rem;
  }
  /* Mobile: colunas de tamanho compactas (não esticar) */
  .venda-grade-table.is-mobile .grade-tam,
  .venda-grade-table.is-mobile .grade-qty,
  .venda-grade-table.is-mobile.cols-fit .grade-tam,
  .venda-grade-table.is-mobile.cols-fit .grade-qty,
  .venda-grade-table.is-mobile.cols-scroll .grade-tam,
  .venda-grade-table.is-mobile.cols-scroll .grade-qty {
    width: 2.7rem;
    min-width: 2.7rem;
    max-width: 2.7rem;
  }
  .venda-grade-table.is-mobile.cols-1 .grade-tam,
  .venda-grade-table.is-mobile.cols-1 .grade-qty {
    width: 3.6rem;
    min-width: 3.6rem;
    max-width: 3.6rem;
  }
  .grade-cor-nome {
    font-size: 0.64rem;
  }
  .grade-cell {
    max-width: 2.6rem;
    min-height: 34px;
    font-size: 0.82rem;
    border-radius: 7px;
  }
  .venda-grade-table.is-mobile .grade-cell,
  .venda-grade-table.is-mobile.cols-fit .grade-cell,
  .venda-grade-table.is-mobile:not(.cols-scroll) .grade-cell {
    max-width: 2.6rem;
  }
  .venda-grade-table.is-mobile.cols-1 .grade-cell {
    max-width: 3.4rem;
    min-height: 40px;
  }
  .venda-grade-table.is-mobile input {
    width: 100%;
    max-width: 2.6rem;
    margin: 0 auto;
    display: block;
    padding: 4px 1px;
    font-size: 0.8rem;
    box-sizing: border-box;
  }
  .venda-grade-table.is-mobile.cols-fit input,
  .venda-grade-table.is-mobile:not(.cols-scroll) input {
    max-width: 2.6rem;
  }
  .venda-grade-table.is-mobile.cols-1 input {
    max-width: 3.4rem;
  }
  .venda-grade-summary {
    gap: 12px;
    margin-top: 8px;
    font-size: 0.8rem;
    position: sticky;
    bottom: 0;
    padding-top: 6px;
    background: linear-gradient(transparent, rgba(12,12,16,.92) 30%);
  }
  .venda-grade-panel.is-mobile-grade .track-modal-foot {
    padding: 8px 10px 10px;
  }
  .venda-item-card {
    padding: 10px 12px;
    gap: 4px 12px;
  }
  .venda-item-desc {
    font-size: 0.9rem;
    line-height: 1.25;
  }
  .venda-item-meta { font-size: 0.75rem; }
}
.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-pill.rascunho {
  background: rgba(225, 6, 0,.15);
  color: var(--gold);
}
.status-pill.pendente {
  background: rgba(212, 70, 70, 0.18);
  color: #ff8a8a;
  border: 1px solid rgba(255,120,120,.35);
}
.status-pill.finalizado {
  background: rgba(80,200,120,.12);
  color: #6fd99a;
}
.venda-row-pendente td {
  background: rgba(180, 40, 40, 0.08);
}
.venda-row-ov {
  color: var(--muted);
  font-size: 0.72rem;
}
.vendas-row-actions .btn.tiny.is-warn {
  color: #ff8a8a;
  border-color: rgba(255,120,120,.45);
}
.btn.danger { color: #ff8a8a; border-color: rgba(255,120,120,.35); }

/* —— Catálogos no fluxo de venda (isolado) —— */
.venda-produto-toolbar {
  display: flex;
  gap: 10px;
  align-items: end;
  margin-bottom: 8px;
  flex-shrink: 0;
}
.venda-produto-search { flex: 1; min-width: 0; }
.venda-produto-toolbar .btn {
  flex-shrink: 0;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(225, 6, 0,.12);
  color: var(--text);
  font-weight: 650;
}
@media (max-width: 768px) {
  .venda-produto-panel {
    width: calc(100vw - 12px) !important;
    height: min(640px, calc(100dvh - 12px));
    max-height: calc(100dvh - 12px);
  }
  .venda-produto-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
  }
  .venda-produto-bag {
    order: -1;
    border-left: 0;
    border-bottom: 1px solid var(--line);
    padding-left: 0;
    padding-bottom: 8px;
    max-height: none;
    flex: 0 0 auto;
  }
  .venda-produto-bag-list {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 6px;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .venda-produto-bag-item {
    flex: 0 0 auto;
    width: 132px;
  }
}
.venda-cat-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
.venda-cat-overlay[hidden] { display: none !important; }
body.venda-cat-open .track-modal { z-index: 1400; }
/* Overlay vive dentro de .content (z-index:1); mobile-bar (80) cobria o cabeçalho */
body.venda-cat-open .mobile-bar {
  display: none !important;
}
body.venda-cat-open .content {
  z-index: 90;
}
/* Mesmo visual das capas de /catalogos (4 colunas / 2 no mobile) */
.venda-cat-panel {
  flex: 1;
  overflow: auto;
  padding: 20px clamp(16px, 3vw, 40px) 48px;
  width: 100%;
  box-sizing: border-box;
  background:
    radial-gradient(1000px 520px at 70% -10%, rgba(225, 6, 0, 0.08), transparent 55%),
    radial-gradient(800px 480px at 100% 40%, rgba(255, 59, 48, 0.05), transparent 50%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 45%, #f5f5f6 100%);
}
.venda-cat-panel .catalog-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 22px);
  padding: 8px 0 40px;
}
@media (max-width: 720px) {
  .venda-cat-panel .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
}
.venda-cat-head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  padding: 10px 0 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.96) 60%, transparent);
}
.venda-cat-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.35rem;
}
#btnVendaCatSairGrid {
  flex-shrink: 0;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 700;
}
.venda-cat-reader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #f5f5f6;
}
.venda-cat-reader[hidden] { display: none !important; }
.venda-cat-reader-bar {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
  padding: max(12px, env(safe-area-inset-top, 0px)) 16px 10px;
  background: linear-gradient(#ffffff, rgba(255,255,255,.96));
  border-bottom: 1px solid rgba(232,238,233,.06);
}
.venda-cat-reader-bar .reader-close {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-color: rgba(225, 6, 0,.45);
  background: rgba(225, 6, 0,.12);
  color: var(--gold, #d4a24c);
}
.venda-cat-exit-fab {
  display: none;
  position: absolute;
  left: 12px;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  z-index: 4;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(225, 6, 0,.5);
  background: rgba(15, 20, 18, 0.92);
  color: var(--gold, #d4a24c);
  font-weight: 700;
  font-size: 0.82rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
@media (max-width: 768px) {
  .venda-cat-exit-fab {
    display: inline-flex;
    align-items: center;
  }
  .venda-cat-pricebar {
    left: 12px;
    right: 12px;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    max-width: none;
  }
  .venda-cat-cart-fab {
    bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  }
}
/* Folhear igual ao reader de /catalogos — sem faixa preta extra */
.venda-cat-reader .reader-scroll {
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: y proximity;
  background: #070a09;
  padding: 0;
}
.venda-cat-reader .reader-pages {
  display: grid;
  gap: 10px;
  padding: 12px 12px 120px;
  max-width: 820px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}
@media (max-width: 720px) {
  .venda-cat-reader .reader-pages { padding: 8px 8px 110px; gap: 8px; }
}
.venda-cat-pricebar {
  position: absolute;
  left: 12px;
  right: 84px;
  bottom: 22px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  pointer-events: none;
  max-width: calc(100% - 96px);
}
.venda-cat-pricebar[hidden] { display: none !important; }
.venda-cat-pricechip {
  pointer-events: auto;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(18, 22, 20, 0.92);
  border: 1px solid rgba(225, 6, 0,.45);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  backdrop-filter: blur(8px);
  color: var(--ink);
}
.venda-cat-pricechip .ref {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}
.venda-cat-pricechip .preco {
  font-family: var(--display);
  font-weight: 650;
  font-size: 1.05rem;
  color: #e8c27a;
}
.venda-cat-pricechip.is-missing .preco { color: #ff8a8a; font-size: 0.82rem; }
.venda-cat-cart-fab {
  position: absolute;
  right: 16px;
  bottom: 22px;
  z-index: 4;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(145deg, var(--accent), #a80500);
  color: #1a1206;
  box-shadow: 0 12px 28px rgba(0,0,0,.4);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.venda-cat-cart-fab span {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #1a211d;
  color: #e8c27a;
  font-size: 0.7rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.venda-cat-cart-fab span[hidden] { display: none !important; }
.venda-cat-cart-sheet {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: end center;
}
.venda-cat-cart-sheet[hidden] { display: none !important; }
.venda-cat-cart-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4,7,6,.55);
}
.venda-cat-cart-panel {
  position: relative;
  width: min(520px, 100%);
  max-height: min(72vh, 640px);
  overflow: auto;
  background: var(--bg-2);
  border-radius: 18px 18px 0 0;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.venda-cat-cart-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.venda-cat-cart-row:last-child { border-bottom: 0; }
.venda-cat-cart-row strong { display: block; font-family: var(--mono); }
.venda-cat-cart-row .desc { color: var(--muted); font-size: 0.82rem; }
.venda-cat-cart-row .preco {
  color: var(--accent);
  font-weight: 700;
  font-family: var(--display);
}

.clientes-export-actions {
  gap: 8px;
}
@media (max-width: 720px) {
  .clientes-export-actions {
    width: 100%;
  }
  .clientes-export-actions .btn {
    flex: 1 1 auto;
  }
}

.vendas-download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
@media (max-width: 720px) {
  .vendas-download-actions {
    width: 100%;
  }
  .vendas-download-actions .btn {
    flex: 1 1 auto;
    min-height: 44px;
  }
}

.content {
  color: var(--ink);
}
.panel, .card, .table-wrap, .modal-card, .sheet, .drawer,
.venda-modal, .client-form-modal .modal-panel,
.empty-card, .rank-list, .chart-card, .rank-item,
.kpi, .filters, .table-panel, .clients-page-panel,
.venda-itens-panel, .venda-produto-panel, .venda-qty-panel,
.venda-cat-panel, .venda-cat-cart-panel, .venda-share-panel,
.clients-modal-panel, .client-form-panel,
.reader-sheet, .reader-hint, .venda-cat-reader,
.page-head, .clients-toolbar, .vendas-toolbar, .mobile-bar,
.venda-cat-reader-bar, .sidebar, .side-brand,
.pedidos-controls, .table-faturado {
  background: #ffffff !important;
  color: var(--ink);
  background-image: none !important;
}
.track-modal-panel {
  background: #f5f5f7 !important;
  color: var(--ink);
  background-image: none !important;
}
.track-chip,
.boleto-share-box {
  background: #ffffff !important;
  color: var(--ink);
}
input, select, textarea,
.filters input, .filters select,
.table-tools select, .date-campo select,
.date-trigger, .status-trigger, .pedidos-search input,
.client-name-btn,
.clients-search input, .vendas-vendor-filter select,
.venda-form-grid input, .venda-form-grid select, .venda-form-grid textarea,
.entry-input,
.btn:not(.primary):not(.danger),
.campo-pill:not(.on),
.month-chip:not(.on),
.status-chip:not(.on) {
  color: var(--ink) !important;
  background: #ffffff !important;
}
.btn.primary,
.month-chip.on,
.campo-pill.on,
.status-chip.on {
  background: var(--accent) !important;
  color: #ffffff !important;
  border-color: var(--accent) !important;
  box-shadow: 0 6px 16px rgba(225, 6, 0, 0.18) !important;
}
.clients-table-wrap,
.clients-table,
.clients-table th,
.clients-table td {
  background: #ffffff !important;
  color: var(--ink);
}
.clients-table th {
  color: var(--muted) !important;
  background: #ffffff !important;
}
.client-vendor-pill {
  background: #ffffff !important;
  color: var(--ink) !important;
  border: 1px solid var(--line) !important;
}
.btn.tiny.danger {
  background: #ffffff !important;
  color: var(--accent) !important;
  border-color: rgba(225, 6, 0, 0.35) !important;
}
/* Status com cor semântica (não vermelho genérico) */
.status-opt.on {
  background: var(--accent) !important;
  color: #ffffff !important;
  border-color: var(--accent) !important;
}
.status-opt[data-status="Incluída"].on {
  background: #f3e2c0 !important;
  color: #4a3208 !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
.status-opt[data-status="Faturada com NF"].on {
  background: #d8f0e0 !important;
  color: #124028 !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
.status-opt[data-status="Remessa"].on {
  background: #d9e6f5 !important;
  color: #123055 !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
.status-opt[data-status="Cancelada"].on {
  background: #f6ddd8 !important;
  color: #5c1e16 !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
.table-faturado {
  border: 1px solid var(--line) !important;
  box-shadow: 0 4px 14px rgba(20, 20, 20, 0.06) !important;
}
.table-faturado span { color: var(--muted) !important; }
.table-faturado strong { color: var(--ink) !important; }
.table th { color: var(--muted); background: #ffffff !important; }
.table td { color: var(--ink); }
.rank-item {
  background: #ffffff !important;
  border: 1px solid var(--line);
}
.nav-item {
  color: var(--ink);
  background: transparent !important;
}
.nav-item:hover,
.nav-item.active {
  background: rgba(225, 6, 0, 0.06) !important;
  box-shadow: none;
}
.nav-item.active em,
.nav-item.active small { color: var(--accent); }
.side-brand strong {
  font-family: var(--display);
  letter-spacing: 0.06em;
  color: var(--accent);
}
.mobile-bar {
  background: #ffffff !important;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 16px rgba(20, 20, 20, 0.04);
}
.mobile-brand strong { color: var(--accent); font-family: var(--display); letter-spacing: 0.06em; }
.hero h1 {
  font-family: var(--display);
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, #ff4a3d, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: none;
}
.kpi {
  background: #ffffff !important;
  box-shadow: 0 8px 22px rgba(20, 20, 20, 0.05);
}
.filters,
.pedidos-controls {
  background: #ffffff !important;
  border: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(20, 20, 20, 0.04);
}
.logout-btn {
  color: var(--accent) !important;
  border-color: rgba(225, 6, 0, 0.25) !important;
  background: #ffffff !important;
}
/* Catálogo / grade: sem faixa preta */
.reader-scroll,
.venda-cat-reader .reader-scroll,
.reader-page-slot,
.reader-page-slot img,
.reader-page-slot.is-loading::before,
.venda-grade-table.is-desktop .grade-corner,
.venda-grade-table.is-desktop .grade-cor-cell,
.venda-grade-table.is-desktop thead .grade-corner,
.venda-share-panel {
  background: #ffffff !important;
}
.kpi,
.empty-card,
.panel,
.table-wrap {
  background-color: #ffffff !important;
  background-image: none !important;
}

/* —— Comissões —— */
.comissao-year-label {
  display: grid;
  gap: 4px;
  align-content: center;
}
.comissao-year-label select {
  min-width: 96px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}
.comissao-months {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0 22px;
}
.comissao-month {
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 14px 14px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: inherit;
  cursor: pointer;
  font: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.comissao-month strong {
  font-size: 0.95rem;
}
.comissao-month .mono {
  color: var(--ink);
  font-weight: 600;
}
.comissao-month small {
  color: var(--muted);
  font-size: 0.72rem;
}
.comissao-month:hover {
  border-color: rgba(225, 6, 0, 0.35);
}
.comissao-month.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(225, 6, 0, 0.12);
}
.comissao-month.has-data .mono {
  color: var(--accent-2);
}
.comissao-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.comissao-detail-head h2 {
  margin: 4px 0 0;
  font-family: var(--display);
  font-size: clamp(1.6rem, 2.4vw, 2.1rem);
}
.comissao-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.comissao-badge {
  display: grid;
  gap: 2px;
  min-width: 92px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.comissao-badge em {
  font-style: normal;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.comissao-badge strong {
  font-family: var(--mono);
  font-size: 0.9rem;
}
.comissao-badge.is-ok {
  border-color: rgba(26, 127, 75, 0.35);
}
.comissao-badge.is-empty {
  opacity: 0.7;
}
.comissao-badge.is-total {
  border-color: rgba(225, 6, 0, 0.4);
  background: linear-gradient(180deg, #fff, #fff5f4);
}
.comissao-badge.is-total strong {
  color: var(--accent);
}
.comissao-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.comissao-tab {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 9px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
}
.comissao-tab.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.comissao-empresa-total {
  display: grid;
  gap: 2px;
  text-align: right;
}
.comissao-empresa-total span {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.comissao-empresa-total strong {
  font-family: var(--mono);
  font-size: 1.05rem;
  color: var(--accent-2);
}
@media (max-width: 1100px) {
  .comissao-months {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  .comissao-months {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .comissao-tabs {
    overflow-x: auto;
  }
}

/* —— Sortable headers —— */
.th-sort {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 650;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-align: left;
}
.th-sort::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  opacity: 0.35;
  border-top: 5px solid currentColor;
}
.th-sort.is-asc::after {
  opacity: 1;
  border-top: 0;
  border-bottom: 5px solid currentColor;
}
.th-sort.is-desc::after {
  opacity: 1;
}

/* —— Vendas month filter —— */
.vendas-month-filter {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.vendas-month-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  min-width: 280px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(20, 20, 20, 0.12);
}
.vendas-month-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.vendas-month-grid button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px 8px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.vendas-month-grid button.is-on {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 2px rgba(225, 6, 0, 0.12);
}
#btnVendasMeses.is-active {
  border-color: var(--accent);
  color: var(--accent);
}

/* —— Comissões divergência —— */
.comissao-tabs-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 12px;
}
.comissao-tabs-row .comissao-tabs {
  margin-bottom: 0;
}
.comissao-divergencia {
  margin: 0;
  margin-left: auto;
  max-width: min(420px, 100%);
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(225, 6, 0, 0.28);
  background: #fff5f4;
  color: var(--accent-2);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
}
@media (max-width: 700px) {
  .vendas-month-pop { right: auto; left: 0; }
  .comissao-divergencia { margin-left: 0; width: 100%; }
}

/* —— Campanhas —— */
.campanha-compose {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}
.campanha-msg-label {
  display: grid;
  gap: 6px;
}
.campanha-msg-label textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  line-height: 1.45;
  background: #fff;
}
.campanha-msg-label textarea:focus {
  outline: none;
  border-color: rgba(225, 6, 0, 0.45);
  box-shadow: 0 0 0 3px rgba(225, 6, 0, 0.08);
}
.campanha-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.campanha-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}
.campanha-table .campanha-check-col {
  width: 42px;
  text-align: center;
}
.campanha-inline {
  width: 100%;
  min-width: 120px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
  font: inherit;
  background: #fff;
}
.campanha-inline:focus {
  outline: none;
  border-color: rgba(225, 6, 0, 0.45);
}
.campanha-list-panel {
  display: grid;
  gap: 0;
}
.campanha-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
}
.campanha-city-picker {
  position: relative;
  flex: 1 1 280px;
  min-width: 220px;
  max-width: 420px;
  display: grid;
  gap: 8px;
}
.campanha-city-search-wrap {
  position: relative;
  display: block;
  z-index: 2;
}
.campanha-city-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  display: grid;
  place-items: center;
}
.campanha-city-search {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px 0 36px;
  font: inherit;
  color: var(--ink);
  background: rgba(20, 20, 20, 0.03);
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.campanha-city-search::placeholder {
  color: var(--muted);
}
.campanha-city-search:hover {
  background: rgba(20, 20, 20, 0.045);
}
.campanha-city-search:focus {
  outline: none;
  background: #fff;
  border-color: rgba(225, 6, 0, 0.4);
  box-shadow: 0 0 0 3px rgba(225, 6, 0, 0.08);
}
.campanha-city-menu {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: 280px;
  overflow: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(20, 20, 20, 0.14), 0 2px 8px rgba(20, 20, 20, 0.06);
}
.campanha-city-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.campanha-city-option:hover,
.campanha-city-option.is-active {
  background: rgba(20, 20, 20, 0.05);
}
.campanha-city-option.is-on {
  background: rgba(225, 6, 0, 0.07);
}
.campanha-city-option .campanha-cidade-n {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
}
.campanha-city-option-empty {
  padding: 14px 12px;
  color: var(--muted);
  font-size: 0.88rem;
}
.campanha-city-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.campanha-city-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  height: 28px;
  padding: 0 4px 0 10px;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.06);
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1;
}
.campanha-city-tag span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.campanha-city-tag button {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.campanha-city-tag button:hover {
  background: rgba(20, 20, 20, 0.08);
  color: var(--ink);
}
.campanha-city-clear {
  margin-top: 2px;
  height: 40px;
}
.campanha-cel-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  margin-top: 2px;
  height: 40px;
  padding: 0 2px;
  color: var(--ink);
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.campanha-cel-filter input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #e10600;
  cursor: pointer;
}

/* —— Agendamento —— */
.ag-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  margin: 0 0 14px;
  border-radius: 14px;
  background: rgba(20, 20, 20, 0.05);
  border: 1px solid rgba(20, 20, 20, 0.06);
}
.ag-seg-btn {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--muted, #6e6e73);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 11px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.ag-seg-btn.is-on {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(20, 20, 20, 0.08), 0 4px 12px rgba(20, 20, 20, 0.04);
}
.ag-toolbar {
  align-items: flex-start;
}
.ag-search {
  margin-left: auto;
  margin-top: 2px;
  height: 40px;
  min-width: 180px;
  max-width: 260px;
  flex: 1 1 180px;
  border-radius: 12px;
  border: 1px solid rgba(20, 20, 20, 0.1);
  background: #fff;
  padding: 0 12px;
  font: inherit;
  font-size: 0.9rem;
}
.ag-table tbody tr {
  cursor: pointer;
}
.ag-table tbody tr:hover td {
  background: rgba(225, 6, 0, 0.03);
}
.ag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.ag-pill-carteira {
  background: rgba(20, 20, 20, 0.06);
  color: #6e6e73;
}
.ag-pill-agendado {
  background: rgba(0, 122, 255, 0.12);
  color: #0071e3;
}
.ag-pill-atendido {
  background: rgba(52, 199, 89, 0.14);
  color: #1f8f3d;
}
.ag-pill-nao_quer {
  background: rgba(142, 142, 147, 0.18);
  color: #636366;
}
.ag-when {
  font-variant-numeric: tabular-nums;
  font-size: 0.86rem;
  color: var(--muted, #6e6e73);
  white-space: nowrap;
}
.ag-rotas-head {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 18px;
}
.ag-rotas-title {
  margin: 0 0 4px;
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 600;
}
.ag-rotas-lede {
  margin: 0;
  color: var(--muted, #6e6e73);
  font-size: 0.92rem;
  max-width: 42ch;
}
.ag-rota-create {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.ag-rota-create input {
  height: 42px;
  min-width: 200px;
  border-radius: 12px;
  border: 1px solid rgba(20, 20, 20, 0.1);
  background: #fff;
  padding: 0 12px;
  font: inherit;
}
.ag-rotas-list {
  display: grid;
  gap: 12px;
}
.ag-rota-card {
  border-radius: 18px;
  border: 1px solid rgba(20, 20, 20, 0.08);
  background: #fff;
  overflow: hidden;
}
.ag-rota-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
}
.ag-rota-card-head h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-family: var(--display);
}
.ag-rota-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.ag-rota-count {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.05);
  color: #6e6e73;
}
.ag-rota-tools {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.ag-rota-cities {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 18px 12px;
}
.ag-rota-city {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px 5px 10px;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.05);
  font-size: 0.82rem;
  font-weight: 500;
}
.ag-rota-city button {
  border: 0;
  background: transparent;
  color: #8e8e93;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
}
.ag-rota-add {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 18px 14px;
  align-items: center;
}
.ag-rota-add input {
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(20, 20, 20, 0.1);
  padding: 0 10px;
  font: inherit;
  font-size: 0.86rem;
  min-width: 140px;
}
.ag-rota-add input.ag-uf {
  width: 56px;
  min-width: 56px;
  text-transform: uppercase;
}
.ag-rota-city-select {
  flex: 1 1 220px;
  min-width: 180px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(20, 20, 20, 0.1);
  padding: 0 10px;
  font: inherit;
  font-size: 0.86rem;
  background: #fff;
}
.ag-addr {
  max-width: 280px;
  font-size: 0.84rem;
  color: #6e6e73;
  white-space: normal;
}
.ag-rota-clients {
  border-top: 1px solid rgba(20, 20, 20, 0.06);
  background: #fafafa;
  max-height: 420px;
  overflow: auto;
}
.ag-rota-client {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(20, 20, 20, 0.05);
  cursor: pointer;
  background: transparent;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
}
.ag-rota-client:hover {
  background: rgba(225, 6, 0, 0.04);
}
.ag-rota-client strong {
  display: block;
  font-size: 0.9rem;
}
.ag-rota-client small {
  color: #8e8e93;
  font-size: 0.78rem;
}
.ag-rota-empty {
  padding: 16px 18px;
  color: #8e8e93;
  font-size: 0.88rem;
}
.ag-sheet .track-modal-panel {
  width: min(520px, 100%);
}
.ag-sheet-panel {
  display: flex;
  flex-direction: column;
  max-height: min(92vh, 860px);
}
.ag-sheet-body {
  padding: 8px 20px 24px;
  overflow: auto;
}
.ag-sheet-meta {
  margin: 4px 0 0;
  color: #6e6e73;
  font-size: 0.88rem;
}
.ag-status-row {
  margin-bottom: 14px;
}
.ag-actions {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}
.ag-action {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(20, 20, 20, 0.08);
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  font: inherit;
  transition: border-color .15s ease, background .15s ease, transform .12s ease;
}
.ag-action:hover {
  border-color: rgba(20, 20, 20, 0.16);
  background: #fbfbfc;
}
.ag-action strong {
  font-size: 0.98rem;
}
.ag-action span {
  color: #8e8e93;
  font-size: 0.82rem;
}
.ag-action-ok strong { color: #1f8f3d; }
.ag-action-plan strong { color: #0071e3; }
.ag-action-no strong { color: #636366; }
.ag-action.is-current {
  border-color: rgba(225, 6, 0, 0.35);
  background: rgba(225, 6, 0, 0.04);
}
.ag-schedule-box {
  margin: 0 0 14px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(0, 122, 255, 0.06);
  border: 1px solid rgba(0, 122, 255, 0.12);
}
.ag-schedule-box input[type="datetime-local"] {
  width: 100%;
  height: 42px;
  margin: 6px 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(20, 20, 20, 0.1);
  padding: 0 12px;
  font: inherit;
  background: #fff;
}
.ag-schedule-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.ag-nota-label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}
.ag-nota-label textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(20, 20, 20, 0.1);
  padding: 10px 12px;
  font: inherit;
  resize: vertical;
  min-height: 64px;
  background: #fff;
}
.ag-clear-btn {
  width: 100%;
  margin-bottom: 16px;
}
.ag-route-hint {
  margin: 0 0 16px;
  padding: 14px;
  border-radius: 16px;
  background: #f5f5f7;
  border: 1px solid rgba(20, 20, 20, 0.06);
}
.ag-route-hint header {
  margin-bottom: 10px;
}
.ag-route-hint h3 {
  margin: 0;
  font-size: 1rem;
  font-family: var(--display);
}
.ag-route-hint-list {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
}
.ag-route-hint-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 0;
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  font: inherit;
  box-shadow: 0 1px 2px rgba(20, 20, 20, 0.04);
}
.ag-route-hint-item strong {
  display: block;
  font-size: 0.86rem;
}
.ag-route-hint-item small {
  color: #8e8e93;
  font-size: 0.74rem;
}
.ag-hist-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.ag-hist-list li {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(20, 20, 20, 0.03);
  font-size: 0.84rem;
}
.ag-hist-list time {
  display: block;
  color: #8e8e93;
  font-size: 0.74rem;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 720px) {
  .ag-search {
    margin-left: 0;
    max-width: none;
    width: 100%;
    flex: 1 1 100%;
  }
  .ag-seg-btn {
    flex: 1 1 calc(50% - 4px);
    font-size: 0.8rem;
    padding: 9px 8px;
  }
  .ag-sheet {
    padding: 0;
    place-items: end center;
  }
  .ag-sheet .track-modal-panel {
    width: 100%;
    max-height: 92vh;
    border-radius: 22px 22px 0 0;
  }
}

/* Agendamento · rotas WA / lista */
.ag-rota-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 0 18px 14px;
}
.ag-rota-add-row .ag-rota-add {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  flex: 1 1 240px;
  padding: 0;
}
.ag-rota-wa-btn {
  white-space: nowrap;
}
.ag-rota-body {
  border-top: 1px solid rgba(20, 20, 20, 0.06);
  background: #fafafa;
}
.ag-rota-body-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(20, 20, 20, 0.05);
  font-size: 0.86rem;
}
.ag-rota-check-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.ag-rota-client {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(20, 20, 20, 0.05);
  width: 100%;
  box-sizing: border-box;
}
.ag-rota-check {
  display: grid;
  place-items: center;
  padding-top: 4px;
}
.ag-rota-client-main {
  min-width: 0;
  display: grid;
  gap: 8px;
}
.ag-rota-client-name {
  display: grid;
  gap: 2px;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.ag-rota-client-name:hover strong {
  color: var(--accent, #e10600);
}
.ag-rota-client-name small {
  color: #8e8e93;
  font-size: 0.78rem;
}
.ag-rota-client-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ag-rota-client-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  padding-top: 2px;
}
.ag-wa-ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(37, 211, 102, 0.35);
  background: rgba(37, 211, 102, 0.12);
  color: #128c7e;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.ag-wa-ico:hover {
  background: rgba(37, 211, 102, 0.22);
}
.ag-wa-body {
  padding: 8px 20px 22px;
}
.ag-wa-hint {
  margin: 0 0 14px;
  color: #8e8e93;
  font-size: 0.78rem;
}
.ag-wa-job {
  margin: 0 0 12px;
  min-height: 1.2em;
  color: #6e6e73;
}
.ag-wa-panel {
  width: min(520px, 100%);
}
@media (max-width: 720px) {
  .ag-rota-client-fields {
    grid-template-columns: 1fr;
  }
  .ag-rota-client {
    grid-template-columns: 24px 1fr;
  }
  .ag-rota-client-side {
    grid-column: 2;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
  }
}

/* Retornos WhatsApp — badge no menu */
.side-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.side-top .side-brand { flex: 1; min-width: 0; }
.wa-retornos-btn {
  position: relative;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(37, 211, 102, 0.35);
  background: rgba(37, 211, 102, 0.12);
  color: #128c7e;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  animation: waRetornoPulse 1.4s ease-in-out infinite;
}
.wa-retornos-btn[hidden] { display: none !important; }
.wa-retornos-btn:hover {
  background: rgba(37, 211, 102, 0.22);
}
.wa-retornos-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e10600;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(225, 6, 0, 0.35);
}
@keyframes waRetornoPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.35); }
  50% { transform: scale(1.06); box-shadow: 0 0 0 8px rgba(37, 211, 102, 0); }
}
.mobile-bar .wa-retornos-btn {
  margin-left: auto;
  margin-right: 8px;
}
.wa-retornos-panel {
  width: min(560px, 100%);
  max-height: min(88vh, 760px);
  display: flex;
  flex-direction: column;
}
.wa-retornos-body {
  padding: 8px 16px 16px;
  overflow: auto;
  flex: 1;
}
.wa-retorno-item {
  border: 1px solid rgba(20, 20, 20, 0.08);
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.wa-retorno-item.is-novo {
  border-color: rgba(37, 211, 102, 0.4);
  background: rgba(37, 211, 102, 0.06);
}
.wa-retorno-item strong {
  display: block;
  font-size: 0.98rem;
}
.wa-retorno-item .wa-retorno-meta {
  color: #8e8e93;
  font-size: 0.8rem;
  margin-top: 2px;
}
.wa-retorno-item .wa-retorno-msg {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(20, 20, 20, 0.04);
  font-size: 0.92rem;
  white-space: pre-wrap;
}
.wa-retorno-empty {
  text-align: center;
  color: #8e8e93;
  padding: 28px 12px;
}
