/* ===== Sistema de espaçamento e acabamento premium (escala de 4px) ===== */
:root {
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px;
  --line: #eceef1;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, .08);
  --shadow-lg: 0 24px 64px rgba(16, 24, 40, .22);
  --grad: linear-gradient(180deg, #f77a2a, #e55f0b);
}
body { font-size: 14px; line-height: 1.5; }
h1, h2, h3, h4, h5, h6 { letter-spacing: -.015em; font-weight: 700; }
.content { padding: var(--s5) var(--s6); max-width: 1400px; width: 100%; margin: 0 auto; }
.topbar { padding: var(--s3) var(--s6); min-height: 64px; }
.topbar h1 { font-size: 20px; }
.top-actions { gap: var(--s2); }
.footer { padding: var(--s5); font-size: 12px; }
@media (max-width: 900px) { .content { padding: var(--s4); } .topbar { padding: var(--s3) var(--s4); } }

/* menu lateral */
.sidebar { padding: var(--s5) var(--s3) var(--s4); gap: var(--s4); width: 248px; }
.main { margin-left: 248px; }
@media (max-width: 900px) { .main { margin-left: 0; } }
.side-brand { padding: 0 var(--s2) var(--s3); border-bottom: 1px solid var(--line); }
.side-brand strong { font-size: 15px; }
#nav { gap: var(--s1); }
#nav a { padding: 10px var(--s3); font-size: 14px; }
#nav a i { width: 20px; text-align: center; font-size: 17px; }
.logout { padding: var(--s3); border-radius: var(--r-md); }
.logout:hover { background: var(--bg); color: var(--text); }

/* cartões e grades */
.card { padding: var(--s5); border-radius: var(--r-lg); }
.card + .card, .stack > * + * { margin-top: var(--s4); }
.card h3 { font-size: 16px; margin-bottom: var(--s4); }
.grid { gap: var(--s4); }
.row { gap: var(--s3); }
.kpi { padding: var(--s5); min-height: 128px; border-radius: var(--r-lg); }
.kpi strong { font-size: 24px; letter-spacing: -.02em; }
.kpi span { letter-spacing: .06em; opacity: .92; }
.stat strong { font-size: 22px; letter-spacing: -.02em; }
.stat span { letter-spacing: .06em; }
.section-title { margin: var(--s6) 0 var(--s4); }
.section-title h3 { font-size: 17px; }
.intro { margin-bottom: var(--s5); }
.hub-hero { padding: var(--s6); border-radius: 20px; box-shadow: var(--shadow-md); }
.module { padding: var(--s5); gap: var(--s3); transition: transform .15s, box-shadow .15s, border-color .15s; }
.module:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #f4c9a8; }
.module .ic { width: 40px; height: 40px; border-radius: var(--r-md); font-size: 18px; }

/* abas */
.tabs, .mc-tabs { background: #fff; border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s1); gap: var(--s1); margin-bottom: var(--s5); box-shadow: var(--shadow-sm); }
.mc-tabs { display: inline-flex; }
.tabs button, .mc-tabs button { padding: 9px var(--s4); border-radius: 9px; border: 0; font-weight: 500; color: #4b5160; transition: background .15s, color .15s; }
.tabs button:hover:not(.active), .mc-tabs button:hover:not(.active) { background: var(--bg); }
.tabs button.active, .mc-tabs button.active { background: var(--grad); color: #fff; box-shadow: 0 2px 8px rgba(242, 106, 20, .3); }

/* tabelas */
th, td { padding: var(--s3); border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11px; letter-spacing: .06em; background: #fafafb; white-space: nowrap; }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: #fcfcfd; }
.table-wrap { border: 1px solid var(--line); border-radius: var(--r-md); }
.table-wrap tr:last-child td { border-bottom: 0; }

/* selos, segmentados, chips, switches */
.badge { padding: 4px 10px; letter-spacing: .02em; }
.seg, .mc-seg { border-radius: 9px; box-shadow: var(--shadow-sm); }
.seg button, .mc-seg button { padding: 7px var(--s3); font-weight: 500; transition: background .15s; }
.chip { padding: 6px var(--s3); border-radius: 999px; transition: all .15s; }
.chip:hover { border-color: var(--primary); }
.switch span { background: #d5d8de; }
.switch input:checked + span { background: var(--grad); }
.toggle-row { padding: var(--s4) 0; gap: var(--s4); }

/* formulários */
label { font-size: 13px; font-weight: 600; color: #3a3f4b; }
label > input, label > select, label > textarea { margin-top: 6px; }
input, select, textarea { padding: 10px var(--s3); min-height: 40px; }
input[type=checkbox], input[type=radio] { min-height: 0; }
input::placeholder, textarea::placeholder { color: #a3a8b3; }
.field { margin-bottom: var(--s4); }
.modal .body { gap: var(--s4); padding: var(--s5); }
small.hint { margin-top: var(--s1); }

/* modal e assistente */
.modal-bg, .wiz-bg { backdrop-filter: blur(3px); }
.modal { border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }
.modal header { padding: var(--s4) var(--s5); }
.modal footer { padding: var(--s4) var(--s5); background: #fafafb; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.wiz { border-radius: 20px; box-shadow: var(--shadow-lg); }
.wiz > header { padding: var(--s5) var(--s6) 0; }
.wiz > header h2 { font-size: 22px; letter-spacing: -.02em; }
.wiz-tabs { gap: var(--s5); margin-top: var(--s3); }
.wiz-body { padding: var(--s5) var(--s6); }
.wiz > footer { padding: var(--s4) var(--s6); background: #fafafb; border-radius: 0 0 20px 20px; }
.wiz-grid { gap: var(--s6); }
.opt-box { background: #fafafb; border-radius: var(--r-md); padding: var(--s4) var(--s5); margin: var(--s4) 0; }
.check-card, .serve, .model-card, .g-card, .comp-card { border-radius: var(--r-md); transition: border-color .15s, box-shadow .15s, background .15s; }
.check-card:hover, .serve:hover, .model-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.comp-card { padding: var(--s4) var(--s5); margin-bottom: var(--s4); }
.img-drop { border-radius: var(--r-md); border-color: #d5d8de; }
.toast { border-radius: var(--r-md); box-shadow: var(--shadow-md); padding: var(--s3) var(--s5); }

/* cardápio */
.mc-cat, .cat-block { border-radius: var(--r-lg); margin-bottom: var(--s5); box-shadow: var(--shadow-sm); }
.mc-cat-head { padding: var(--s4) var(--s5); gap: var(--s3); }
.mc-cat-head h4 { font-size: 16px; }
.mc-cat-body { margin: 0 var(--s5) var(--s5); border-radius: var(--r-md); overflow: hidden; }
.mc-row { padding: var(--s4); gap: var(--s4); transition: background .12s; }
.mc-row:hover { background: #fcfcfd; }
.thumb { border-radius: var(--r-md); box-shadow: 0 0 0 1px var(--line); }
.mc-filters { gap: var(--s3); margin-bottom: var(--s5); }
.mc-toolbar { gap: var(--s3); margin-bottom: var(--s4); }
.mc-groups { padding: 0 var(--s4) var(--s4) 56px; }
.mc-comp { padding: var(--s2) 0 var(--s2) var(--s3); gap: var(--s4); }
.kebab-menu { border-radius: var(--r-md); box-shadow: var(--shadow-md); padding: var(--s1); }
.kebab-menu a { border-radius: var(--r-sm); padding: var(--s2) var(--s3); }
.kebab-menu a + a { border-top: 0; }
.save-bar { border-radius: var(--r-md); padding: var(--s3) var(--s5); box-shadow: var(--shadow-md); background: #17181c; }
.price-input { font-variant-numeric: tabular-nums; }
.icon-plain { border-radius: var(--r-sm); width: 34px; height: 34px; }
.icon-plain:hover { background: var(--bg); }
.search input { padding-left: 38px; }

/* demais telas */
.hours-row { padding: var(--s3) 0; gap: var(--s4); }
.robo-item { border-radius: var(--r-md); padding: var(--s3) var(--s4); margin-bottom: var(--s2); transition: border-color .15s; }
.robo-sec { margin: var(--s5) 0 var(--s3); }
.kds-card { border-radius: var(--r-md); padding: var(--s4); margin-bottom: var(--s3); }
.notif-panel { border-radius: var(--r-lg); box-shadow: var(--shadow-md); padding: var(--s4); }
.empty { padding: var(--s6); }
details.acq { border-radius: var(--r-md); padding: var(--s3) var(--s4); }
.progress { height: 8px; background: #eceef1; }
.progress b { background: linear-gradient(90deg, #f98a3f, #e25a08); }
:focus-visible { outline: 3px solid rgba(242, 106, 20, .35); outline-offset: 2px; }
::selection { background: rgba(242, 106, 20, .22); }

/* logo da loja */
.brand-logo { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; background: #fff; box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(242, 106, 20, .35), 0 4px 12px rgba(16, 24, 40, .18); }
.brand-logo.big { width: 92px; height: 92px; display: block; margin: 0 auto; box-shadow: 0 0 0 4px #fff, 0 0 0 5px rgba(242, 106, 20, .35), 0 10px 28px rgba(16, 24, 40, .22); }
.side-brand { gap: var(--s3); }

/* alinhamento: a linha sob a marca coincide com a linha sob o título da página */
.sidebar { padding-top: 0; }
.side-brand { height: 64px; box-sizing: border-box; margin: 0 calc(-1 * var(--s3)); padding: 0 var(--s5); align-items: center; border-bottom: 1px solid var(--border); }
.topbar { height: 64px; box-sizing: border-box; min-height: 0; border-bottom: 1px solid var(--border); }
.topbar h1 { line-height: 1.2; }
.sidebar { gap: var(--s3); }

/* área da foto do item */
.img-drop { width: 260px; height: 195px; border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: #f4f4f5 center / cover no-repeat; margin: var(--s3) 0; position: relative;
  box-shadow: 0 1px 2px rgba(16,24,40,.06), 0 10px 28px rgba(16,24,40,.12); transition: box-shadow .2s; }
.img-drop:hover { box-shadow: 0 1px 2px rgba(16,24,40,.06), 0 14px 34px rgba(16,24,40,.18); }
.img-drop:not([style*="background-image"]) { border: 1.5px dashed #c9c9cf; box-shadow: none; background: #fafafa; }
.img-actions { position: absolute; inset: auto 0 0 0; padding: 28px var(--s3) var(--s3); display: flex; gap: var(--s2); justify-content: center;
  background: linear-gradient(180deg, transparent, rgba(10,10,12,.72)); opacity: 0; transform: translateY(6px); transition: opacity .18s, transform .18s; }
.img-drop:hover .img-actions, .img-drop:focus-within .img-actions { opacity: 1; transform: none; }
@media (hover: none) { .img-actions { opacity: 1; transform: none; } }
.img-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.16); color: #fff; backdrop-filter: blur(8px);
  padding: 7px 12px; border-radius: 999px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: background .15s; white-space: nowrap; }
.img-btn:hover { background: rgba(255,255,255,.3); }
.img-btn.danger:hover { background: rgba(220,47,58,.75); border-color: transparent; }
.img-specs { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s1); }
.img-specs span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); background: #f4f4f5; border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; }
.img-specs i { font-size: 13px; }

/* janelas sempre centralizadas e inteiras na tela: rodapé (Cancelar/Voltar) sempre visível */
.wiz-bg { align-items: center; justify-items: center; padding: var(--s4); overflow: hidden; }
.wiz { height: min(860px, calc(100vh - 32px)); height: min(860px, calc(100dvh - 32px)); max-height: calc(100vh - 32px); min-height: 0; }
.wiz-body { min-height: 0; }
.wiz > header, .wiz > footer { flex: none; }
.modal { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); }
.modal .body { min-height: 0; }
@media (max-width: 800px) { .wiz-bg { padding: 0; } .wiz { width: 100%; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; } }

/* cartões dentro de grades nunca recebem margem extra (todos do mesmo tamanho e alinhados) */
.grid > .card, .grid > .card + .card, .grid > * + * { margin-top: 0; }
.grid > .stat { display: flex; flex-direction: column; justify-content: center; }

/* login: lembrar login e senha */
.login-card .login-lembrar { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 14px; cursor: pointer; }
.login-card .login-lembrar input { width: 16px; height: 16px; margin: 0; padding: 0; accent-color: #22c55e; }

/* ===== Polimento geral (varredura de 14/10) ===== */
/* aviso (toast) escondido de verdade quando não está aparecendo */
.toast { opacity: 0; visibility: hidden; transition: transform .25s, opacity .2s, visibility .25s; }
.toast.show { opacity: 1; visibility: visible; }

/* cabeçalho de cartão: título e botão na mesma linha, centralizados */
.card > .row.between:first-child { align-items: center; margin-bottom: var(--s4); }
.card > .row.between:first-child h3 { margin: 0; }
.card > .row.between:first-child > div > h3 { margin-bottom: var(--s1); }
.card > .row.between:first-child + .table-wrap, .card > .row.between:first-child + p { margin-top: 0; }

/* barra de período: rótulos e seletores na mesma linha */
label.row { gap: var(--s2); color: var(--muted); }
label.row > select, label.row > input:not([type=checkbox]):not([type=radio]) { margin-top: 0; }
.p-go { min-height: 40px; padding: 0 var(--s5); }

/* texto digitado nos campos em peso normal (o rótulo continua em negrito) */
label > input, label > select, label > textarea { font-weight: 400; color: var(--text); }

/* barra superior: botão "Abrir loja" da mesma altura dos ícones */
.top-actions .btn { height: 38px; padding: 0 var(--s4); font-size: 13px; }
.top-actions .icon-btn { width: 38px; height: 38px; }

/* Dashboard: os 5 indicadores numa linha só em telas largas */
@media (min-width: 1101px) { #stats.g4 { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* Cupom Fideliza: texto "Ativo" legível sobre o fundo escuro */
.hub-hero .hero-switch { color: #e4e4e7; }

/* Cadastros > Usuários: ações sempre à direita, alinhadas ao nome */
.user-row { flex-wrap: nowrap; align-items: flex-start; }
.user-row > .row:last-child { flex: none; flex-wrap: nowrap; gap: var(--s2); }
.user-row .badge.info { margin: var(--s1) 2px 0 0; }
.card > .user-row:last-child { border-bottom: 0 !important; padding-bottom: 0 !important; }

/* títulos de seção com contador alinhados pelo centro */
.section-title.row { align-items: center; }
.section-title p { margin: 2px 0 0; color: var(--muted); }
.user-row > .row:first-child { align-items: flex-start; }
.user-row > .row:first-child > .brand-badge { margin-top: 2px; }

/* KDS: botões do topo da mesma altura do seletor */
.kds-top .btn, .kds-top select { height: 40px; min-height: 40px; }
.kds-top .btn.sm { padding: 0 var(--s4); font-size: 13px; }
@media (max-width: 700px) {
  .user-row { flex-wrap: wrap; }
  .user-row > .row:last-child { flex: 1 1 100%; min-width: 0; flex-wrap: wrap; padding-left: 48px; }
}
