@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@500;600;700;800;900&display=swap');

/* ======================================================================
   PDV iFody — tablet portrait first
   Leve: sem backdrop-filter, sem grandes box-shadows, sem radial-gradients
   ====================================================================== */

:root {
  color-scheme: dark;
  --bg:        #0F0A1A;
  --bg-2:      #15102A;
  --surface:   #1C1428;
  --surface-2: #221A30;
  --surface-3: #2A1F3D;
  --line:      #2E2240;
  --line-2:    #3B2A55;

  --text:    #FFFFFF;
  --text-2:  #C9BFD8;
  --text-3:  #8B7DA3;
  --muted:   #8B7DA3;

  --pink:        #FF3D8A;
  --pink-light:  #FF8EB8;
  --pink-strong: #E22275;
  --violet:      #8B3CFF;
  --orange:      #FF8E53;
  --gold:        #FFD485;

  --success:      #4CD964;
  --success-soft: rgba(76, 217, 100, 0.12);
  --success-line: rgba(76, 217, 100, 0.30);
  --danger:       #FF5C7A;
  --danger-soft:  rgba(255, 92, 122, 0.12);
  --danger-line:  rgba(255, 92, 122, 0.32);
  --warning:      #FFB930;
  --warning-soft: rgba(255, 185, 48, 0.12);

  --r-sm: 10px;
  --r:    14px;
  --r-lg: 20px;

  --header-h: 48px;
  --search-h: 50px;
  --cartbar-h: 72px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --font: 'Outfit', system-ui, Segoe UI, Roboto, Arial, sans-serif;
}

/* ---------- reset ---------- */
* { box-sizing: border-box; }
html { -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(255, 61, 138, 0.55);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ---------- header ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  gap: 10px;
  height: var(--header-h);
  padding: 0 10px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
}

.hb {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: transparent;
  border: 0;
}
.hb span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 2.5px 0;
  background: var(--text);
  border-radius: 2px;
}

.brand {
  display: grid;
  place-items: center;
  height: 100%;
}
.brand img {
  height: 26px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
}

.cart-icon {
  position: relative;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: transparent;
  border: 0;
  color: var(--text);
}
.cart-icon svg { width: 22px; height: 22px; }
.cart-icon__img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(255, 61, 138, 0.35));
  pointer-events: none;
}
.cart-icon--off { opacity: 0.3; }
.cart-icon--off .cart-icon__img { filter: grayscale(0.3); }
.cart-icon__badge {
  position: absolute;
  top: -2px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--pink);
  color: #fff;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---------- searchbar (sticky logo abaixo do header) ---------- */
.searchbar {
  position: sticky;
  top: var(--header-h);
  z-index: 25;
  display: grid;
  grid-template-columns: 1fr 130px auto;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
}
.searchbar__field {
  position: relative;
  display: flex;
  align-items: center;
  height: var(--search-h);
  padding-left: 38px;
  padding-right: 40px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line);
}
.searchbar__field svg {
  position: absolute;
  left: 11px;
  color: var(--text-3);
}
.searchbar__field input {
  border: 0;
  background: transparent;
  width: 100%;
  height: 100%;
  padding: 0;
  color: var(--text);
  font-size: 16px;
}
.searchbar__field input::placeholder { color: var(--text-3); }
.searchbar__clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-2);
  border: 0;
  font-size: 13px;
}
.searchbar__clear:active { background: var(--surface-3); color: var(--text); }
.searchbar__submit {
  min-height: var(--search-h);
  padding: 0 16px;
  white-space: nowrap;
  animation: fadeIn .15s ease-out;
}
.searchbar__submit[hidden],
.searchbar__clear[hidden] { display: none !important; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-2px); } to { opacity: 1; transform: none; } }
.searchbar select {
  height: var(--search-h);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  padding: 0 32px 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

/* ---------- drawer ---------- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
}
.drawer__backdrop {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, 0.55);
  border: 0;
}
.drawer__panel {
  position: relative;
  z-index: 2;
  width: 86%;
  max-width: 340px;
  height: 100%;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 16px 16px calc(20px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}
.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.drawer__head strong {
  font-size: 18px;
  font-weight: 800;
  color: var(--pink-light);
}
.drawer__close {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 18px;
}
.drawer__section { display: grid; gap: 6px; }
.drawer__title {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.drawer__empty {
  margin: 0;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: var(--r);
  color: var(--text-3);
  font-size: 14px;
}
.drawer__link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 14px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 700;
}
.drawer__link span { flex: 1; }
.drawer__link svg { color: var(--pink-light); }

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-3);
  font-size: 12px;
  font-weight: 800;
}
.badge--warn { background: var(--warning-soft); color: var(--warning); }

/* ---------- shell ---------- */
.shell {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 12px calc(14px + var(--cartbar-h) + var(--safe-bottom));
}

/* ---------- sync banner ---------- */
.sync-banner {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.sync-banner strong { font-weight: 800; }
.sync-banner--ok   { background: var(--success-soft); color: var(--success); border-bottom-color: var(--success-line); }
.sync-banner--erro { background: var(--danger-soft);  color: var(--danger);  border-bottom-color: var(--danger-line); }

/* ---------- tipografia ---------- */
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: 24px; font-weight: 800; letter-spacing: -0.01em; }
h2 { margin-bottom: 8px; font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.muted, dt { color: var(--muted); }
.eyebrow {
  display: inline-block;
  margin: 0 0 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 61, 138, 0.12);
  color: var(--pink-light);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.backlink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 8px 16px 8px 12px;
  min-height: 40px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  color: var(--pink-light);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.01em;
  transition: background .15s, border-color .15s, color .15s;
}
.backlink::before {
  content: "‹";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--pink);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  font-weight: 900;
  padding-bottom: 2px;
}
.backlink:active {
  background: rgba(255, 61, 138, 0.10);
  border-color: var(--pink);
  color: #fff;
}
.backlink:active::before { background: var(--pink-strong); }
/* Variantes ja podem reutilizar essa pílula */
.page-head { margin-bottom: 14px; }
.page-head p { margin: 0; font-size: 14px; color: var(--text-2); }
.page-head strong { color: var(--text); }

