/* ============================================
   Painel do Lojista - tema verde e branco
   ============================================ */
:root {
  --verde-900: #14532d;
  --verde-800: #166534;
  --verde-700: #15803d;
  --verde-600: #16a34a;
  --verde-500: #22c55e;
  --verde-400: #4ade80;
  --verde-100: #dcfce7;
  --verde-50: #f0fdf4;

  --fundo: #f5f8f5;
  --branco: #ffffff;
  --texto: #16241b;
  --texto-2: #5b6b60;
  --cinza: #8a9990;
  --borda: #e5ece7;
  --borda-forte: #d3ddd6;

  --primaria: var(--verde-600);
  --verde: var(--verde-600);
  --vermelho: #dc2626;
  --amarelo: #d97706;

  --sombra-sm: 0 1px 2px rgba(16, 45, 28, .06);
  --sombra-md: 0 4px 14px rgba(16, 45, 28, .08);
  --sombra-lg: 0 18px 40px rgba(16, 45, 28, .16);

  --raio: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }
body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--fundo);
  color: var(--texto);
  font-size: 15px;
  line-height: 1.5;
}
.hidden { display: none !important; }

/* ================= LOGIN ================= */
#tela-login {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1100px 600px at 12% -10%, rgba(34, 197, 94, .28), transparent 60%),
    radial-gradient(900px 500px at 108% 108%, rgba(22, 163, 74, .22), transparent 55%),
    linear-gradient(160deg, #06301c, #0b4426 55%, #0e5a32);
}
.cartao-login {
  background: var(--branco);
  padding: 40px 36px;
  border-radius: 20px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--sombra-lg);
}
.cartao-login .logo-login {
  width: 56px; height: 56px; border-radius: 16px;
  background: var(--verde-100);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; margin-bottom: 14px;
}
.cartao-login h1 { font-size: 1.4rem; font-weight: 800; letter-spacing: -.02em; }
.cartao-login > p { color: var(--texto-2); font-size: .9rem; margin: 4px 0 22px; }

/* ================= LAYOUT ================= */
#app { display: flex; min-height: 100vh; }

/* Botao hamburguer */
.btn-menu {
  position: fixed; top: 12px; left: 12px; z-index: 100;
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--verde-700); color: #fff; border: none;
  font-size: 1.4rem; cursor: pointer; display: none;
  align-items: center; justify-content: center;
  box-shadow: var(--sombra-md);
}
@media (max-width: 860px) {
  .btn-menu { display: flex; }
}

.sidebar {
  width: 244px;
  background: linear-gradient(180deg, #0b3d22, #0a3420);
  color: #cfe8d6;
  padding: 18px 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

/* Overlay escuro por trás do menu lateral */
.sidebar-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 98;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
.sidebar-overlay.visivel { opacity: 1; pointer-events: auto; }

/* Sidebar oculta no mobile */
@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    width: 260px;
    z-index: 99;
    transition: left .25s ease;
    height: 100vh;
    box-shadow: 4px 0 24px rgba(0, 0, 0, .25);
  }
  .sidebar.aberta { left: 0; }
  .conteudo { padding-top: 60px; }
}

