/* =====================================================================
   Star 43 Burger - painel do lojista
   Mesma paleta do cardapio, em layout de desktop com barra lateral.
   ===================================================================== */

:root {
  --amarelo:        #f9b233;
  --amarelo-claro:  #ffc95c;
  --laranja:        #f47b20;
  --marrom:         #2b1810;
  --marrom-2:       #3d2718;
  --creme:          #fdf6ec;
  --creme-2:        #f6ead8;
  --branco:         #ffffff;
  --texto:          #2b1810;
  --texto-suave:    #8a7565;
  --borda:          #e8dccb;
  --verde:          #2e9e5b;
  --azul:           #2f6fb0;
  --roxo:           #7a4fc0;
  --vermelho:       #d94a3d;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --sombra: 0 2px 10px rgba(43, 24, 16, .07);
  --sombra-md: 0 8px 24px rgba(43, 24, 16, .12);
  --lateral: 232px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--creme);
  color: var(--texto);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ---------------------------------------------------------------------
   Estrutura
   --------------------------------------------------------------------- */
.admin { display: flex; min-height: 100vh; }

.lateral {
  width: var(--lateral);
  flex: 0 0 var(--lateral);
  background: var(--marrom);
  color: #fff;
  padding: 18px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.lateral-marca {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 20px;
}
.lateral-marca .simbolo {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: var(--amarelo);
  color: var(--marrom);
  display: grid;
  place-items: center;
  flex: 0 0 38px;
}
.lateral-marca strong { font-size: 15px; font-weight: 900; line-height: 1.15; display: block; }
.lateral-marca small { font-size: 10.5px; color: rgba(255,255,255,.55); letter-spacing: .5px; }

.menu-lateral { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.menu-lateral a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 700;
  color: rgba(255,255,255,.72);
  transition: all .15s ease;
}
.menu-lateral a:hover { background: rgba(255,255,255,.07); color: #fff; }
.menu-lateral a.ativo { background: var(--amarelo); color: var(--marrom); }
.menu-lateral a .conta {
  margin-left: auto;
  background: var(--laranja);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  border-radius: 999px;
  display: grid;
  place-items: center;
}
.menu-lateral a.ativo .conta { background: var(--marrom); color: var(--amarelo); }

.lateral-rodape {
  border-top: 1px solid rgba(255,255,255,.12);
  padding-top: 12px;
  margin-top: 12px;
  font-size: 12px;
  color: rgba(255,255,255,.55);
}
.lateral-rodape strong { display: block; color: #fff; font-size: 13px; margin-bottom: 2px; }
.lateral-rodape a { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--amarelo); font-weight: 700; }

.conteudo { flex: 1; min-width: 0; padding: 22px 26px 60px; }

.cab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.cab h1 { margin: 0; font-size: 25px; font-weight: 900; }
.cab p { margin: 3px 0 0; font-size: 13.5px; color: var(--texto-suave); }
.cab-acoes { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }

/* ---------------------------------------------------------------------
   Componentes
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 800;
  background: var(--branco);
  color: var(--texto);
  border: 1.5px solid var(--borda);
  transition: all .15s ease;
  white-space: nowrap;
}
.btn:hover { border-color: var(--amarelo); }
.btn-primario { background: var(--amarelo); border-color: var(--amarelo); color: var(--marrom); }
.btn-primario:hover { background: var(--amarelo-claro); border-color: var(--amarelo-claro); }
.btn-escuro { background: var(--marrom); border-color: var(--marrom); color: #fff; }
.btn-perigo { background: #fdecea; border-color: #f4c7c1; color: #a4342a; }
.btn-perigo:hover { border-color: var(--vermelho); }
.btn-sm { padding: 7px 11px; font-size: 12.5px; }

/* Historico de itens cancelados (detalhe do pedido e comanda da mesa) */
.cancelados-bloco {
  margin-top: 10px; padding: 9px 12px;
  border: 1.5px dashed #f4c7c1; border-radius: var(--r-sm); background: #fff8f7;
}
.cancelados-titulo {
  font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px;
  color: #a4342a; margin-bottom: 4px;
}
.cancelado-linha {
  display: flex; justify-content: space-between; gap: 10px; align-items: flex-start;
  font-size: 13px; padding: 4px 0; color: var(--texto-suave);
}
.cancelado-linha small { font-size: 11.5px; }
.cancelado-valor { font-weight: 800; color: #a4342a; white-space: nowrap; }
.btn:disabled { opacity: .5; pointer-events: none; }

.cartao {
  background: var(--branco);
  border-radius: var(--r-md);
  box-shadow: var(--sombra);
  padding: 18px 20px;
  margin-bottom: 18px;
}
.cartao h2 { margin: 0 0 14px; font-size: 17px; font-weight: 900; }

.aviso {
  border-radius: var(--r-sm);
  padding: 12px 15px;
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.5;
}
.aviso.erro { background: #fdecea; color: #a4342a; }
.aviso.ok { background: #e7f6ec; color: #226e41; }
.aviso.atencao { background: #fff5e0; color: #8a5d12; }
.aviso-conexao { border-left: 4px solid #e89b1c; }
.aviso-conexao svg { vertical-align: -3px; margin-right: 4px; }
.aviso-conexao a { color: inherit; margin-left: 4px; }

/* Tabelas */
.tabela-wrap { overflow-x: auto; }
table.tabela { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tabela th {
  text-align: left;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--texto-suave);
  padding: 10px 12px;
  border-bottom: 2px solid var(--borda);
  white-space: nowrap;
}
table.tabela td {
  padding: 12px;
  border-bottom: 1px solid var(--borda);
  vertical-align: middle;
}
table.tabela tr:last-child td { border-bottom: 0; }
table.tabela tbody tr:hover { background: var(--creme); }
table.tabela .acoes { display: flex; gap: 6px; justify-content: flex-end; }
.thumb {
  width: 46px; height: 46px;
  border-radius: var(--r-sm);
  object-fit: cover;
  background: var(--creme-2);
}

/* Formularios */
.campo { margin-bottom: 15px; }
.campo label {
  display: block;
  font-size: 11.5px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--texto-suave);
  margin-bottom: 6px;
}
.campo input[type=text], .campo input[type=number], .campo input[type=email],
.campo input[type=password], .campo input[type=time], .campo input[type=date],
.campo select, .campo textarea, .campo input[type=file] {
  width: 100%;
  border: 1.5px solid var(--borda);
  border-radius: var(--r-sm);
  background: var(--branco);
  padding: 10px 12px;
  font-size: 14px;
  outline: 0;
  transition: border-color .15s ease;
}
.campo input:focus, .campo select:focus, .campo textarea:focus { border-color: var(--amarelo); }
.campo textarea { resize: vertical; min-height: 82px; }
.campo .ajuda { font-size: 11.5px; color: var(--texto-suave); margin-top: 5px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.grade-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 16px; }

.switch { display: flex; align-items: center; gap: 9px; cursor: pointer; padding: 7px 0; }
.switch input { width: 17px; height: 17px; accent-color: var(--laranja); }
.switch span { font-size: 14px; font-weight: 700; }

/* Etiquetas de status */
.etiqueta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.etiqueta.recebido     { background: #fff2d9; color: #8a5d12; }
.etiqueta.em_preparo   { background: #e6f0fa; color: #26598e; }
.etiqueta.pronto       { background: #ede5fa; color: #5a3795; }
.etiqueta.saiu_entrega { background: #ffe8d6; color: #a8521a; }
.etiqueta.concluido    { background: #e7f6ec; color: #226e41; }
.etiqueta.cancelado    { background: #f1ece7; color: #7a6a5d; }
.etiqueta.pago         { background: #e7f6ec; color: #226e41; }
.etiqueta.pendente     { background: #fff2d9; color: #8a5d12; }
.etiqueta.neutra       { background: var(--creme-2); color: var(--texto-suave); }

/* Selo do WhatsApp no cabecalho */
.selo-zap { border: 0; cursor: default; font-family: inherit; }
.selo-zap::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .55; }
.selo-zap.on  { background: #e7f6ec; color: #226e41; }
.selo-zap.on::before { opacity: 1; }
.selo-zap.off { background: #fdecea; color: #a4342a; cursor: pointer; }
.selo-zap.off::before { opacity: 1; animation: piscar-zap 1.2s ease-in-out infinite; }
.selo-zap.off:hover { background: #fbd9d4; }
.selo-zap.config { cursor: pointer; }
@keyframes piscar-zap { 50% { opacity: .2; } }

/* ---------------------------------------------------------------------
   Kanban de pedidos
   --------------------------------------------------------------------- */
.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(250px, 1fr));
  gap: 14px;
  align-items: start;
}
.coluna {
  background: rgba(255,255,255,.55);
  border-radius: var(--r-md);
  padding: 12px;
  min-height: 140px;
}
.coluna-cab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px 12px;
  font-size: 12.5px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--texto-suave);
}
/* Cada coluna rola sozinha: a pagina nao cresce com muitos pedidos. */
.coluna-lista {
  max-height: calc(100vh - 260px);
  min-height: 120px;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin-right: -6px;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,.25) transparent;
}
.coluna-lista::-webkit-scrollbar { width: 7px; }
.coluna-lista::-webkit-scrollbar-thumb { background: rgba(0,0,0,.22); border-radius: 999px; }
.coluna-lista::-webkit-scrollbar-track { background: transparent; }

.coluna-cab .pino { width: 9px; height: 9px; border-radius: 50%; }
.coluna-cab .n {
  margin-left: auto;
  background: var(--creme-2);
  color: var(--texto-suave);
  font-size: 11px;
  min-width: 21px; height: 21px;
  border-radius: 999px;
  display: grid; place-items: center;
}

.pedido-card {
  background: var(--branco);
  border-radius: var(--r-md);
  box-shadow: var(--sombra);
  padding: 13px 14px;
  margin-bottom: 10px;
  transition: box-shadow .15s ease, transform .15s ease;
}
.pedido-card:hover { box-shadow: var(--sombra-md); }
.pedido-card.novo { animation: entrando .5s ease; }
@keyframes entrando {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: none; }
}

.pedido-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.pedido-codigo { font-size: 14.5px; font-weight: 900; letter-spacing: .5px; }
.pedido-hora { font-size: 11.5px; color: var(--texto-suave); font-weight: 700; }
.pedido-cliente { font-size: 13px; font-weight: 800; margin: 0 0 3px; }
.pedido-meta { font-size: 11.5px; color: var(--texto-suave); line-height: 1.5; margin: 0 0 9px; }
.pedido-itens {
  font-size: 12.5px;
  line-height: 1.6;
  border-top: 1px dashed var(--borda);
  border-bottom: 1px dashed var(--borda);
  padding: 8px 0;
  margin-bottom: 9px;
}
.pedido-itens .obs { color: var(--laranja); font-size: 11.5px; font-weight: 700; }
.pedido-rodape { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pedido-total { font-size: 16px; font-weight: 900; color: var(--laranja); }
.pedido-acoes { display: flex; gap: 5px; }

.tempo-alerta { color: var(--vermelho); font-weight: 900; }

/* ---------------------------------------------------------------------
   Relatorios
   --------------------------------------------------------------------- */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.kpi {
  background: var(--branco);
  border-radius: var(--r-md);
  box-shadow: var(--sombra);
  padding: 16px 18px;
}
.kpi .rotulo {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--texto-suave);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.kpi .valor { font-size: 26px; font-weight: 900; line-height: 1; }
.kpi .nota { font-size: 12px; color: var(--texto-suave); margin-top: 5px; font-weight: 700; }
.kpi.destaque { background: var(--marrom); color: #fff; }
.kpi.destaque .rotulo { color: rgba(255,255,255,.6); }
.kpi.destaque .valor { color: var(--amarelo); }
.kpi.destaque .nota { color: rgba(255,255,255,.6); }
/* Olhinho que esconde o faturamento na tela de pedidos. */
.kpi-olho {
  display: inline-grid; place-items: center; vertical-align: middle;
  width: 24px; height: 24px; margin: -4px 0 -4px 6px; padding: 0;
  border: 0; border-radius: 6px; background: none; color: inherit; cursor: pointer;
}
.kpi-olho:hover { background: var(--creme-2); }
.barras { display: flex; flex-direction: column; gap: 11px; }
.barra-linha { display: grid; grid-template-columns: 150px 1fr 74px; gap: 12px; align-items: center; font-size: 13px; }
.barra-linha .nome { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra-trilho { display: block; background: var(--creme-2); border-radius: 999px; height: 11px; overflow: hidden; }
/* <span> e inline por padrao: sem display:block a largura em % e ignorada e a barra some. */
.barra-preenchida { display: block; height: 100%; background: linear-gradient(90deg, var(--amarelo), var(--laranja)); border-radius: 999px; }
.barra-linha .valor { text-align: right; font-weight: 900; font-size: 13px; }

.vazio-painel { text-align: center; padding: 46px 20px; color: var(--texto-suave); }
.vazio-painel strong { display: block; font-size: 16px; color: var(--texto); margin-bottom: 4px; }
.vazio-painel span { font-size: 13.5px; }

/* ---------------------------------------------------------------------
   Login
   --------------------------------------------------------------------- */
.login-tela {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, var(--amarelo) 0%, #e89b1c 55%, var(--laranja) 100%);
  padding: 24px;
}
.login-caixa {
  background: var(--branco);
  border-radius: var(--r-lg);
  box-shadow: 0 20px 50px rgba(43, 24, 16, .26);
  padding: 34px 32px;
  width: 100%;
  max-width: 388px;
}
.login-marca { text-align: center; margin-bottom: 24px; }
.login-marca .simbolo {
  width: 62px; height: 62px;
  border-radius: 19px;
  background: var(--marrom);
  color: var(--amarelo);
  display: grid; place-items: center;
  margin: 0 auto 13px;
}
.login-marca h1 { margin: 0; font-size: 22px; font-weight: 900; }
.login-marca p { margin: 4px 0 0; font-size: 13.5px; color: var(--texto-suave); }

/* ---------------------------------------------------------------------
   Modal
   --------------------------------------------------------------------- */
.modal-fundo {
  position: fixed;
  inset: 0;
  background: rgba(20, 10, 5, .55);
  display: none;
  place-items: center;
  z-index: 100;
  padding: 24px;
}
.modal-fundo.aberto { display: grid; }
.modal {
  background: var(--branco);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--sombra-md);
}
.modal-cab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--borda);
  position: sticky;
  top: 0;
  background: var(--branco);
}
.modal-cab h3 { margin: 0; font-size: 18px; font-weight: 900; }
.modal-corpo { padding: 20px 22px; }
.modal-rodape {
  padding: 15px 22px;
  border-top: 1px solid var(--borda);
  display: flex;
  gap: 9px;
  justify-content: flex-end;
}

/* Alternador de abas */
.abas { display: flex; gap: 6px; border-bottom: 2px solid var(--borda); margin-bottom: 18px; flex-wrap: wrap; }
.abas button {
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--texto-suave);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}
.abas button.ativa { color: var(--texto); border-bottom-color: var(--amarelo); }

.filtros { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.filtros input, .filtros select {
  border: 1.5px solid var(--borda);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-size: 13.5px;
  background: var(--branco);
  outline: 0;
}
.filtros input:focus, .filtros select:focus { border-color: var(--amarelo); }
/* Olhinho dentro da caixa do select (Relatorios), antes da setinha. */
.select-olho { position: relative; display: inline-flex; align-items: center; }
.select-olho select:has(+ .kpi-olho) { padding-right: 62px; }
.select-olho .kpi-olho { position: absolute; right: 28px; margin: 0; }
@media (max-width: 1100px) {
  .kanban { grid-template-columns: repeat(2, minmax(240px, 1fr)); }
}

@media (max-width: 820px) {
  .admin { flex-direction: column; }
  .lateral {
    width: 100%;
    flex: none;
    height: auto;
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    overflow-x: auto;
    padding: 12px;
  }
  .lateral-marca { padding: 0 8px 0 4px; flex: 0 0 auto; }
  .lateral-marca .texto { display: none; }
  .menu-lateral { flex-direction: row; flex: 1; }
  .menu-lateral a span:not(.conta) { display: none; }
  .lateral-rodape { display: none; }
  .conteudo { padding: 18px 15px 50px; }
  .kanban { grid-template-columns: 1fr; }
  .coluna-lista { max-height: 65vh; }
}
