:root {
  --bg: #f4f5f7;
  --card: #fff;
  --text: #1d2330;
  --muted: #667085;
  --border: #dfe3ea;
  --primary: #1f6feb;
  --primary-dark: #1557c0;
  --danger: #c62828;
  --ok: #1b873f;
  --warn-bg: #fff4e5;
  --wa-bg: #e7fbd8;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
h1 { font-size: 1.25rem; margin: 0; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
h3 { font-size: .95rem; margin: 1rem 0 .5rem; }
.hidden { display: none !important; }
.muted, .hint { color: var(--muted); }
.hint { font-size: .85rem; margin: .25rem 0 .75rem; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }

.topbar {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem;
  padding: .9rem 1.5rem; background: #111827; color: #fff;
}
.status-pills { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.pill { padding: .25rem .7rem; border-radius: 999px; font-size: .8rem; background: #374151; }
.pill.ok { background: var(--ok); }
.pill.bad { background: var(--danger); }

/* Computador: abas no topo, como antes. Os elementos do menu do celular ficam escondidos */
.menu-btn, .status-btn, .section-name, .status-title, .nav-head, .nav-group, .nav-link, .nav-dot, .nav-backdrop, .tabs .ico { display: none; }
.tabs { display: flex; gap: .25rem; padding: .5rem 1.5rem 0; background: #fff; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs button {
  background: none; color: var(--muted); border: 0; border-bottom: 3px solid transparent;
  border-radius: 0; padding: .7rem 1rem; font-weight: 600; white-space: nowrap;
}
.tabs button[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }

/* Celular e tablet: barra fixa, menu lateral que desliza e status num cartão */
@media (max-width: 860px) {
  .topbar {
    position: sticky; top: 0; z-index: 30; flex-wrap: nowrap; gap: .6rem;
    background: rgb(17 24 39 / .96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px rgb(0 0 0 / .18);
  }
  .topbar h1 { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
  .brand-name { font-size: .68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #38bdf8; }
  .section-name { display: block; font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* Botão do menu: três linhas que viram um X */
  .menu-btn { display: grid; place-items: center; flex: none; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 12px; background: rgb(255 255 255 / .08); }
  .menu-btn span, .menu-btn span::before, .menu-btn span::after {
    display: block; width: 20px; height: 2px; border-radius: 2px; background: #fff; transition: transform .2s, opacity .2s; content: '';
  }
  .menu-btn span { position: relative; }
  .menu-btn span::before { position: absolute; top: -6px; }
  .menu-btn span::after { position: absolute; top: 6px; width: 14px; }
  .nav-open .menu-btn span { background: transparent; }
  .nav-open .menu-btn span::before { transform: translateY(6px) rotate(45deg); }
  .nav-open .menu-btn span::after { transform: translateY(-6px) rotate(-45deg); width: 20px; }

  /* Ícone do app com bolinha de status; toque mostra as conexões */
  .status-btn { display: block; position: relative; flex: none; padding: 0; border: 2px solid rgb(255 255 255 / .15); border-radius: 50%; background: none; width: 40px; height: 40px; }
  .status-btn img { display: block; width: 100%; height: 100%; border-radius: 50%; }
  .status-dot { position: absolute; right: -2px; bottom: -2px; width: 13px; height: 13px; border-radius: 50%; background: #9ca3af; border: 2px solid #111827; }
  .status-dot.ok { background: #22c55e; }
  .status-dot.bad { background: #ef4444; animation: pulse 1.6s infinite; }
  @keyframes pulse { 50% { box-shadow: 0 0 0 5px rgb(239 68 68 / .3); } }

  .status-pills {
    position: absolute; top: calc(100% + .4rem); right: max(.75rem, env(safe-area-inset-right)); z-index: 40;
    width: min(290px, calc(100vw - 1.5rem)); flex-direction: column; align-items: stretch; gap: .4rem;
    padding: .8rem; border-radius: 16px; background: #fff; color: var(--text); box-shadow: 0 16px 40px rgb(0 0 0 / .22);
    opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top right; pointer-events: none; transition: opacity .15s, transform .15s;
  }
  .status-pills.open { opacity: 1; transform: none; pointer-events: auto; }
  .status-title { display: block; margin: 0 0 .1rem; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  .status-pills .pill { padding: .55rem .75rem; border-radius: 10px; font-size: .85rem; background: var(--bg); color: var(--text); }
  .status-pills .pill.ok { background: #e8f5ec; color: #146c33; }
  .status-pills .pill.bad { background: #fdecec; color: #a11d1d; }
  .status-pills .pill-btn { margin-top: .2rem; text-align: left; color: var(--danger); }
  .status-pills .pill-btn:hover { background: #fdecec; }

  /* Menu lateral */
  .tabs {
    position: fixed; inset: 0 auto 0 0; z-index: 50; width: min(300px, 84vw);
    flex-direction: column; gap: .15rem; overflow-y: auto; overscroll-behavior: contain;
    padding: max(1rem, env(safe-area-inset-top)) .75rem max(1rem, env(safe-area-inset-bottom)) max(.75rem, env(safe-area-inset-left));
    background: #fff; border: 0; border-radius: 0 22px 22px 0; box-shadow: 8px 0 30px rgb(0 0 0 / .2);
    transform: translateX(-105%); transition: transform .25s cubic-bezier(.2, .8, .2, 1); visibility: hidden;
  }
  .nav-open .tabs { transform: none; visibility: visible; }
  .nav-open { overflow: hidden; }
  .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 45; background: rgb(17 24 39 / .45); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
  .nav-backdrop[hidden] { display: none; }

  .nav-head {
    display: flex; align-items: center; gap: .7rem; margin-bottom: .6rem; padding: .85rem .8rem;
    border-radius: 16px; color: #fff; background: linear-gradient(135deg, #020a1f, #0b4fb8);
  }
  .nav-head img { border-radius: 12px; flex: none; }
  .nav-head div { display: flex; flex-direction: column; min-width: 0; flex: 1; }
  .nav-head strong { font-size: 1rem; }
  .nav-head span { font-size: .72rem; opacity: .85; }
  .nav-close { flex: none; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: rgb(255 255 255 / .22); color: #fff; font-size: 1.4rem; font-weight: 400; line-height: 1; }

  .nav-group { display: block; margin: .9rem .6rem .3rem; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #9ca3af; }
  .tabs button[data-tab], .nav-link {
    display: flex; align-items: center; gap: .75rem; width: 100%; padding: .75rem .8rem;
    border: 0; border-radius: 12px; color: var(--text); font-size: .95rem; font-weight: 600; text-align: left; text-decoration: none;
  }
  .tabs button[data-tab]:active, .nav-link:active { background: var(--bg); }
  .tabs button[aria-selected="true"] { color: #0b63ce; background: #eef6ff; box-shadow: inset 3px 0 0 #0ea5e9; }
  .tabs .ico { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--bg); font-size: 1.05rem; }
  .tabs button[aria-selected="true"] .ico { background: #ede9fe; }
  .nav-dot { display: block; margin-left: auto; width: 9px; height: 9px; border-radius: 50%; background: #d1d5db; }
  .nav-dot.ok { background: #22c55e; }
  #dot-cupons.bad { background: #ee4d2d; animation: pulse 1.6s infinite; }
  .nav-dot.bad { background: #ef4444; }
  .nav-link { margin-top: .9rem; border: 1px dashed var(--border); color: var(--muted); }
}
@media (max-width: 860px) and (prefers-reduced-motion: reduce) {
  .tabs, .status-pills, .menu-btn span, .menu-btn span::before, .menu-btn span::after { transition: none; }
  .status-dot.bad { animation: none; }
}

main { padding: 1.25rem 1.5rem; max-width: 1300px; margin: 0 auto; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 1.1rem; margin-bottom: 1rem; }
.card.warn { background: var(--warn-bg); border-color: #f5c27a; }
.narrow { max-width: 560px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.grid-2.tight { gap: .75rem; grid-template-columns: 1fr 1fr; }
.row-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.row-between h2 { margin: 0; }
.row-end { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; }
.spaced { margin-top: 1.5rem; }
.row-start { display: flex; gap: .5rem; flex-wrap: wrap; }
.notice {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
  background: var(--warn-bg); border: 1px solid #f5c27a; border-radius: 8px; padding: .6rem .8rem; margin-bottom: .9rem; font-size: .875rem;
}
.notice.ok { background: #e8f5ec; border-color: #9fd3b0; }
.hint.ok { color: var(--ok); }
.hint.error { color: var(--danger); }

label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: .75rem; }
label.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
input, select, textarea {
  display: block; width: 100%; margin-top: .3rem; padding: .55rem .65rem; font: inherit; font-weight: 400;
  border: 1px solid var(--border); border-radius: 6px; background: #fff;
}
label.check input, fieldset input { width: auto; margin: 0; display: inline-block; }
.filters input, .filters select { width: auto; margin: 0; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 1px;
}
fieldset { border: 1px solid var(--border); border-radius: 6px; margin: 0 0 1rem; padding: .5rem .9rem; }
fieldset label { display: inline-flex; align-items: center; gap: .35rem; margin: .25rem 1rem .25rem 0; font-weight: 500; }

button {
  font: inherit; font-weight: 600; font-size: .875rem; cursor: pointer;
  padding: .55rem 1rem; border-radius: 6px; border: 1px solid var(--primary); background: var(--primary); color: #fff;
}
button:hover { background: var(--primary-dark); }
button:disabled { opacity: .6; cursor: progress; }
button.ghost { background: #fff; color: var(--text); border-color: var(--border); }
button.ghost:hover { background: var(--bg); }
button.danger { background: var(--danger); border-color: var(--danger); }
button.small { padding: .3rem .6rem; font-size: .8rem; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .9rem; }
.product { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; background: #fff; }
.product.inactive .media img, .product.inactive .body { opacity: .5; }
.product .media img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--bg); display: block; }
.product .body { padding: .6rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.product .title { font-size: .85rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product .price { color: var(--ok); font-weight: 700; }
.product .old { color: var(--muted); text-decoration: line-through; font-size: .8rem; margin-left: .3rem; font-weight: 400; }
.product .meta { font-size: .75rem; color: var(--muted); }
.product .actions { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: auto; }
.tag { font-size: .7rem; padding: .1rem .45rem; border-radius: 4px; background: #eef2ff; color: #3730a3; align-self: flex-start; }

.product-grid > p { grid-column: 1 / -1; }

/* Barra de filtros */
.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; margin-bottom: .75rem; }
.toolbar > input { flex: 1 1 220px; margin: 0; }
.field-inline { display: flex; flex-direction: column; gap: .2rem; margin: 0; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.field-inline select { margin: 0; min-width: 120px; text-transform: none; letter-spacing: 0; color: var(--text); font-size: .875rem; }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.chip {
  background: #fff; color: var(--muted); border: 1px solid var(--border); border-radius: 999px;
  padding: .3rem .85rem; font-size: .8rem; font-weight: 600;
}
.chip:hover { background: var(--bg); }
.chip[aria-pressed="true"] { background: #111827; border-color: #111827; color: #fff; }

/* Barra de seleção: fica grudada no topo enquanto rola a lista */
.select-bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; flex-wrap: wrap; gap: .6rem;
  padding: .55rem .75rem; margin: 0 -.25rem .9rem; border-radius: 10px;
  background: var(--bg); border: 1px dashed var(--border); transition: background .15s, border-color .15s;
}
.select-bar.active { background: #111827; border: 1px solid #111827; color: #fff; }
/* Com produtos marcados, a barra acompanha a rolagem da lista (fica logo abaixo do topo) */
.select-bar.active {
  position: sticky; top: calc(var(--topbar-h, 0px) + .5rem); z-index: 20;
  box-shadow: 0 10px 28px rgb(17 24 39 / .28);
}
.select-bar.active .select-page { color: #fff; }
.select-page { margin: 0; font-size: .85rem; font-weight: 600; }
.select-page input { width: 18px; height: 18px; accent-color: var(--primary); }
.sel-count { font-weight: 700; font-size: .85rem; }
.sel-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.sel-actions[hidden] { display: none; }
.select-bar.active button.ghost { background: transparent; color: #fff; border-color: #4b5563; }
.select-bar.active button.ghost:hover { background: #1f2937; }
#btn-delete-filter { margin-left: auto; }
#btn-delete-filter[hidden] { display: none; }
button.danger-outline { background: #fff; color: var(--danger); border-color: #f1b5b5; }
button.danger-outline:hover { background: #fdecec; }
button.link { background: none; border: 0; color: #93c5fd; text-decoration: underline; padding-inline: .3rem; }
button.link:hover { background: none; color: #fff; }

/* Cartão do produto: seleção e selos */
.product { position: relative; transition: box-shadow .15s, border-color .15s; }
.product.selected { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.product .media { position: relative; }
.pick-wrap {
  position: absolute; top: .45rem; left: .45rem; z-index: 2; margin: 0;
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px;
  background: rgb(255 255 255 / .92); box-shadow: 0 1px 3px rgb(0 0 0 / .25); cursor: pointer;
}
.pick-wrap input { width: 18px; height: 18px; margin: 0; cursor: pointer; accent-color: var(--primary); }
.badges { position: absolute; top: .45rem; right: .45rem; display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; }
.badge { font-size: .7rem; font-weight: 700; padding: .15rem .45rem; border-radius: 5px; color: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .2); }
.badge.off { background: #e11d48; }
.badge.sent { background: var(--ok); }
.badge.paused { background: #6b7280; }
.tags { display: flex; gap: .3rem; flex-wrap: wrap; }
.tag.soft { background: #f3f4f6; color: var(--muted); }
.pager .gap { align-self: center; color: var(--muted); padding: 0 .2rem; }

/* Botão Enviar (verde WhatsApp) */
:root { --send: #16a34a; --send-dark: #15803d; }
button.send { background: var(--send); border-color: var(--send); color: #fff; }
button.send:hover { background: var(--send-dark); }
.select-bar button.send { padding-inline: 1rem; font-size: .85rem; }
.sel-actions .sep { width: 1px; align-self: stretch; background: #4b5563; margin: 0 .15rem; }

/* Janela de confirmação */
dialog.confirm { width: min(440px, 92vw); border-radius: 16px; box-shadow: 0 24px 60px rgb(0 0 0 / .3); }
dialog.confirm[open] { animation: pop .16s ease-out; }
dialog.confirm::backdrop { background: rgb(17 24 39 / .55); backdrop-filter: blur(2px); }
@keyframes pop { from { transform: translateY(8px) scale(.97); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { dialog.confirm[open] { animation: none; } }
.confirm-body { padding: 1.5rem 1.5rem 1.25rem; text-align: center; }
.confirm-icon {
  width: 52px; height: 52px; margin: 0 auto .85rem; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.35rem; font-weight: 800;
  background: #e0ebff; color: var(--primary);
}
dialog[data-tone="danger"] .confirm-icon { background: #fde8e8; color: var(--danger); }
dialog[data-tone="send"] .confirm-icon { background: #dcfce7; color: var(--send); }
.confirm-body h2 { font-size: 1.15rem; margin: 0 0 .4rem; }
#confirm-msg { margin: 0 0 1rem; color: var(--muted); font-size: .92rem; line-height: 1.45; overflow-wrap: anywhere; }
#confirm-msg:empty { display: none; }
#confirm-extra { text-align: left; }
#confirm-extra:empty { display: none; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: 1.1rem; }
.confirm-actions button { padding: .7rem 1rem; font-size: .92rem; border-radius: 10px; }
.type-confirm { font-size: .82rem; color: var(--muted); }
.type-confirm input { text-align: center; letter-spacing: .15em; font-weight: 700; text-transform: uppercase; }

.send-summary { background: var(--bg); border-radius: 10px; padding: .75rem .9rem; display: flex; flex-direction: column; gap: .55rem; font-size: .85rem; }
.summary-row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin: 0; font-weight: 400; }
.summary-row strong { text-align: right; overflow-wrap: anywhere; }
.gap-field input { width: 90px; margin: 0; text-align: center; }
.warn-line { margin: 0; color: #9a5b00; font-size: .8rem; }
.summary-row.top { align-items: flex-start; }
.dest-list { list-style: none; margin: 0; padding: 0; text-align: right; font-weight: 600; max-height: 120px; overflow: auto; }
.dest-list li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }

/* Telegram */
.tg-bot { display: flex; align-items: center; gap: .75rem; padding: .75rem; border-radius: 10px; background: #e8f4fd; border: 1px solid #b6dcf7; margin-bottom: 1rem; }
.tg-avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: #229ed9; font-size: 1.3rem; }
.badge-ok { margin-left: auto; background: var(--ok); color: #fff; font-size: .72rem; font-weight: 700; padding: .2rem .55rem; border-radius: 99px; }
.warn-text { color: #9a5b00; }
.hint:empty { display: none; }
.howto { margin-top: 1rem; border: 1px solid var(--border); border-radius: 8px; padding: .6rem .8rem; font-size: .875rem; }
.howto summary { cursor: pointer; font-weight: 600; }
.howto ol { margin: .6rem 0 .3rem; padding-left: 1.2rem; line-height: 1.6; }
.howto code, .tg-steps code { background: var(--bg); padding: .05rem .3rem; border-radius: 4px; }
.tg-steps { font-size: .85rem; background: var(--bg); border-radius: 10px; padding: .7rem .9rem; margin-bottom: .9rem; }
.tg-steps p { margin: 0 0 .4rem; }
.tg-steps ul { margin: 0 0 .4rem; padding-left: 1.1rem; line-height: 1.55; }
.tg-steps.dim { opacity: .55; }
.inline-form { display: flex; gap: .5rem; margin-bottom: .9rem; }
.inline-form input { margin: 0; }
.tg-list { display: flex; flex-direction: column; gap: .45rem; }
.tg-list .empty { margin: .25rem 0; font-size: .875rem; }
.tg-chat { display: flex; align-items: center; gap: .5rem; border: 1px solid var(--border); border-radius: 10px; padding: .45rem .55rem; }
.tg-chat.on { border-color: #9fd3b0; background: #f4fbf6; }
.tg-chat-main { display: flex; align-items: center; gap: .6rem; flex: 1; min-width: 0; margin: 0; cursor: pointer; font-weight: 400; }
.tg-chat-main input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--ok); }
.tg-chat-icon { font-size: 1.15rem; }
.tg-chat-text { display: flex; flex-direction: column; min-width: 0; }
.tg-chat-text strong, .tg-chat-text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .85rem; }
.tg-chat-text span { font-size: .75rem; }
.tg-chat-actions { display: flex; gap: .3rem; flex: none; }

/* Agendamento */
.agenda { max-width: 820px; }
.agenda-head { display: flex; flex-direction: column; gap: 1rem; }
.switch { display: flex; align-items: center; gap: .75rem; margin: 0; cursor: pointer; font-weight: 400; }
.switch > span:last-child { display: flex; flex-direction: column; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { position: relative; flex: none; width: 46px; height: 26px; border-radius: 99px; background: #cbd2dc; transition: background .15s; }
.switch-ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: transform .15s; }
.switch input:checked + .switch-ui { background: var(--send); }
.switch input:checked + .switch-ui::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--primary); outline-offset: 2px; }
.switch.tiny .switch-ui { width: 36px; height: 20px; }
.switch.tiny .switch-ui::after { width: 14px; height: 14px; }
.switch.tiny input:checked + .switch-ui::after { transform: translateX(16px); }

.mode-pick { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.mode { margin: 0; cursor: pointer; font-weight: 400; }
.mode input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mode-card { display: flex; flex-direction: column; gap: .25rem; height: 100%; padding: .85rem .95rem; border: 2px solid var(--border); border-radius: 12px; transition: border-color .15s, background .15s; }
.mode-card .muted { font-size: .8rem; line-height: 1.4; }
.mode-icon { font-size: 1.3rem; }
.mode input:checked + .mode-card { border-color: var(--primary); background: #f0f6ff; }
.mode input:focus-visible + .mode-card { outline: 2px solid var(--primary); outline-offset: 2px; }

.day-total { font-weight: 700; color: var(--send); font-size: .9rem; }

.timeline { position: relative; height: 34px; margin: .5rem 0 1.4rem; background: repeating-linear-gradient(90deg, var(--bg) 0 calc(100% / 24 - 1px), var(--border) calc(100% / 24 - 1px) calc(100% / 24)); border-radius: 8px; border: 1px solid var(--border); }
.tl-hour { position: absolute; bottom: -1.2rem; transform: translateX(-50%); font-size: .68rem; color: var(--muted); }
.tl-hour:first-child { transform: none; }
.tl-hour:last-child { transform: translateX(-100%); }
.tl-block { position: absolute; top: 5px; bottom: 5px; min-width: 4px; border-radius: 5px; background: var(--send); opacity: .85; }
.tl-block.clash { background: #f59e0b; }

.slot-list { display: flex; flex-direction: column; gap: .55rem; margin-bottom: 1rem; }
.slot-list .empty { margin: 0; font-size: .875rem; }
.slot { display: flex; align-items: flex-start; gap: .75rem; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.slot.off { background: var(--bg); }
.slot.off .slot-main { opacity: .55; }
.slot.clash { border-color: #f5c27a; }
.slot .switch { margin-top: 1.35rem; }
.slot-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .5rem; }
.slot-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.slot-fields label { margin: 0; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.slot-fields input { margin-top: .2rem; font-size: .95rem; color: var(--text); min-width: 0; max-width: 100%; }
.slot-fields label { min-width: 0; }
/* O iPhone desenha o campo de horário mais largo que a coluna: limita */
.slot-fields input[type="time"] { -webkit-appearance: none; appearance: none; min-height: 2.6rem; }
.gap-input { display: flex; margin-top: .2rem; }
.gap-input input { margin: 0; border-radius: 6px 0 0 6px; min-width: 0; font-size: .95rem; color: var(--text); text-transform: none; }
.gap-input select { margin: 0; width: auto; border-left: 0; border-radius: 0 6px 6px 0; background: var(--bg); font-size: .85rem; color: var(--text); text-transform: none; letter-spacing: 0; padding-inline: .45rem; }
.unit-input { position: relative; display: block; }

/* Stories em massa */
button.story-btn { background: linear-gradient(135deg, #f58529, #dd2a7b 50%, #8134af); border: 0; color: #fff; }
button.story-btn:hover { filter: brightness(1.08); }
button.ai-btn { background: linear-gradient(135deg, #0f766e, #7c3aed); border: 0; color: #fff; white-space: nowrap; }
button.ai-btn:hover { filter: brightness(1.1); }
.headline-switch { margin: .25rem 0 .5rem; padding: .7rem .8rem; border-radius: 10px; background: #f5f3ff; }
.headline-switch input:checked + .switch-ui { background: #7c3aed; }
.headline-switch .muted { font-size: .78rem; }
.product .headline { font-size: .7rem; font-weight: 800; letter-spacing: .02em; color: #7c3aed; line-height: 1.25; }
.input-row { display: flex; gap: .4rem; align-items: center; }
.input-row input { flex: 1; min-width: 0; margin: 0; }
.ig-avatar { background: linear-gradient(135deg, #f58529, #dd2a7b 50%, #8134af); color: #fff; font-weight: 800; }
.tg-bot.ig { background: #fdf2f8; border-color: #f5c2dc; }
.story-modes { display: flex; flex-direction: column; gap: .4rem; }
.story-mode { display: flex; align-items: flex-start; gap: .55rem; margin: 0; padding: .55rem .6rem; border: 2px solid var(--border); border-radius: 10px; background: #fff; font-weight: 400; cursor: pointer; }
.story-mode:has(input:checked) { border-color: var(--primary); background: #f0f6ff; }
.story-mode.disabled { opacity: .55; cursor: not-allowed; }
.story-mode input { width: auto; margin: .2rem 0 0; }
.story-mode > span { display: flex; flex-direction: column; }
.story-mode .muted { font-size: .78rem; }
#st-theme { width: auto; margin: 0; }
.gap-field[hidden] { display: none; }
.batch-panel.story { bottom: calc(max(1.25rem, env(safe-area-inset-bottom)) + 7rem); }
.batch-panel.story .batch-bar span { background: linear-gradient(90deg, #f58529, #dd2a7b, #8134af); }

/* Arte do Story */
dialog.story-dlg { width: min(900px, 96vw); border-radius: 16px; }
dialog.story-dlg::backdrop { background: rgb(17 24 39 / .6); }
.story-body { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 1.5rem; padding: 1.25rem; max-height: 92vh; overflow: auto; }
.story-preview { position: relative; aspect-ratio: 9 / 16; border-radius: 14px; overflow: hidden; background: #1f2937; box-shadow: 0 10px 30px rgb(0 0 0 / .25); }
.story-preview img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .2s; }
.story-preview img.loading { opacity: .35; }
.story-loading { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: .9rem; }
.story-loading[hidden] { display: none; }
.story-side { display: flex; flex-direction: column; gap: .9rem; min-width: 0; }
.story-side h2 { margin: 0; }
#story-product { margin: -.5rem 0 0; font-size: .85rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; }
.story-themes { margin: 0; }
.theme-list { display: flex; flex-wrap: wrap; gap: .5rem; padding-top: .25rem; }
.theme { display: flex; align-items: center; gap: .5rem; background: #fff; color: var(--text); border: 2px solid var(--border); border-radius: 10px; padding: .35rem .7rem .35rem .4rem; }
.theme:hover { background: var(--bg); }
.theme[aria-pressed="true"] { border-color: var(--primary); background: #f0f6ff; }
.theme-swatch { width: 26px; height: 40px; border-radius: 6px; display: grid; place-items: end center; padding-bottom: 6px; }
.theme-swatch span { width: 14px; height: 5px; border-radius: 3px; }
img.theme-swatch { object-fit: cover; padding: 0; }

/* Minhas artes (Story) */
.my-arts { margin: .2rem 0 .9rem; padding: .8rem; border: 1px dashed var(--border); border-radius: 12px; background: #fafafa; }
.my-arts .row-between { margin-bottom: .2rem; }
.my-arts .file-btn { cursor: pointer; }
.art-list { display: grid; gap: .6rem; }
.art-card { display: flex; gap: .7rem; align-items: center; padding: .55rem; border: 2px solid var(--border); border-radius: 12px; background: #fff; }
.art-card.on { border-color: var(--primary); background: #f0f6ff; }
.art-card img { width: 54px; height: 96px; object-fit: cover; border-radius: 8px; flex: none; background: var(--bg); }
.art-fields { display: flex; flex-direction: column; gap: .35rem; flex: 1; min-width: 0; }
.art-fields input, .art-fields select { margin: 0; }
.art-empty { margin: .2rem 0 0; font-size: .85rem; }
.button-link {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; align-self: flex-start;
  padding: .6rem 1.1rem; border-radius: 8px; background: var(--primary); color: #fff; font-weight: 600; font-size: .9rem; text-decoration: none;
}
.button-link:hover { background: var(--primary-dark); }
.button-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.story-howto { background: var(--bg); border-radius: 12px; padding: .8rem .9rem; font-size: .85rem; }
.story-howto ol { margin: .4rem 0 .5rem; padding-left: 1.2rem; line-height: 1.55; }
.story-howto .hint { margin: .6rem 0 0; }
.copy-row { display: flex; gap: .4rem; }
.copy-row input { margin: 0; font-size: .8rem; }
@media (max-width: 700px) {
  .story-body { grid-template-columns: 1fr; }
  .story-preview { max-width: 300px; width: 100%; margin: 0 auto; }
}

/* Afiliados: Mercado Livre, Magalu e Natura */
.detect-box { background: #f0f6ff; border: 1px solid #c7dbff; border-radius: 10px; padding: .75rem .85rem .2rem; margin-bottom: 1rem; }
.detect-box .inline-form { margin: .3rem 0 0; }
.aff-store { margin-bottom: .9rem; padding: .6rem .9rem .4rem; }
.aff-store legend { font-weight: 700; font-size: .9rem; }
/* Aqui os campos são de texto: um embaixo do outro, largura total */
.aff-store label { display: block; margin: 0 0 .5rem; font-weight: 600; }
.aff-store input { display: block; width: 100%; margin-top: .3rem; }
.aff-store .hint { margin: 0 0 .3rem; }
#ext-token { font-family: ui-monospace, Consolas, monospace; font-size: .8rem; }

/* Importação de CSV */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: .2rem; text-align: center;
  padding: 1.1rem .75rem; border: 2px dashed var(--border); border-radius: 12px; cursor: pointer; font-weight: 400;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: #f0f6ff; }
.dropzone:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.dropzone strong { font-size: .9rem; }
.dropzone .muted { font-size: .78rem; }
.drop-icon { font-size: 1.5rem; }
.csv-files { list-style: none; margin: .6rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; max-height: 220px; overflow: auto; }
.csv-files:empty { display: none; }
/* Nome em cima, resultado embaixo: o nome do arquivo nunca fica espremido */
.csv-file {
  display: grid; grid-template-columns: 1.2rem minmax(0, 1fr) auto; column-gap: .45rem; row-gap: .05rem;
  align-items: center; padding: .4rem .5rem; border-radius: 8px; background: var(--bg); font-size: .8rem;
}
.csv-icon { grid-row: 1 / span 2; text-align: center; font-weight: 700; color: var(--muted); }
.csv-name { grid-column: 2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.csv-info { grid-column: 2; color: var(--muted); font-size: .75rem; overflow-wrap: anywhere; }
.csv-file > button { grid-column: 3; grid-row: 1 / span 2; }
.csv-file.ok { background: #e8f5ec; }
.csv-file.ok .csv-icon { color: var(--ok); }
.csv-file.erro { background: #fdecec; }
.csv-file.erro .csv-icon, .csv-file.erro .csv-info { color: var(--danger); }
.csv-file.importando { background: #eef4ff; }
.csv-file .small { padding: .1rem .4rem; }
.unit-input span { position: absolute; right: .65rem; top: 50%; transform: translateY(-40%); font-size: .8rem; text-transform: none; letter-spacing: 0; pointer-events: none; }
.unit-input input { padding-right: 2.6rem; }
.slot-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .9rem; font-size: .78rem; }
.slot-status { color: var(--ok); }
.slot-status.bad { color: #9a5b00; }
.slot > button { margin-top: 1.25rem; }

.days { display: flex; gap: .25rem; }
.day { width: 32px; height: 32px; padding: 0; border-radius: 50%; font-size: .78rem; background: #fff; color: var(--muted); border: 1px solid var(--border); }
.day:hover { background: var(--bg); }
.day[aria-pressed="true"] { background: #111827; color: #fff; border-color: #111827; }
.days.small .day { width: 26px; height: 26px; font-size: .7rem; }

.slot-add { display: flex; flex-direction: column; gap: .7rem; padding: .85rem; border: 2px dashed var(--border); border-radius: 12px; }
.slot-add > button { align-self: flex-start; }

@media (max-width: 640px) {
  .mode-pick { grid-template-columns: 1fr; }
  .slot { flex-wrap: wrap; }
  .slot .switch, .slot > button { margin-top: 0; }
  .slot-main { order: 3; flex-basis: 100%; }
  .slot > button { margin-left: auto; }
}

/* Painel de progresso do envio em lote */
.batch-panel {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 50; width: min(340px, calc(100vw - 2rem));
  background: #111827; color: #fff; border-radius: 14px; padding: .9rem 1rem; box-shadow: 0 12px 32px rgb(0 0 0 / .35);
}
.batch-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.batch-head button.ghost { background: transparent; color: #fca5a5; border-color: #4b5563; }
.batch-head button[hidden] { display: none; }
.batch-bar { height: 6px; background: #374151; border-radius: 99px; margin: .7rem 0 .5rem; overflow: hidden; }
.batch-bar span { display: block; height: 100%; width: 0; background: var(--send); border-radius: inherit; transition: width .4s; }
.batch-text { margin: 0; font-size: .8rem; color: #d1d5db; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.batch-panel.done .batch-bar span { background: #60a5fa; }
.pager { display: flex; gap: .4rem; justify-content: center; margin-top: 1rem; flex-wrap: wrap; }

.group-list { display: flex; flex-direction: column; gap: .4rem; max-height: 480px; overflow: auto; }
.group-list label { display: flex; align-items: center; gap: .55rem; margin: 0; font-weight: 500; padding: .35rem; border-radius: 6px; }
.group-list label:hover { background: var(--bg); }
.group-list input { width: auto; margin: 0; }

.qr img { width: 280px; max-width: 100%; height: auto; aspect-ratio: 1; display: block; margin: .5rem 0; }
.pairing { border-top: 1px solid var(--border); margin-top: 1rem; padding-top: .5rem; }
.pairing-code { font: 700 1.8rem ui-monospace, Consolas, monospace; letter-spacing: .15em; margin: .75rem 0 0; }
.pairing-code:empty { display: none; }

.pill-btn { border: 0; color: #fff; font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; padding: .25rem .7rem; }
.pill-btn:hover { background: #4b5563; }

/* App instalado no iPhone: respeita o entalhe e a barra de início */
.topbar { padding-top: max(.9rem, env(safe-area-inset-top)); padding-left: max(1.5rem, env(safe-area-inset-left)); padding-right: max(1.5rem, env(safe-area-inset-right)); }
main { padding-bottom: max(1.25rem, env(safe-area-inset-bottom)); }
.batch-panel { bottom: max(1.25rem, env(safe-area-inset-bottom)); }
.toast { bottom: max(1.25rem, env(safe-area-inset-bottom)); }
/* Sem destaque azul ao tocar e sem seleção acidental de texto nos botões */
button, .chip, .day, .theme { -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }

/* Tela de login */
.login-page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 1.5rem; background: linear-gradient(160deg, #020a1f, #0b3a8f 55%, #0891d1); }
.login-box { width: min(360px, 100%); background: #fff; border-radius: 20px; padding: 2rem 1.5rem 1.5rem; text-align: center; box-shadow: 0 24px 60px rgb(0 0 0 / .3); }
.login-box h1 { font-size: 1.4rem; margin: .75rem 0 .25rem; color: var(--text); }
.login-box > p { margin: 0 0 1.25rem; }
.login-box form { text-align: left; }
.login-box button { width: 100%; padding: .8rem; font-size: 1rem; border-radius: 10px; }
.login-box input { font-size: 16px; padding: .75rem; }
.login-logo { border-radius: 18px; display: block; margin: 0 auto; }
.login-logo-wide { width: min(300px, 100%); height: auto; border-radius: 14px; margin-bottom: .6rem; }

/* Celular */
@media (max-width: 640px) {
  .topbar { padding: max(.6rem, env(safe-area-inset-top)) max(.75rem, env(safe-area-inset-right)) .6rem max(.75rem, env(safe-area-inset-left)); }
  main { padding: .75rem; }
  .card { padding: .9rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
  .toolbar > input { flex-basis: 100%; }
  .field-inline { flex: 1 1 45%; }
  .field-inline select { min-width: 0; }
  #btn-delete-filter { margin-left: 0; }
  .sel-actions { width: 100%; }
  /* Barra de seleção no celular: botões numa linha só, arrastando para o lado,
     para ela não cobrir a lista enquanto acompanha a rolagem */
  .select-bar.active .sel-actions {
    flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
    margin-inline: -.2rem; padding: .1rem .2rem .2rem; scroll-snap-type: x proximity;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
  .select-bar.active .sel-actions::-webkit-scrollbar { display: none; }
  .select-bar.active .sel-actions > * { flex: none; scroll-snap-align: start; white-space: nowrap; }
  input, select, textarea { font-size: 16px; } /* evita zoom automático no iPhone */
  button { padding: .65rem 1rem; }
  button.small { padding: .45rem .6rem; }
}

.wa-bubble {
  background: var(--wa-bg); border-radius: 8px; padding: .8rem 1rem; white-space: pre-wrap; word-break: break-word;
  font-size: .9rem; line-height: 1.45; min-height: 3rem;
}

dialog { border: 0; border-radius: 12px; padding: 0; width: min(560px, 95vw); }
dialog::backdrop { background: rgb(0 0 0 / .45); }
.dialog-body { padding: 1.25rem; max-height: 90vh; overflow: auto; }

/* Meus dados */
.plan-box { display: flex; flex-direction: column; gap: .3rem; padding: .9rem; margin-bottom: .9rem; border-radius: 12px; background: #f5f3ff; }
.plan-badge { align-self: flex-start; padding: .15rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 700; background: #e5e7eb; color: var(--text); }
.plan-badge.ok { background: #dcfce7; color: #166534; }
.plan-badge.bad { background: #fee2e2; color: #991b1b; }
.limits { margin: .9rem 0 0; padding-left: 1.1rem; color: var(--muted); font-size: .85rem; }
.limits:empty { display: none; }
a.button-link {
  display: inline-block; padding: .55rem 1rem; border-radius: 6px; border: 1px solid var(--primary);
  background: var(--primary); color: #fff; font-weight: 600; font-size: .875rem; text-decoration: none;
}
a.button-link.ghost { background: #fff; color: var(--primary); }
a.button-link[hidden] { display: none; }

/* Clientes (administrador) */
.adm-new { flex-wrap: wrap; align-items: end; gap: .5rem; }
.adm-new input[type="email"] { flex: 1 1 220px; margin: 0; }
.adm-new .field-inline { margin: 0; }
.adm-new .field-inline input { width: 90px; }
.adm-list { display: grid; gap: .6rem; margin-top: .5rem; }
.adm-client { border: 1px solid var(--border); border-radius: 12px; padding: .8rem .9rem; display: flex; flex-direction: column; gap: .45rem; }
.adm-client.off { background: #fafafa; }
.adm-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; word-break: break-all; }
.adm-meta { display: flex; flex-wrap: wrap; gap: .2rem 1rem; font-size: .8rem; color: var(--muted); }
.adm-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.adm-events { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; font-size: .82rem; max-height: 360px; overflow: auto; }

/* Assinatura vencida: some o menu de uso */
.account-inactive .tabs button[data-tab]:not([data-tab="conta"]),
.account-inactive .nav-group,
.account-inactive .nav-link { display: none !important; }
.inactive-card { max-width: 520px; margin: 1.5rem auto; text-align: center; padding: 2rem 1.25rem; }
.inactive-icon { width: 64px; height: 64px; margin: 0 auto .8rem; display: grid; place-items: center; border-radius: 50%; background: #fee2e2; color: #991b1b; font-size: 1.6rem; }
.inactive-card .button-link { margin: .5rem 0; font-size: 1rem; padding: .75rem 1.4rem; }

/* Cupons da Shopee */
.cp-alert { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; padding: .8rem 1rem; border-radius: 12px; background: linear-gradient(135deg, #ff7337, #ee4d2d); color: #fff; font-weight: 600; }
.cp-alert .button-link { margin-left: auto; background: #fff; border-color: #fff; color: #c2410c; }
.cp-grid { align-items: start; }
.cp-tools { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.cp-tools .check { margin: 0; }
.cp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.cp-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .7rem; padding: .65rem .8rem; border: 1.5px dashed #f5a58f; border-radius: 12px; background: #fff8f5; cursor: pointer; }
.cp-item:has(input:checked) { border-style: solid; border-color: #ee4d2d; background: #fff1ec; }
.cp-item input { width: auto; margin: 0; }
.cp-item-main { display: flex; flex-direction: column; min-width: 0; }
.cp-item-main strong { color: #c2410c; }
.cp-item-main small { font-size: .75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-sent { font-size: .7rem; font-weight: 700; color: #166534; background: #dcfce7; padding: .1rem .45rem; border-radius: 999px; }
.cp-empty { padding: 1.2rem; text-align: center; color: var(--muted); border: 1px dashed var(--border); border-radius: 12px; }
.cp-howto { margin: .4rem 0 .6rem; padding-left: 1.2rem; display: grid; gap: .35rem; font-size: .88rem; }
.cp-art { display: block; width: 100%; max-width: 360px; margin: .4rem auto .8rem; border-radius: 14px; box-shadow: 0 8px 24px rgb(0 0 0 / .15); }
.cp-art[hidden] { display: none; }
.cp-link-row { margin: .7rem 0 .2rem; }
.cp-preview-card { position: sticky; top: calc(var(--topbar-h, 0px) + .75rem); }
@media (max-width: 860px) { .cp-preview-card { position: static; } }

/* Relatórios de vendas */
.rp { --s1: #2a78d6; --s2: #eb6834; --good: #0ca30c; --warn: #fab219; --bad: #d03b3b; --grid: #e1e0d9; }
.rp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.rp-head h2 { margin: 0; display: flex; align-items: center; gap: .5rem; font-size: 1.25rem; }
.rp-head p { margin: .25rem 0 0; font-size: .82rem; }
.rp-head p.error { color: var(--danger); }
.rp-filters { display: flex; flex-direction: column; gap: .6rem; }
.rp-presets { display: flex; gap: .35rem; flex-wrap: wrap; }
.rp-presets .chip[aria-pressed="true"] { background: var(--primary); color: #fff; border-color: var(--primary); }
.rp-fields { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-end; }
.rp-fields .field-inline { margin: 0; }
.rp-fields input[type="date"], .rp-fields select { margin-top: .2rem; width: auto; }
.rp-fields input[type="search"] { flex: 1 1 200px; margin: 0; width: auto; min-width: 0; }
.rp-bot { margin: 0; font-size: .82rem; }
#rp-body.loading { opacity: .55; transition: opacity .15s; }
.rp-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.rp-kpi { display: flex; flex-direction: column; gap: .15rem; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: .8rem .9rem; }
.rp-kpi-label { font-size: .75rem; color: var(--muted); font-weight: 600; }
.rp-kpi strong { font-size: 1.45rem; font-weight: 650; line-height: 1.15; }
.rp-kpi-sub { font-size: .72rem; color: var(--muted); }
.rp-delta { font-size: .72rem; font-weight: 600; color: var(--muted); }
.rp-delta.up { color: #006300; }
.rp-delta.down { color: #a11d1d; }
.rp-kpi:first-child { background: linear-gradient(135deg, #020a1f, #0b3a8f); border: 0; color: #fff; }
.rp-kpi:first-child .rp-kpi-label, .rp-kpi:first-child .rp-kpi-sub { color: rgb(255 255 255 / .8); }
.rp-kpi:first-child .rp-delta { color: #38bdf8; }
.rp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.rp-grid > .card { margin: 0; }
.rp-wide { grid-column: 1 / -1; }
.rp-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; }
.rp-card-head h3 { margin: 0; font-size: .95rem; }
.rp-card-head .muted { font-size: .78rem; }
/* Colunas por dia: uma série (azul), barras finas com ponta arredondada */
.rp-chart { display: flex; gap: .5rem; height: 200px; }
.rp-yaxis { display: flex; flex-direction: column; justify-content: space-between; font-size: .68rem; color: var(--muted); padding-bottom: 1.3rem; text-align: right; flex: none; font-variant-numeric: tabular-nums; }
.rp-cols { flex: 1; display: flex; align-items: stretch; gap: 2px; border-bottom: 1px solid #c3c2b7; background: linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 100% 50%; padding-bottom: 1.3rem; position: relative; min-width: 0; }
.rp-col { flex: 1; position: relative; display: flex; align-items: flex-end; justify-content: center; cursor: default; outline: none; min-width: 0; }
.rp-col:hover, .rp-col:focus-visible { background: rgb(42 120 214 / .06); }
.rp-bar { width: min(100%, 24px); background: var(--s1); border-radius: 4px 4px 0 0; }
.rp-xlabel { position: absolute; bottom: -1.25rem; font-size: .64rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Barra de parte do todo (status) */
.rp-stack { display: flex; gap: 2px; height: 22px; border-radius: 6px; overflow: hidden; margin-bottom: .8rem; }
.rp-stack.small { height: 12px; margin: .3rem 0 .4rem; }
.rp-seg { min-width: 3px; outline: none; }
.rp-seg:hover, .rp-seg:focus-visible { filter: brightness(1.1); }
.st-good { background: var(--good); }
.st-warn { background: var(--warn); }
.st-bad { background: var(--bad); }
.st-muted { background: #9ca3af; }
.cat-1 { background: var(--s1); }
.cat-2 { background: var(--s2); }
.rp-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; font-size: .85rem; }
.rp-legend li { display: grid; grid-template-columns: 12px 1fr auto auto; align-items: center; gap: .5rem; }
.rp-legend .muted { font-size: .75rem; }
.rp-legend.inline { display: flex; gap: .9rem; flex-wrap: wrap; font-size: .8rem; }
.rp-legend.inline li { display: flex; align-items: center; gap: .35rem; }
.rp-key { width: 12px; height: 12px; border-radius: 3px; display: inline-block; flex: none; }
/* Horário: 24 colunas */
.rp-hours { display: flex; align-items: flex-end; gap: 2px; height: 120px; border-bottom: 1px solid #c3c2b7; }
.rp-hour { flex: 1; height: 100%; display: flex; align-items: flex-end; outline: none; }
.rp-hour span { width: 100%; background: #86b6ef; border-radius: 3px 3px 0 0; }
.rp-hour.peak span { background: var(--s1); }
.rp-hour:hover span, .rp-hour:focus-visible span { background: #1c5cab; }
.rp-hours-axis { display: flex; justify-content: space-between; font-size: .66rem; color: var(--muted); margin-top: .3rem; }
/* Produtos que mais renderam */
.rp-top { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; counter-reset: top; }
.rp-top li { display: grid; grid-template-columns: 20px 40px 1fr auto; align-items: center; gap: .6rem; font-size: .85rem; counter-increment: top; }
.rp-top li::before { content: counter(top); font-weight: 700; color: var(--muted); font-size: .8rem; text-align: center; }
.rp-top li.muted { display: block; }
.rp-top li.muted::before { content: none; }
.rp-top img, .rp-noimg { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--bg); display: block; }
.rp-top-name { display: flex; flex-direction: column; min-width: 0; }
.rp-top-name > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-top-name small { font-size: .72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-from-bot { color: #6d28d9; font-weight: 600; }
.rp-top strong { color: #006300; white-space: nowrap; }
/* Categorias: barras horizontais */
.rp-hbar { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; align-items: center; gap: .6rem; padding: .3rem 0; font-size: .82rem; outline: none; border-radius: 6px; }
.rp-hbar:hover, .rp-hbar:focus-visible { background: rgb(42 120 214 / .06); }
.rp-hbar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-hbar-track { height: 12px; }
.rp-hbar-track span { display: block; height: 100%; background: var(--s1); border-radius: 0 4px 4px 0; }
.rp-hbar strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-split { margin-bottom: .9rem; }
.rp-split-title { font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.rp-bot-share { margin: .4rem 0 0; padding: .7rem .8rem; border-radius: 10px; background: #f5f3ff; font-size: .85rem; }
.rp-bot-share strong { color: #6d28d9; }
/* Tabela de itens */
.rp-table-wrap { overflow-x: auto; margin: 0 -.25rem; }
.rp-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.rp-table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: .5rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.rp-table td { padding: .55rem .5rem; border-bottom: 1px solid #f0efec; vertical-align: middle; }
.rp-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-prod { display: flex; align-items: center; gap: .6rem; min-width: 240px; }
.rp-prod img, .rp-prod .rp-noimg { width: 40px; height: 40px; flex: none; }
.rp-prod > span { display: flex; flex-direction: column; min-width: 0; }
.rp-prod-name { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; }
.rp-prod small { font-size: .72rem; }
.rp-badge { display: inline-block; padding: .15rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.rp-badge.st-good { background: #dcfce7; color: #166534; }
.rp-badge.st-warn { background: #fef3c7; color: #92400e; }
.rp-badge.st-bad { background: #fee2e2; color: #991b1b; }
.rp-badge.st-muted { background: #f3f4f6; color: #4b5563; }
.rp-date { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.sort-mini { width: auto; margin: 0; padding: .35rem .5rem; font-size: .8rem; }
.rp-empty { text-align: center; padding: 2.5rem 1rem; }
.rp-tip { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; background: #111827; color: #fff; padding: .45rem .65rem; border-radius: 8px; font-size: .78rem; line-height: 1.4; box-shadow: 0 8px 20px rgb(0 0 0 / .25); }
.rp-tip strong { font-weight: 700; }
@media (max-width: 760px) {
  .rp-grid { grid-template-columns: 1fr; }
  .rp-chart { height: 170px; }
  .rp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rp-kpi:first-child { grid-column: 1 / -1; }
  .rp-kpi strong { font-size: 1.2rem; }
  .rp-fields .field-inline { flex: 1 1 45%; }
  .rp-fields input[type="date"], .rp-fields select { width: 100%; }
}

/* Meu site */
.site-hero { display: flex; gap: 1.2rem; flex-wrap: wrap; align-items: stretch; background: linear-gradient(135deg, #020a1f, #0b4fb8); color: #fff; border: 0; }
.site-hero .hint { color: rgb(255 255 255 / .85); }
.site-hero h2 { margin: .4rem 0 .2rem; font-size: 1.25rem; }
.site-hero-main { flex: 1 1 320px; min-width: 0; }
.site-hero .copy-row input { background: rgb(255 255 255 / .95); }
.site-hero .button-link { background: #fde047; border-color: #fde047; color: #1e1b4b; }
.site-live { display: inline-flex; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: .2rem .6rem; border-radius: 999px; background: rgb(34 197 94 / .25); color: #bbf7d0; }
.site-live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #22c55e; }
.site-live.off { background: rgb(239 68 68 / .25); color: #fecaca; }
.site-live.off::before { background: #ef4444; }
.site-stats { flex: 0 1 300px; display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; padding: .8rem; border-radius: 14px; background: rgb(255 255 255 / .1); }
.site-stats > div:not(.st-chart) { display: flex; flex-direction: column; }
.site-stats strong { font-size: 1.6rem; line-height: 1.1; }
.site-stats span { font-size: .75rem; opacity: .8; }
.st-chart { grid-column: 1 / -1; display: flex; align-items: flex-end; gap: 4px; height: 52px; }
.st-chart span { flex: 1; border-radius: 4px 4px 0 0; background: #fde047; opacity: .9; }
.site-logo-row { display: flex; gap: .8rem; align-items: center; margin-bottom: .8rem; }
.site-logo-row img { border-radius: 16px; object-fit: cover; background: var(--bg); flex: none; }
.site-logo-row .hint { margin: .3rem 0 0; }
.file-btn { cursor: pointer; margin: 0; font-weight: 600; }
.color-row { display: flex; align-items: center; gap: .5rem; margin-top: .3rem; }
.color-row input[type="color"] { width: 46px; height: 38px; padding: 2px; margin: 0; flex: none; cursor: pointer; }
.color-presets { display: flex; gap: .3rem; flex-wrap: wrap; }
.color-dot { width: 24px; height: 24px; padding: 0; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px var(--border); }
.slug-prefix { flex: none; font-size: .85rem; font-weight: 400; }
.domain-state { padding: .6rem .8rem; border-radius: 10px; font-weight: 600; font-size: .9rem; margin-bottom: .8rem; }
.domain-state.ok { background: #dcfce7; color: #166534; }
.domain-state.wait { background: #fef3c7; color: #92400e; }
.domain-state[hidden] { display: none; }
.dns-steps { margin: .4rem 0 1rem; padding-left: 1.2rem; font-size: .85rem; color: var(--muted); display: grid; gap: .45rem; }
.dns-box { display: block; margin-top: .3rem; padding: .45rem .6rem; border-radius: 8px; background: var(--bg); color: var(--text); }
.dns-box code { font-weight: 700; user-select: all; }
.site-top { margin: 0; padding-left: 1.2rem; display: grid; gap: .4rem; font-size: .85rem; }
.site-top li { display: flex; justify-content: space-between; gap: .6rem; }
.site-top li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-top li strong { flex: none; color: var(--primary); }
.site-top li.muted { display: block; list-style: none; margin-left: -1.2rem; }

/* Converter link */
.conv-grid { align-items: start; }
.conv-form { display: flex; flex-direction: column; gap: .2rem; }
.conv-input { display: flex; gap: .4rem; }
.conv-input input { margin: 0; font-size: 1rem; padding: .7rem .8rem; }
.conv-input button { flex: none; }
#btn-convert { padding: .75rem; font-size: 1rem; }
.conv-stores { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0 .4rem; padding: 0; }
.conv-stores li { padding: .3rem .65rem; border-radius: 999px; background: var(--bg); font-size: .8rem; font-weight: 600; }
.conv-stores li span { font-weight: 400; color: var(--ok); }
.conv-result h2 { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
#conv-source { font-size: .8rem; font-weight: 500; color: var(--muted); }
.conv-photo { display: grid; place-items: center; height: 180px; margin-bottom: .9rem; border-radius: 12px; background: var(--bg); overflow: hidden; }
.conv-photo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.conv-photo img[hidden] { display: none; }
.conv-noimg { color: var(--muted); font-size: .85rem; }
.conv-noimg[hidden] { display: none; }
.conv-result input.needs { border-color: #f59e0b; background: #fffbeb; }
.conv-actions { margin-top: 1rem; }
.conv-actions button { flex: 1 1 200px; }

/* Entrar com o Google */
.google-btn {
  display: flex; align-items: center; justify-content: center; gap: .6rem; width: 100%;
  padding: .75rem; border: 1px solid #dadce0; border-radius: 10px; background: #fff; color: #1f1f1f;
  font-weight: 600; font-size: .95rem; text-decoration: none;
}
.google-btn:hover { background: #f8f9fa; }
.or-line { display: flex; align-items: center; gap: .6rem; margin: 1rem 0; color: var(--muted); font-size: .8rem; }
.or-line::before, .or-line::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.google-link { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; padding: .75rem; margin-bottom: 1rem; border: 1px solid var(--border); border-radius: 12px; }
.google-link[hidden] { display: none; }
.google-link img { border-radius: 50%; }
.google-link > div { display: flex; flex-direction: column; flex: 1; min-width: 160px; }
.google-link > div span { font-size: .8rem; }
a.button-link.small { padding: .4rem .7rem; font-size: .8rem; }

/* Quem está logado (no cartão de conexões) */
.me-card { display: flex; align-items: center; gap: .6rem; }
.me-card[hidden] { display: none; }
.me-card img { border-radius: 50%; flex: none; object-fit: cover; }
.me-card div { display: flex; flex-direction: column; min-width: 0; }
.me-card strong, .me-card span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-card span { font-size: .75rem; color: var(--muted); }
/* Computador: foto pequena ao lado das conexões */
@media (min-width: 861px) {
  .me-card { order: 10; gap: .4rem; }
  .me-card img { width: 28px; height: 28px; }
  .me-card strong { font-size: .8rem; max-width: 160px; }
  .me-card span { display: none; }
}
/* Foto do Google: sem a borda do ícone do app */
.status-btn.has-photo img { object-fit: cover; }

/* Login: link "esqueci minha senha" */
.login-links { margin: 1rem 0 0; font-size: .85rem; }
.login-links a { color: #6d28d9; }

.toast {
  position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%); max-width: 90vw;
  background: #111827; color: #fff; padding: .7rem 1.1rem; border-radius: 8px; font-size: .9rem;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.toast.show { opacity: 1; }
.toast.error { background: var(--danger); }
.cp-sync { margin: .1rem 0 .6rem; font-size: .8rem; color: var(--muted); }

/* Cupons por print */
.check-row { display: flex; gap: .5rem; align-items: flex-start; font-size: .88rem; margin: .2rem 0 .7rem; font-weight: 400; }
.check-row input[type="checkbox"] { margin-top: .15rem; width: auto; flex: 0 0 auto; }
.file-btn.disabled { opacity: .6; pointer-events: none; }

/* Vários números de WhatsApp */
.wa-numbers { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 .9rem; }
.wa-numbers .chip { display: inline-flex; align-items: center; gap: .3rem; padding: .45rem .95rem; font-size: .85rem; }
.wa-numbers .chip small { font-weight: 500; opacity: .8; }
.wa-dot { width: 9px; height: 9px; border-radius: 50%; background: #d1d5db; flex: 0 0 auto; }
.wa-dot.ok { background: #22c55e; }
.wa-dot.bad { background: #ef4444; }
.danger-text { color: var(--danger); }
.wa-num-add { border-style: dashed; color: var(--text); }

/* Agendamento: selecionar rodadas para apagar de uma vez */
#slot-select-bar.hidden { display: none; }
.slot-pick { width: 18px; height: 18px; margin: 1.45rem 0 0; flex: none; accent-color: var(--primary); cursor: pointer; }
.slot.picked { border-color: var(--primary); box-shadow: 0 0 0 2px rgb(31 111 235 / .25); }
@media (max-width: 640px) { .slot-pick { margin-top: .15rem; } }

/* Lista de produtos atualizando: fica um pouco apagada (sem pular a tela) */
#product-list.loading { opacity: .55; transition: opacity .12s; pointer-events: none; }

/* Vitrine da Shopee */
.vt-modes .chip { font-size: .85rem; padding: .45rem 1rem; }
.vt-cats .chip { white-space: nowrap; }
@media (max-width: 860px) {
  .vt-cats { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .35rem; scrollbar-width: none; }
  .vt-cats::-webkit-scrollbar { display: none; }
  .vt-cats .chip { flex: none; }
}
.vt-hide { margin: 0 0 0 auto; font-size: .82rem; font-weight: 500; }
.select-bar.active .vt-hide { color: #fff; }
.vt-more { display: flex; justify-content: center; margin-top: 1rem; }
#vt-list.loading { opacity: .55; pointer-events: none; transition: opacity .12s; }
.product.queued .media img { opacity: .6; }
