:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #15171a;
  --muted: #6b7280;
  --primary: #151515;
  --accent: #f4b21a;
  --brand-red: #c81414;
  --ok: #15803d;
  --danger: #b91c1c;
  --border: #e5e7eb;
  --shadow: 0 8px 30px rgba(0,0,0,.08);
}
* { box-sizing: border-box; }
html { scroll-behavior:smooth; }
body { margin:0; font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif; background:var(--bg); color:var(--text); }
button, input, textarea, select { font: inherit; }
button { cursor:pointer; }
button:disabled { opacity:.5; cursor:not-allowed; transform:none!important; }
.container { max-width:1100px; margin:auto; padding:20px; }
.container.wide { max-width:1450px; }
.topbar { background:linear-gradient(90deg,#101010,#1c1c1c); color:#fff; position:sticky; top:0; z-index:30; box-shadow:var(--shadow); }
.topbar .inner { max-width:1450px; margin:auto; padding:12px 20px; display:flex; align-items:center; justify-content:space-between; gap:14px; }
.brand { font-weight:900; font-size:20px; }
.brand-with-logo { display:flex; align-items:center; gap:11px; }
.brand-with-logo small { display:block; font-size:11px; color:#d1d5db; margin-top:2px; font-weight:600; }
.brand-logo { width:54px; height:54px; object-fit:cover; border-radius:50%; border:2px solid #fff; background:#fff; }
.badge { background:var(--brand-red); color:#fff; padding:7px 11px; border-radius:999px; font-size:12px; font-weight:900; }
.badge.closed { background:#4b5563; }
.grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:16px; }
.card { background:var(--card); border:1px solid var(--border); border-radius:18px; padding:18px; box-shadow:0 4px 18px rgba(0,0,0,.04); }
.product { border-top:4px solid transparent; display:flex; flex-direction:column; min-height:210px; }
.product:hover { border-top-color:var(--brand-red); }
.product h3 { margin:0 0 6px; font-size:19px; }
.product p { color:var(--muted); flex:1; line-height:1.45; }
.option-hint { font-size:12px; font-weight:800; color:#7c2d12; background:#fff7ed; padding:7px 9px; border-radius:9px; margin-bottom:10px; }
.price { font-weight:950; font-size:21px; }
.btn { border:0; border-radius:12px; padding:11px 14px; font-weight:900; background:var(--primary); color:#fff; transition:.15s transform,.15s opacity; }
.btn:hover { transform:translateY(-1px); opacity:.94; }
.btn.secondary { background:#e5e7eb; color:#111827; }
.btn.ok { background:var(--ok); }
.btn.warn { background:#d97706; }
.btn.danger { background:var(--danger); }
.btn.full { width:100%; }
.btn.compact { padding:7px 10px; font-size:12px; }
.row { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.space { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.muted { color:var(--muted); }
.section-title { margin:26px 0 12px; font-size:24px; border-left:6px solid var(--brand-red); padding-left:10px; scroll-margin-top:150px; }
.category-section { scroll-margin-top:145px; }
.floating-cart { position:fixed; right:18px; bottom:18px; z-index:20; box-shadow:var(--shadow); }
.floating-cart .btn { background:var(--brand-red); }
.cart-panel { position:fixed; inset:0 0 0 auto; width:min(460px,100%); background:#fff; z-index:40; transform:translateX(105%); transition:.25s; box-shadow:-10px 0 40px rgba(0,0,0,.15); overflow:auto; }
.cart-panel.open { transform:translateX(0); }
.cart-head { position:sticky; top:0; background:#fff; border-bottom:1px solid var(--border); padding:16px; z-index:2; }
.cart-body { padding:16px; }
.cart-item { border-bottom:1px solid var(--border); padding:12px 0; }
.cart-unavailable { background:#fff1f2; padding:10px; border-radius:10px; }
.cart-choice { font-weight:800; color:#7c2d12; margin:4px 0; }
input, textarea, select { width:100%; padding:12px; border:1px solid #d1d5db; border-radius:10px; background:#fff; }
input:focus,textarea:focus,select:focus { outline:2px solid rgba(200,20,20,.15); border-color:var(--brand-red); }
label { display:block; font-weight:700; margin:10px 0 6px; }
.field-grid { display:grid; gap:10px; }
.field-grid.two { grid-template-columns:2fr 1fr; }
.modal-backdrop { position:fixed; inset:0; background:rgba(0,0,0,.6); display:none; align-items:center; justify-content:center; padding:18px; z-index:50; }
.modal-backdrop.show { display:flex; }
.modal { background:#fff; width:min(560px,100%); max-height:92vh; overflow:auto; border-radius:18px; padding:20px; }
.modal-price { font-size:24px; font-weight:950; color:var(--brand-red); }
.check,.choice { display:flex; gap:10px; align-items:center; padding:10px; margin:6px 0; border:1px solid var(--border); border-radius:10px; font-weight:700; }
.check input,.choice input { width:auto; }
.choice:has(input:checked) { border-color:var(--brand-red); background:#fff7f7; }
.notice { padding:12px 14px; border-radius:12px; background:#fff7ed; border:1px solid #fed7aa; }
.success { padding:18px; border-radius:16px; background:#ecfdf5; border:1px solid #bbf7d0; }
.closed-notice { padding:15px 18px; margin:0 0 16px; border-radius:14px; background:#fff1f2; border:1px solid #fecdd3; color:#881337; }
.payment-help { padding:10px 12px; border-radius:10px; margin-top:8px; font-size:14px; }
.card-help { background:#eff6ff; color:#1e40af; }
.pix-help { background:#ecfdf5; color:#166534; }
.cash-help { background:#fffbeb; color:#92400e; }
.track-link { font-weight:900; color:var(--ok); }
.category-nav { position:sticky; top:78px; z-index:15; display:flex; gap:8px; overflow-x:auto; padding:10px 0; background:rgba(244,245,247,.96); backdrop-filter:blur(8px); scrollbar-width:none; }
.category-nav::-webkit-scrollbar { display:none; }
.category-nav button { flex:0 0 auto; border:1px solid #d1d5db; background:#fff; border-radius:999px; padding:9px 13px; font-weight:800; }
.category-nav button:hover { border-color:var(--brand-red); color:var(--brand-red); }

.hero { display:grid; grid-template-columns:150px 1fr; gap:22px; align-items:center; background:linear-gradient(135deg,#151515,#292929); color:#fff; border-radius:22px; padding:22px; margin-bottom:18px; box-shadow:var(--shadow); overflow:hidden; position:relative; }
.hero:after { content:""; position:absolute; right:-50px; top:-70px; width:220px; height:220px; border-radius:50%; background:rgba(200,20,20,.22); }
.hero-logo { width:140px; height:140px; object-fit:cover; border-radius:22px; background:#fff; position:relative; z-index:1; }
.hero h1 { margin:0 0 8px; font-size:30px; line-height:1.05; }
.hero p { margin:0 0 12px; color:#e5e7eb; }
.hero-fee { display:inline-block; background:var(--brand-red); padding:8px 12px; border-radius:999px; font-weight:900; }
.top-link { color:#fff; font-weight:800; text-decoration:none; }

/* Cozinha */
.kitchen-body { background:#eef0f3; }
.kitchen-head h1 { margin-bottom:4px; }
.order-board { display:grid; grid-template-columns:repeat(auto-fit,minmax(365px,1fr)); gap:18px; align-items:start; }
.order-card { background:#fff; border-radius:18px; border:3px solid #e5e7eb; padding:18px; box-shadow:0 5px 20px rgba(0,0,0,.06); }
.order-card.new { border-color:#f59e0b; }
.order-card.preparing { border-color:#3b82f6; }
.order-card.ready { border-color:#16a34a; }
.order-card.out_for_delivery { border-color:#8b5cf6; }
.order-top { align-items:flex-start; }
.order-number { font-size:34px; font-weight:1000; line-height:1; }
.order-time { display:inline-block; margin-top:7px; border-radius:999px; padding:5px 8px; font-weight:900; font-size:12px; }
.ok-time { background:#ecfdf5; color:#166534; }
.warn-time { background:#fffbeb; color:#92400e; }
.late { background:#fff1f2; color:#991b1b; }
.customer-name { font-size:22px; font-weight:950; margin-top:12px; }
.delivery-box,.pickup-box { margin:10px 0; padding:10px; border-radius:10px; font-weight:800; }
.delivery-box { background:#eff6ff; }
.pickup-box { background:#f5f3ff; }
.reference { margin-top:4px; font-weight:600; color:#4b5563; }
.items-block { border-top:2px solid #111; border-bottom:2px solid #111; margin:12px 0; }
.itemline { padding:12px 0; border-bottom:1px dashed #bbb; font-size:16px; }
.itemline:last-child { border-bottom:0; }
.kitchen-item-name { font-size:20px; font-weight:950; }
.choice-line { margin-top:4px; color:#7c2d12; }
.note-line { margin-top:4px; font-weight:800; background:#fff7ed; padding:6px 8px; border-radius:7px; }
.alert { font-weight:950; color:#b91c1c; }
.status-pill { display:inline-block; border-radius:999px; padding:7px 10px; background:#e5e7eb; font-size:12px; font-weight:950; }
.payment-box { margin:12px 0; border-radius:12px; padding:12px; font-size:16px; }
.payment-box.card { background:#eff6ff; }
.payment-box.pix { background:#ecfdf5; }
.payment-box.cash { background:#fffbeb; }
.machine-alert { color:#b91c1c; font-weight:1000; }
.total-row { margin:10px 0 14px; }
.big-total { font-size:28px; font-weight:1000; }
.kitchen-actions { display:grid; grid-template-columns:1fr auto; gap:8px; margin-top:10px; }
.action-primary { font-size:17px; min-height:54px; }
.admin-link { background:#374151; padding:8px 10px; border-radius:9px; }

/* Rastreamento */
.status-step { display:flex; gap:12px; align-items:flex-start; padding:13px 0; border-bottom:1px solid var(--border); opacity:.45; }
.status-step.active { opacity:1; font-weight:800; }
.status-dot { width:18px; height:18px; border-radius:50%; background:#d1d5db; margin-top:2px; flex:0 0 auto; }
.status-step.active .status-dot { background:#16a34a; }
.tracking-summary { margin-top:14px; padding:12px; border-radius:12px; background:#f9fafb; }
.cancelled-box { padding:16px; border-radius:12px; background:#fff1f2; color:#991b1b; }

/* Configurações */
.admin-hero { display:flex; justify-content:space-between; align-items:center; gap:20px; }
.admin-hero h1 { margin:0 0 6px; }
.store-switch-card { min-width:220px; text-align:center; padding:16px; background:#f9fafb; border-radius:14px; }
.store-switch-card > span { display:block; font-weight:1000; margin-bottom:10px; }
.state-open { color:#166534; }
.state-closed { color:#991b1b; }
.admin-note { margin:16px 0; padding:14px 16px; background:#fffbeb; border:1px solid #fde68a; border-radius:12px; color:#78350f; }
.availability-list { display:grid; gap:10px; }
.availability-item { background:#fff; border:1px solid var(--border); border-radius:14px; padding:14px; transition:.15s; }
.availability-item.off { opacity:.6; background:#f3f4f6; }
.availability-main { display:flex; justify-content:space-between; align-items:center; gap:15px; }
.option-admin { margin-top:12px; padding:12px; border-radius:10px; background:#f9fafb; }
.option-admin-title { font-size:13px; font-weight:900; text-transform:uppercase; color:#6b7280; margin-bottom:7px; }
.option-admin-row { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid #e5e7eb; }
.option-admin-row:last-of-type { border-bottom:0; }
.add-option { display:grid; grid-template-columns:1fr auto; gap:8px; margin-top:10px; }
.text-danger { border:0; background:transparent; color:#b91c1c; font-weight:800; font-size:12px; }
.fee-editor { display:flex; align-items:center; gap:8px; }
.fee-editor input { width:100px; }
.switch { position:relative; display:inline-block; width:50px; height:28px; margin:0; flex:0 0 auto; }
.switch input { opacity:0; width:0; height:0; }
.slider { position:absolute; inset:0; background:#9ca3af; border-radius:999px; transition:.2s; }
.slider:before { content:""; position:absolute; width:22px; height:22px; left:3px; top:3px; background:white; border-radius:50%; transition:.2s; box-shadow:0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + .slider { background:#16a34a; }
.switch input:checked + .slider:before { transform:translateX(22px); }
.big-switch { width:70px; height:38px; }
.big-switch .slider:before { width:30px; height:30px; left:4px; top:4px; }
.big-switch input:checked + .slider:before { transform:translateX(32px); }
.small-switch { width:44px; height:24px; }
.small-switch .slider:before { width:18px; height:18px; }
.small-switch input:checked + .slider:before { transform:translateX(20px); }

@media (max-width:760px){
  .container{padding:14px}.grid{grid-template-columns:1fr}.order-board{grid-template-columns:1fr}.topbar .inner{padding:10px 14px}.floating-cart{left:14px; right:14px}.floating-cart .btn{width:100%}
  .hero{grid-template-columns:88px 1fr;padding:16px;gap:14px}.hero-logo{width:84px;height:84px;border-radius:16px}.hero h1{font-size:22px}.brand-logo{width:42px;height:42px}.brand-with-logo small{display:none}.badge{font-size:10px}
  .category-nav{top:64px}.field-grid.two{grid-template-columns:2fr 1fr}.admin-hero{align-items:stretch;flex-direction:column}.store-switch-card{width:100%;min-width:0}.fee-editor{width:100%}.fee-editor input{flex:1}.kitchen-actions{grid-template-columns:1fr}.admin-link{font-size:12px}
}
.flavor-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:10px; margin-top:14px; }
.flavor-chip { display:flex; align-items:center; justify-content:space-between; gap:12px; background:#f9fafb; border:1px solid var(--border); border-radius:12px; padding:12px; font-weight:900; }

/* V5 - fotos, bebidas e tempos */
.product { padding:0; overflow:hidden; display:flex; flex-direction:column; }
.product-image { width:100%; height:190px; object-fit:cover; background:#111; display:block; }
.product-image.placeholder { display:grid; place-items:center; font-size:54px; }
.product-content { padding:16px; display:flex; flex-direction:column; flex:1; }
.product-content h3 { margin:0 0 7px; font-size:20px; }
.product-content p { margin:0 0 10px; }
.product-footer { margin-top:auto; padding-top:12px; }
.prep-hint { font-size:12px; color:#6b7280; margin-top:8px; font-weight:700; }
.option-hint { display:inline-block; width:max-content; max-width:100%; background:#fff7ed; border:1px solid #fed7aa; color:#9a3412; padding:5px 8px; border-radius:999px; font-size:12px; font-weight:900; }
.modal-product-image { width:calc(100% + 40px); height:210px; margin:-20px -20px 18px; object-fit:cover; border-radius:18px 18px 0 0; background:#111; }
.choice-cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(135px,1fr)); gap:9px; }
.option-card { margin:0; align-items:center; min-height:68px; }
.option-card img { width:48px; height:48px; border-radius:9px; object-fit:cover; background:#111; }
.option-card span { display:flex; flex-direction:column; gap:3px; }
.option-card small { color:var(--brand-red); font-weight:900; }
.estimate-box,.estimate-customer { margin-top:12px; border-radius:12px; background:#eff6ff; border:1px solid #bfdbfe; padding:12px; color:#1e3a8a; }
.estimate-customer { margin:14px 0; }
.estimate-customer small { display:block; margin-top:4px; color:#475569; }
.estimate-kitchen { display:grid; grid-template-columns:1fr auto; gap:2px 10px; margin:12px 0 2px; padding:10px 12px; border-radius:12px; background:#f0fdf4; border:1px solid #bbf7d0; color:#166534; }
.estimate-kitchen b { font-size:18px; }
.estimate-kitchen small { grid-column:1/-1; color:#4b5563; }
.estimate-kitchen.estimate-late { background:#fff1f2; border-color:#fecdd3; color:#991b1b; }
.test-badge { display:inline-block; font-size:10px; line-height:1; padding:5px 7px; border-radius:999px; background:#fef3c7; color:#92400e; vertical-align:middle; }
.admin-settings-grid { display:grid; grid-template-columns:1fr 2fr; gap:24px; }
.inline-editor { display:flex; gap:8px; align-items:center; }
.inline-editor input { width:120px; }
.time-settings { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-bottom:10px; }
.time-settings label { margin:0; }
.time-settings input { margin-top:6px; }
.admin-product-title { display:flex; align-items:center; gap:12px; }
.admin-product-title img { width:68px; height:48px; object-fit:cover; border-radius:9px; background:#111; }
.product-admin-edit { display:grid; grid-template-columns:150px 150px auto; gap:8px; align-items:end; margin-top:12px; padding-top:12px; border-top:1px solid #e5e7eb; }
.product-admin-edit label { margin:0; font-size:12px; color:#4b5563; }
.product-admin-edit input { margin-top:5px; }
.option-admin-info { display:flex; align-items:center; gap:10px; }
.option-admin-info img { width:48px; height:48px; object-fit:cover; border-radius:8px; background:#111; }
.option-admin-info span { display:flex; flex-direction:column; }
.option-admin-info small { color:#6b7280; margin-top:2px; }
.option-controls { display:flex; align-items:center; gap:7px; }
.option-price { width:92px; padding:8px; }
.btn.tiny { min-height:34px; padding:7px 9px; font-size:12px; }

@media (max-width:760px){
  .product-image{height:175px}
  .modal-product-image{height:180px}
  .admin-settings-grid{grid-template-columns:1fr}
  .time-settings{grid-template-columns:1fr}
  .product-admin-edit{grid-template-columns:1fr 1fr;}
  .product-admin-edit .btn{grid-column:1/-1}
  .option-admin-row{align-items:flex-start;flex-direction:column}
  .option-controls{width:100%;justify-content:flex-end}
  .option-price{flex:1;max-width:none}
}

/* V6 - grupos corretos de porções e bebidas */
.product-image.contain, .modal-product-image.contain { object-fit:contain; background:#fff; padding:12px; }
.option-card img.contain { object-fit:contain; background:#fff; padding:4px; }
.option-pending { opacity:.55; background:#f3f4f6; }
.option-pending small { color:#6b7280; }

/* V19 - clientes e simulador WhatsApp */
.customer-card{margin-bottom:12px}.customer-card h2{margin:0 0 4px}.customer-orders{margin-top:16px;border-top:1px solid #ddd;padding-top:12px}.customer-order-row{display:grid;grid-template-columns:70px 170px 1fr 110px 140px;gap:10px;align-items:center;padding:10px 0;border-bottom:1px solid #eee}.wa-body{background:#e5ddd5}.wa-info{margin-bottom:14px}.wa-shell{max-width:850px;margin:auto;background:#efeae2;border-radius:16px;overflow:hidden;box-shadow:0 8px 30px #0002}.wa-toolbar{background:#075e54;color:white;padding:12px;display:flex;gap:12px;align-items:end;justify-content:space-between}.wa-toolbar label{flex:1}.wa-toolbar input{margin-top:5px}.wa-chat{height:520px;overflow:auto;padding:18px;background:linear-gradient(#efeae2,#e8e1d8)}.wa-bubble{white-space:pre-wrap;max-width:78%;padding:10px 12px;border-radius:12px;margin:7px 0;box-shadow:0 1px 2px #0002;line-height:1.35}.wa-bubble.user{margin-left:auto;background:#d9fdd3}.wa-bubble.bot{margin-right:auto;background:white}.wa-compose{display:flex;gap:8px;background:#f0f2f5;padding:10px}.wa-compose input{margin:0}.wa-shortcuts{display:flex;gap:6px;flex-wrap:wrap;padding:8px;background:#fafafa}.wa-shortcuts button{border:0;border-radius:20px;padding:7px 12px;cursor:pointer}@media(max-width:700px){.customer-order-row{grid-template-columns:1fr 1fr}.wa-chat{height:58vh}.wa-toolbar{align-items:stretch;flex-direction:column}}


/* V20 - login e painel administrativo */
.login-body{min-height:100vh;display:grid;place-items:center;background:linear-gradient(135deg,#101010,#2a1b06)}.login-wrap{width:min(430px,calc(100% - 28px))}.login-card{padding:30px}.login-logo{width:92px;height:92px;object-fit:cover;border-radius:50%;display:block;margin:0 auto 14px}.login-card h1{text-align:center;margin:8px 0}.login-card>p{text-align:center}.login-card input{margin-bottom:12px}.login-msg{color:#b91c1c;font-weight:800;margin-top:10px}.login-test{font-size:12px;background:#fff7ed;border:1px solid #fed7aa;padding:10px;border-radius:10px;margin-top:18px!important}.dashboard-head{display:flex;align-items:end;justify-content:space-between;gap:15px;margin-bottom:18px}.dashboard-head h1{margin-bottom:4px}.range-tabs{display:flex;gap:6px;flex-wrap:wrap}.range-tabs button{border:1px solid #ddd;background:#fff;border-radius:999px;padding:8px 12px;font-weight:800}.range-tabs button.active{background:#111;color:#fff}.kpi-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:16px}.kpi{background:#fff;border:1px solid var(--border);border-radius:16px;padding:18px;box-shadow:0 4px 18px #0000000a}.kpi small{display:block;color:var(--muted);font-weight:800}.kpi b{display:block;font-size:28px;margin:7px 0}.kpi span{font-size:12px;color:var(--muted)}.dash-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:16px}.dash-grid.four{grid-template-columns:repeat(4,1fr)}.bar-chart{display:grid;gap:10px}.bar-row{display:grid;grid-template-columns:minmax(90px,150px) 1fr auto;gap:10px;align-items:center;font-size:13px}.bar-track{height:12px;background:#eee;border-radius:999px;overflow:hidden}.bar-track i{display:block;height:100%;background:linear-gradient(90deg,var(--brand-red),var(--accent));border-radius:999px}.rank-row{display:grid;grid-template-columns:34px 1fr auto;gap:8px;padding:9px 0;border-bottom:1px solid #eee;align-items:center}.rank-row:last-child{border:0}.rank-row>b{color:var(--brand-red)}.wa-status,.wa-ready{margin-top:12px;padding:12px;background:#ecfdf5;border:1px solid #a7f3d0;border-radius:12px;color:#166534}.wa-ready{display:flex;flex-direction:column;gap:4px;margin:0}.password-grid{display:grid;grid-template-columns:1fr 1fr auto;gap:8px}.password-grid input{margin:0}@media(max-width:950px){.kpi-grid{grid-template-columns:1fr 1fr}.dash-grid.four{grid-template-columns:1fr 1fr}}@media(max-width:650px){.dashboard-head{align-items:flex-start;flex-direction:column}.kpi-grid,.dash-grid,.dash-grid.four{grid-template-columns:1fr}.password-grid{grid-template-columns:1fr}.bar-row{grid-template-columns:100px 1fr auto}}

.custom-range{display:flex;gap:8px;align-items:center;justify-content:flex-end;margin-top:10px;flex-wrap:wrap}.custom-range input{max-width:160px;margin:0}.custom-range span{color:#6b7280;font-size:14px}@media(max-width:700px){.custom-range{justify-content:flex-start}.custom-range input{max-width:145px}}

.active-order-banner { margin:0 0 16px; padding:14px 16px; border:1px solid #86efac; background:#f0fdf4; border-radius:14px; display:flex; align-items:center; justify-content:space-between; gap:14px; box-shadow:0 6px 18px rgba(22,101,52,.08); }
.active-order-banner > div { display:flex; flex-direction:column; gap:3px; }
.active-order-banner b { font-size:17px; color:#14532d; }
.active-order-banner span { font-size:13px; font-weight:900; color:#166534; }
@media (max-width:760px){ .active-order-banner{align-items:stretch;flex-direction:column}.active-order-banner .btn{width:100%;text-align:center} }