/* ---------- botões ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--r);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.005em;
}
.button:active { background: var(--surface-3); }
.button.primary { background: var(--pink); color: #fff; font-weight: 800; }
.button.primary:active { background: var(--pink-strong); }
.button.ghost { background: transparent; border-color: var(--line-2); color: var(--text); }
.button.ghost:active { background: rgba(255, 61, 138, 0.1); }
.button.subtle { background: var(--surface-2); border-color: var(--line); color: var(--text-2); }
.button.subtle:active { background: var(--surface-3); color: var(--text); }
.button.danger { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.button.danger:active { background: rgba(255, 92, 122, 0.25); }
.button.compact { min-height: 40px; padding: 0 12px; font-size: 13px; border-radius: var(--r-sm); }
.button.large { min-height: 56px; font-size: 16px; }
.button.block { width: 100%; }
.button[disabled], .button.disabled {
  opacity: 0.45;
  pointer-events: none;
}
.button.is-locked::after {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: 8px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* ---------- formulários ---------- */
.field, label.option { display: grid; gap: 6px; }
.field > span {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
}
input, select, textarea {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-2);
  color: var(--text);
  padding: 12px 14px;
  font-size: 16px;
  font-weight: 500;
}
input::placeholder { color: var(--text-3); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--pink);
  background: var(--surface-3);
}
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 38px;
}

/* ---------- lobby ---------- */
.lobby-body .shell { padding-top: 32px; }
.lobby {
  max-width: 460px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
  padding: 24px 4px;
  text-align: center;
}
.lobby__logo { height: 80px; width: auto; margin: 0 auto 6px; object-fit: contain; }
.lobby__icon {
  display: block;
  margin: 0 auto 4px;
  filter: drop-shadow(0 8px 18px rgba(255, 61, 138, 0.25));
}
.lobby h1 { font-size: 28px; margin: 6px 0 0; }
.lobby__sub { color: var(--text-2); margin: 0 0 8px; }
.lobby__form { display: grid; gap: 12px; text-align: left; margin-top: 8px; }
.lobby__settings {
  margin-top: 12px;
  display: inline-block;
  color: var(--text-3);
  font-weight: 700;
  font-size: 14px;
  text-decoration: underline;
}

/* ---------- catálogo ---------- */
.catalog {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  min-width: 0;
}
.card__media {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  padding: 8px;
  display: block;
}
.card__noimg {
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.card__body { padding: 10px 12px 6px; display: grid; gap: 2px; }
.card__name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 2px;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__sku {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.04em;
}
.card__price {
  margin: 6px 0 0;
  font-size: 18px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.01em;
}
.card__pix {
  margin: 2px 0 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
  color: var(--success);
  font-weight: 700;
}
.card__pix strong { font-size: 15px; font-weight: 900; }
.card__parc {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--text-3);
  font-weight: 600;
}
.card__actions {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px;
  padding: 8px 10px 10px;
  min-width: 0;
}
/* Permitir shrink dos filhos do grid — sem isso, button.primary com ícone
 * estoura o card em telas estreitas e o overflow:hidden corta. */
