:root{
  --bg:#f5f5f7;
  --card:#ffffff;
  --text:#1d1d1f;
  --muted:#6e6e73;
  --line:#e5e5ea;
  --accent:#7d1424;
  --accent-soft:#f6e9eb;
  --green:#198754;
  --whatsapp:#25D366;
  --whatsapp-dark:#128C7E;
  --green-soft:#e8f5ed;
  --orange:#9a5a00;
  --orange-soft:#fff3df;
  --red:#c92a2a;
  --red-soft:#fdecec;
  --blue:#0a66c2;
  --shadow:0 1px 2px rgba(0,0,0,.04),0 10px 30px rgba(0,0,0,.05);
}
*{box-sizing:border-box}
html,body{margin:0;background:var(--bg);color:var(--text);font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",sans-serif}
body{min-height:100vh}
button,input{font:inherit}
button{cursor:pointer}
.hidden{display:none!important}
.app-shell{width:min(900px,100%);margin:0 auto;padding:env(safe-area-inset-top) 18px calc(32px + env(safe-area-inset-bottom))}
.topbar{display:flex;justify-content:space-between;align-items:center;padding:26px 2px 18px}
.eyebrow{font-size:12px;font-weight:700;letter-spacing:.16em;color:var(--muted)}
h1{font-size:34px;line-height:1.05;margin:4px 0 0;letter-spacing:-.03em}
.icon-button{width:44px;height:44px;border-radius:50%;border:1px solid var(--line);background:rgba(255,255,255,.86);font-size:24px;color:var(--accent)}
.metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:2px 0 16px}
.metric{background:var(--card);border:1px solid var(--line);border-radius:18px;padding:14px 15px;min-height:88px}
.metric-label{font-size:12px;color:var(--muted);font-weight:600;margin-bottom:8px}.metric-value{font-size:24px;font-weight:750;letter-spacing:-.03em}.metric-sub{font-size:11px;color:var(--muted);margin-top:4px}
.filters{display:flex;gap:8px;overflow:auto;padding:2px 0 12px;scrollbar-width:none}.filters::-webkit-scrollbar{display:none}
.filter{border:0;background:#e9e9ec;color:#46464a;border-radius:999px;padding:10px 14px;font-weight:650;white-space:nowrap;display:inline-flex;align-items:center;gap:7px}.filter.active{background:var(--text);color:white}.filter-count{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:22px;padding:0 6px;border-radius:999px;background:rgba(29,29,31,.08);font-size:12px;font-weight:800;line-height:1}.filter.active .filter-count{background:rgba(255,255,255,.18);color:#fff}
.search-wrap{margin-bottom:12px}.search-wrap input,.login-card input{width:100%;border:1px solid var(--line);background:white;border-radius:14px;padding:13px 14px;outline:0;font-size:16px}.search-wrap input:focus,.login-card input:focus{border-color:#bbb}
.status-bar{font-size:13px;color:var(--muted);min-height:22px;padding:0 2px 8px}
.orders-list{display:flex;flex-direction:column;gap:10px}
.order-card{background:var(--card);border:1px solid var(--line);border-radius:20px;padding:15px;box-shadow:var(--shadow)}

/* Status visual: cor sutil, sem transformar o painel em semáforo */
.order-card.status-novo{background:#fffafa;border-color:#f1d6d6;border-left:3px solid #d85c5c}
.order-card.status-aguardando_pagamento{background:#fffdf8;border-color:#f0e3c7;border-left:3px solid #d6a144}
.order-card.status-pago{background:#fbfefc;border-color:#d9eadf;border-left:3px solid #48a66f}
.order-card.status-cancelado{background:#ececef;border-color:#c9c9ce;border-left:4px solid #7d7d84;box-shadow:none}.order-card.status-cancelado .order-name,.order-card.status-cancelado .order-total{color:#55555a}.order-card.status-cancelado .order-meta,.order-card.status-cancelado .order-code{color:#85858b}

.order-head{display:flex;justify-content:space-between;gap:12px}.order-name{font-size:18px;font-weight:750;letter-spacing:-.01em}.order-code{font-size:11px;color:var(--muted);margin-top:3px}.order-total{font-size:18px;font-weight:750;white-space:nowrap}.order-meta{margin-top:10px;color:var(--muted);font-size:14px;line-height:1.45}.order-meta strong{color:var(--text);font-weight:600}
.badge{display:inline-flex;align-items:center;border-radius:999px;padding:6px 9px;font-size:12px;font-weight:700;margin-top:11px}.badge.novo{background:#fff0f0;color:#b42318}.badge.aguardando_pagamento{background:var(--orange-soft);color:var(--orange)}.badge.pago{background:var(--green-soft);color:var(--green)}.badge.cancelado{background:#f1f1f3;color:#7a3030}
.actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:13px}.action{border:0;border-radius:13px;padding:11px 13px;font-weight:700;background:#ededf0;color:var(--text);flex:1;min-width:118px}.action.primary{background:var(--accent);color:white}.action.whatsapp{background:var(--whatsapp);color:#062b18}.action.whatsapp:hover{background:#20c75a}.action.confirm{background:var(--green);color:white}.action.paid-state{background:var(--green-soft);color:var(--green)}.action.danger{background:var(--red-soft);color:var(--red)}.action:disabled{opacity:.45;cursor:not-allowed}
.login-card{background:white;border:1px solid var(--line);border-radius:22px;padding:22px;box-shadow:var(--shadow);max-width:430px;margin:12vh auto}.login-card h2{margin:0 0 6px}.login-card p{margin:0 0 16px;color:var(--muted)}.full{width:100%;margin-top:10px;border:0;border-radius:14px;padding:13px}.primary{background:var(--accent);color:white;font-weight:750}.error-text{color:var(--red);font-size:13px;margin-top:9px}
.sheet-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.24);backdrop-filter:blur(2px);z-index:20}.detail-sheet{position:fixed;z-index:21;left:50%;bottom:0;transform:translateX(-50%);width:min(760px,100%);max-height:88vh;overflow:auto;background:#fafafa;border-radius:28px 28px 0 0;padding:9px 18px calc(26px + env(safe-area-inset-bottom));box-shadow:0 -20px 60px rgba(0,0,0,.14)}.sheet-handle{width:42px;height:5px;border-radius:999px;background:#c9c9cc;margin:3px auto 16px}.sheet-title{font-size:26px;font-weight:780;letter-spacing:-.03em;margin:0}.sheet-code{font-size:12px;color:var(--muted);margin-top:3px}.detail-block{background:white;border:1px solid var(--line);border-radius:17px;padding:14px;margin-top:12px}.detail-row{display:flex;justify-content:space-between;gap:18px;padding:6px 0}.detail-label{color:var(--muted)}.detail-value{text-align:right;font-weight:600}.item-line{display:flex;justify-content:space-between;gap:16px;padding:8px 0;border-bottom:1px solid #f0f0f2}.item-line:last-child{border-bottom:0}.item-note{font-size:12px;color:var(--muted);margin-top:2px}
.empty{text-align:center;color:var(--muted);padding:50px 10px}
@media(max-width:700px){.app-shell{padding-left:12px;padding-right:12px}.metrics{grid-template-columns:repeat(3,1fr);gap:7px}.metric{min-height:78px;padding:12px 10px}.metric-label{font-size:11px}.metric-value{font-size:20px}.metric-sub{font-size:10px}.order-card{border-radius:18px}.detail-sheet{padding-left:14px;padding-right:14px}.actions .action{min-width:calc(50% - 4px)}}


/* Navegação principal */
.main-tabs{display:flex;gap:8px;margin:0 0 16px;overflow:auto;scrollbar-width:none}.main-tabs::-webkit-scrollbar{display:none}.main-tab{border:0;border-radius:999px;padding:10px 15px;background:#e9e9ec;color:#4a4a4f;font-weight:700;white-space:nowrap}.main-tab.active{background:var(--accent);color:#fff}.main-tab.disabled{opacity:.42;cursor:default}

/* Produção */
.production-metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:9px;margin:2px 0 10px}.production-metric{background:#fff;border:1px solid var(--line);border-radius:18px;padding:14px;min-height:92px}.production-metric.ok{background:#fbfefc;border-color:#d9eadf}.production-metric.open{background:#fffdf8;border-color:#f0e3c7}.production-metric-label{font-size:12px;color:var(--muted);font-weight:650}.production-metric-value{font-size:28px;line-height:1;margin-top:9px;font-weight:800;letter-spacing:-.04em}.production-metric-sub{font-size:11px;color:var(--muted);margin-top:6px}.production-content{display:flex;flex-direction:column;gap:14px}.production-group{background:#fff;border:1px solid var(--line);border-radius:20px;overflow:hidden;box-shadow:var(--shadow)}.production-group-head{display:grid;grid-template-columns:1fr 132px;align-items:end;padding:16px 16px 10px;border-bottom:1px solid var(--line)}.production-group-head h2{font-size:20px;margin:0;letter-spacing:-.02em}.production-group-head>div{display:grid;grid-template-columns:1fr 1fr;text-align:center;gap:6px;font-size:10px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);font-weight:700}.production-row{display:grid;grid-template-columns:1fr 60px 60px;gap:6px;align-items:center;padding:13px 16px;border-bottom:1px solid #f0f0f2}.production-row:last-child{border-bottom:0}.production-flavor{font-size:16px;font-weight:650}.production-number{text-align:center;font-variant-numeric:tabular-nums}.production-number.confirmed{font-size:20px;font-weight:800;color:var(--green)}.production-number.pending{font-size:15px;color:#aaa;font-weight:700}.production-number.pending.has-pending{color:var(--orange);background:var(--orange-soft);border-radius:999px;padding:5px 4px}.production-empty{padding:24px 16px;color:var(--muted)}
@media(max-width:700px){.production-metrics{grid-template-columns:repeat(2,1fr)}.production-group-head{grid-template-columns:1fr 116px}.production-row{grid-template-columns:1fr 52px 52px;padding-left:14px;padding-right:14px}}


/* Entregas / fechamento logístico */
.delivery-metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:9px;margin:2px 0 12px}.delivery-metric{background:#fff;border:1px solid var(--line);border-radius:18px;padding:14px;min-height:92px}.delivery-metric.ok{background:#fbfefc;border-color:#d9eadf}.delivery-metric.warn{background:#fffdf8;border-color:#f0e3c7}.delivery-metric-label{font-size:12px;color:var(--muted);font-weight:650}.delivery-metric-value{font-size:26px;line-height:1;margin-top:9px;font-weight:800;letter-spacing:-.04em}.delivery-metric-sub{font-size:11px;color:var(--muted);margin-top:6px}.delivery-list{display:flex;flex-direction:column;gap:10px}.delivery-card{background:#fff;border:1px solid var(--line);border-radius:20px;padding:15px;box-shadow:var(--shadow)}.delivery-card.logistics-pendente{border-left:3px solid #d6a144}.delivery-card.logistics-avisado{border-left:3px solid #6a88a8;background:#fbfdff}.delivery-card.logistics-problema{border-left:4px solid var(--red);background:#fff8f8}.delivery-card.logistics-concluido{border-left:3px solid #48a66f;background:#fbfefc}.delivery-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}.delivery-name{font-size:18px;font-weight:760}.delivery-code{font-size:11px;color:var(--muted);margin-top:3px}.delivery-meta{font-size:14px;color:var(--muted);line-height:1.45;margin-top:10px}.delivery-meta strong{color:var(--text)}.logistics-badge{display:inline-flex;align-items:center;border-radius:999px;padding:6px 9px;font-size:12px;font-weight:750;white-space:nowrap}.logistics-badge.pendente{background:var(--orange-soft);color:var(--orange)}.logistics-badge.avisado{background:#eaf1f8;color:#40688e}.logistics-badge.problema{background:var(--red-soft);color:var(--red)}.logistics-badge.concluido{background:var(--green-soft);color:var(--green)}.delivery-items{margin-top:12px;border-top:1px solid #f0f0f2;border-bottom:1px solid #f0f0f2;padding:8px 0}.delivery-item{font-size:14px;line-height:1.45;padding:3px 0}.delivery-item span{color:var(--muted)}.delivery-item.muted{color:var(--muted)}.delivery-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:13px}.delivery-actions .action{min-width:150px}.delivery-filters{margin-bottom:4px}
@media(max-width:700px){.delivery-metrics{grid-template-columns:repeat(2,1fr)}.delivery-actions .action{min-width:calc(50% - 4px)}}


/* Filtros contextuais e fila logística */
.logistics-context{margin:-2px 0 8px}.context-label{font-size:11px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);padding:0 2px 5px}.context-filters{padding-bottom:7px}.logistics-group,.pickup-day{margin-bottom:16px}.logistics-group-head,.pickup-day-head{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;padding:12px 4px 9px}.logistics-group-head h2,.pickup-day-head h2{font-size:22px;line-height:1.05;margin:2px 0 0;letter-spacing:-.025em}.logistics-group-head>strong,.pickup-day-head>strong{font-size:13px;color:var(--muted);white-space:nowrap}.logistics-kicker{font-size:10px;font-weight:800;letter-spacing:.11em;color:var(--muted)}.logistics-group-list{display:flex;flex-direction:column;gap:9px}.pickup-day{background:rgba(255,255,255,.32);border-radius:22px;padding:4px 8px 10px}.pickup-slot{margin-top:5px}.pickup-slot-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 6px 7px;border-top:1px solid var(--line)}.pickup-slot:first-of-type .pickup-slot-head{border-top:0}.pickup-slot-head strong{font-size:17px}.pickup-slot-head span{font-size:12px;font-weight:750;color:var(--accent);background:var(--accent-soft);border-radius:999px;padding:5px 8px;white-space:nowrap}

/* Ordem lógica dos quatro indicadores de produção */
@media(max-width:700px){
  .production-metrics .production-metric:nth-child(1){grid-column:1}
  .production-metrics .production-metric:nth-child(2){grid-column:2}
  .production-metrics .production-metric:nth-child(3){grid-column:1}
  .production-metrics .production-metric:nth-child(4){grid-column:2}
  .logistics-group-head,.pickup-day-head{padding-left:2px;padding-right:2px}
  .pickup-day{padding-left:4px;padding-right:4px}
}


/* ADMIN V8 */
.admin-intro{background:#fff;border:1px solid var(--line);border-radius:20px;padding:16px;margin:2px 0 10px}.admin-intro h2{font-size:24px;letter-spacing:-.03em;margin:3px 0 4px}.admin-intro p{margin:0;color:var(--muted);font-size:13px;line-height:1.45}.admin-kicker,.admin-section-kicker,.admin-form-kicker{font-size:10px;font-weight:800;letter-spacing:.11em;color:var(--muted)}
.admin-tabs{display:flex;gap:7px;overflow:auto;padding:2px 0 10px;scrollbar-width:none}.admin-tabs::-webkit-scrollbar{display:none}.admin-tab{border:0;background:#e9e9ed;color:#5d5d63;border-radius:999px;padding:9px 13px;font-size:13px;font-weight:750;white-space:nowrap}.admin-tab.active{background:#1d1d1f;color:#fff}
.admin-section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:6px 2px 9px}.admin-section-head h3{font-size:22px;margin:2px 0 0;letter-spacing:-.025em}.admin-add{border:0;background:var(--accent);color:#fff;border-radius:12px;padding:10px 12px;font-weight:750;font-size:13px;white-space:nowrap}.admin-help{background:#f0f0f2;color:var(--muted);border-radius:14px;padding:10px 12px;font-size:12px;line-height:1.4;margin-bottom:9px}
.admin-list{display:flex;flex-direction:column;gap:9px}.admin-card{background:#fff;border:1px solid var(--line);border-radius:20px;padding:14px;box-shadow:var(--shadow)}.admin-card.admin-inactive{background:#f2f2f4;color:#777}.admin-card-main{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.admin-card-title{font-size:18px;font-weight:760;letter-spacing:-.015em}.admin-card-meta{color:var(--muted);font-size:12px;margin-top:3px}.admin-price{font-size:17px;font-weight:800;white-space:nowrap}.admin-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}.admin-chip{display:inline-flex;align-items:center;padding:5px 8px;border-radius:999px;background:#f0f0f2;color:#666;font-size:11px;font-weight:750}.admin-chip.ok{background:var(--green-soft);color:var(--green)}.admin-chip.warn{background:var(--orange-soft);color:var(--orange)}.admin-chip.accent{background:var(--accent-soft);color:var(--accent)}.admin-chip.muted{background:#e7e7ea;color:#777}.admin-actions{display:flex;gap:8px;margin-top:12px}.admin-edit,.admin-quick{border:0;border-radius:12px;padding:10px 12px;font-size:13px;font-weight:750}.admin-edit{background:#ededf0;color:#1d1d1f}.admin-quick{background:#f7eee5;color:#9b5c25}.admin-quick.off{background:#edf7f0;color:#28744a}
.admin-sheet{z-index:31}.admin-form{padding-bottom:8px}.admin-form-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px}.admin-form-head h2{font-size:26px;margin:2px 0 0;letter-spacing:-.03em}.admin-close{border:0;background:#ededf0;border-radius:999px;padding:8px 11px;font-weight:700;color:#555}.admin-field{display:block;margin:11px 0}.admin-field>span{display:block;font-size:12px;color:var(--muted);font-weight:700;margin:0 0 6px 2px}.admin-field input,.admin-field select,.admin-field textarea{width:100%;border:1px solid var(--line);background:#fff;border-radius:13px;padding:12px 13px;font:inherit;font-size:16px;color:var(--text);outline:0}.admin-field textarea{resize:vertical}.admin-field input:focus,.admin-field select:focus,.admin-field textarea:focus{border-color:#aaa}.admin-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px}.admin-switch-row{display:flex;align-items:center;justify-content:space-between;gap:16px;background:#fff;border:1px solid var(--line);border-radius:14px;padding:12px 13px;margin:9px 0}.admin-switch-row strong{display:block;font-size:14px}.admin-switch-row small{display:block;color:var(--muted);font-size:11px;line-height:1.35;margin-top:2px}.admin-switch-row input[type=checkbox]{width:22px;height:22px;accent-color:var(--accent);flex:0 0 auto}.admin-edition-box{background:#f2f2f4;border-radius:17px;padding:6px 12px 10px;margin:12px 0}.admin-combo-fields{border-top:1px solid #ddd;margin-top:10px;padding-top:2px}.admin-photo-note{font-size:11px;color:var(--muted);line-height:1.4;padding:4px 3px 14px}.admin-save{margin-top:5px}.admin-sheet+.hidden{display:none}
#adminBackdrop{z-index:30}
@media(max-width:620px){.admin-form-grid{grid-template-columns:1fr}.admin-card-title{font-size:17px}.admin-actions{display:grid;grid-template-columns:1fr 1fr}.admin-actions>*{width:100%}}


/* ADMIN V9 — listas compactas, miniaturas, pagamento e edições */
.admin-list-row{display:flex;gap:12px;align-items:flex-start;background:#fff;border:1px solid var(--line);border-radius:18px;padding:11px 12px;box-shadow:var(--shadow)}
.admin-list-row.admin-inactive{background:#f2f2f4;color:#777;box-shadow:none}.admin-row-body{min-width:0;flex:1}.admin-row-top{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}.admin-row-top .admin-chip{flex:0 0 auto}.admin-thumb{width:64px;height:64px;border-radius:14px;background:#ededf0;overflow:hidden;flex:0 0 64px;display:grid;place-items:center;color:#9a9aa0;font-size:10px;font-weight:750}.admin-thumb img{width:100%;height:100%;object-fit:cover;display:block}.admin-thumb span{display:none}.admin-thumb:not(:has(img)) span,.admin-thumb.no-image span{display:block}.admin-actions.compact{margin-top:9px;justify-content:flex-end}.admin-actions.compact button{padding:8px 10px}.admin-log-icon,.admin-edition-icon{width:44px;height:44px;border-radius:13px;background:#f0f0f2;display:grid;place-items:center;flex:0 0 44px;font-size:19px;font-weight:800;color:#555}.edition-row.edition-active{border-color:#cfe7d8;background:#fbfefc}.edition-row.edition-active .admin-edition-icon{background:var(--green-soft);color:var(--green)}
.admin-settings-card{background:#fff;border:1px solid var(--line);border-radius:20px;padding:15px;box-shadow:var(--shadow)}.admin-settings-title{font-size:18px;font-weight:800;letter-spacing:-.02em;margin:1px 0 9px}.admin-settings-title.secondary{margin-top:18px;padding-top:16px;border-top:1px solid var(--line)}
@media(max-width:620px){.admin-list-row{padding:10px;gap:10px}.admin-thumb{width:58px;height:58px;flex-basis:58px}.admin-row-top{gap:8px}.admin-price{font-size:15px}.admin-actions.compact{display:flex;justify-content:flex-start}.admin-actions.compact button{width:auto}.admin-log-icon,.admin-edition-icon{width:40px;height:40px;flex-basis:40px}}


/* PWA/mobile: quick taps on controls must not trigger double-tap zoom. */
button,
.qty button,
.flavor-stepper button,
.cartbar button,
.main-tab,
.filter,
.admin-tab,
.admin-add {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.qty button,
.flavor-stepper button {
  -webkit-user-select: none;
  user-select: none;
}
