:root {
  --bg: #fff7ed;
  --text: #1c1917;
  --muted: #78716c;
  --line: rgba(234, 88, 12, 0.16);
  --orange: #ea580c;
  --orange-deep: #c2410c;
  --orange-soft: #ffedd5;
  --ok: #059669;
  --warn: #d97706;
  --rose: #e11d48;
  --radius: 18px;
  font-family: 'Outfit', system-ui, sans-serif;
  color: var(--text);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(900px 420px at 0% -10%, rgba(234, 88, 12, 0.18), transparent 55%),
    linear-gradient(180deg, #fffbeb 0%, #fff7ed 100%);
}

.stage {
  min-height: 100dvh;
  padding: 12px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(234, 88, 12, 0.18);
  border: 1px solid var(--line);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand strong {
  display: block;
  font-size: 1.1rem;
}

.brand-sub {
  color: var(--muted);
  font-size: 0.82rem;
}

.top-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.busca-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chip-icon {
  width: 42px;
  height: 42px;
  min-width: 42px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  color: var(--orange-deep);
}

.chip-icon svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
  flex-shrink: 0;
}

.chip-icon[aria-expanded="true"] {
  background: #fff7ed;
  border-color: #fdba74;
}

.busca-box {
  display: flex;
  align-items: center;
  gap: 6px;
  animation: busca-in 0.18s ease-out;
}

.busca-box[hidden] {
  display: none !important;
}

.busca-box input {
  width: min(42vw, 160px);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  font: inherit;
  background: #fff;
  outline: none;
}

.busca-box input:focus {
  border-color: #fb923c;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.18);
}

.chip.chip-buscar {
  background: var(--orange-deep);
  color: #fff !important;
  border-color: var(--orange-deep);
  padding: 0.55rem 0.9rem;
  font-weight: 700;
}

.chip.chip-buscar:hover {
  filter: brightness(1.05);
}

.card.card-destaque {
  outline: 3px solid #ea580c;
  box-shadow: 0 0 0 4px rgba(234, 88, 12, 0.2), 0 12px 28px rgba(234, 88, 12, 0.18);
  animation: destaque-pulse 1.2s ease;
}

@keyframes busca-in {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes destaque-pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.015); }
  100% { transform: scale(1); }
}

.top-meta time {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--orange-deep);
  font-size: 1.15rem;
}

.chip, .btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font: inherit;
  cursor: pointer;
}

.chip:hover, .btn:hover { filter: brightness(0.98); }

.banner {
  padding: 10px 14px;
  border-radius: 12px;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #9f1239;
}

.resumo {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.tile {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  font: inherit;
  text-align: left;
  color: inherit;
  transition: 0.15s ease;
}

.tile:hover {
  border-color: rgba(234, 88, 12, 0.4);
}

.tile.ativa {
  border-color: var(--orange);
  box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.18);
  background: #fff7ed;
}