.card__actions > * { min-width: 0; }
.card__actions .button {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* No mobile, empilhar os dois botoes em 1 coluna pra dar respiro. */
@media (max-width: 480px) {
  .card__actions {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  /* Quando "Adicionar" esta dentro de <form>, o form vira o filho do grid
   * (largura total) mas o button fica content-width e alinha a esquerda.
   * Forcamos form + button a ocupar 100% pra alinhar com o link "Detalhes". */
  .card__actions form { display: block; width: 100%; }
  .card__actions .button.compact {
    width: 100%;
    padding: 0 10px;
    font-size: 12px;
    min-height: 36px;
  }
}

.loadmore { margin: 16px 0 4px; }
.loadmore__end {
  margin: 16px 0 4px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}

.empty {
  margin: 28px auto;
  max-width: 380px;
  text-align: center;
  display: grid;
  gap: 10px;
  padding: 28px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  justify-items: center;
}
.empty p { color: var(--text-3); margin: 0; }
.empty__icon {
  filter: drop-shadow(0 8px 16px rgba(255, 61, 138, 0.22));
  margin-bottom: 4px;
}

/* Icones 3D dentro de botoes */
.btn-icon-3d {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* ---------- detalhe ---------- */
.backlink-big {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 18px;
  margin-bottom: 12px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-weight: 800;
  font-size: 16px;
}
.backlink-big span { font-size: 22px; line-height: 1; color: var(--pink-light); }
.backlink-big:active { background: var(--surface-2); }

.detail { display: grid; gap: 14px; min-width: 0; }
.detail__info { min-width: 0; }

.gallery { display: grid; gap: 8px; }
.gallery__main {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 14px;
}
.gallery__thumbs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 64px;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0;
}
.gallery__thumb {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  padding: 0;
  overflow: hidden;
}
.gallery__thumb img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.gallery__thumb.is-active { border-color: var(--pink); }

.description {
  margin-top: 14px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  min-width: 0;
}
.description h2 { font-size: 15px; margin-bottom: 8px; }
.description__body {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.description__body * { max-width: 100% !important; }
.description__body p { margin: 0 0 8px; }
.description__body img,
.description__body video,
.description__body iframe {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 6px 0;
}
.description__body table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}
.description__body pre { white-space: pre-wrap; overflow-x: auto; }
.description__body a { color: var(--pink-light); text-decoration: underline; word-break: break-all; }
.description__body ul, .description__body ol { padding-left: 18px; margin: 0 0 8px; }
.detail__info { display: grid; gap: 8px; }
.detail__info h1 { font-size: 22px; }
.detail__price { margin: 4px 0 0; font-size: 28px; font-weight: 900; color: var(--text); letter-spacing: -0.02em; }
.detail__pix {
  margin: 0;
  display: flex;
  gap: 8px;
  align-items: baseline;
  color: var(--success);
  font-weight: 700;
}
.detail__pix strong { font-size: 20px; font-weight: 900; }
.detail__parc { margin: 0; color: var(--text-3); font-size: 13px; font-weight: 600; }
.stock {
  width: fit-content;
  margin: 6px 0 0;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid var(--success-line);
  font-size: 12px;
  font-weight: 800;
}
.detail__form { display: grid; gap: 10px; margin-top: 14px; }
.detail__form .qty input { max-width: 160px; }

/* ---------- carrinho ---------- */
.lines { display: grid; gap: 10px; margin-bottom: 16px; }
.lineitem {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.lineitem__media {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.lineitem__media img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.lineitem__body { min-width: 0; }
.lineitem__body h2 {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 2px;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.lineitem__body p { margin: 0; font-size: 12px; }
.lineitem__qty { color: var(--text-3); font-weight: 700; }
.lineitem__total { display: grid; gap: 6px; justify-items: end; }
.lineitem__total strong { font-size: 16px; color: var(--pink-light); font-weight: 900; }

.qty-stepper {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  margin-top: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.qty-stepper form { display: inline-flex; margin: 0; }
.qty-stepper__btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  touch-action: manipulation;
}
.qty-stepper__btn:active { background: var(--surface-3, rgba(255, 255, 255, .06)); }
.qty-stepper__input {
  width: 44px;
  height: 34px;
  text-align: center;
  background: transparent;
  border: none;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  padding: 0;
  -moz-appearance: textfield;
}
.qty-stepper__input::-webkit-outer-spin-button,
.qty-stepper__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.qty-stepper__input:focus { outline: 2px solid var(--pink-light); outline-offset: -2px; }
.qty-stepper__form { display: inline-flex; }

.summary {
  display: grid;
  gap: 10px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.summary__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 15px;
  font-weight: 700;
}
.summary__row strong { font-size: 17px; font-weight: 900; }
.summary__row--pix {
  margin-top: 4px;
  padding: 12px 14px;
  border-radius: var(--r);
  background: var(--success-soft);
  border: 1px solid var(--success-line);
  color: var(--success);
}
.summary__row--total {
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--line-2);
}
.summary__row--total span { font-weight: 800; }
.summary__row--total strong { font-size: 22px; color: var(--pink-light); font-weight: 900; }

.troco {
  margin-top: 10px;
  padding: 12px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px dashed var(--line-2);
}

.field-label {
  margin: 6px 0 8px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
}

.parc-pick {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.parc-pick__btn {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
}
.parc-pick__btn:active { background: var(--surface-3); }
.parc-pick__btn.is-active {
  border-color: var(--pink);
  background: var(--pink);
  color: #fff;
}
.parc-pick__qty {
  font-size: 18px;
  font-weight: 900;
  text-align: center;
  letter-spacing: -0.02em;
}
.parc-pick__val {
  font-size: 15px;
  font-weight: 700;
}
.parc-pick__tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: inherit;
  white-space: nowrap;
}
.parc-pick__btn:not(.is-active) .parc-pick__tag {
  background: var(--surface-3);
  color: var(--text-3);
}

@media (min-width: 600px) {
  .parc-pick { grid-template-columns: repeat(3, 1fr); }
}

.link-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 0;
  background: none;
  border: 0;
  color: var(--pink-light);
  font-weight: 700;
  font-size: 14px;
}
.link-button:active { color: var(--pink); }

.split-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.split-totals { display: grid; }
.split-totals .muted { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.split-totals strong { font-size: 22px; font-weight: 900; color: var(--text); }

.split-footer { margin-top: 8px; display: grid; gap: 8px; }
.split-restante {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--r);
  background: var(--warning-soft);
  border: 1px solid rgba(255, 185, 48, 0.32);
  color: var(--warning);
  font-weight: 700;
}
.split-restante strong { font-size: 18px; font-weight: 900; }
.split-restante.is-ok {
  background: var(--success-soft);
  border-color: var(--success-line);
  color: var(--success);
}

.pagto-row__fill {
  width: 100%;
  margin-top: 4px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 185, 48, 0.12);
  border: 1px dashed rgba(255, 185, 48, 0.4);
  color: var(--warning);
  font-weight: 800;
  font-size: 13px;
}
.pagto-row__fill:active { background: rgba(255, 185, 48, 0.25); }

/* ---------- WhatsApp module ---------- */
.button--wa {
  background: #25D366;
  color: #053822;
  font-weight: 800;
  border-color: transparent;
}
.button--wa:active { background: #128C7E; color: #fff; }
.button--wa svg { stroke-width: 2.4; }

.card__actions--wa { grid-template-columns: 1fr 1fr; }
@media (max-width: 480px) {
  /* No celular, mantem empilhado igual aos demais cards. */
  .card__actions--wa { grid-template-columns: 1fr; }
}
.wa-taxa {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: end;
  margin: 12px 0;
  padding: 12px;
  background: var(--surface-2);
  border: 1px dashed var(--line-2);
  border-radius: var(--r);
}
.wa-taxa button { grid-column: 1 / -1; }

.pagto-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  margin-bottom: 12px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.pagto-tab {
  min-height: 44px;
  border-radius: 10px;
  background: transparent;
  border: 0;
  color: var(--text-2);
  font-weight: 700;
  font-size: 14px;
}
.pagto-tab:active { background: var(--surface-3); }
.pagto-tab.is-active {
  background: var(--pink);
  color: #fff;
  font-weight: 800;
}

.wa-pagto { display: grid; gap: 10px; }
.wa-pagto[hidden] { display: none; }
.wa-pagto__opt {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-2);
  cursor: pointer;
}
.wa-pagto__opt input { width: 22px; height: 22px; margin-top: 2px; flex: 0 0 auto; }
.wa-pagto__opt strong { display: block; font-weight: 800; }
.wa-pagto__opt small { display: block; color: var(--text-3); font-size: 13px; margin-top: 2px; }
.wa-pagto__opt:has(input:checked) {
  border-color: var(--pink);
  background: rgba(255, 61, 138, 0.08);
}

.pedidos__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pedido__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
}
.pedido__meta { margin: 4px 0 0; font-size: 12px; color: var(--text-3); }
.pedido__status {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.pedido__status--rascunho            { background: var(--surface-3); color: var(--text-3); }
.pedido__status--aguardando_pagamento{ background: var(--warning-soft); color: var(--warning); }
.pedido__status--pago                { background: var(--success-soft); color: var(--success); }
.pedido__status--enviado_woo         { background: var(--success-soft); color: var(--success); }
.pedido__status--cancelado           { background: var(--danger-soft); color: var(--danger); }
.pedido__status--expirado            { background: var(--surface-3); color: var(--text-3); }

.pedido__itens { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pedido__itens li {
  padding: 8px 10px;
  background: var(--surface-2);
  border-radius: 10px;
  font-size: 13px;
}

.pagto-list { display: grid; gap: 10px; margin: 4px 0 10px; }
.pagto-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.pagto-row__head {
  display: grid;
  grid-template-columns: 1fr 1fr 40px;
  gap: 8px;
  align-items: end;
}
.pagto-row__remove {
  width: 40px;
  height: 52px;
  border-radius: var(--r-sm);
  background: var(--danger-soft);
  border: 1px solid var(--danger-line);
  color: var(--danger);
  font-size: 16px;
  font-weight: 800;
}
.pagto-row__extra { display: grid; gap: 6px; }
.pagto-row__final {
  margin: 0;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
  color: var(--text-3);
  font-weight: 700;
}
.pagto-row__final strong { color: var(--pink-light); font-size: 15px; font-weight: 900; }
.troco__out {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-2);
}
.troco__out strong { font-size: 18px; font-weight: 900; }

.summary__label {
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.parc-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.parc-grid__chip {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
}

/* ---------- checkout ---------- */
.checkout { display: grid; gap: 14px; }
.panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  margin-bottom: 14px;
}
/* Quando painel esta dentro de grid com gap (dashboard/comissoes), o gap ja
 * cuida do espaco — zera margin pra evitar gap duplicado. */
.dash-grid > .panel { margin-bottom: 0; }
.options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.option { position: relative; min-height: 52px; }
.option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
}
.option span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}
.option input:checked + span {
  border-color: var(--pink);
  background: var(--pink);
  color: #fff;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-2__full { grid-column: 1 / -1; }
.hint { margin: 0; color: var(--text-3); font-size: 12px; font-weight: 600; }
.checkout__submit { margin-top: 4px; }

/* ---------- configurações ---------- */
.sync-actions { display: grid; gap: 8px; }

.pwa-state {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin: 6px 0 12px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-2);
}
.pwa-state__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--text-3);
}
.pwa-state__dot--ok      { background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.pwa-state__dot--pronto  { background: var(--pink);    box-shadow: 0 0 0 4px rgba(255, 61, 138, 0.18); }
.pwa-state__dot--manual  { background: var(--warning); box-shadow: 0 0 0 4px var(--warning-soft); }

.pwa-help {
  margin-top: 10px;
  padding: 0;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.pwa-help > summary {
  list-style: none;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pwa-help > summary::-webkit-details-marker { display: none; }
.pwa-help > summary::after {
  content: "▾";
  color: var(--text-3);
}
.pwa-help[open] > summary::after { transform: rotate(180deg); }
.pwa-help__body {
  padding: 0 14px 14px;
  display: grid;
  gap: 8px;
  color: var(--text-3);
  font-size: 13px;
}
.pwa-help__body p { margin: 0; }
.pwa-help__body strong { color: var(--text); }
.pwa-help__body code {
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(0,0,0,0.35);
  font-size: 12px;
}

/* ---------- notice ---------- */
.notice {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 14px;
  font-weight: 700;
}
.notice--success { background: var(--success-soft); border-color: var(--success-line); color: var(--success); }
.notice--warning { background: var(--warning-soft); border-color: rgba(255, 185, 48, 0.32); color: var(--warning); }

/* ---------- bottom bar carrinho (sempre visível durante venda) ---------- */
.cartbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px calc(10px + var(--safe-bottom));
  background: var(--bg-2);
  border-top: 1px solid var(--line);
}
.cartbar__info { display: grid; gap: 2px; }
.cartbar__info strong { font-size: 15px; font-weight: 800; }
.cartbar__info span { font-size: 14px; color: var(--pink-light); font-weight: 700; }

/* ---------- categorias (drawer) ---------- */
.cat-tree {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
  max-height: 60vh;
  overflow-y: auto;
}
.cat-tree__item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 12px 6px calc(12px + var(--lvl, 0) * 12px);
  border-radius: 10px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
}
.cat-tree__thumb {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.cat-tree__thumb--placeholder {
  display: inline-block;
  background:
    linear-gradient(135deg, rgba(255, 61, 138, 0.18), rgba(139, 60, 255, 0.18)),
    var(--surface-2);
}
.cat-tree__item[aria-disabled="true"] { pointer-events: none; opacity: 0.5; }
.cat-tree__item:active { background: var(--surface-2); color: var(--text); }
.cat-tree__item.is-active { background: var(--pink); color: #fff; }
.cat-tree__item.is-active .cat-tree__count { background: rgba(255, 255, 255, 0.22); color: #fff; }
.cat-tree__name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cat-tree__count {
  flex: 0 0 auto;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-3);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.filter-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: rgba(255, 61, 138, 0.10);
  border: 1px solid rgba(255, 61, 138, 0.30);
  color: var(--pink-light);
  font-size: 13px;
  font-weight: 700;
}
.filter-chip strong { color: #fff; margin-left: 4px; }

/* ---------- modal genérico + montagem rápida ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: stretch;
}
.modal[hidden] { display: none; }
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}
.modal__panel {
  position: relative;
  margin: auto;
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.modal__head h2 { margin: 0 0 4px; font-size: 18px; }
.modal__head p { margin: 0; font-size: 12px; }
.modal__close {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
}

.mr-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.mr-results {
  overflow-y: auto;
  padding-right: 2px;
  min-height: 120px;
}
.mr-empty {
  margin: 16px 0;
  text-align: center;
  color: var(--text-3);
  font-size: 14px;
}
.mr-count {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-3);
  text-transform: uppercase;
}
.mr-list { display: grid; gap: 8px; }
.mr-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-2);
}
.mr-row.is-added {
  border-color: var(--success-line);
  background: var(--success-soft);
}
.mr-row__media {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.mr-row__media img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.mr-row__body { min-width: 0; }
.mr-row__body h3 {
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.mr-row__body p { margin: 0; font-size: 11px; }
.mr-row__price { color: var(--pink-light); font-weight: 800; font-size: 14px; }
.mr-row__action { display: grid; gap: 4px; justify-items: end; }
.mr-row__ok { color: var(--success); font-size: 12px; font-weight: 800; }

.page-head--actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.page-head__title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.page-head__icon {
  flex: 0 0 auto;
  filter: drop-shadow(0 4px 12px rgba(255, 61, 138, 0.30));
}
.page-head__title h1 { margin: 0; }
.page-head__title p { margin: 2px 0 0; }

/* Ícone 3D pequeno dentro de h2 das seções (Cliente, Pagamento, etc) */
.panel-h2-icon {
  vertical-align: middle;
  margin-right: 6px;
  filter: drop-shadow(0 2px 6px rgba(255, 61, 138, 0.22));
  transform: translateY(-1px);
}
.panel h2 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* Ícone 3D pequeno em linhas do resumo (PIX, Taxa de entrega) */
.summary__row span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.row-icon-3d {
  flex: 0 0 auto;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.35));
}

/* Ícone dentro das opções de radio (Entregar/Retirar) */
.option--with-icon span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: left;
}
.option-icon-3d {
  flex: 0 0 auto;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.30));
}

