/* Kitchen Display — Kanban de pedidos numa TV na cozinha.
   Auto-contido. Otimizado pra leitura à distância: fontes grandes, alto
   contraste, cor de urgência só na borda do card. Não depende de emoji pra
   transmitir informação (emoji é reforço, não a única pista). */

.kds-body {
  margin: 0;
  background: #0a0a12;
  color: #f4f4f8;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
.kds { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }

/* ── Topo ─────────────────────────────────────────────────────── */
.kds__top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px; background: #11111d; border-bottom: 2px solid #1e1e30; flex: 0 0 auto;
}
.kds__brand { font-size: 27px; font-weight: 800; letter-spacing: .3px; display: flex; align-items: center; gap: 10px; }
.kds__sub { color: #8a8aa5; font-weight: 600; }
.kds__status { width: 12px; height: 12px; border-radius: 50%; background: #34d399; box-shadow: 0 0 10px #34d399; }
.kds__status.is-off { background: #ff4d4d; box-shadow: 0 0 10px #ff4d4d; }
.kds__tools { display: flex; align-items: center; gap: 18px; }
.kds__clock { font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; color: #e6e6f5; }
.kds__voice {
  font-size: 18px; font-weight: 700; color: #fff; cursor: pointer; background: #2a2a45;
  border: 2px solid #3a3a5c; border-radius: 999px; padding: 11px 20px; user-select: none; touch-action: none;
}
.kds__voice.is-listening { background: #c0392b; border-color: #ff6b5b; animation: kds-pulse 1s infinite; }
.kds__voice:disabled { opacity: .35; cursor: not-allowed; }

/* ── Barra de confirmação de voz ──────────────────────────────── */
.kds__voicebar { display: flex; align-items: center; gap: 16px; flex: 0 0 auto;
  padding: 12px 24px; background: #1a2a40; border-bottom: 2px solid #2a4a70; }
.kds__voicebar[hidden] { display: none; } /* fix: classe de componente sobrescrevia [hidden] */
.kds__voiceheard { font-size: 23px; font-weight: 800; flex: 1; }
.kds__voicebar:not(.kds__voicebar--actionable) .kds__voiceok,
.kds__voicebar:not(.kds__voicebar--actionable) .kds__voicecancel { display: none; }
.kds__voiceok, .kds__voicecancel { font-size: 20px; font-weight: 800; padding: 12px 26px;
  border-radius: 12px; border: none; cursor: pointer; color: #fff; }
.kds__voiceok { background: #16a34a; }
.kds__voicecancel { background: #44445c; }

/* ── Board: 4 colunas ─────────────────────────────────────────── */
.kds__board { flex: 1 1 auto; display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; padding: 12px; min-height: 0; }
.kds-col { display: flex; flex-direction: column; min-height: 0; background: #0f0f1c;
  border-radius: 16px; border: 1px solid #1e1e30; }
.kds-col__title { margin: 0; padding: 13px 16px; font-size: 20px; font-weight: 800;
  display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid #1e1e30;
  letter-spacing: .4px; }
.kds-col__count { font-size: 18px; font-weight: 800; min-width: 30px; height: 30px; padding: 0 9px;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 999px;
  background: #1e1e30; color: #cfcfe6; }
.kds-col[data-status="confirmed"] .kds-col__title { color: #d7d7ea; }
.kds-col[data-status="preparing"] .kds-col__title { color: #ffb454; }
.kds-col[data-status="preparing"] .kds-col__count { background: #3a2c12; color: #ffb454; }
.kds-col[data-status="ready"]     .kds-col__title { color: #34d399; }
.kds-col[data-status="ready"]     .kds-col__count { background: #10301f; color: #34d399; }
.kds-col[data-status="delivered"] .kds-col__title { color: #7a7a98; }
.kds-col__cards { flex: 1 1 auto; overflow-y: auto; padding: 12px; display: flex;
  flex-direction: column; gap: 12px; min-height: 60px; }
.kds-col__cards:empty::after { content: "— sem pedidos —"; margin: 24px auto auto;
  color: #33334a; font-size: 16px; font-weight: 600; }

/* ── Card ─────────────────────────────────────────────────────── */
.kds-card { background: #181826; border: 2px solid #2a2a40; border-left-width: 8px;
  border-radius: 14px; padding: 13px 15px; cursor: grab; transition: border-color .2s; }
.kds-col[data-status="preparing"] .kds-card { border-left-color: #ffb454; }
.kds-col[data-status="ready"]     .kds-card { border-left-color: #34d399; }
.kds-col[data-status="delivered"] .kds-card { opacity: .6; }
.kds-card--ghost { opacity: .4; }

.kds-card__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; }
.kds-card__num { font-size: 34px; font-weight: 900; line-height: 1; }
.kds-card__timer { font-size: 18px; font-weight: 800; color: #b6b6cf; font-variant-numeric: tabular-nums;
  background: #232338; border-radius: 999px; padding: 4px 12px; }

.kds-card__items { list-style: none; margin: 0 0 9px; padding: 0; }
.kds-card__items li { font-size: 23px; font-weight: 600; line-height: 1.34; }
.kds-card__qty { font-weight: 900; color: #ffd23f; margin-right: 9px; }

.kds-card__note { font-size: 19px; font-weight: 800; color: #ffe07a; background: #3a2f12;
  border-left: 4px solid #ffb454; border-radius: 8px; padding: 7px 11px; margin-bottom: 9px; }

.kds-card__meta { display: flex; justify-content: space-between; align-items: center; gap: 8px;
  font-size: 17px; margin-bottom: 2px; }
.kds-card__fulfill { font-weight: 800; display: inline-flex; align-items: center; gap: 6px; }
.kds-card__fulfill--delivery { color: #7cc4ff; }
.kds-card__fulfill--pickup { color: #b0b0cc; }
.kds-card__fee { color: #34d399; font-weight: 800; }
.kds-card__fee--missing { color: #8a8aa5; font-weight: 700; font-style: italic; }
.kds-card__customer { color: #9a9ab8; font-weight: 600; max-width: 50%; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }

.kds-card__actions { display: flex; gap: 8px; margin-top: 12px; }
.kds-card__advance, .kds-card__moto, .kds-card__quote {
  flex: 1; padding: 14px 10px; font-size: 21px; font-weight: 900; border: none; border-radius: 10px; cursor: pointer; }
.kds-card__advance { color: #06140c; background: #34d399; }
.kds-col[data-status="confirmed"] .kds-card__advance { background: #ffb454; color: #1a1205; }
.kds-card__moto { color: #04121f; background: #7cc4ff; }
.kds-card__quote { color: #cfe7ff; background: #1f3a55; font-size: 18px; flex: 0 0 auto; padding: 14px 16px; }
.kds-card__advance:active, .kds-card__moto:active, .kds-card__quote:active { transform: scale(.98); }

/* ── Estados (urgência / novo / voz) ──────────────────────────── */
.kds-card.is-warn { border-color: #f5c518; box-shadow: 0 0 0 1px #f5c518; }
.kds-card.is-warn .kds-card__timer { background: #3a3212; color: #ffe07a; }
.kds-card.is-late { border-color: #ff4d4d; box-shadow: 0 0 16px rgba(255,77,77,.5); animation: kds-pulse 1.4s infinite; }
.kds-card.is-late .kds-card__timer { background: #3a1414; color: #ff8080; }
.kds-card.is-new { animation: kds-flash 1s ease-out 4; }
.kds-card.is-voice-target { border-color: #7cc4ff; box-shadow: 0 0 18px rgba(124,196,255,.7); }
.kds-card.is-moto-pending .kds-card__moto { background: #2a4a66; color: #7cc4ff; }

@keyframes kds-pulse { 0%,100% { opacity: 1 } 50% { opacity: .55 } }
@keyframes kds-flash { 0% { background: #2a4d2f } 100% { background: #181826 } }

/* ── Overlay de boot (destrava áudio) ─────────────────────────── */
.kds__start { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center;
  justify-content: center; background: rgba(8,8,16,.97); cursor: pointer; }
.kds__startbox { text-align: center; }
.kds__starticon { font-size: 84px; }
.kds__starttitle { font-size: 35px; font-weight: 900; margin: 12px 0 26px; }
.kds__startbtn { font-size: 27px; font-weight: 900; color: #06140c; background: #34d399;
  border: none; border-radius: 14px; padding: 18px 44px; cursor: pointer; }
.kds__starthint { margin-top: 18px; color: #8a8aa5; font-size: 17px; }

/* ── Saúde do conector + alerta de ação humana (header) ───────── */
.kds__health { display:inline-flex; align-items:center; gap:7px; font-size:16px; font-weight:700;
  background:#11251a; color:#34d399; border:1px solid #1f5038; border-radius:999px; padding:7px 15px; }
.kds__health.is-down { background:#2a1414; color:#ff6b6b; border-color:#5a2a2a; }
.kds__alert { display:inline-flex; align-items:center; gap:7px; font-size:16px; font-weight:800;
  background:#3a1d0a; color:#ffb454; border:1px solid #6a3a14; border-radius:999px; padding:7px 15px;
  animation:kds-pulse 1.4s infinite; }
.kds__alert[hidden] { display:none; }

/* ── Camada de despacho da entrega (dentro do card) ───────────── */
.kds-disp { margin-top:11px; border-radius:10px; padding:10px 12px; font-size:18px; font-weight:800;
  display:flex; align-items:center; gap:10px; }
.kds-disp__ico { font-size:22px; }
.kds-disp__txt { flex:1; line-height:1.2; }
.kds-disp__sub { font-size:13px; font-weight:600; opacity:.8; display:block; }
/* automático rodando = azul calmo + spinner (a máquina cuida) */
.kds-disp--auto { background:#102234; color:#7cc4ff; border:1px solid #234a6e; }
.kds-disp__spin { width:18px; height:18px; flex:0 0 auto; border:3px solid #234a6e; border-top-color:#7cc4ff;
  border-radius:50%; animation:kds-rot .8s linear infinite; }
@keyframes kds-rot { to { transform:rotate(360deg); } }
/* AGUARDANDO HUMANO = laranja vibrante + pisca (é com você) */
.kds-disp--human { background:#3a1a0a; color:#ffd0a0; border:2px solid #ff8c3b; animation:kds-pulse 1.3s infinite; flex-wrap:wrap; }
.kds-disp--human .kds-disp__do { background:#ff8c3b; color:#1a0e02; border:none; border-radius:8px;
  font-weight:900; font-size:17px; padding:11px 16px; cursor:pointer; width:100%; margin-top:8px; }
/* a caminho = verde tranquilo */
.kds-disp--transit { background:#10301f; color:#5ee0a0; border:1px solid #1f5038; }
/* estado inicial: PEDIR MOTO — automático (robô) em destaque, manual separado */
.kds-disp--pick { display:block; padding:11px; margin-top:11px; background:#0f1626;
  border:1px solid #1e2c44; border-radius:11px; }
.kds-disp__label { font-size:12px; font-weight:800; letter-spacing:1px; color:#6a7a95;
  text-transform:uppercase; margin-bottom:7px; }
.kds-disp__btn { width:100%; padding:14px; font-size:19px; font-weight:900; color:#04121f;
  background:#7cc4ff; border:none; border-radius:10px; cursor:pointer;
  display:flex; align-items:center; justify-content:center; gap:8px; }
.kds-disp__btn small { font-weight:700; opacity:.65; font-size:13px; }
.kds-disp__btn:active { transform:scale(.98); }
.kds-disp__manual { display:flex; align-items:center; gap:6px; margin-top:9px; }
.kds-disp__manual-lbl { font-size:13px; font-weight:700; color:#7a8aa5; white-space:nowrap; }
.kds-disp__alt-btn { flex:1; padding:9px 6px; font-size:14px; font-weight:700; color:#9fb8d0;
  background:#16213a; border:1px solid #25406a; border-radius:8px; cursor:pointer; }
.kds-disp__alt-btn:active { transform:scale(.97); }

/* dica de comandos de voz */
.kds__voicewrap { display:flex; flex-direction:column; align-items:flex-end; gap:2px; }
.kds__voicehint { font-size:12px; color:#6a7a95; font-weight:600; }

@media (max-width: 1100px) { .kds__board { grid-template-columns: repeat(2, 1fr); } }