.tile span {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tile strong {
  font-family: 'Syne', sans-serif;
  font-size: 1.55rem;
  line-height: 1;
}

.tile.pendente strong { color: var(--rose); }
.tile.prep strong { color: var(--warn); }
.tile.atrasado strong { color: #b45309; }
.tile.pronto strong { color: var(--ok); }

.board {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.col {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.col-unica {
  height: 100%;
}

.col-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 14px 8px;
  flex-shrink: 0;
}

.col-head h2 {
  margin: 0;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.count {
  font-family: 'Syne', sans-serif;
  color: var(--orange);
  font-size: 1.1rem;
}

.col-list {
  padding: 0 10px 12px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  align-content: start;
  min-height: 0;
}

.card {
  position: relative;
  border: none;
  background:
    linear-gradient(180deg, #fffcf7 0%, #f7f3ec 100%);
  border-radius: 10px;
  padding: 14px 14px 18px;
  text-align: left;
  cursor: default;
  transition: 0.15s ease;
  width: 100%;
  font: inherit;
  color: #1e293b;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.1);
  overflow: hidden;
}

.card.is-clickable {
  cursor: pointer;
}

.card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
}

.card::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 8px;
  background: #facc15;
}

.card.status-pendente::after { background: #facc15; }
.card.status-aceito::after { background: #3b82f6; }
.card.status-prep::after { background: #fb923c; }
.card.status-atrasado::after { background: #f59e0b; }
.card.status-pronto::after { background: #86efac; }

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.card-head-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.card-tipo {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #e2e8f0;
  color: #334155;
}

.card-tipo svg {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
}

.card-tipo-delivery {
  background: #dbeafe;
  color: #1d4ed8;
}

.card-tipo-balcao {
  background: #ffedd5;
  color: #c2410c;
}

.card-tipo-mesa {
  background: #dcfce7;
  color: #15803d;
}

.card-title {
  margin: 0;
  font-family: 'Bebas Neue', 'Syne', sans-serif;
  font-size: 1.45rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #0b1f44;
  line-height: 1;
}

.card-cliente {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: #475569;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-tempo-entrega {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #c2410c;
  line-height: 1.2;
}

.card-badge {
  display: inline-block;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  background: #64748b;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card-badge.prep { background: #ea580c; }
.card-badge.aceito { background: #2563eb; }
.card-badge.atrasado { background: #d97706; }
.card-badge.pronto { background: #059669; }

.card-timer {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(100, 116, 139, 0.72);
  color: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  max-width: 46%;
}

.card-timer strong {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.card-timer small {
  font-size: 0.68rem;
  opacity: 0.9;
}

.card-table {
  width: 100%;
  border-collapse: collapse;
}

.card-table th {
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: #0f172a;
  padding: 0 0 8px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.12);
}

.card-table th.qtd-col { width: 48px; }

.card-table td {
  padding: 8px 0 0;
  vertical-align: top;
  font-size: 0.95rem;
}

.card-table .qtd-col {
  font-weight: 700;
  color: #0f172a;
  width: 48px;
}

.card-table .desc-main {
  font-weight: 400;
  color: #0f172a;
  display: block;
}

.card-table .desc-obs {
  display: block;
  margin-top: 2px;
  color: #94a3b8;
  font-size: 0.82rem;
  font-weight: 400;
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 24px 8px;
  font-size: 0.9rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 23, 0.45);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: start center;
  padding: 24px 12px 12px;
  z-index: 40;
  align-content: start;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal {
  width: min(520px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(28, 25, 23, 0.22);
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: min(85dvh, 720px);
  overflow: auto;
  margin-top: 4vh;
}

.modal h2 {
  margin: 0;
  font-family: 'Syne', sans-serif;
}

.modal-sub {
  margin: 0;
  color: var(--muted);
}

.modal-itens {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-table th.check-col,
.card-table td.check-col {
  width: 34px;
  text-align: center;
}

.card-table input[type="checkbox"],
.modal-itens input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #ea580c;
  cursor: pointer;
}

.modal-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.modal-itens li {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--orange-soft);
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 10px;
  align-items: start;
}

.btn-notif-item {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: rgba(234, 88, 12, 0.12);
  color: #c2410c;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s ease, transform 0.15s ease;
}

.btn-notif-item:hover {
  background: rgba(234, 88, 12, 0.22);
  transform: scale(1.05);
}

.btn-notif-item.has-notif {
  background: #ea580c;
  color: #fff;
}

.btn-notif-item svg {
  width: 18px;
  height: 18px;
  display: block;
}

.modal-notif-backdrop {
  z-index: 60;
}

.modal-notif textarea {
  width: 100%;
  resize: vertical;
  min-height: 96px;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  font: inherit;
}

.modal-itens li small.item-notif-preview {
  color: #c2410c;
  font-style: italic;
}

.btn-iniciar {
  background: linear-gradient(135deg, var(--orange), var(--orange-deep));
  border: none;
  color: #fff;
  font-weight: 700;
  grid-column: 1 / -1;
}

.modal label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.modal input,
.modal textarea {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font: inherit;
  background: #fffbeb;
  resize: vertical;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-pronto {
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  color: #fff;
  font-weight: 700;
}

.btn-atrasar {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  color: #fff;
  font-weight: 700;
}

.btn-ghost {
  background: transparent;
  width: 100%;
}

.btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

/* Tablet */
@media (max-width: 980px) {
  .resumo {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .col-list {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

/* Celular */
@media (max-width: 640px) {
  .stage { padding: 10px; gap: 10px; }

  .brand-sub { display: none; }

  .top-meta {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .busca-box input {
    width: min(48vw, 140px);
  }

  .top-meta time { font-size: 1rem; }

  .modal-backdrop {
    place-items: start stretch;
    padding-top: 12px;
  }

  .modal {
    width: 100%;
    border-radius: 16px;
    margin-top: 0;
  }

  .modal-actions {
    grid-template-columns: 1fr;
  }

  .btn-atrasar, .btn-pronto {
    min-height: 48px;
  }
}