/* Modal: header com ícone à esquerda do título */
.modal__title {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}
.modal__title-icon {
  flex: 0 0 auto;
  filter: drop-shadow(0 4px 10px rgba(255, 61, 138, 0.28));
}
.modal__title h2 { margin: 0; }
.modal__title p { margin: 2px 0 0; }

/* ---------- toast (flash) ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--success);
  color: #053822;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 6px 24px rgba(0,0,0,.4);
  animation: toastIn .25s ease-out;
  max-width: calc(100vw - 32px);
}
.toast--out { animation: toastOut .3s ease-in forwards; }
.toast__icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,.85);
  color: var(--success);
  font-weight: 900;
}
.toast__msg strong { font-weight: 900; }
@keyframes toastIn {
  from { transform: translate(-50%, 14px); opacity: 0; }
  to   { transform: translate(-50%, 0); opacity: 1; }
}
@keyframes toastOut {
  to { transform: translate(-50%, 14px); opacity: 0; }
}

/* ---------- loading overlay ---------- */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 10, 26, 0.82);
  display: grid;
  place-items: center;
  padding: 24px;
}
.loading-overlay[hidden] { display: none; }
.loading-overlay__box {
  display: grid;
  gap: 16px;
  justify-items: center;
  padding: 26px 30px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  max-width: 360px;
  text-align: center;
}
.loading-overlay__box p {
  margin: 0;
  color: var(--text);
  font-weight: 700;
}
.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--surface-3);
  border-top-color: var(--pink);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- sync status (lobby) ---------- */
