/* Loja Grussaí: branco e o azul da logo. Letra grande, poucos botões. */
:root {
  --blue: #1d5f9e;
  --blue-dark: #123d66;
  --blue-soft: #eaf3fb;
  --text: #1c2b38;
  --muted: #55626e;
  --line: #d5dee6;
  --white: #fff;
  --green: #1f6b3f;
  --green-soft: #e8f5ed;
  --orange: #8a4b00;
  --orange-soft: #fff1dd;
  --danger: #a3303c;
  color-scheme: light;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--white);
  font-size: 17px;
  line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--white); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: var(--blue); text-underline-offset: 3px; }
img { max-width: 100%; display: block; object-fit: cover; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { color: var(--blue-dark); line-height: 1.2; }
input, textarea, select { width: 100%; min-height: 50px; padding: 11px 14px; border: 1.5px solid #aebdca; border-radius: 10px; background: var(--white); }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px var(--blue-soft); }
input[type="checkbox"], input[type="radio"] { width: 24px; height: 24px; min-height: 24px; padding: 0; accent-color: var(--blue); flex-shrink: 0; }
input::placeholder, textarea::placeholder { color: #6b7782; opacity: 1; }
:focus-visible { outline: 3px solid #5b9bd5; outline-offset: 3px; }
main:focus { outline: none; }
.icon { width: 22px; height: 22px; flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 1000; padding: 12px 18px; background: var(--blue-dark); color: var(--white); }
.skip-link:focus { top: 12px; }
.small { font-size: 15px; }
.muted { color: var(--muted); }
.wrap { width: min(1120px, calc(100% - 32px)); margin-inline: auto; }

.button { min-height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 20px; border: 1.5px solid var(--blue); border-radius: 12px; background: var(--white); color: var(--blue-dark); font-weight: 600; text-decoration: none; line-height: 1.2; text-align: center; }
.button:hover:not(:disabled) { background: var(--blue-soft); }
.button.primary { background: var(--blue); color: var(--white); }
.button.primary:hover:not(:disabled) { background: var(--blue-dark); }
.button.danger { background: var(--danger); border-color: var(--danger); color: var(--white); }
.button.wide { width: 100%; }
.button.small-button { min-height: 44px; padding: 8px 14px; }
.button.loading { opacity: .7; }
.text-button { border: 0; padding: 10px 4px; min-height: 48px; color: var(--blue); text-decoration: underline; font-weight: 500; }
.icon-button { border: 0; display: inline-flex; align-items: center; justify-content: center; min-width: 48px; min-height: 48px; border-radius: 10px; }
.icon-button:hover { background: var(--blue-soft); }
.tab { min-height: 48px; padding: 10px 18px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--white); font-weight: 600; color: var(--blue-dark); }
.tab.active { background: var(--blue-dark); border-color: var(--blue-dark); color: var(--white); }
.price { font-size: 22px; font-weight: 700; color: var(--blue-dark); }
.price.big { font-size: 30px; }
.field-label { display: block; font-weight: 600; margin: 18px 0 6px; }
.form-error { color: var(--danger); font-weight: 600; min-height: 0; }
.form-error:not(:empty) { margin-top: 12px; }
.checkbox-label { display: flex; align-items: center; gap: 12px; min-height: 48px; font-weight: 500; cursor: pointer; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 700; font-size: 20px; color: var(--blue-dark); }
.brand img { width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--blue-soft); }
.brand-link { text-decoration: none; }
.empty-state { padding: 40px 16px; text-align: center; display: grid; gap: 14px; justify-items: center; grid-column: 1 / -1; }
.not-found, .initial-loading { padding: 18vh 16px; text-align: center; display: grid; gap: 20px; justify-items: center; }

/* Vitrine */
.shop { min-height: 100vh; display: flex; flex-direction: column; }
.shop.has-bag { padding-bottom: 84px; }
.shop main { flex: 1; }
.test-bar { background: var(--blue-soft); border-bottom: 1px solid var(--line); padding: 8px 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; }
.shop-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 18px; }
.shop-intro { padding-block: 20px 24px; }
.shop-intro h1 { font-size: clamp(30px, 5vw, 44px); }
.shop-intro p { margin-top: 10px; font-size: 19px; color: var(--muted); max-width: 34em; }
.category-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px 24px; padding-bottom: 56px; }
.product-card { display: flex; flex-direction: column; gap: 6px; }
.product-image { border: 0; padding: 0; border-radius: 16px; overflow: hidden; aspect-ratio: 4 / 5; background: var(--blue-soft); margin-bottom: 8px; }
.product-image img { width: 100%; height: 100%; transition: transform .25s; }
.product-image:hover img { transform: scale(1.03); }
.product-card h3 { font-size: 21px; }
.product-meta { color: var(--muted); }
.product-card .price { margin-bottom: 8px; }
.product-card .button { margin-top: auto; }
.photo-empty { width: 100%; height: 100%; display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--muted); }
.shop-footer { background: var(--blue-dark); color: var(--white); padding-block: 36px; }
.shop-footer h2 { color: var(--white); font-size: 18px; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.shop-footer a { color: var(--white); font-weight: 600; }
.shop-footer p span { opacity: .85; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px; }
.footer-grid p + a { display: inline-block; margin-top: 6px; }

/* Janelas */
#modal { width: min(920px, calc(100% - 24px)); max-height: calc(100dvh - 24px); border: 0; border-radius: 18px; padding: 28px; overflow: auto; color: var(--text); }
#modal::backdrop { background: rgba(18, 61, 102, .55); }
#modal.edit-modal, #modal.import-modal { width: min(860px, calc(100% - 24px)); }
#modal:has(.simple-modal) { width: min(520px, calc(100% - 24px)); }
.modal-close { position: absolute; top: 12px; right: 12px; background: var(--white); z-index: 2; box-shadow: 0 1px 6px rgba(0,0,0,.18); border-radius: 50%; }
/* Janela da peça: cabe inteira na tela, sem barra de rolagem; a foto encolhe para dar lugar às escolhas. */
#modal.product-modal { padding: 0; overflow: hidden; width: min(920px, calc(100% - 32px)); height: min(640px, calc(100dvh - 32px)); }
.product-detail { display: grid; grid-template-columns: 1fr 1fr; height: 100%; }
.detail-image { position: relative; min-height: 0; background: var(--blue-soft); overflow: hidden; }
.detail-image > .photo-empty { height: 100%; }
.zoom-button { display: block; width: 100%; height: 100%; padding: 0; border: 0; position: relative; cursor: zoom-in; }
.detail-photo { width: 100%; height: 100%; }
.zoom-hint { position: absolute; left: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.92); color: var(--blue-dark); font-weight: 600; font-size: 15px; padding: 6px 12px; border-radius: 999px; }
.zoom-hint .icon { width: 18px; height: 18px; }
.image-thumbs { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 6px; }
.thumb-button { border: 2px solid var(--white); border-radius: 8px; padding: 0; overflow: hidden; opacity: .8; }
.thumb-button.active { border-color: var(--blue); opacity: 1; }
.thumb-button img { width: 44px; height: 52px; }
.detail-copy { display: flex; flex-direction: column; gap: 14px; padding: 24px; min-height: 0; }
.detail-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-right: 44px; }
.detail-title h2 { font-size: 24px; }
.detail-color { color: var(--muted); }
.detail-title .price { white-space: nowrap; }
.price.big { font-size: 26px; }
.detail-description { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.choice-group { border: 0; padding: 0; margin: 0; }
.choice-group legend { font-weight: 700; font-size: 17px; color: var(--blue-dark); margin-bottom: 8px; padding: 0; }
.choice-group legend span { font-weight: 500; color: var(--muted); }
.size-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.size-button { min-width: 64px; min-height: 54px; border: 2px solid #aebdca; border-radius: 12px; font-size: 20px; font-weight: 700; background: var(--white); }
.size-button:hover { border-color: var(--blue); }
.size-button.selected { background: var(--blue); border-color: var(--blue); color: var(--white); box-shadow: 0 0 0 3px var(--blue-soft); }
.pickup-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pickup-option.perguntar { grid-column: 1 / -1; }
.pickup-option input { position: absolute; opacity: 0; pointer-events: none; }
.pickup-option span { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 8px 10px; border: 2px solid #aebdca; border-radius: 12px; font-weight: 600; text-align: center; cursor: pointer; line-height: 1.2; }
.pickup-option input:checked + span { background: var(--blue-soft); border-color: var(--blue); color: var(--blue-dark); box-shadow: inset 0 0 0 1px var(--blue); }
.pickup-option input:focus-visible + span { outline: 3px solid #5b9bd5; outline-offset: 2px; }
.detail-copy .form-error:empty { display: none; }
.detail-copy .form-error:not(:empty) { margin-top: -6px; }
.detail-copy .button.primary { margin-top: auto; min-height: 56px; font-size: 18px; }

/* Foto ampliada: zoom com dois dedos, sem barras de rolagem. */
.photo-viewer { position: fixed; inset: 0; z-index: 10; background: #0b1520; display: flex; flex-direction: column; }
.viewer-stage { flex: 1; min-height: 0; overflow: hidden; touch-action: none; display: grid; place-items: center; cursor: grab; }
.viewer-stage img { width: 100%; height: 100%; object-fit: contain; transform-origin: center; user-select: none; -webkit-user-drag: none; will-change: transform; }
.viewer-close { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; background: var(--white); }
.viewer-step { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 72px; border: 0; border-radius: 12px; background: rgba(255,255,255,.88); color: var(--blue-dark); font-size: 40px; line-height: 1; }
.viewer-step.prev { left: 8px; }
.viewer-step.next { right: 8px; }
.viewer-hint { color: #d9e4ee; text-align: center; font-size: 15px; padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); }
body:has(#modal[open]) { overflow: hidden; }

.simple-modal { display: grid; gap: 14px; }
.simple-modal h2 { font-size: 24px; padding-right: 52px; }
#modal h2[tabindex="-1"]:focus { outline: none; }
.simple-modal .field-label { margin: 4px 0 -6px; }
.order-text { background: var(--blue-soft); border-left: 5px solid var(--blue); padding: 14px 16px; border-radius: 8px; font-size: 17px; white-space: pre-line; }
.modal-footer { display: flex; justify-content: flex-end; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); visibility: hidden; background: var(--blue-dark); color: var(--white); padding: 14px 22px; border-radius: 12px; font-weight: 600; max-width: calc(100% - 32px); transition: transform .2s; z-index: 50; }
#toast.visible { transform: translate(-50%, 0); visibility: visible; }

/* Sacola */
.in-bag { position: absolute; left: 10px; top: 10px; display: inline-flex; align-items: center; gap: 4px; background: var(--blue); color: var(--white); font-weight: 700; font-size: 15px; padding: 4px 10px; border-radius: 999px; }
.in-bag .icon { width: 16px; height: 16px; }
.product-image { position: relative; }
.one-size { font-weight: 600; color: var(--blue-dark); }
.bag-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: var(--white); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(18,61,102,.08); padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); }
.bag-bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bag-bar .wrap > span { display: flex; align-items: center; gap: 10px; font-size: 18px; color: var(--blue-dark); }
.added-piece { display: flex; gap: 14px; align-items: center; padding-right: 44px; }
.added-piece img, .added-piece .photo-empty { width: 72px; height: 88px; border-radius: 10px; flex-shrink: 0; }
.added-piece h2 { padding-right: 0; margin-bottom: 4px; }
#modal.bag-modal { height: auto; max-height: min(760px, calc(100dvh - 32px)); width: min(560px, calc(100% - 32px)); }
.bag { display: flex; flex-direction: column; height: 100%; max-height: inherit; padding: 22px 22px 18px; gap: 12px; }
.bag h2 { font-size: 24px; padding-right: 52px; }
.bag-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; scrollbar-width: thin; flex: 1 1 auto; min-height: 0; display: grid; gap: 10px; align-content: start; }
.bag-item { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px 8px 8px; }
.bag-item > img, .bag-item > .photo-empty { width: 56px; height: 68px; border-radius: 8px; }
.bag-item-copy { display: grid; gap: 2px; min-width: 0; }
.bag-item-copy strong { color: var(--blue-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bag-item-copy > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bag-item-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.bag-item-copy span { color: var(--muted); font-size: 15px; }
.bag-item-copy .bag-price { color: var(--blue-dark); font-weight: 700; font-size: 17px; }
.qty { display: flex; align-items: center; gap: 6px; }
.qty span { min-width: 22px; text-align: center; font-weight: 700; font-size: 19px; }
.qty-button { width: 40px; height: 40px; border: 1.5px solid #aebdca; border-radius: 10px; font-size: 22px; font-weight: 700; color: var(--blue-dark); display: grid; place-content: center; }
.qty-button .icon { width: 18px; height: 18px; }
.bag-footer { flex: 0 0 auto; display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.bag-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 18px; }
.bag-total strong { font-size: 24px; color: var(--blue-dark); }
.bag-footer .form-error:empty { display: none; }
.size-mode { display: flex; gap: 18px; flex-wrap: wrap; }
.stock-inputs[hidden] { display: none; }

/* Painel */
.admin-layout { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: var(--blue-soft); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { font-size: 18px; padding-inline: 6px; }
.sidebar nav { display: grid; gap: 4px; }
.sidebar-link { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: var(--blue-dark); font-weight: 600; }
.sidebar-link:hover { background: var(--white); }
.sidebar-link.active { background: var(--blue); color: var(--white); }
.nav-count { margin-left: auto; background: var(--blue); color: var(--white); border-radius: 999px; min-width: 28px; padding: 2px 8px; text-align: center; font-weight: 700; }
.sidebar-link.active .nav-count { background: var(--white); color: var(--blue-dark); }
.sidebar-separator { height: 1px; background: var(--line); margin: 10px 6px; }
.sidebar-shop { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-height: 48px; font-weight: 600; text-decoration: none; }
.admin-main { padding: 28px 32px 48px; min-width: 0; max-width: 1200px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-heading h1 { font-size: 32px; }
.heading-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.page-intro { color: var(--muted); margin: -6px 0 22px; max-width: 46em; }
.search-field { position: relative; display: block; }
.search-field .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-field input { padding-left: 46px; }
.status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 14px; font-weight: 600; background: var(--blue-soft); color: var(--blue-dark); }
.status.waiting { background: var(--orange-soft); color: var(--orange); }
.status.human { background: var(--green-soft); color: var(--green); }
.status.closed { background: #eef0f2; color: var(--muted); }
.avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-content: center; background: var(--blue-soft); color: var(--blue-dark); font-weight: 700; flex-shrink: 0; }

.inbox-tabs { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.inbox-workspace { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; min-height: 620px; }
.conversation-list { min-width: 0; border-right: 1px solid var(--line); padding: 14px; display: flex; flex-direction: column; gap: 10px; overflow: auto; max-height: 78vh; }
.conversation-item { min-width: 0; display: flex; gap: 12px; width: 100%; text-align: left; border: 1.5px solid transparent; border-radius: 12px; padding: 12px; }
.conversation-item:hover { background: var(--blue-soft); }
.conversation-item.active { background: var(--blue-soft); border-color: var(--blue); }
.conversation-item.waiting .avatar { background: var(--orange-soft); color: var(--orange); }
.conversation-item-copy { display: grid; gap: 4px; min-width: 0; flex: 1; justify-items: start; }
.name-time { display: flex; justify-content: space-between; gap: 8px; width: 100%; }
.name-time span { color: var(--muted); font-size: 14px; }
.last-message { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
.list-empty { padding: 24px 8px; text-align: center; display: grid; gap: 12px; justify-items: center; }
.conversation-detail { display: flex; flex-direction: column; min-width: 0; padding: 18px 22px; gap: 14px; }
.mobile-back { display: none; align-self: flex-start; }
.chat-header { display: flex; align-items: center; gap: 12px; }
.chat-header h2 { font-size: 22px; }
.chat-header span { color: var(--muted); }
.chat-state { padding: 12px 16px; border-radius: 12px; background: var(--blue-soft); font-weight: 600; }
.chat-state.waiting { background: var(--orange-soft); color: var(--orange); }
.chat-state.human { background: var(--green-soft); color: var(--green); }
.chat-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.selected-piece { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.selected-piece img { width: 56px; height: 66px; border-radius: 8px; }
.selected-piece span { font-size: 14px; color: var(--muted); }
.selected-piece strong { display: block; color: var(--blue-dark); }
.messages-scroll { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px; min-height: 240px; max-height: 52vh; }
.message { max-width: min(78%, 520px); padding: 10px 14px; border-radius: 14px; background: #f1f4f7; align-self: flex-start; }
.message.automatic, .message.human { align-self: flex-end; background: var(--blue-soft); }
.message.human { background: var(--blue); color: var(--white); }
.message img { border-radius: 10px; margin-bottom: 6px; width: 180px; height: 210px; }
.message-label { display: block; font-size: 13px; font-weight: 700; opacity: .8; margin-bottom: 2px; }
.message-time { display: block; font-size: 12px; opacity: .7; margin-top: 4px; text-align: right; }
.system-message { align-self: center; font-size: 14px; color: var(--muted); text-align: center; padding: 4px 12px; }
.chat-composer { display: flex; gap: 10px; align-items: flex-end; }
.chat-composer textarea, .chat-composer input { min-height: 52px; }
.send-button { min-width: 56px; padding: 12px; }

.inventory-search { max-width: 420px; margin-bottom: 18px; }
.inventory-cards { display: grid; gap: 14px; }
.inventory-card { display: grid; grid-template-columns: 96px 1fr auto; gap: 16px; align-items: center; border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.inventory-card > img, .inventory-card > .photo-empty { width: 96px; height: 116px; border-radius: 10px; background: var(--blue-soft); }
.inventory-card.hidden-piece { background: #f7f8f9; }
.inventory-card.hidden-piece > img { opacity: .5; }
.inventory-card-copy { display: grid; gap: 4px; }
.inventory-card-copy h2 { font-size: 20px; }
.inventory-card-copy .price { font-size: 20px; }
.stock-sizes { display: flex; gap: 8px; flex-wrap: wrap; }
.stock-cell { background: var(--blue-soft); border-radius: 8px; padding: 2px 10px; }
.stock-cell.zero { background: #f3e9e9; color: var(--danger); }
.inventory-status { color: var(--muted); font-size: 15px; }
.edit-product-form h2, .import-dialog h2 { font-size: 26px; padding-right: 40px; margin-bottom: 8px; }
.edit-product-grid { display: grid; grid-template-columns: 240px 1fr; gap: 28px; }
.edit-photos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
.edit-photo { position: relative; }
.edit-photo img { width: 100%; aspect-ratio: 4 / 5; border-radius: 10px; }
.edit-photo .icon-button { position: absolute; top: 4px; right: 4px; background: var(--white); min-width: 40px; min-height: 40px; }
.upload-empty { grid-column: 1 / -1; aspect-ratio: 4 / 3; border: 2px dashed var(--line); border-radius: 12px; display: grid; place-content: center; justify-items: center; gap: 6px; color: var(--muted); }
.upload-button { width: 100%; cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sizes-fieldset { border: 0; padding: 0; margin: 18px 0 0; }
.sizes-fieldset legend { font-weight: 700; padding: 0; margin-bottom: 8px; }
.stock-inputs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stock-inputs label { display: grid; gap: 4px; font-weight: 700; text-align: center; }
.stock-inputs input { text-align: center; font-size: 20px; }
.more-fields { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.more-fields summary, .mapping-details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--blue); font-weight: 600; }

.import-upload { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; border: 1.5px dashed #aebdca; border-radius: 14px; padding: 16px; margin-top: 16px; }
.import-upload .upload-button { width: auto; }
.import-models { margin-top: 10px; }
.import-config { margin-top: 16px; }
.import-mapping { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 10px 0; }
.import-mapping label { display: grid; gap: 4px; font-weight: 600; font-size: 15px; }
.preview-refresh { margin-top: 10px; }
.import-counts { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.import-counts span { background: var(--blue-soft); border-radius: 10px; padding: 8px 14px; }
.import-counts .has-errors { background: #f9e5e7; color: var(--danger); }
.preview-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.preview-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.preview-table th, .preview-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.preview-table td span { display: block; color: var(--muted); }
.invalid-row { background: #fdf3f4; }
.import-result { font-weight: 700; }
.import-result.error { color: var(--danger); }
.import-result.create { color: var(--green); }
.preview-pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.preview-pagination div { display: flex; gap: 8px; }
.import-blocking-note { margin-top: 12px; color: var(--danger); font-weight: 600; }

.settings-section { border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; margin-bottom: 18px; max-width: 760px; }
.settings-section h2 { font-size: 22px; margin-bottom: 4px; }
.hours-editor { border: 0; padding: 0; margin: 14px 0 0; }
.hours-editor legend { font-weight: 700; padding: 0; margin-bottom: 6px; }
.hours-editor > div { display: flex; gap: 14px; flex-wrap: wrap; }
.hours-editor label { display: grid; gap: 4px; font-weight: 500; }
.hours-editor input[type="time"] { width: 150px; }
.faq-editor-row { border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 12px; }
.settings-save { position: sticky; bottom: 0; background: var(--white); padding: 14px 0; border-top: 1px solid var(--line); max-width: 760px; display: flex; justify-content: flex-end; align-items: center; gap: 14px; flex-wrap: wrap; }

.simulation-toolbar { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 18px; }
.simulation-toolbar label { display: grid; gap: 4px; font-weight: 600; min-width: 260px; }
.simulation-grid { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 24px; align-items: start; }
.phone { border: 1px solid var(--line); border-radius: 22px; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #fbfcfd; }
.phone-header { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.phone-header .brand { font-size: 17px; }
.phone-header .brand img { width: 40px; height: 40px; }
.phone-messages { min-height: 320px; }
.quick-replies { display: flex; gap: 8px; flex-wrap: wrap; }
.quick-replies .button { min-height: 44px; font-size: 15px; }
.simulation-store { display: grid; gap: 14px; }
.simulation-store h2 { font-size: 22px; }
.whatsapp-preview { border: 1px solid #cfe5d6; background: #f1f8f3; border-radius: 14px; padding: 16px; display: grid; gap: 10px; }
.whatsapp-preview h3 { font-size: 17px; color: var(--green); }
.whatsapp-bubble { background: var(--white); border-radius: 0 12px 12px 12px; padding: 12px 14px; white-space: pre-wrap; overflow-wrap: anywhere; }

.history-controls { display: grid; grid-template-columns: minmax(240px, 380px) minmax(220px, 360px); gap: 14px; align-items: end; margin-bottom: 16px; }
.history-controls .field-label { margin: 0; }
.history-controls select { margin-top: 6px; }
.history-context { background: var(--blue-soft); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.history-record { border-bottom: 1px solid var(--line); padding: 12px 4px; display: flex; justify-content: space-between; gap: 14px; }
.history-record span { color: var(--muted); font-size: 14px; white-space: nowrap; }
.reset-demo { margin-top: 24px; color: var(--danger); }

@media (max-width: 900px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 24px 16px; }
  #modal.product-modal { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .product-detail { display: flex; flex-direction: column; }
  .detail-image { flex: 1 1 auto; min-height: 120px; }
  .detail-copy { flex: 0 0 auto; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); gap: 12px; }
  .detail-copy .button.primary { margin-top: 2px; }
  .detail-description { display: none; }
  #modal.bag-modal { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; }
  .bag { padding: 16px 16px calc(14px + env(safe-area-inset-bottom)); }
  .admin-layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; padding: 12px; gap: 10px; }
  .sidebar { min-width: 0; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 6px; }
  .sidebar-link { white-space: nowrap; min-height: 48px; padding: 8px 12px; background: var(--white); }
  .sidebar-separator, .sidebar-shop { display: none; }
  .admin-main { padding: 20px 16px 40px; }
  .inbox-workspace { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .conversation-list { border-right: 0; max-height: none; }
  .inbox-workspace .conversation-detail { display: none; }
  .inbox-workspace.mobile-chat .conversation-list { display: none; }
  .inbox-workspace.mobile-chat .conversation-detail { display: flex; }
  .mobile-back { display: inline-flex; }
  .simulation-grid, .edit-product-grid { grid-template-columns: 1fr; }
  .history-controls { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  :root { font-size: 17px; }
  .shop-header .ig-long { display: none; }
  .shop-header .button { padding: 12px 14px; }
  .brand { font-size: 18px; }
  .brand img { width: 48px; height: 48px; }
  .product-grid { grid-template-columns: 1fr; }
  .product-image { aspect-ratio: 1; }
  #modal { padding: 20px 16px; }
  .inventory-card { grid-template-columns: 72px 1fr; }
  .inventory-card > img, .inventory-card > .photo-empty { width: 72px; height: 88px; }
  .inventory-card > .button { grid-column: 1 / -1; }
  .form-row { grid-template-columns: 1fr; }
  .stock-inputs { grid-template-columns: repeat(2, 1fr); }
  .page-heading h1 { font-size: 28px; }
  .heading-actions, .heading-actions .button, .chat-actions .button { width: 100%; }
  .message { max-width: 88%; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Login do painel e página de privacidade */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 16px; background: var(--blue-soft); }
.login-box { width: min(380px, 100%); background: var(--white); border-radius: 18px; padding: 28px 22px; display: grid; gap: 10px; justify-items: stretch; }
.login-box .brand { justify-self: center; }
.login-box h1 { font-size: 24px; text-align: center; margin-top: 6px; }
.login-box .field-label { margin-bottom: 0; }
.login-box > a { text-align: center; margin-top: 6px; }
.privacy { max-width: 720px; padding-block: 24px 48px; display: grid; gap: 12px; }
.privacy h1 { font-size: 30px; margin-top: 12px; }
.privacy h2 { font-size: 20px; margin-top: 12px; }
.privacy .button { justify-self: start; margin-top: 16px; }
.footer-legal { margin-top: 24px; font-size: 15px; opacity: .85; }
.sidebar-shop.text-button { margin-top: 0; color: var(--blue-dark); text-decoration: none; justify-content: flex-start; }
