:root {
  --navy: #0b1b34;
  --navy-2: #132a4d;
  --agua: #00f5c8;
  --agua-forte: #00a88a;
  --agua-claro: #e3fbf5;
  --fundo: #f4f7fb;
  --linha: #e2e8f0;
  --texto: #0f1e33;
  --suave: #5b6b82;
  --perigo: #b8322f; /* contraste AA com texto branco */
  --alerta: #e8a317;
  --raio: 14px;
  --sombra: 0 1px 2px rgba(11, 27, 52, .06), 0 6px 20px rgba(11, 27, 52, .06);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Plus Jakarta Sans', system-ui, sans-serif; background: var(--fundo); color: var(--texto); font-size: 15px; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--agua-forte); }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 20% 10%, #1b3a66 0, var(--navy) 55%); padding: 24px; }
.login form { background: #fff; width: min(400px, 100%); padding: 36px 32px; border-radius: 20px; box-shadow: 0 30px 60px rgba(0,0,0,.25); }
.login h1 { margin: 18px 0 4px; font-size: 24px; }
.login p { margin: 0 0 22px; color: var(--suave); }
.marca { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.marca svg { width: 34px; height: 32px; }
.marca small { font-weight: 700; color: #00785f; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- Estrutura ---------- */
.casca { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.lateral { background: var(--navy); color: #cfe0f5; padding: 22px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.lateral .marca { color: #fff; padding: 0 10px 22px; }
.lateral .marca small { color: var(--agua); }
.lateral button.nav { background: none; border: 0; text-align: left; padding: 11px 14px; border-radius: 10px; cursor: pointer; display: flex; gap: 10px; align-items: center; color: inherit; font-weight: 500; }
.lateral button.nav:hover { background: var(--navy-2); }
.lateral button.nav.ativo { background: var(--agua); color: var(--navy); font-weight: 700; }
.lateral .rodape { margin-top: auto; font-size: 13px; padding: 10px; border-top: 1px solid #22395e; }
.lateral .rodape button { margin-top: 8px; }
.principal { padding: 26px 32px 60px; min-width: 0; }
.topo { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.topo h2 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.topo .acoes { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- Componentes ---------- */
.btn { border: 0; border-radius: 10px; padding: 10px 16px; font-weight: 600; cursor: pointer; background: var(--navy); color: #fff; display: inline-flex; align-items: center; gap: 8px; }
.btn:hover { filter: brightness(1.12); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.agua { background: var(--agua); color: var(--navy); }
.btn.claro { background: #fff; color: var(--navy); border: 1px solid var(--linha); }
.btn.perigo { background: #fff; color: var(--perigo); border: 1px solid #f3c9c9; }
.btn.peq { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.largo { width: 100%; justify-content: center; padding: 13px; }
.cartao { background: #fff; border-radius: var(--raio); box-shadow: var(--sombra); padding: 20px; }
.grade { 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)); }
label { display: block; font-size: 13px; font-weight: 600; color: var(--suave); margin-bottom: 14px; }
label > input, label > select, label > textarea { display: block; width: 100%; margin-top: 6px; }
input, select, textarea { border: 1px solid var(--linha); border-radius: 10px; padding: 10px 12px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--agua); border-color: transparent; }
textarea { resize: vertical; min-height: 70px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--texto); font-weight: 500; }
.check input { width: auto; margin: 0; accent-color: var(--agua-forte); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: #eef2f7; color: var(--suave); white-space: nowrap; }
.chip.ok { background: var(--agua-claro); color: #00785f; }
.chip.teste { background: #e7f0ff; color: #1f5fbf; }
.chip.alerta { background: #fff4dc; color: #9a6500; }
.chip.ruim { background: #fde8e8; color: #b42318; }
.faixa { border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; font-weight: 500; display: flex; gap: 10px; align-items: center; }
.faixa.alerta { background: #fff4dc; color: #7a5000; }
.faixa.ruim { background: #fde8e8; color: #8f1d14; }
.faixa.teste { background: #e7f0ff; color: #194d9b; }
.vazio { text-align: center; color: var(--suave); padding: 30px 10px; font-size: 14px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--suave); padding: 10px 12px; border-bottom: 1px solid var(--linha); }
td { padding: 12px; border-bottom: 1px solid var(--linha); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.miniatura { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--agua-claro); display: inline-grid; place-items: center; font-size: 18px; }
.num { font-variant-numeric: tabular-nums; }
.riscado { text-decoration: line-through; color: var(--suave); font-size: 12px; margin-right: 6px; }
.interruptor { position: relative; width: 44px; height: 24px; display: inline-block; }
.interruptor input { opacity: 0; width: 0; height: 0; }
.interruptor span { position: absolute; inset: 0; background: #cbd5e1; border-radius: 99px; transition: .2s; cursor: pointer; }
.interruptor span::after { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.interruptor input:checked + span { background: var(--agua-forte); }
.interruptor input:checked + span::after { transform: translateX(20px); }

/* ---------- Pedidos (quadro) ---------- */
.quadro { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 14px; overflow-x: auto; align-items: start; }
.coluna { background: #e9eef5; border-radius: var(--raio); padding: 12px; min-height: 200px; }
.coluna h3 { margin: 2px 4px 12px; font-size: 14px; display: flex; justify-content: space-between; }
.coluna h3 .chip { background: #fff; }
.pedido { background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 10px; box-shadow: var(--sombra); border-left: 4px solid var(--agua-forte); }
.pedido.novo { border-left-color: var(--alerta); animation: pisca 1.2s ease-in-out 4; }
.pedido.cancelado { border-left-color: var(--perigo); opacity: .65; }
@keyframes pisca { 50% { box-shadow: 0 0 0 4px rgba(232, 163, 23, .35); } }
.pedido .cab { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pedido .cab b { font-size: 17px; }
.pedido .meta { color: var(--suave); font-size: 12.5px; margin: 4px 0 10px; }
.pedido ul { margin: 0 0 10px; padding: 0; list-style: none; font-size: 13.5px; }
.pedido li { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.pedido .obs { background: #fff8e6; border-radius: 8px; padding: 6px 8px; font-size: 12.5px; margin-bottom: 8px; }
.pedido .total { display: flex; justify-content: space-between; font-weight: 700; border-top: 1px dashed var(--linha); padding-top: 8px; margin-bottom: 10px; }
.pedido .botoes { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Resumo ---------- */
.indicador small { display: block; color: var(--suave); font-weight: 600; font-size: 12.5px; }
.indicador b { font-size: 26px; letter-spacing: -.02em; }
.barras { display: flex; align-items: flex-end; gap: 12px; height: 180px; padding-top: 10px; }
.barras div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; font-size: 12px; color: var(--suave); }
.barras i { display: block; width: 100%; max-width: 46px; background: linear-gradient(180deg, var(--agua), var(--agua-forte)); border-radius: 8px 8px 3px 3px; min-height: 3px; }

/* ---------- Horários ---------- */
.horario { display: grid; grid-template-columns: 90px 1fr; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--linha); }
.horario .faixas { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.horario input[type=time] { padding: 6px 8px; }

/* ---------- Modal e aviso ---------- */
.modal { position: fixed; inset: 0; background: rgba(11, 27, 52, .55); display: grid; place-items: center; padding: 20px; z-index: 20; }
.modal[hidden], .aviso[hidden] { display: none; }
.modal .caixa { background: #fff; border-radius: 18px; width: min(560px, 100%); max-height: 92vh; overflow: auto; padding: 26px; }
.modal h3 { margin: 0 0 18px; }
.modal .rodape { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.aviso { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 30; box-shadow: var(--sombra); font-weight: 500; }
.aviso.erro { background: var(--perigo); }
.codigo { font-family: ui-monospace, monospace; background: #0f1e33; color: var(--agua); padding: 12px; border-radius: 10px; word-break: break-all; font-size: 13px; }

@media (max-width: 900px) {
  .casca { grid-template-columns: 1fr; }
  .lateral { position: static; height: auto; flex-direction: row; flex-wrap: wrap; padding: 12px; }
  .lateral .marca { padding: 0 8px; width: 100%; }
  .lateral .rodape { display: none; }
  .principal { padding: 18px 14px 50px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr 1fr; }
  .quadro { grid-template-columns: repeat(4, 82vw); }
}
.pedido li span:last-child, .pedido .total span:last-child { white-space: nowrap; }
label.interruptor { margin: 0; vertical-align: middle; }
.pedido.parado { border-left-color: var(--perigo); }
.pedido .espera { background: #fde8e8; color: #8f1d14; font-weight: 700; font-size: 12.5px; border-radius: 8px; padding: 5px 8px; margin-top: 6px; }
.configuracao { max-width: 820px; margin: 0 auto; }
.assistente h2 { font-size: 26px; margin: 18px 0 4px; letter-spacing: -.02em; }
.assistente h3 { margin: 0 0 12px; }
.termos ul { margin: 0 0 14px; padding-left: 18px; color: var(--texto); }
.termos li { margin-bottom: 6px; }
.pedido ul.itens li { align-items: center; }
.foto-item { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; background: var(--agua-claro); }
.foto-item.vazia, .miniatura.sem-foto { display: inline-grid; place-items: center; font-size: 9.5px; color: var(--suave); background: #eef2f7; text-align: center; line-height: 1.1; }
.nome-item { flex: 1; }
.nome-item small { display: block; color: var(--suave); font-size: 11.5px; }
.foto-produto { display: flex; gap: 14px; align-items: flex-start; }
.foto-produto img { width: 96px; height: 96px; border-radius: 12px; object-fit: cover; border: 1px solid var(--linha); }
.faixa .btn { margin-left: 6px; }
.linha-bairro { display: grid; grid-template-columns: 1fr 130px; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--linha); }
.linha-bairro label { margin: 0; }
.indicador .sub { display: block; color: var(--suave); font-size: 12.5px; margin-top: 2px; }
.destaques { margin-top: 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; background: var(--agua-claro); }
.cab-rel { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.cab-rel h3 { margin: 0; }
.barras.rel { height: 200px; gap: 4px; overflow-x: auto; }
.barras.rel div { min-width: 26px; font-size: 11px; }
.barras.rel .num { font-size: 10px; writing-mode: vertical-rl; transform: rotate(180deg); max-height: 70px; }
.hbarra { display: grid; grid-template-columns: 110px 1fr auto auto; gap: 8px; align-items: center; padding: 5px 0; font-size: 13.5px; }
.hbarra .rot { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbarra .trilho { background: #eef2f7; border-radius: 99px; height: 10px; overflow: hidden; }
.hbarra .trilho i { display: block; height: 100%; background: linear-gradient(90deg, var(--agua), var(--agua-forte)); border-radius: 99px; }
.hbarra small { color: var(--suave); }
.opcao-entregador { border: 1px solid var(--linha); border-radius: 12px; padding: 12px; margin-bottom: 8px; }
.btn.navy { background: var(--navy); color: #fff; }
.selo-st { font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.selo-st.perigo { background: #fde8e6; color: #b0281a; }
.selo-st.aviso { background: #fff4d6; color: #8a5a00; }
.selo-st.ok { background: #e3fbf5; color: #00785f; }
.tempo { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 8px 0 4px; font-size: 12px; }
.tempo i { color: var(--suave); font-style: normal; }
.tempo .etapa { background: #eef3f9; border-radius: 8px; padding: 3px 7px; white-space: nowrap; }
.tempo .etapa b { font-weight: 700; }
.tempo .etapa small { color: var(--suave); margin-left: 4px; }
.tempo .etapa.entregue { background: #e3fbf5; color: #00785f; }
.tempo .etapa.cancelado { background: #fde8e6; color: #b0281a; }
.tempo .etapa.total { background: #0b1b34; color: #fff; font-weight: 700; }
.alertas-loja li { margin-bottom: 6px; }
/* valores do pedido */
.pedido .valores { border-top: 1px dashed var(--linha); padding-top: 8px; margin-bottom: 10px; font-size: 14px; }
.pedido .valores > div { display: flex; justify-content: space-between; gap: 8px; }
.pedido .valores .total { border-top: 0; padding-top: 2px; margin: 2px 0 0; font-size: 17px; }
.pedido .valores .pagto { display: block; color: var(--suave); font-size: 13px; margin-top: 2px; }
/* bairros */
.bairros-novos { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -4px 0 10px; }
/* modo TV: tela cheia, letras grandes, som repetindo */
#barra-tv { display: none; }
body.modo-tv #barra-tv { display: flex; align-items: center; gap: 18px; padding: 10px 20px; background: #0b1b34; color: #fff; font-size: 22px; position: sticky; top: 0; z-index: 20; }
body.modo-tv #barra-tv #relogio-tv { font-weight: 800; color: #00f5c8; }
body.modo-tv #barra-tv button { margin-left: auto; }
body.modo-tv .faixa-tv { background: #e8a317; color: #0b1b34; font-weight: 800; padding: 6px 14px; border-radius: 10px; animation: piscar 1s infinite alternate; }
body.modo-tv .lateral, body.modo-tv .principal > .topo { display: none !important; }
body.modo-tv .casca { display: block; }
body.modo-tv .principal { padding: 14px; max-width: none; }
body.modo-tv .pedido { font-size: 18px; }
body.modo-tv .pedido .cab b { font-size: 30px; }
body.modo-tv .pedido .valores .total { font-size: 22px; }
body.modo-tv .coluna h3 { font-size: 22px; }
@keyframes piscar { from { opacity: 1; } to { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { body.modo-tv .faixa-tv { animation: none; } }
@media (max-width: 640px) {
  .g2 { grid-template-columns: 1fr; }
  .g3 { grid-template-columns: 1fr; }
}
/* sugestões de produto (Open Food Facts) */
.sugestoes { margin: -4px 0 10px; }
.sug-lista { display: grid; gap: 6px; margin-top: 6px; max-height: 240px; overflow: auto; }
.sug { display: flex; gap: 10px; align-items: center; text-align: left; background: #fff; border: 1px solid var(--linha); border-radius: 12px; padding: 6px 8px; cursor: pointer; font: inherit; }
.sug:hover, .sug:focus { border-color: var(--agua-forte); }
.sug img { width: 48px; height: 48px; object-fit: contain; border-radius: 8px; background: #f4f7fb; }
.cards-cat { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.card-cat { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 10px; border: 1px solid var(--linha); border-radius: 16px; background: #fff; cursor: pointer; font: inherit; color: var(--navy); }
.card-cat .ic { width: 52px; height: 52px; border-radius: 50%; background: #e3fbf5; display: grid; place-items: center; font-size: 26px; }
.card-cat small { color: var(--suave); }
.card-cat.inativa { opacity: .55; }
.card-cat.mais { border-style: dashed; border-color: var(--agua-forte); }
.card-cat.mais .ic { background: var(--agua-forte); color: #fff; font-weight: 800; }
.icones-cat { display: flex; flex-wrap: wrap; gap: 6px; }
.ic-op input { position: absolute; opacity: 0; }
.ic-op span { display: grid; place-items: center; width: 44px; height: 44px; border: 2px solid var(--linha); border-radius: 12px; font-size: 22px; cursor: pointer; }
.ic-op input:checked + span { border-color: var(--agua-forte); background: #e3fbf5; }
.ic-op input:focus-visible + span { outline: 3px solid var(--agua-forte); }
.faixa-suporte { background: #fff4d6; color: #5c3b00; padding: 10px 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; border-bottom: 2px solid #e8a317; }

.pedido .pix { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; border-radius: 10px; padding: 8px 10px; margin: 8px 0; font-size: 14px; font-weight: 600; }
.pedido .pix.espera { background: #fff4d6; color: #7a5300; }
.pedido .pix.chegou { background: #e3f6f1; color: #00594a; }
.pedido .pix.ok { background: #eef3f9; color: #0b1b34; }
