.stats-four { grid-template-columns: repeat(4, 1fr); }
.stats-four small a { color: var(--purple); font-weight: 700; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 18px; flex-wrap: wrap; }
.pagination button { border: 1px solid var(--line); background: white; min-width: 34px; height: 34px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.pagination button.active { background: var(--purple); border-color: var(--purple); color: white; font-weight: 700; }
.pagination button:disabled { opacity: .4; cursor: default; }
.overview-item .overview-views { color: var(--muted); font-size: 12px; white-space: nowrap; }
.cart-card { background: white; border: 1px solid var(--line); border-radius: 13px; padding: 18px 20px; margin-bottom: 12px; }
.cart-card .order-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.cart-card ul { margin: 8px 0; padding-left: 18px; font-size: 13px; color: #444; }
.settings-panel { max-width: 980px; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; }
.secondary { border: 1px solid var(--line); border-radius: 7px; padding: 10px 15px; background: white; cursor: pointer; }
.check-label { display: flex !important; grid-template-columns: 18px 1fr; align-items: center; gap: 9px !important; }
.check-label input { width: 18px !important; height: 18px; }
.banner-admin-list { display: grid; gap: 14px; }
.banner-admin-card { display: grid; grid-template-columns: 240px 1fr auto; gap: 18px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 11px; }
.banner-admin-card.inactive { opacity: .58; }
.banner-admin-card img { width: 240px; aspect-ratio: 16/7; object-fit: cover; border-radius: 8px; background: #eee; }
.banner-admin-card h3 { margin: 0 0 5px; font: 700 17px Manrope; }
.banner-admin-card p { margin: 0 0 7px; }
.banner-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.status-pill { padding: 4px 8px; border-radius: 12px; background: #e7f7ee; color: #16834b; font-size: 10px; font-weight: 700; }
.status-pill.off { background: #eee; color: #777; }
.banner-actions, .menu-actions { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.banner-actions button, .menu-actions button { min-width: 35px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 6px; background: white; cursor: pointer; }
.banner-actions .edit-banner, .menu-actions .edit-menu { color: var(--brand-red-dark); border-color: #e7b0b8; }
.banner-actions .delete-banner, .menu-actions .delete-menu { color: #b63e49; }
.banner-preview { min-height: 190px; border-radius: 10px; background: #101724 center/cover no-repeat; }
.menu-item { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 13px 0; border-bottom: 1px solid #eee; }
.menu-item.inactive { opacity: .5; }
.menu-item h3 { margin: 0 0 3px; font-size: 14px; }
.menu-item small { color: var(--muted); }
.empty-admin { padding: 35px; border: 1px dashed var(--line); border-radius: 9px; text-align: center; color: var(--muted); }
.logout-button { margin-top: 0; background: none; border: 0; cursor: pointer; text-align: left; color: #e28a93; font-size: 13px; font-family: inherit; }
.logout-button:hover { color: #ff9ba5; }
.order-items { margin: 0; padding-left: 18px; font-size: 13px; display: grid; gap: 3px; }

/* ---- Tabela de produtos (edição inline de estoque/preço/promocional) ---- */
.products-table .product-thumb { width: 42px; height: 42px; object-fit: cover; border-radius: 6px; background: #eee; }
.products-table .product-name-cell { max-width: 260px; }
.products-table .product-name-cell b { display: block; font-size: 13px; }
.products-table .product-name-cell small { color: var(--muted); display: block; margin-top: 2px; }
.product-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.product-tags .tag { background: #f2f0fb; color: var(--purple); font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 10px; }
.product-tags .tag-badge { background: #fde3e5; color: #b63e49; }
.inline-input { width: 90px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; background: white; }
.inline-input:focus { outline: 0; border-color: var(--purple); }
.products-table td { vertical-align: middle; }
.table-actions { display: flex; gap: 6px; white-space: nowrap; }
.table-actions button { padding: 7px 11px; font-size: 12px; }
.table-actions .delete { border: 1px solid #e7b9bd; color: #b63e49; background: white; border-radius: 6px; cursor: pointer; }

/* ---- Editor de descrição (Visual/HTML) na ficha de produto ---- */
.desc-editor { display: grid; gap: 7px; }
.desc-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.desc-tab { border: 0; background: none; padding: 8px 14px; font-size: 12px; font-weight: 700; color: #858b9b; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.desc-tab.active { color: var(--purple); border-bottom-color: var(--purple); }
.desc-toolbar { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 6px; border: 1px solid var(--line); border-bottom: 0; border-radius: 7px 7px 0 0; background: #fafafb; }
.desc-toolbar button { min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid transparent; border-radius: 5px; background: none; cursor: pointer; font-size: 12px; color: #333; }
.desc-toolbar button:hover { background: #eee; border-color: var(--line); }
.desc-toolbar select { height: 30px; border: 1px solid var(--line); border-radius: 5px; background: white; font-size: 12px; padding: 0 4px; }
.desc-color { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 5px; cursor: pointer; font-size: 12px; font-weight: 700; position: relative; }
.desc-color:hover { background: #eee; }
.desc-color input[type="color"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.desc-visual { min-height: 260px; max-height: 420px; overflow-y: auto; border: 1px solid var(--line); border-radius: 0 0 7px 7px; padding: 14px; font-size: 14px; line-height: 1.6; }
.desc-visual:focus { outline: 0; border-color: var(--purple); }
.desc-visual:empty:before { content: attr(data-placeholder); color: #aaa; }
textarea.desc-html { min-height: 260px; max-height: 420px; font-family: 'Courier New', monospace; font-size: 12px; border-radius: 7px !important; }

/* ---- Badge de contagem nos itens do menu lateral (Pedidos, Clientes) ---- */
.admin-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nav-badge { background: var(--brand-red, #c8102e); color: #fff; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 2px 7px; min-width: 8px; text-align: center; line-height: 1.5; }
.admin-nav.active .nav-badge { background: rgba(255, 255, 255, .3); }

/* ---- Carrinhos abandonados (continua em cards, não em tabela) ---- */
.orders-list { display: grid; gap: 14px; }
.order-head small { color: var(--muted); }
.order-head strong { margin-left: auto; font-size: 16px; }
.order-customer { margin: 0; color: var(--muted); font-size: 13px; }
.order-actions { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.order-actions .delete { margin-left: auto; border: 1px solid #e7b9bd; color: #b63e49; background: white; padding: 8px 12px; border-radius: 6px; cursor: pointer; }

/* ---- Tela de Pedidos: barra de busca/filtros + tabela (estilo Nuvemshop) ---- */
.orders-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.orders-search input { padding: 10px 13px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; width: 260px; max-width: 100%; background: white; }
.orders-search input:focus { outline: 0; border-color: var(--purple); }
.orders-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.order-filter-chip { border: 1px solid var(--line); background: white; border-radius: 20px; padding: 7px 13px; font-size: 12px; font-weight: 700; color: #50535d; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.order-filter-chip .chip-count { background: #eef0f3; color: #50535d; border-radius: 10px; padding: 1px 7px; font-size: 11px; font-weight: 700; min-width: 8px; text-align: center; }
.order-filter-chip:hover { border-color: var(--purple); }
.order-filter-chip.active { background: var(--purple); border-color: var(--purple); color: white; }
.order-filter-chip.active .chip-count { background: rgba(255,255,255,.28); color: white; }
#orders-sort-toggle { margin-left: auto; white-space: nowrap; }
.orders-table td, .orders-table th { vertical-align: middle; }
.orders-table tr[data-order-row] { cursor: pointer; }
.orders-table tr[data-order-row]:hover { background: #fafafb; }
.order-id-cell b { display: block; font-size: 13px; }
.order-customer-cell b { display: block; font-size: 13px; }
.order-customer-cell small { color: var(--muted); }
.order-items-cell { font-size: 12px; color: var(--muted); white-space: nowrap; }
.status-select { border: 0; border-radius: 20px; padding: 6px 10px; font-size: 11px; font-weight: 700; cursor: pointer; }
.status-select.pay-pendente { background: #fff3d6; color: #9a6b00; }
.status-select.pay-pago { background: #e1f7ea; color: #158a4c; }
.status-select.pay-cancelado { background: #fde3e5; color: #b63e49; }
.status-select.st-novo { background: #fde3e5; color: #b63e49; }
.status-select.st-em-atendimento { background: #eef0fd; color: #5147c9; }
.status-select.st-concluído { background: #e1f7ea; color: #158a4c; }
.status-select.st-cancelado { background: #eef0f3; color: #6d7180; }
.order-actions-cell { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }
.order-actions-cell button { padding: 7px 11px; font-size: 12px; }
.order-actions-cell .delete { border: 1px solid #e7b9bd; color: #b63e49; background: white; border-radius: 6px; cursor: pointer; }
@media(max-width:900px){ .orders-toolbar { flex-direction: column; align-items: stretch; } .orders-search input { width: 100%; } #orders-sort-toggle { margin-left: 0; } }
.overview-list { display: grid; }
.overview-item { display: grid; grid-template-columns: 52px 1fr auto auto; gap: 14px; align-items: center; padding: 11px 0; border-bottom: 1px solid #eee; }
.overview-item:last-child { border-bottom: 0; }
.overview-item img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; background: #eee; }
.overview-info { display: grid; gap: 2px; min-width: 0; }
.overview-info b { font-size: 14px; }
.overview-info small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overview-price { font-weight: 700; white-space: nowrap; }
.overview-actions { display: flex; gap: 6px; }
.overview-edit { border: 1px solid #e7b0b8; color: var(--brand-red-dark, #8e0c21); background: white; padding: 8px 14px; border-radius: 6px; cursor: pointer; font-weight: 600; }
.overview-edit:hover { background: #faf4e4; }
.overview-delete { border: 1px solid #e7b9bd; color: #b63e49; background: white; padding: 8px 14px; border-radius: 6px; cursor: pointer; }
.overview-delete:hover { background: #fff4f5; }
.category-actions { display: flex; gap: 6px; }
.category-actions .edit-cat { color: var(--brand-red-dark, #8e0c21); border-color: #e7b0b8; }
.category-actions .delete-cat { color: #b63e49; border-color: #e7b9bd; }
.image-hint { margin: -4px 0 2px; font-size: 12px; color: var(--muted); }
.image-field { display: grid; gap: 7px; font-size: 12px; font-weight: 600; color: #555b68; }

.gallery-field { display: grid; gap: 7px; font-size: 12px; font-weight: 600; color: #555b68; }
.gallery-grid { display: flex; flex-wrap: wrap; gap: 12px; padding: 12px; border: 1px dashed var(--line); border-radius: 10px; background: #fafbfc; min-height: 108px; transition: .15s; }
.gallery-grid.drag-over { border-color: var(--purple); background: #f3f0fd; }
.gallery-grid:empty::after { content: 'Nenhuma foto ainda — envie ou arraste arquivos aqui.'; color: var(--muted); font-weight: 500; font-size: 12px; align-self: center; }
.gallery-item { position: relative; width: 96px; height: 96px; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); background: #eee; cursor: grab; }
.gallery-item:active { cursor: grabbing; }
.gallery-item.dragging { opacity: .35; }
.gallery-item.drop-target { outline: 2px solid var(--purple); outline-offset: 2px; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.gallery-item .gallery-order { position: absolute; left: 5px; bottom: 5px; background: #000000b3; color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 20px; }
.gallery-item .gallery-star { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border: 0; border-radius: 50%; background: #ffffffe0; color: #c9ccd4; font-size: 14px; line-height: 24px; text-align: center; cursor: pointer; padding: 0; }
.gallery-item .gallery-star:hover { color: #e0a900; }
.gallery-item .gallery-star.active { color: #f5b400; background: #fff; box-shadow: 0 0 0 2px var(--purple); }
.gallery-item .gallery-remove { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: #000000b3; color: #fff; font-size: 13px; line-height: 22px; text-align: center; cursor: pointer; padding: 0; }
.gallery-item .gallery-remove:hover { background: #b63e49; }
.gallery-item.is-cover { box-shadow: 0 0 0 2px var(--purple); }
.gallery-add-row { display: flex; gap: 8px; flex-wrap: wrap; }

.dashboard-filters { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; padding: 14px 0 20px; border-bottom: 1px solid #eee; margin-bottom: 16px; }
.dashboard-filters label { display: grid; gap: 5px; font-size: 11px; font-weight: 700; color: #555b68; }
.dashboard-filters input, .dashboard-filters select { border: 1px solid var(--line); border-radius: 7px; padding: 9px 11px; font-size: 13px; font-family: inherit; background: white; color: inherit; height: 38px; }
.dashboard-filters select { min-width: 160px; cursor: pointer; }
.dashboard-filters .dash-search { flex: 1; min-width: 160px; }
.dashboard-filters .dash-search input { width: 100%; }
.dashboard-filters button.primary { border: 0; background: var(--purple); color: white; border-radius: 7px; padding: 10px 16px; font-weight: 700; font-size: 13px; cursor: pointer; }
.dashboard-filters button.secondary { border: 1px solid var(--line); background: white; border-radius: 7px; padding: 10px 16px; font-size: 13px; cursor: pointer; }
@media(max-width:600px){.dashboard-filters{flex-direction:column;align-items:stretch}.dashboard-filters .dash-search{min-width:0}}

.whatsapp-status { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.whatsapp-dot { width: 10px; height: 10px; border-radius: 50%; background: #c9ccd4; flex: none; }
.whatsapp-dot.qr { background: #e2a03f; }
.whatsapp-dot.connected { background: #20ad61; }
.whatsapp-dot.connecting { background: #6177e9; }
.whatsapp-qr { margin-top: 16px; display: grid; place-items: center; gap: 10px; }
.whatsapp-qr img { width: 220px; height: 220px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: white; }
.whatsapp-qr small { color: var(--muted); text-align: center; max-width: 320px; }
.campaign-select-head { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 10px; }
.campaign-customers { max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: 9px; }
.campaign-customer-row { display: flex !important; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.campaign-customer-row input[type="checkbox"] { width: 16px !important; height: 16px; flex: none; margin: 0; }
.campaign-customer-row:last-child { border-bottom: 0; }
.campaign-customer-row small { color: var(--muted); margin-left: auto; text-align: right; }
.campaign-customer-row.missing-channel { opacity: .5; }
#campaign-results { margin-top: 14px; font-size: 13px; display: grid; gap: 4px; }
#campaign-results .ok { color: #16834b; }
#campaign-results .fail { color: #b63e49; }
.contact-actions { display: flex; gap: 5px; }
.contact-actions button { border: 1px solid var(--line); background: white; border-radius: 6px; padding: 7px 10px; cursor: pointer; font-size: 12px; }
.contact-actions .contact-whatsapp { color: #16834b; border-color: #b7e3c8; }
.contact-actions .contact-email { color: var(--brand-red-dark, #8e0c21); border-color: #e7b0b8; }
.contact-actions .secondary { border: 1px solid var(--line); background: white; border-radius: 6px; padding: 7px 12px; cursor: pointer; font-size: 12px; font-weight: 600; }
.icon-inline { width: 14px; height: 14px; vertical-align: -2px; margin-right: 3px; }
.icon-mail { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-whatsapp { fill: currentColor; }
th .icon-inline, td .icon-inline { color: inherit; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 10px 12px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; border-bottom: 2px solid #eee; white-space: nowrap; }
.data-table td { padding: 12px; border-bottom: 1px solid #f0f0f0; white-space: nowrap; }
.data-table tbody tr:hover { background: #fafafa; }
.data-table td.contact-actions { display: flex; gap: 5px; align-items: center; white-space: nowrap; }

.customer-view-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 4px 0 10px; }
.customer-view-grid .full { grid-column: 1 / -1; }
.customer-view-grid span { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.customer-view-grid b { font-size: 15px; font-weight: 600; color: #262a35; }
@media(max-width:560px){.customer-view-grid{grid-template-columns:1fr}}
.image-uploader { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px dashed var(--line); border-radius: 8px; background: #fafbfc; transition: .15s; }
.image-uploader.drag-over { border-color: var(--purple); background: #f3f0fd; }
.image-thumb { width: 74px; height: 74px; object-fit: cover; border-radius: 8px; background: #eee; border: 1px solid var(--line); cursor: grab; }
.image-thumb:active { cursor: grabbing; }
.image-empty { width: 74px; height: 74px; display: grid; place-items: center; border-radius: 8px; background: #eef0f3; color: var(--muted); font-size: 10px; text-align: center; }
.image-buttons { display: flex; gap: 7px; flex-wrap: wrap; }
.image-buttons .upload-btn { display: inline-flex; align-items: center; background: var(--purple); color: white; border-radius: 6px; padding: 9px 13px; cursor: pointer; font-weight: 700; font-size: 12px; }
.image-buttons .link-btn, .image-buttons .clear-btn { border: 1px solid var(--line); background: white; border-radius: 6px; padding: 9px 13px; cursor: pointer; font-size: 12px; }
.image-buttons .clear-btn { color: #b63e49; }
@media(max-width:560px){.overview-item{grid-template-columns:44px 1fr;grid-auto-rows:auto}.overview-item img{width:44px;height:44px}.overview-price,.overview-actions{grid-column:2}.overview-actions{justify-content:flex-start}}
@media(max-width:1000px){.stats-four{grid-template-columns:repeat(2,1fr)}.banner-admin-card{grid-template-columns:170px 1fr}.banner-admin-card img{width:170px}.banner-actions{grid-column:1/-1;justify-content:flex-start}}
@media(max-width:780px){.stats-four{grid-template-columns:1fr}.banner-admin-card{grid-template-columns:1fr}.banner-admin-card img{width:100%}.menu-columns{grid-template-columns:1fr}.admin-sidebar nav{overflow:auto}}

/* ---- Estatísticas: presets de período e gráficos de barra (sem libs) ---- */
.stats-presets { display: flex; gap: 8px; flex-wrap: wrap; }
.stats-presets button { border: 1px solid var(--line); background: white; border-radius: 7px; padding: 8px 14px; font-size: 12px; cursor: pointer; font-weight: 600; color: inherit; }
.stats-presets button.active { background: var(--purple); border-color: var(--purple); color: white; }
.bar-chart { display: flex; align-items: flex-end; gap: 4px; height: 170px; padding: 10px 4px 0; overflow-x: auto; }
.bar-chart .bar-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; flex: 1 0 auto; min-width: 20px; height: 100%; }
.bar-chart-days .bar-col { min-width: 30px; }
.bar-chart .bar-value { font-size: 10px; color: var(--muted); font-weight: 700; margin-bottom: 3px; min-height: 12px; }
.bar-chart .bar { width: 100%; max-width: 24px; background: #ded7f2; border-radius: 3px 3px 0 0; transition: height .2s; }
.bar-chart .bar.peak { background: var(--purple); }
.bar-chart .bar-label { font-size: 10px; color: var(--muted); margin-top: 6px; white-space: nowrap; }