.sync-status {
  margin-top: 14px;
  padding: 0;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: left;
}
.sync-status > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 16px;
  font-weight: 800;
  font-size: 14px;
  color: var(--text-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sync-status > summary::after {
  content: "▾";
  color: var(--text-3);
  transition: transform .15s;
}
.sync-status[open] > summary::after { transform: rotate(180deg); }
.sync-status > summary::-webkit-details-marker { display: none; }
.sync-status__body { padding: 0 14px 14px; display: grid; gap: 10px; }
.sync-status__row {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: grid;
  gap: 6px;
  font-size: 13px;
}
.sync-status__row strong { font-weight: 800; }
.sync-status__row--ok    { border-color: var(--success-line); background: var(--success-soft); color: var(--success); }
.sync-status__row--ok strong { color: var(--success); }
.sync-status__row--falha { border-color: var(--danger-line);  background: var(--danger-soft);  color: var(--danger); }
.sync-status__row--falha strong { color: var(--danger); }
.sync-status__row--nunca { color: var(--text-3); }
.sync-status__msg {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--text-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
  max-height: 180px;
}

/* sync-banner: msg legível, monoespaçada, quebra de linha */
.sync-banner { gap: 4px; }
.sync-banner span {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  word-break: break-word;
  white-space: pre-wrap;
  opacity: 0.9;
}

.notice--danger {
  background: var(--danger-soft);
  border-color: var(--danger-line);
  color: var(--danger);
}

.lobby__hint { margin: 8px 0 0; font-size: 13px; }

.sessions {
  margin: 14px 0 4px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  text-align: left;
}
.sessions h2 { margin: 0 0 2px; font-size: 15px; }
.sessions p { margin: 0 0 10px; font-size: 12px; }
.sessions__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sessao {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 8px;
  align-items: stretch;
}
.sessao__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 56px;
  padding: 8px 12px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
}
.sessao__link:active { background: var(--surface-3); }
.sessao__nome { display: block; font-weight: 800; font-size: 15px; }
.sessao__meta { margin: 2px 0 0; font-size: 12px; color: var(--text-3); font-weight: 600; }
.sessao__arrow { color: var(--pink-light); font-size: 22px; line-height: 1; }
.sessao__delete {
  width: 44px;
  height: 100%;
  min-height: 56px;
  border-radius: var(--r);
  background: var(--danger-soft);
  border: 1px solid var(--danger-line);
  color: var(--danger);
  font-size: 16px;
  font-weight: 800;
}
.sessao__delete:active { background: rgba(255, 92, 122, 0.22); }