.sidebar .marca {
  display: flex; align-items: center; gap: 10px;
  padding: 0 18px 16px;
  font-weight: 800; color: #fff; font-size: 1.05rem;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.sidebar .marca .ico {
  width: 34px; height: 34px; border-radius: 10px;
  background: rgba(74, 222, 128, .16);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.sidebar .loja-nome {
  margin: 14px 14px 0;
  padding: 10px 12px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 10px;
  font-size: .8rem; color: #d7efe0; word-break: break-word;
}
.sidebar nav { flex: 1; margin-top: 12px; padding: 0 10px; }
.sidebar nav button,
.sidebar nav a {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  background: none; border: none; color: #b7d8c2; text-decoration: none;
  padding: 10px 12px; margin-bottom: 2px;
  font: inherit; font-size: .9rem; font-weight: 500;
  border-radius: 10px; cursor: pointer;
  transition: background .15s, color .15s;
}
.sidebar nav button:hover,
.sidebar nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar nav button.ativo,
.sidebar nav a.ativo {
  background: rgba(74, 222, 128, .14);
  color: #fff; font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, .25);
}

/* Grupo hierárquico (Cardápio com subitens) */
.sidebar nav .nav-grupo { margin-bottom: 2px; }
.sidebar nav .nav-grupo-titulo { justify-content: flex-start; }
.sidebar nav .nav-grupo-titulo .seta {
  margin-left: auto; font-size: .7rem; opacity: .65;
  transition: transform .2s ease;
}
.sidebar nav .nav-grupo-titulo.aberto .seta { transform: rotate(90deg); }
.sidebar nav .nav-grupo-titulo.tem-ativo {
  color: #fff; background: rgba(255, 255, 255, .05);
}
.sidebar nav .nav-submenu { display: none; padding-left: 12px; }
.sidebar nav .nav-submenu.aberto { display: block; }
.sidebar nav .nav-submenu button,
.sidebar nav .nav-submenu a {
  font-size: .83rem; padding: 8px 12px; color: #a5cdb4;
  border-left: 2px solid rgba(255, 255, 255, .12);
  border-radius: 0 10px 10px 0; margin-left: 4px;
}
.sidebar nav .nav-submenu button.ativo,
.sidebar nav .nav-submenu a.ativo {
  border-left-color: rgba(74, 222, 128, .6);
}
.link-cardapio {
  display: block; margin: 12px 14px 8px; padding: 10px 12px;
  background: rgba(74, 222, 128, .1); border: 1px dashed rgba(74, 222, 128, .4);
  color: #a7f3c0; text-decoration: none; font-size: .8rem; border-radius: 10px;
  text-align: center;
}
.link-cardapio:hover { background: rgba(74, 222, 128, .18); }
.sidebar .sair {
  margin: 6px 14px 0; padding: 10px;
  background: rgba(255, 255, 255, .06); color: #d7efe0;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px; cursor: pointer; font: inherit; font-size: .88rem;
}
.sidebar .sair:hover { background: rgba(255, 255, 255, .12); }

.conteudo { flex: 1; padding: 28px 32px; overflow-x: auto; min-width: 0; }
.conteudo h2 { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: 4px; }
.subtitulo { color: var(--texto-2); font-size: .9rem; margin-bottom: 20px; }

/* ================= CARDS RESUMO ================= */
.resumo { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 22px; }
.resumo .card {
  background: var(--branco); border: 1px solid var(--borda);
  border-radius: var(--raio); padding: 16px 18px;
  box-shadow: var(--sombra-sm); position: relative; overflow: hidden;
}
.resumo .card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--borda-cor, var(--verde-600));
}
.resumo .card .num { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; }
.resumo .card .rot {
  font-size: .72rem; color: var(--cinza);
  text-transform: uppercase; letter-spacing: .05em; font-weight: 600; margin-top: 2px;
}

.card-simples {
  background: var(--branco); border: 1px solid var(--borda);
  border-radius: var(--raio); padding: 20px; box-shadow: var(--sombra-sm);
}
.card-simples h3 { font-size: 1rem; margin-bottom: 12px; }

