:root {
  --primary: #ff6600; --primary-dark: #e55a00; --primary-soft: #fff1e8;
  --bg: #f4f5f7; --card: #fff; --text: #1f2430; --muted: #6b7280; --border: #e6e8ec;
  --green: #18a058; --yellow: #f5b800; --blue: #1e6ff2; --cyan: #17c1e8; --red: #e8252f;
  --radius: 12px; --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: Inter, system-ui, sans-serif; font-size: 14px; color: var(--text); background: var(--bg); }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
h1, h2, h3, h4, h5, h6 { margin: 0; }
input, select, textarea { font: inherit; color: inherit; width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--primary); }
textarea { min-height: 90px; resize: vertical; }
label { display: block; font-weight: 500; font-size: 13px; color: #374151; }
label > input, label > select, label > textarea { margin-top: 5px; }
small.hint { display: block; color: var(--muted); font-weight: 400; margin-top: 3px; font-size: 12px; }

/* botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border); background: #fff; color: var(--text);
  padding: 9px 16px; border-radius: 8px; font-weight: 600; cursor: pointer; font-size: 13px; white-space: nowrap; }
.btn:hover { filter: brightness(.97); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.outline { border-color: var(--primary); color: var(--primary); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 6px 12px; font-size: 12px; }
.btn.block { width: 100%; }
.icon-btn { border: 1px solid var(--border); background: #fff; width: 38px; height: 38px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; font-size: 17px; position: relative; }
.icon-btn.bell { color: var(--primary); border: 0; background: transparent; font-size: 20px; }
.icon-btn.bell b { position: absolute; top: 2px; right: 2px; background: var(--red); color: #fff; font-size: 10px; border-radius: 9px; padding: 0 5px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #fff 0%, var(--primary-soft) 100%); padding: 16px; }
.login-card { width: 100%; max-width: 380px; background: #fff; border-radius: 16px; padding: 32px; box-shadow: 0 10px 40px rgba(0,0,0,.08); display: grid; gap: 14px; text-align: center; }
.login-card h4 { font-size: 22px; } .login-card h6 { color: var(--muted); font-weight: 400; margin-bottom: 8px; }
.login-card label { text-align: left; }
.error { color: var(--red); min-height: 1em; margin: 0; font-size: 13px; }
.brand-badge { width: 44px; height: 44px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 800; letter-spacing: -.5px; flex: none; }
.brand-badge.big { width: 72px; height: 72px; font-size: 24px; margin: 0 auto; }

/* layout */
#app { display: flex; min-height: 100vh; }
.sidebar { width: 236px; background: #fff; border-right: 1px solid var(--border); padding: 18px 14px; display: flex; flex-direction: column; gap: 12px; position: fixed; inset: 0 auto 0 0; overflow-y: auto; z-index: 30; transition: transform .2s; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 8px; }
.tag { margin-left: auto; background: var(--primary); color: #fff; font-style: normal; font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 6px; }
#nav { display: flex; flex-direction: column; gap: 2px; }
#nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; color: #374151; font-weight: 500; }
#nav a span { display: flex; flex-direction: column; line-height: 1.15; } #nav a small { font-size: 11px; color: var(--muted); font-weight: 400; }
#nav a i { font-size: 16px; color: #6b7280; }
#nav a:hover { background: var(--bg); }
#nav a.active { background: var(--primary-soft); color: var(--primary); } #nav a.active i, #nav a.active small { color: var(--primary); }
.logout { margin-top: auto; border: 0; background: none; color: var(--muted); display: flex; gap: 10px; padding: 10px; cursor: pointer; font: inherit; }
.main { flex: 1; margin-left: 236px; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; padding: 12px 24px; }
.topbar h1 { font-size: 19px; font-weight: 700; flex: 1; }
.top-actions { display: flex; gap: 8px; align-items: center; }
#menuToggle { display: none; }
.content { padding: 24px; flex: 1; }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 16px; }
.backdrop { display: none; }
.help-fab { position: fixed; right: 20px; bottom: 20px; background: var(--primary); color: #fff; border: 0; border-radius: 24px; padding: 11px 18px; font-weight: 700; cursor: pointer; box-shadow: 0 6px 18px rgba(255,102,0,.35); z-index: 25; font-size: 14px; display: flex; gap: 6px; }
.notif-panel { position: fixed; right: 16px; top: 64px; width: 340px; max-width: calc(100vw - 32px); background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.12); z-index: 40; padding: 14px; max-height: 70vh; overflow: auto; }
.notif-panel h6 { font-size: 14px; margin-bottom: 8px; }
.notif { border-top: 1px solid var(--border); padding: 10px 0; } .notif small { color: var(--muted); }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  #app.menu-open .sidebar { transform: none; }
  #app.menu-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 29; }
  .main { margin-left: 0; }
  #menuToggle { display: grid; }
  .topbar { padding: 10px 16px; } .content { padding: 16px; }
  #openStore span { display: none; }
}

/* componentes */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card, .stack > * + * { margin-top: 16px; }
.card h3 { font-size: 15px; font-weight: 700; margin-bottom: 12px; } .card h3.center { text-align: center; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g6 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) { .g2, .g3, .g4, .g6 { grid-template-columns: 1fr 1fr; } .g2.keep1, .g3, .g2 { grid-template-columns: 1fr; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .row.end { justify-content: flex-end; } .row.between { justify-content: space-between; }
.muted { color: var(--muted); } .center { text-align: center; } .right { text-align: right; }
.intro { text-align: center; color: #4b5563; max-width: 640px; margin: 0 auto 18px; font-size: 15px; }

.kpi { border-radius: var(--radius); color: #fff; padding: 18px; min-height: 120px; display: flex; flex-direction: column; justify-content: flex-end; position: relative; overflow: hidden; }
.kpi i { position: absolute; right: 16px; top: 12px; font-size: 40px; opacity: .35; }
.kpi strong { font-size: 22px; } .kpi span { font-size: 11px; font-weight: 700; text-transform: uppercase; margin-top: 4px; }
.kpi.green { background: linear-gradient(135deg, #1fae63, #128a4a); } .kpi.yellow { background: linear-gradient(135deg, #f8c41a, #eaa500); }
.kpi.blue { background: linear-gradient(135deg, #3684ff, #1559d6); } .kpi.cyan { background: linear-gradient(135deg, #2ad0f0, #0fa8cc); }
.kpi.red { background: linear-gradient(135deg, #f04048, #cc1520); } .kpi.orange { background: linear-gradient(135deg, #ff8533, #e55a00); }
.stat { text-align: center; } .stat strong { font-size: 20px; display: block; } .stat span { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.stat small { display: block; color: var(--muted); }

.tabs { display: flex; gap: 4px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 4px; overflow-x: auto; margin-bottom: 16px; }
.tabs button { border: 0; background: none; padding: 9px 14px; border-radius: 7px; font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; color: #374151; }
.tabs button.active { background: var(--primary); color: #fff; }

table { width: 100%; border-collapse: collapse; } th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 700; } .table-wrap { overflow-x: auto; }
tr.sub td { background: #fafafa; font-size: 12px; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; background: #eef0f3; color: #4b5563; }
.badge.ok { background: #e3f7ec; color: #0f7a40; } .badge.warn { background: #fff4d6; color: #a06b00; } .badge.off { background: #fde8e8; color: #b42318; }
.badge.info { background: #e6f0ff; color: #1559d6; } .badge.orange { background: var(--primary-soft); color: var(--primary); }

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: #f3f4f6; padding: 6px 12px; font: inherit; font-size: 12px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--green); color: #fff; } .seg button.on.warn { background: var(--yellow); } .seg button.on.off { background: var(--red); }

.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #d1d5db; border-radius: 22px; cursor: pointer; transition: .2s; }
.switch span::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--primary); } .switch input:checked + span::before { transform: translateX(18px); }
.toggle-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--border); }
.toggle-row:last-child { border-bottom: 0; } .toggle-row div { flex: 1; } .toggle-row b { display: block; font-weight: 600; }

/* cardápio */
.cat-block { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; }
.cat-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.cat-head h4 { font-size: 16px; flex: 1; min-width: 160px; }
.prod { display: grid; grid-template-columns: 64px 1fr 140px auto auto; gap: 14px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.prod:last-child { border-bottom: 0; }
.thumb { width: 64px; height: 64px; border-radius: 10px; background: var(--primary-soft) center/cover; display: grid; place-items: center; color: var(--primary); font-size: 22px; }
.prod h5 { font-size: 14px; margin-bottom: 4px; } .prod p { margin: 0; color: var(--muted); font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price-input { text-align: right; } .price-input.changed { border-color: var(--primary); background: var(--primary-soft); }
@media (max-width: 800px) { .prod { grid-template-columns: 56px 1fr; } .prod > :nth-child(n+3) { grid-column: 2; } }
.save-bar { position: sticky; bottom: 12px; background: #1f2430; color: #fff; border-radius: 12px; padding: 12px 16px; display: flex; gap: 10px; align-items: center; z-index: 10; margin-top: 12px; }
.save-bar span { flex: 1; }

/* config hub */
.hub-hero { background: linear-gradient(135deg, #1f2430, #3a2a20); color: #fff; border-radius: 16px; padding: 28px; }
.hub-hero h2 { font-size: 24px; margin: 10px 0; } .hub-hero p { opacity: .8; margin: 0; max-width: 520px; }
.module { display: flex; flex-direction: column; gap: 8px; min-height: 160px; }
.module .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: 17px; }
.module h4 { font-size: 15px; } .module p { margin: 0; color: var(--muted); font-size: 13px; flex: 1; }
.module a.go { color: var(--primary); font-weight: 600; font-size: 13px; }
.section-title { margin: 26px 0 12px; } .section-title h3 { font-size: 16px; } .section-title p { margin: 2px 0 0; color: var(--muted); }
.progress { height: 8px; background: #eee; border-radius: 6px; overflow: hidden; } .progress b { display: block; height: 100%; background: var(--primary); }

/* horários */
.hours-row { display: grid; grid-template-columns: 90px 1fr 200px; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.hours-bar { height: 22px; background: #f1f2f4; border-radius: 6px; position: relative; } .hours-bar b { position: absolute; top: 0; bottom: 0; background: var(--primary); border-radius: 6px; opacity: .85; }
@media (max-width: 700px) { .hours-row { grid-template-columns: 70px 1fr; } .hours-row .hours-bar { display: none; } }

/* modal & toast */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 18, 25, .5); display: grid; place-items: center; z-index: 60; padding: 16px; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 620px; max-height: 92vh; display: flex; flex-direction: column; }
.modal header { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); } .modal header h3 { flex: 1; font-size: 17px; }
.modal .body { padding: 20px; overflow-y: auto; display: grid; gap: 14px; } .modal footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 120px); background: #1f2430; color: #fff; padding: 11px 18px; border-radius: 10px; transition: transform .25s; z-index: 80; }
.toast.show { transform: translate(-50%, 0); }
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; } .chip { border: 1px solid var(--border); border-radius: 20px; padding: 5px 11px; cursor: pointer; background: #fff; font: inherit; font-size: 12px; }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.empty { text-align: center; padding: 30px; color: var(--muted); }
.wa-msg { background: #e7ffd9; border-radius: 10px; padding: 10px 12px; white-space: pre-wrap; font-size: 13px; margin-bottom: 6px; }