.venda-ok {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  margin: 0 0 12px;
  text-align: left;
  background: var(--success-soft);
  border: 1px solid var(--success-line);
  border-radius: var(--r-lg);
  color: var(--success);
  animation: venda-ok-pop .3s ease-out;
}
.venda-ok__check {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--success);
  color: #0b1f12;
  font-size: 24px;
  font-weight: 900;
}
.venda-ok strong { display: block; color: var(--success); font-size: 16px; font-weight: 800; }
.venda-ok p { margin: 2px 0 0; color: var(--text-2); font-size: 13px; }
@keyframes venda-ok-pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* tablet portrait (≥ 600px): mantém 2 cols, melhora apenas paddings/tipografia.
   Apenas em desktop largo (≥ 1100px) liberamos 3 cols. */
@media (min-width: 600px) {
  .card__name { font-size: 14px; }
  .card__price { font-size: 20px; }
  .card__pix strong { font-size: 16px; }
  .shell { padding: 16px 16px calc(16px + var(--cartbar-h) + var(--safe-bottom)); }
  .lineitem { grid-template-columns: 80px 1fr auto; }
  .lineitem__media { width: 80px; height: 80px; }
}

@media (min-width: 1100px) {
  .catalog { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}
@media (min-width: 1440px) {
  .catalog { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- reduce motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- auth (login OTP) ---------- */
.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(80% 60% at 30% 0%, rgba(139, 60, 255, 0.18), transparent 65%),
    radial-gradient(70% 50% at 80% 100%, rgba(255, 61, 138, 0.12), transparent 60%),
    var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px 24px 24px;
  display: grid;
  gap: 14px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(15, 10, 26, 0.6);
}
.auth-card__logo {
  height: 64px;
  width: auto;
  margin: 0 auto 4px;
  object-fit: contain;
}
.auth-card__title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.auth-card__sub {
  margin: 0;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.45;
}
.auth-card__hint {
  margin: 12px 0 0;
  color: var(--text-3);
  font-size: 13px;
}
.auth-form {
  display: grid;
  gap: 12px;
  text-align: left;
  margin-top: 4px;
}
.auth-form__field {
  display: grid;
  gap: 6px;
}
.auth-form__field span {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 600;
}
.auth-form__input {
  height: 48px;
  padding: 0 14px;
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--text);
  font-size: 16px;
  font-family: var(--font);
}
.auth-form__input:focus,
.auth-form__codigo:focus {
  outline: 2px solid var(--pink);
  outline-offset: 1px;
}
.auth-form__codigo {
  width: 100%;
  height: 64px;
  padding: 0 16px;
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--text);
  font-size: 32px;
  font-weight: 800;
  text-align: center;
  letter-spacing: 12px;
  font-variant-numeric: tabular-nums;
  font-family: var(--font);
}
.auth-form__refazer {
  margin-top: 6px;
  text-align: center;
}
.auth-form__refazer .link {
  background: none;
  border: 0;
  color: var(--text-3);
  font: inherit;
  font-size: 14px;
  text-decoration: underline;
  cursor: pointer;
  padding: 6px 8px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Lista de chats WAHA — grid avatar/texto/cta com truncamento por coluna. */
.chat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.chat-row__link {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 64px;
  padding: 10px 12px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}
.chat-row__link:active { background: var(--surface-3); }
.chat-row__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-3);
}
.chat-row__avatar--placeholder {
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--text-2);
}
.chat-row__body { min-width: 0; overflow: hidden; }
.chat-row__nome,
.chat-row__meta {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-row__nome { font-weight: 800; font-size: 15px; }
.chat-row__meta { margin: 2px 0 0; font-size: 12px; color: var(--text-3); font-weight: 600; }
.chat-row__cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-radius: var(--r);
  color: var(--pink-light);
  font-weight: 800;
  font-size: 14px;
  white-space: nowrap;
}

/* Filtros em chips (atendimentos). */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 12px;
}
.filter-chips__item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.filter-chips__item.is-active {
  background: var(--pink-soft, var(--surface-3));
  border-color: var(--pink-light);
  color: var(--pink-light);
}