/* ================= FORMULARIOS E BOTOES ================= */
input, select, textarea {
  width: 100%; padding: 10px 13px;
  border: 1px solid var(--borda-forte); border-radius: 10px;
  font: inherit; font-size: .92rem; background: var(--branco); color: var(--texto);
  transition: border .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--verde-600);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, .14);
}
label { display: block; font-size: .8rem; font-weight: 600; margin-top: 12px; color: var(--texto-2); }
label input, label select, label textarea { margin-top: 5px; }
.campo-linha { display: flex; gap: 12px; }
.campo-linha > div { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: none; border-radius: 10px; padding: 10px 17px;
  font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
  background: var(--verde-600); color: #fff; text-decoration: none;
  transition: filter .12s, transform .05s;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn.verde { background: var(--verde-600); }
.btn.cinza { background: #eef1ee; color: var(--texto-2); }
.btn.cinza:hover { background: #e2e8e3; filter: none; }
.btn.vermelho { background: var(--vermelho); }
.btn.contorno {
  background: var(--branco); color: var(--verde-800);
  border: 1px solid var(--borda-forte);
}
.btn.contorno:hover { background: var(--verde-50); filter: none; }
.btn.pequeno { padding: 6px 12px; font-size: .8rem; border-radius: 8px; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
.barra-acoes { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }

/* ================= TABELAS ================= */
.tabela-wrap { background: var(--branco); border: 1px solid var(--borda); border-radius: var(--raio); overflow-x: auto; box-shadow: var(--sombra-sm); -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; background: var(--branco); min-width: 600px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--borda); font-size: .88rem; vertical-align: middle; }
th {
  background: var(--verde-50); color: var(--verde-800);
  font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #f7faf7; }
table a { color: var(--verde-700); font-weight: 500; text-decoration: none; }
table a:hover { text-decoration: underline; }

.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 600; white-space: nowrap; }
.tag.aberto { background: #fef3c7; color: #92400e; }
.tag.producao { background: #dbeafe; color: #1e40af; }
.tag.entrega { background: #ede9fe; color: #6d28d9; }
.tag.finalizado { background: var(--verde-100); color: var(--verde-800); }
.tag.cancelado { background: #fee2e2; color: #991b1b; }
.tag.bloqueada { background: #fee2e2; color: #991b1b; }
.tag.ativa { background: var(--verde-100); color: var(--verde-800); }
.tag.pendente { background: #fef3c7; color: #92400e; }
.tag.pago { background: var(--verde-100); color: var(--verde-800); }
.tag.desativado { background: #eef1ee; color: var(--texto-2); }

/* ================= PEDIDOS ================= */
.pedido-card {
  background: var(--branco); border: 1px solid var(--borda);
  border-left: 4px solid #f59e0b;
  border-radius: var(--raio); padding: 16px 18px;
  margin-bottom: 12px; box-shadow: var(--sombra-sm);
}
.pedido-card.finalizado { border-left-color: var(--verde-500); opacity: .85; }
.pedido-card.cancelado { border-left-color: var(--vermelho); opacity: .75; }
.pedido-topo { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.pedido-topo .cod { font-weight: 800; font-size: .95rem; }
.pedido-itens {
  font-size: .85rem; color: #3d4a41; background: var(--verde-50);
  padding: 10px 12px; border-radius: 10px; margin: 8px 0; white-space: pre-wrap;
}
.pedido-cliente { font-size: .85rem; color: var(--texto-2); margin-bottom: 8px; }
.pedido-acoes { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pedido-acoes select { width: auto; }

/* ================= AVISOS ================= */
.aviso {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: 12px; font-size: .86rem;
  margin-bottom: 16px; border: 1px solid;
}
.aviso.alerta { background: #fef3c7; border-color: #fde68a; color: #92400e; }
.aviso.info { background: #e0f2fe; border-color: #bae6fd; color: #075985; }
.aviso.ok { background: var(--verde-50); border-color: var(--verde-100); color: var(--verde-800); }

/* ================= CHIP DE RECURSO ================= */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--branco); border: 1px solid var(--borda);
  padding: 7px 12px; border-radius: 999px; font-size: .82rem; font-weight: 500;
}
.chip .ponto { width: 8px; height: 8px; border-radius: 50%; background: var(--verde-500); }
.chip.off .ponto { background: #cbd5cd; }
.chip.off { color: var(--cinza); text-decoration: line-through; }

/* ================= GRAFICOS ================= */
.graficos { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-bottom: 16px; }
.grafico-card {
  background: var(--branco); border: 1px solid var(--borda);
  border-radius: var(--raio); padding: 18px; box-shadow: var(--sombra-sm);
}
.grafico-card h3 { font-size: .95rem; margin-bottom: 14px; }
.barras {
  display: flex; align-items: flex-end; gap: 6px;
  height: 160px; padding-top: 8px; overflow-x: auto;
}
.barras .barra-col {
  flex: 1; min-width: 26px; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end; height: 100%; gap: 4px;
}
.barras .barra {
  width: 100%; max-width: 34px; background: linear-gradient(180deg, var(--verde-400), var(--verde-600));
  border-radius: 6px 6px 2px 2px; min-height: 3px;
}
.barras .barra-label { font-size: .62rem; color: var(--cinza); white-space: nowrap; }

.barras-h .linha-h { margin-bottom: 10px; }
.barras-h .linha-h .lh-topo { display: flex; justify-content: space-between; font-size: .8rem; margin-bottom: 4px; }
.barras-h .trilho { background: #eef3ef; border-radius: 999px; height: 10px; overflow: hidden; }
.barras-h .preench { height: 100%; background: linear-gradient(90deg, var(--verde-500), var(--verde-700)); border-radius: 999px; }

/* ================= TIMELINE (historico) ================= */
.timeline { list-style: none; padding-left: 6px; }
.timeline li {
  position: relative; padding: 0 0 18px 26px;
  border-left: 2px solid var(--verde-100); margin-left: 6px;
}
.timeline li::before {
  content: ''; position: absolute; left: -7px; top: 2px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--verde-500); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--verde-100);
}
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline .tl-status { font-weight: 700; font-size: .9rem; }
.timeline .tl-meta { font-size: .78rem; color: var(--cinza); }

/* ================= MODAL ================= */
#modal-fundo {
  position: fixed; inset: 0; background: rgba(10, 30, 18, .55);
  z-index: 50; display: flex; align-items: center; justify-content: center;
  padding: 16px; backdrop-filter: blur(2px);
}
.modal {
  background: #fff; border-radius: 18px; padding: 24px; width: 100%;
  max-width: 580px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--sombra-lg); animation: pop .18s ease;
}
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal h3 { margin-bottom: 12px; font-size: 1.1rem; }
.modal-acoes { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ================= VARIAÇÕES (opções do produto) ================= */
.var-linha {
  background: var(--fundo); border: 1px solid var(--borda);
  border-radius: 10px; padding: 10px;
}
.var-linha input {
  border: 1px solid var(--borda); border-radius: 8px;
  padding: 9px 10px; font-size: .9rem; background: #fff;
}
.var-linha input:focus { outline: none; border-color: var(--verde-500); }
.var-remover { min-width: 34px; padding: 6px 10px; }

/* ================= TOAST ================= */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--verde-900); color: #fff; padding: 13px 24px;
  border-radius: 999px; font-size: .9rem; font-weight: 500;
  z-index: 99; box-shadow: var(--sombra-lg); animation: rise .2s ease;
}
#toast.erro { background: var(--vermelho); }
@keyframes rise { from { transform: translate(-50%, 12px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* ================= HORARIOS ================= */
.horario-dia {
  display: flex; align-items: center; gap: 10px; background: var(--verde-50);
  padding: 10px 14px; border-radius: 10px; margin-bottom: 8px; flex-wrap: wrap;
  border: 1px solid var(--borda);
}
.horario-dia .dia { width: 84px; font-weight: 600; font-size: .85rem; }
.horario-dia input[type="time"] { width: 112px; }
.horario-dia label { margin: 0; display: flex; gap: 6px; align-items: center; font-weight: 500; color: var(--texto); }
.horario-dia input[type="checkbox"] { width: auto; }

.img-produto { width: 46px; height: 46px; object-fit: cover; border-radius: 10px; background: #eef1ee; }
.img-produto:not(img) { display: inline-block; }

/* ================= RESPONSIVO ================= */
@media (max-width: 860px) {
  .conteudo { padding: 76px 14px 18px; }
  .conteudo h2 {
    text-align: center;
    padding-left: 44px;
    padding-right: 44px;
  }
  .conteudo .subtitulo {
    text-align: center;
    padding-left: 24px;
    padding-right: 24px;
  }
  .campo-linha { flex-direction: column; gap: 0; }
}
