:root {
  --acento:       #d95e00;
  --acento-claro: #fff3ec;
  --acento-esc:   #b84e00;
  --header:       #1a1a2e;
  --borda:        #e0e0e0;
  --fundo:        #f0f2f5;
  --texto:        #1a1a1a;
  --suave:        #777;
  --r: 8px;
  --topbar-h: 96px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  background: var(--fundo);
  color: var(--texto);
  height: 100vh;
  overflow: hidden;
}

.hidden { display: none !important; }

/* ── LOGIN ─────────────────────────────────────────────────────────────── */
#tela-login {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: white;
  border-radius: 14px;
  padding: 44px 40px;
  width: 380px;
  box-shadow: 0 6px 32px rgba(0,0,0,0.14);
}

.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo h1 { font-size: 22px; color: var(--acento); font-weight: 700; }
.login-logo p  { color: var(--suave); margin-top: 4px; font-size: 13px; }

.form-grupo { margin-bottom: 18px; }
label { display: block; font-size: 11px; font-weight: 700; margin-bottom: 6px; color: #444; text-transform: uppercase; letter-spacing: 0.5px; }

input[type="text"], input[type="password"] {
  width: 100%; padding: 10px 12px;
  border: 1.5px solid var(--borda); border-radius: var(--r);
  font-size: 14px; outline: none; transition: border-color 0.15s;
}
input:focus { border-color: var(--acento); }

.btn-primary {
  width: 100%; padding: 12px;
  background: var(--acento); color: white;
  border: none; border-radius: var(--r);
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: background 0.15s; margin-top: 4px;
}
.btn-primary:hover { background: var(--acento-esc); }

.alerta { padding: 10px 12px; border-radius: var(--r); font-size: 13px; margin-bottom: 12px; }
.alerta-erro { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }

/* ── TELA CLIENTE ─────────────────────────────────────────────────────── */
#tela-cliente {
  height: 100vh;
  background: var(--fundo);
  overflow: hidden;
}

.tela-cliente-scroll {
  height: 100%;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  padding: 48px 20px 48px;
}

.tela-cliente-inner {
  width: 560px;
  flex-shrink: 0;
}

.cliente-topo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

.cliente-topo h2 {
  font-size: 24px;
  color: var(--texto);
  font-weight: 700;
}
.cliente-topo h2 span { color: var(--acento); }

.cliente-subtitulo {
  font-size: 18px;
  color: var(--suave);
  margin-bottom: 20px;
  font-weight: 300;
}