/* Badge de status do atendimento. */
.status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-right: 6px;
  vertical-align: middle;
}
.status-pill--aberto       { background: rgba(82, 167, 255, .15); color: #66b3ff; }
.status-pill--aguardando   { background: rgba(255, 196, 92, .18); color: #ffc45c; }
.status-pill--finalizado   { background: rgba(96, 220, 144, .15); color: #6fde9b; }
.status-pill--cancelado    { background: rgba(255, 92, 122, .15); color: #ff5c7a; }

/* ---------- dashboard de vendas ---------- */
.dash-datepicker {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin: 4px 0 16px;
}
.dash-datepicker .field {
  flex: 1 1 180px;
  min-width: 160px;
}
.dash-datepicker input[type="date"] {
  height: 48px;
  padding: 0 14px;
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--text);
  font-size: 16px;
  font-family: var(--font);
}
.dash-datepicker .button { height: 48px; }

.dash-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.dash-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px;
  display: grid;
  gap: 4px;
  min-height: 96px;
}
.dash-card__icon {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  pointer-events: none;
  filter: drop-shadow(0 6px 14px rgba(255, 61, 138, 0.22));
}
.dash-card__label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
}
.dash-card__value {
  font-size: 28px;
  font-weight: 900;
  color: var(--text);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.dash-card__sub {
  font-size: 13px;
  color: var(--text-2);
}
.dash-card--ok     { border-color: var(--success-line); }
.dash-card--ok     .dash-card__value { color: var(--success); }
.dash-card--danger { border-color: var(--danger-line); }
.dash-card--danger .dash-card__value { color: var(--danger); }
.dash-card--warn   { border-color: rgba(255, 185, 48, 0.32); }
.dash-card--warn   .dash-card__value { color: var(--warning); }

.dash-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.dash-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.dash-list__row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.dash-list__rotulo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--text);
}
.dash-list__qtd {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-3);
  background: var(--surface-3);
  padding: 2px 8px;
  border-radius: 999px;
  min-width: 28px;
  text-align: center;
}
.dash-list__val {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: var(--pink-light);
}

.dash-pedidos {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.dash-pedido {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--text-3);
  border-radius: var(--r);
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}
.dash-pedido--venda     { border-left-color: var(--success); }
.dash-pedido--pendente  { border-left-color: var(--warning); }
.dash-pedido--cancelado { border-left-color: var(--danger); opacity: 0.78; }

.dash-pedido__head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dash-pedido__id {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
  font-size: 13px;
}
.dash-pedido__tag {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
}
.dash-pedido__tag--venda     { background: var(--success-soft); color: var(--success); }
.dash-pedido__tag--pendente  { background: rgba(255, 185, 48, 0.18); color: var(--warning); }
.dash-pedido__tag--cancelado { background: var(--danger-soft); color: var(--danger); }
.dash-pedido__val {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-size: 16px;
}
.dash-pedido__cupom {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transition: background 120ms ease;
}
.dash-pedido__cupom:hover { background: var(--pink); color: #fff; border-color: var(--pink); }
.dash-pedido__cupom svg { display: block; }
/* Variante "cupom de fidelidade": cor que distingue do botao de entrega. */
.dash-pedido__cupom--fidelidade { background: var(--success-soft, #d4edda); border-color: var(--success, #28a745); color: var(--success, #28a745); }
.dash-pedido__cupom--fidelidade:hover { background: var(--success, #28a745); color: #fff; border-color: var(--success, #28a745); }

/* Bloco de cupom de fidelidade nos checkouts PDV e WhatsApp.
 * Card compacto que tem 2 estados: input (digitar codigo) e aplicado
 * (mostra cupom + botao remover). HTMX troca o bloco inteiro outerHTML. */
.cupom-box {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px dashed var(--line-2);
}
.cupom-box--ativo {
  background: var(--success-soft, #d4edda);
  border-style: solid;
  border-color: var(--success, #28a745);
}
.cupom-box__input {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.cupom-box__field { flex: 1; margin: 0; }
.cupom-box__field input { letter-spacing: 0.04em; }
.cupom-box__aplicar { white-space: nowrap; }
.cupom-box__aplicado {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.cupom-box__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.cupom-box__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  font-weight: 700;
}
.cupom-box__codigo {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text);
}
.cupom-box__valor {
  font-size: 13px;
  font-weight: 700;
  color: var(--success, #28a745);
}
.cupom-box__remover {
  border: 0;
  background: transparent;
  color: var(--danger, #d9534f);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
}
.cupom-box__remover:hover { background: rgba(217, 83, 79, 0.1); }
.cupom-box__erro {
  margin: 8px 0 0;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--danger-soft, #f8d7da);
  color: var(--danger, #d9534f);
  font-size: 12px;
  font-weight: 700;
}
.summary__row--cupom strong { color: var(--success, #28a745); }
.dash-pedido__body { font-size: 14px; }
.dash-pedido__endereco {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.4;
}

@media (min-width: 720px) {
  .dash-cards { grid-template-columns: repeat(4, 1fr); }
  .dash-grid  { grid-template-columns: 1fr 1fr; }
}

/* ---------- dashboard/comissoes: container wide ---------- */
/* Em telas grandes, dashboard e comissoes ocupam ate 1280px (vs 720px do PDV
 * tablet padrao). Mantem responsivo no mobile pq nao mexe abaixo do breakpoint. */
.dash-body .shell {
  max-width: 1280px;
}

/* ---------- comissoes (HTMX swap) ---------- */
.comm-filtros {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: end;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px;
  margin-bottom: 12px;
}
.comm-filtros .field { display: grid; gap: 6px; }
.comm-filtros select,
.comm-filtros input[type="month"] {
  height: 48px;
  padding: 0 14px;
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--text);
  font-size: 16px;
  font-family: var(--font);
}
.comm-filtros .req { color: var(--pink); }
.comm-filtros .button { height: 48px; }
@media (min-width: 720px) {
  .comm-filtros { grid-template-columns: 2fr 1fr auto; }
}

/* indicator htmx: aparece so durante a request */
.comm-loading {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px dashed var(--line-2);
  border-radius: var(--r);
  color: var(--text-2);
  font-size: 14px;
  margin-bottom: 12px;
}
.comm-loading.htmx-request { display: flex; }
.comm-loading .spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line-2);
  border-top-color: var(--pink);
  border-radius: 50%;
  animation: comm-spin 0.7s linear infinite;
}
@keyframes comm-spin {
  to { transform: rotate(360deg); }
}

.comm-empty {
  text-align: center;
  padding: 28px 12px;
}

.comm-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 8px 0 12px;
}
.comm-head h2 { margin: 0; font-size: 22px; }

.comm-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
@media (min-width: 720px) {
  .comm-cards { grid-template-columns: repeat(4, 1fr); }
}

.comm-delta {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 1px 6px;
  border-radius: 999px;
}
.comm-delta--up      { background: var(--success-soft); color: var(--success); }
.comm-delta--down    { background: var(--danger-soft);  color: var(--danger); }
.comm-delta--neutral { background: var(--surface-3);    color: var(--text-3); }

.comm-highlights {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.comm-highlights li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.comm-highlights li span { color: var(--text-3); font-size: 13px; }
.comm-highlights li strong { color: var(--text); font-size: 14px; text-align: right; }

.comm-rank {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  counter-reset: comm-rank;
}
.comm-rank li {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.comm-rank__pos {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--pink-light);
  font-weight: 900;
  font-size: 12px;
}
.comm-rank li:first-child .comm-rank__pos {
  background: var(--pink);
  color: #fff;
}
.comm-rank__nome { font-weight: 700; color: var(--text); }
.comm-rank__qtd { color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.comm-rank__val { font-variant-numeric: tabular-nums; color: var(--pink-light); font-weight: 800; }

/* Bars (dia da semana, hora do dia) */
.comm-bars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.comm-bar {
  display: grid;
  grid-template-columns: 80px 1fr 140px;
  align-items: center;
  gap: 8px;
}
.comm-bar__label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.comm-bar__track {
  display: block;
  height: 14px;
  background: var(--surface-3);
  border-radius: 7px;
  overflow: hidden;
}
.comm-bar__fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--pink) 0%, var(--violet) 100%);
  border-radius: 7px;
  transition: width 200ms ease;
}
.comm-bar__qtd {
  font-size: 11px;
  color: var(--text-3);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Projecao do mes — bloco destacado entre cards e demais paineis */
.comm-projecao header {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}
.comm-projecao header h2 { margin: 0; }
.comm-projecao__cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.comm-projecao__cards > div {
  background: linear-gradient(135deg, rgba(139, 60, 255, .12), rgba(255, 61, 138, .08));
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  padding: 12px 14px;
  display: grid;
  gap: 4px;
}
.comm-projecao__label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-3);
}
.comm-projecao__val {
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.comm-projecao__val--ok { color: var(--pink-light); }
@media (min-width: 720px) {
  .comm-projecao__cards { grid-template-columns: repeat(3, 1fr); }
}

/* Insights — cards de sugestao acionavel */
.comm-insights {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}
.comm-insight {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--pink);
  border-radius: var(--r);
  padding: 12px 14px;
  display: grid;
  gap: 4px;
}
.comm-insight__titulo {
  font-size: 13px;
  font-weight: 800;
  color: var(--pink-light);
  letter-spacing: 0.01em;
}
.comm-insight__detalhe {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-2);
}
@media (min-width: 900px) {
  .comm-insights { grid-template-columns: 1fr 1fr; }
}

/* ---------- Split PIX+Link no checkout WhatsApp ---------- */
.wa-split-config {
  margin-top: 6px;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: var(--r);
  background: rgba(255, 61, 138, 0.05);
  display: grid;
  gap: 6px;
}
.wa-split-config[hidden] { display: none; }
.wa-split-config .field { display: grid; gap: 4px; }
.wa-split-config input {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

/* <dialog> de confirmacao do split.
   Classe propria (NAO .modal) pra nao herdar o display:grid generico do
   modal de montagem rapida — isso fazia o dialog ficar visivel sem [open].
   ::backdrop so renderiza quando aberto via .showModal(). */
dialog.split-modal {
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  width: min(92vw, 480px);
  max-width: 92vw;
  max-height: 92vh;
  margin: auto;
  overflow: visible;
}
dialog.split-modal::backdrop {
  background: rgba(0, 0, 0, 0.65);
}
/* Garante invisibilidade no estado fechado — defesa em profundidade caso
   algum reset CSS futuro mexa no default do <dialog>. */
dialog.split-modal:not([open]) {
  display: none !important;
}
.split-modal__inner {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  display: grid;
  gap: 14px;
}
.split-modal__inner h2 { margin: 0; font-size: 20px; }
.split-modal__inner .muted { margin: 0; color: var(--text-3); font-size: 13px; }
.split-modal__resumo {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: var(--r);
}
.split-modal__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.split-modal__row span { color: var(--text-2); font-size: 14px; }
.split-modal__row strong { font-weight: 800; font-size: 15px; }
.split-modal__row--total {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  margin-top: 4px;
}
.split-modal__row--total span { font-weight: 700; color: var(--text); }
.split-modal__row--total strong { font-size: 18px; color: var(--pink); }
.split-modal__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin: 0;
  padding: 0;
  list-style: none;
}
.split-modal__actions .button { min-width: 120px; }

/* Status de cada cobranca em pedido split */
.split-status {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
}
.split-status__linha {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-2);
}
.split-status__linha--ok {
  border-color: var(--success, #1f9d55);
  background: rgba(31, 157, 85, 0.08);
}
.split-status__linha--pendente {
  border-color: var(--warning, #d97706);
  background: rgba(217, 119, 6, 0.06);
}
.split-status__icone { font-size: 22px; flex: 0 0 auto; }
.split-status__linha strong { display: block; font-weight: 800; }
.split-status__linha small { display: block; color: var(--text-3); font-size: 12px; margin-top: 2px; }

/* Status PARCIALMENTE_PAGO pra cor especifica no header */
.pedido__status--parcialmente_pago {
  background: rgba(217, 119, 6, 0.15);
  color: var(--warning, #d97706);
}