.campo-busca-grande {
  width: 100%;
  padding: 16px 18px;
  border: 2px solid var(--borda);
  border-radius: 12px;
  font-size: 18px;
  background: white;
  color: var(--texto);
  outline: none;
  transition: border-color 0.15s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.campo-busca-grande::placeholder { color: #bbb; }
.campo-busca-grande:focus { border-color: var(--acento); box-shadow: 0 2px 12px rgba(217,94,0,0.15); }

#resultado-clientes { margin-top: 12px; }

.card-cli-busca {
  background: white;
  border: 1.5px solid var(--borda);
  border-radius: var(--r);
  padding: 14px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.card-cli-busca:hover { border-color: var(--acento); background: var(--acento-claro); box-shadow: 0 2px 8px rgba(217,94,0,0.12); }

.cli-nome { font-weight: 700; font-size: 15px; color: var(--texto); }
.cli-razao { font-size: 12px; color: var(--suave); margin-top: 3px; }

.badge-id {
  display: inline-block;
  background: #eee;
  color: #888;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10px;
  font-family: monospace;
}

/* ── TOPBAR ────────────────────────────────────────────────────────────── */
#topbar {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: var(--topbar-h);
  padding: 10px 20px;
  background: var(--header);
  color: white;
  flex-shrink: 0;
  gap: 8px;
}

.topbar-l1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-l1-dir {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.topbar-nome-cli {
  font-size: 20px;
  font-weight: 800;
  color: #ff6b35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.3px;
}

.topbar-l2 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: #aaa;
}

.topbar-l2-sep { color: #555; }

.topbar-l2-item strong {
  color: white;
  font-weight: 700;
  text-transform: uppercase;
}


.btn-trocar-cli {
  background: transparent;
  border: 1px solid #555;
  color: #aaa;
  padding: 5px 14px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  transition: border-color 0.12s;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-trocar-cli:hover { border-color: #ff6b35; color: white; }

.topbar-dir {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #aaa;
  font-size: 13px;
  flex-shrink: 0;
}

.btn-logout {
  background: transparent;
  border: 1px solid #555;
  color: #aaa;
  padding: 5px 14px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  transition: border-color 0.12s;
}
.btn-logout:hover { border-color: #aaa; color: white; }

.btn-logout-claro {
  background: transparent;
  border: 1px solid var(--borda);
  color: var(--suave);
  padding: 5px 14px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  transition: border-color 0.12s;
}
.btn-logout-claro:hover { border-color: var(--acento); color: var(--acento); }

/* ── KIOSK GRID ────────────────────────────────────────────────────────── */
#tela-pedido {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

#kiosk-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.4fr 1.2fr;
  flex: 1;
  overflow: hidden;
  gap: 0;
}

.kiosk-col {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--borda);
  background: white;
  overflow: hidden;
}
.kiosk-col:last-child { border-right: none; background: #fafafa; }

.col-titulo {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--suave);
  border-bottom: 1px solid var(--borda);
  background: #fafafa;
  flex-shrink: 0;
}

.col-corpo {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.col-corpo::-webkit-scrollbar { width: 4px; }
.col-corpo::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

.col-vazia {
  color: #bbb;
  font-size: 13px;
  padding: 24px 8px;
  text-align: center;
}

/* ── BOTÕES DE SELEÇÃO (cols 1-3) ──────────────────────────────────────── */
.btn-sel {
  width: 100%;
  text-align: left;
  padding: 11px 13px;
  border: 1.5px solid var(--borda);
  border-radius: var(--r);
  background: white;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 6px;
  transition: border-color 0.1s, background 0.1s, color 0.1s;
  line-height: 1.3;
}
.btn-sel:hover  { border-color: var(--acento); background: var(--acento-claro); }
.btn-sel.ativo  { border-color: var(--acento); background: var(--acento); color: white; font-weight: 700; }

/* ── CARDS DE PRODUTO FINAL (col 4) ────────────────────────────────────── */
.card-prod-final {
  border: 1.5px solid var(--borda);
  border-radius: var(--r);
  padding: 10px 12px;
  margin-bottom: 8px;
  background: white;
  transition: border-color 0.12s, background 0.12s;
}
.card-prod-final.no-carrinho { border-color: var(--acento); background: var(--acento-claro); }

.prod-desc { font-weight: 600; font-size: 12px; line-height: 1.35; margin-bottom: 6px; }
.prod-molho { font-size: 11px; color: var(--suave); margin-bottom: 6px; }
.prod-rodape { display: flex; justify-content: space-between; align-items: center; }
.prod-preco { font-weight: 700; font-size: 14px; color: #2e7d32; }
.prod-subtotal { font-size: 11px; color: var(--acento); font-weight: 700; }

.qty-wrap { display: flex; align-items: center; gap: 6px; }
.btn-qty {
  width: 28px; height: 28px;
  border: 1.5px solid var(--borda);
  background: white; border-radius: 6px;
  cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  user-select: none; transition: background 0.1s;
}
.btn-qty:hover { background: #f0f0f0; }

.qty-input {
  width: 44px; text-align: center;
  border: 1.5px solid var(--borda);
  border-radius: 6px; padding: 3px;
  font-size: 13px; font-weight: 700; outline: none;
}
.qty-input:focus { border-color: var(--acento); }
.qty-input::-webkit-inner-spin-button { display: none; }

/* ── CARRINHO (col 5) ──────────────────────────────────────────────────── */
.carrinho-vazio { text-align: center; color: #ccc; padding: 40px 0; }
.carrinho-vazio svg { display: block; margin: 0 auto 10px; }

.cli-carrinho {
  font-size: 12px; font-weight: 700; color: #555;
  padding-bottom: 8px; margin-bottom: 8px;
  border-bottom: 1px solid var(--borda);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.cart-item {
  display: flex; justify-content: space-between;
  align-items: flex-start;
  padding: 7px 0;
  border-bottom: 1px solid #f0f0f0;
  gap: 6px;
}
.cart-item:last-of-type { border-bottom: none; }

.ci-info { flex: 1; min-width: 0; }
.ci-nome { font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-det  { font-size: 10px; color: var(--suave); margin-top: 2px; }

.ci-dir { display: flex; align-items: center; gap: 3px; flex-shrink: 0; }
.ci-sub { font-weight: 700; font-size: 12px; }

.btn-rm {
  background: none; border: none; color: #ccc;
  cursor: pointer; font-size: 15px; padding: 0 2px; line-height: 1;
  transition: color 0.1s;
}
.btn-rm:hover { color: #d32f2f; }

.cart-total {
  display: flex; justify-content: space-between;
  margin-top: 12px; padding-top: 10px;
  border-top: 2px solid var(--borda);
  font-weight: 700; font-size: 16px;
}

.btn-confirmar {
  width: 100%; margin-top: 12px; padding: 13px;
  background: var(--acento); color: white;
  border: none; border-radius: var(--r);
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: background 0.15s;
}
.btn-confirmar:hover { background: var(--acento-esc); }
.btn-confirmar:disabled { background: #ccc; cursor: not-allowed; }

/* ── PEDIDOS DE HOJE ────────────────────────────────────────────────────── */
.pedidos-hoje-area { margin-top: 28px; }

.pedidos-hoje-titulo {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--suave);
  margin-bottom: 10px;
}

.card-pedido-hoje {
  background: white;
  border: 1px solid var(--borda);
  border-radius: var(--r);
  padding: 10px 14px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.cpd-info { min-width: 0; flex: 1; }
.cpd-cliente {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--texto);
}
.cpd-pedido { font-size: 11px; color: var(--suave); font-family: monospace; margin-top: 2px; }
.cpd-vendedor { background: #e8f0fe; color: #1a56db; border-radius: 4px; padding: 1px 6px; font-family: sans-serif; font-size: 10px; margin-left: 6px; }

.cpd-dir { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.cpd-hora { font-size: 11px; color: var(--suave); }

.badge-status {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.badge-enviado    { background: #cfe2ff; color: #084298; }
.badge-no-sistema { background: #052c65; color: #ffffff; }
.badge-separado   { background: #e9d7fe; color: #5b21b6; }
.badge-faturado   { background: #d1e7dd; color: #0a3622; }
.badge-cancelado  { background: #e2e3e5; color: #41464b; text-decoration: line-through; }
.badge-verificar  { background: #fff3cd; color: #856404; }
.badge-verificando{ background: #e2e3e5; color: #41464b; }

.pedidos-vazio {
  color: #bbb;
  font-size: 13px;
  padding: 12px 0;
  text-align: center;
}

/* ── LOADING ────────────────────────────────────────────────────────────── */
.loading { text-align: center; color: var(--suave); padding: 20px; font-size: 13px; }
.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid #ddd; border-top-color: var(--acento);
  border-radius: 50%; animation: spin 0.7s linear infinite;
  vertical-align: middle; margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── OVERLAY ────────────────────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center; z-index: 200;
}
.overlay-card {
  background: white; border-radius: 16px;
  padding: 48px 44px; text-align: center; width: 420px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.25);
  animation: pop-in 0.2s ease;
}
@keyframes pop-in {
  from { transform: scale(0.88); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
.overlay-icon { font-size: 60px; margin-bottom: 16px; line-height: 1; }
.overlay-titulo { font-size: 20px; font-weight: 700; }
.overlay-pedido-id { font-size: 34px; font-weight: 700; color: var(--acento); margin: 14px 0 6px; font-family: monospace; letter-spacing: 2px; }
.overlay-sub { color: var(--suave); font-size: 13px; }
.btn-novo {
  margin-top: 28px; padding: 12px 36px;
  background: var(--acento); color: white;
  border: none; border-radius: var(--r);
  font-size: 15px; font-weight: 700; cursor: pointer;
}
.btn-novo:hover { background: var(--acento-esc); }
