@import url("variables.css");

body.page-comandas {
  margin: 0;
  font-family: var(--font-body);
  color: var(--dc-ink);
  background: var(--dc-paper);
  min-height: 100vh;
}

body.page-comandas .flow-guide {
  margin: 16px auto 12px;
}

body.page-comandas .desk-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  padding: 16px 20px 28px;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  align-items: start;
  box-sizing: border-box;
}

body.page-comandas .panel {
  background: var(--dc-white);
  border: 1px solid var(--dc-line);
  border-radius: var(--radius-card);
  min-height: 70vh;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  box-shadow: var(--dc-shadow);
  box-sizing: border-box;
}

body.page-comandas .panel--lista {
  min-height: min(70vh, 720px);
}

body.page-comandas .panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--dc-line);
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dc-navy);
  font-size: 0.88rem;
}

.panel__head-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.panel__head-icon {
  display: inline-flex;
  color: var(--dc-teal);
}

.panel__head-hint {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--dc-muted);
  white-space: nowrap;
}

body.page-comandas .panel__body {
  padding: 10px;
  min-width: 0;
  overflow-x: hidden;
}

body.page-comandas .mesa-group-title {
  margin: 14px 0 8px;
  padding: 0 2px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dc-navy);
}

body.page-comandas .mesa-group-title:first-child {
  margin-top: 0;
}

body.page-comandas .empty {
  color: var(--dc-muted);
  padding: 24px 8px;
  text-align: center;
}

/* Bloques por etapa */
.estado-block {
  margin-bottom: 12px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid transparent;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.estado-block:last-child {
  margin-bottom: 0;
}

.estado-block--nuevo {
  background: rgba(214, 69, 69, 0.1);
  border-color: rgba(214, 69, 69, 0.45);
}

.estado-block--en_preparacion {
  background: rgba(212, 160, 23, 0.12);
  border-color: rgba(212, 160, 23, 0.5);
}

.estado-block--listo {
  background: rgba(42, 157, 143, 0.1);
  border-color: rgba(42, 157, 143, 0.45);
}

.estado-block--entregado,
.estado-block--cancelado {
  background: rgba(107, 114, 128, 0.08);
  border-color: rgba(107, 114, 128, 0.28);
  opacity: 0.92;
}

.estado-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.1;
  min-width: 0;
}

.estado-group-title--takeaway {
  background: #f4e3c4;
  color: #6b3d0e;
  border: 1px solid #c56a1a;
}

.estado-group-title--takeaway .estado-group-title__count {
  background: #c56a1a;
  color: #fff;
}

.estado-block__cards {
  min-width: 0;
  min-height: 52px;
}

.empty--col {
  padding: 18px 8px;
  font-size: 0.86rem;
}

.estado-group-title__icon {
  display: inline-flex;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  color: inherit;
}

.estado-group-title__icon svg {
  width: 20px;
  height: 20px;
}

.estado-block--takeaway {
  margin-bottom: 16px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(197, 106, 26, 0.08);
  border: 2px dashed #c56a1a;
}

.estado-group-title__label {
  font-size: 0.92rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.estado-group-title__count {
  flex: 0 0 auto;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 0.95rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  background: #fff;
}

.estado-block--nuevo .estado-group-title {
  background: #b42318;
  color: #fff;
}

.estado-block--nuevo .estado-group-title__count {
  color: #b42318;
}

.estado-block--en_preparacion .estado-group-title {
  background: #b45309;
  color: #fff;
}

.estado-block--en_preparacion .estado-group-title__count {
  color: #b45309;
}

.estado-block--listo .estado-group-title {
  background: #1f7a70;
  color: #fff;
}

.estado-block--listo .estado-group-title__count {
  color: #1f7a70;
}

.estado-block--entregado .estado-group-title,
.estado-block--cancelado .estado-group-title {
  background: #4b5563;
  color: #fff;
}

.estado-block--entregado .estado-group-title__count,
.estado-block--cancelado .estado-group-title__count {
  color: #4b5563;
}

.pedido-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-align: left;
  border: 1px solid rgba(27, 58, 92, 0.14);
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  box-sizing: border-box;
  overflow: visible;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pedido-row:last-child {
  margin-bottom: 0;
}

.pedido-row:hover {
  border-color: rgba(42, 157, 143, 0.45);
}

.pedido-row.is-selected {
  box-shadow: 0 0 0 2px rgba(42, 157, 143, 0.35);
}

.pedido-row.is-draggable {
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.pedido-row.is-dragging {
  opacity: 0.38;
}

.pedido-row--ghost {
  box-shadow: 0 18px 40px rgba(15, 61, 58, 0.28);
  transform: rotate(1.5deg);
  opacity: 0.96;
  cursor: grabbing;
  pointer-events: none !important;
}

.estado-block.is-drop-ok {
  box-shadow: inset 0 0 0 3px #2a9d8f, 0 8px 22px rgba(42, 157, 143, 0.18);
}

.estado-block.is-drop-no {
  box-shadow: inset 0 0 0 3px #d64545;
}

body.is-comandas-dnd {
  cursor: grabbing;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

body.is-comandas-dnd * {
  cursor: grabbing !important;
}

.pedido-row--nuevo {
  border-color: #d64545;
  background: #fffafa;
}

.pedido-row--en_preparacion {
  border-color: #d4a017;
  background: #fffdf6;
}

.pedido-row--listo {
  border-color: #2a9d8f;
  background: #f7fcfb;
}

.pedido-row--entregado,
.pedido-row--cancelado {
  border-color: #9ca3af;
  background: #f8fafc;
}

.pedido-row__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  min-width: 0;
}

.pedido-row__who {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.pedido-row__id {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 6px;
  min-width: 0;
}

.pedido-row__sep {
  color: #9ca3af;
  font-weight: 700;
}

.pedido-row__status {
  flex: 1 1 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
}

.pedido-row__time {
  flex: 1 1 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
}

.pedido-row__badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex: 0 0 auto;
}

.badge--takeaway {
  background: #c56a1a !important;
  color: #fff !important;
  font-weight: 800 !important;
  letter-spacing: 0.04em;
}

.pedido-row--takeaway {
  border-color: #c56a1a !important;
  border-width: 2px;
  background: #fff8ee !important;
  box-shadow: inset 6px 0 0 #c56a1a;
}

.pedido-row--takeaway.is-selected {
  box-shadow: inset 6px 0 0 #c56a1a, 0 0 0 2px rgba(197, 106, 26, 0.4);
}

.pedido-row__mesa--takeaway {
  color: #c56a1a;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.pedido-row--takeaway .pedido-avatar {
  background: #c56a1a;
  color: #fff;
}

.pedido-row--takeaway-done {
  border-color: #c5cad3 !important;
  border-width: 1px;
  background: #f4f6f8 !important;
  box-shadow: none !important;
}

.pedido-row--takeaway-done.is-selected {
  box-shadow: 0 0 0 2px rgba(107, 114, 128, 0.35) !important;
}

.pedido-row--takeaway-done .pedido-avatar {
  background: #e5e7eb;
  color: #4b5563;
}

.pedido-row--takeaway-done .pedido-row__mesa--takeaway {
  color: #6b7280;
  font-weight: 700;
  letter-spacing: 0;
}

.pedido-avatar {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(42, 157, 143, 0.12);
  color: var(--dc-teal-deep);
}

.pedido-row--nuevo .pedido-avatar {
  background: rgba(214, 69, 69, 0.16);
  color: #b42318;
}

.pedido-row--en_preparacion .pedido-avatar {
  background: rgba(212, 160, 23, 0.2);
  color: #8a6a00;
}

.pedido-avatar--lg {
  width: 48px;
  height: 48px;
}

.pedido-avatar svg {
  width: 16px;
  height: 16px;
}

.pedido-avatar--lg svg {
  width: 22px;
  height: 22px;
}

.pedido-row__name {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--dc-navy);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pedido-row__mesa {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--dc-ink);
  white-space: nowrap;
}

.pedido-row__meta {
  margin: 0;
  font-size: 0.78rem;
  color: #6b7280;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 10px;
  align-items: baseline;
  min-width: 0;
}

.pedido-row__code {
  color: #6b7280;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pedido-row__precio {
  color: var(--dc-navy);
  font-weight: 800;
  margin-left: auto;
}

.pedido-row__nota {
  flex: 1 1 100%;
  color: #b45309;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.pedido-row__timing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  min-width: 0;
}

.pedido-cronos {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  margin-left: auto;
  min-width: 0;
  max-width: 100%;
}

.pedido-time,
.pedido-crono {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 8px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  border: 1px solid transparent;
  max-width: 100%;
}

.pedido-time {
  background: #eef2f7;
  color: var(--dc-navy);
  font-size: 0.86rem;
  border-color: rgba(27, 58, 92, 0.12);
  flex: 0 0 auto;
}

.pedido-crono {
  background: #ffe8e8;
  color: #9f1239;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  border-color: rgba(214, 69, 69, 0.4);
}

.pedido-crono__lbl {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
}

.pedido-crono__val {
  font-size: 0.82rem;
}

.pedido-time svg,
.pedido-crono svg {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
}

.pedido-crono.is-pending {
  opacity: 0.45;
  filter: grayscale(0.35);
}

.pedido-crono--total {
  background: #1b3a5c;
  color: #fff;
  border-color: rgba(27, 58, 92, 0.55);
}

.pedido-crono--total .pedido-crono__lbl {
  opacity: 0.9;
}

.ticket__timing .pedido-cronos {
  justify-content: flex-start;
  margin-left: 0;
}

/* Pedido recibido */
.pedido-crono--nuevo {
  background: #ffe8e8;
  color: #9f1239;
  border-color: rgba(214, 69, 69, 0.45);
}

/* En cocina */
.pedido-crono--prep {
  background: rgba(212, 160, 23, 0.18);
  color: #8a6a00;
  border-color: rgba(212, 160, 23, 0.5);
}

/* Lista para servir */
.pedido-crono--listo {
  background: #e8f7f4;
  color: #14665d;
  border-color: rgba(42, 157, 143, 0.4);
}

/* Servido en mesa / cerrado */
.pedido-crono--entregado,
.pedido-crono.is-stopped {
  background: #e5e7eb;
  color: #4b5563;
  border-color: rgba(107, 114, 128, 0.35);
  animation: none;
}

.pedido-crono.is-urgent {
  box-shadow: 0 0 0 2px rgba(214, 69, 69, 0.22);
  font-weight: 900;
}

.pedido-crono--prep.is-urgent {
  box-shadow: 0 0 0 2px rgba(180, 83, 9, 0.28);
  background: rgba(212, 160, 23, 0.28);
  color: #7a4e00;
}

.pedido-crono--listo.is-urgent {
  box-shadow: 0 0 0 2px rgba(31, 122, 112, 0.28);
  background: rgba(42, 157, 143, 0.22);
  color: #0f5a52;
}

.pedido-crono--serv-suma {
  color: #1a2330;
  background: #e8ecf0;
  border-color: rgba(31, 41, 51, 0.28);
  opacity: 1;
  filter: none;
}

.pedido-crono--serv-suma .pedido-crono__val {
  font-weight: 800;
}

body.page-comandas .pedido-row__badge.badge {
  flex: 0 1 auto;
  max-width: 100%;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 6px 10px;
  border-radius: 999px;
  text-align: center;
  white-space: nowrap;
  line-height: 1.15;
}

body.page-comandas .pedido-row--nuevo .pedido-row__badge {
  background: #b42318;
  color: #fff;
}

body.page-comandas .pedido-row--en_preparacion .pedido-row__badge {
  background: #b45309;
  color: #fff;
}

body.page-comandas .pedido-row--listo .pedido-row__badge {
  background: #1f7a70;
  color: #fff;
}

body.page-comandas .pedido-row--entregado .pedido-row__badge,
body.page-comandas .pedido-row--cancelado .pedido-row__badge {
  background: #4b5563;
  color: #fff;
}

.ticket__timing {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin: 12px 0 4px;
}

.ticket__timing .pedido-time,
.ticket__timing .pedido-crono {
  font-size: 1rem;
  padding: 7px 10px;
}

.ticket__timing .pedido-crono {
  font-size: 1.15rem;
}

body.page-comandas .ticket__badge .badge {
  font-size: 0.82rem;
  font-weight: 900;
  padding: 8px 10px;
  border-radius: 8px;
  letter-spacing: 0.03em;
}

body.page-comandas .ticket__badge .badge--nuevo {
  background: #b42318;
  color: #fff;
}

body.page-comandas .ticket__badge .badge--prep {
  background: #b45309;
  color: #fff;
}

body.page-comandas .ticket__badge .badge--listo {
  background: #1f7a70;
  color: #fff;
}

body.page-comandas .ticket__badge .badge--servida {
  background: #4b5563;
  color: #fff;
}

body.page-comandas .pedido-row .badge {
  margin-top: 0;
  align-self: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body.page-comandas .ticket--takeaway {
  border: 2px solid #c56a1a;
  background: #fff8ee;
}

.ticket__takeaway-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -6px 0 14px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #c56a1a;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.82rem;
}

.ticket__takeaway-banner svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.ticket__mesa--takeaway {
  color: #c56a1a;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.ticket__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--dc-line);
}

.ticket__who {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.ticket__name {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--dc-navy);
}

.ticket__mesa {
  margin: 2px 0 0;
  font-size: 0.95rem;
  color: var(--dc-ink);
}

.ticket__code {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: #9aa3af;
  font-weight: 500;
}

.ticket__badge {
  flex: 0 0 auto;
}

body.page-comandas .ticket__badge .badge {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ticket__items {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: grid;
  gap: 10px;
}

.ticket-plato {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--dc-line);
  border-radius: 12px;
  background: #fff;
  color: var(--dc-navy);
  font-weight: 600;
}

.ticket-plato--luego {
  background: rgba(212, 160, 23, 0.1);
  border-color: rgba(212, 160, 23, 0.38);
}

.ticket-plato__main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.ticket-plato__qty {
  flex: 0 0 auto;
  min-width: 38px;
  height: 28px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--dc-navy);
  color: #fff;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1;
}

.ticket-plato__body {
  min-width: 0;
  flex: 1 1 auto;
}

.ticket-plato__name,
.ticket-plato__add-name {
  margin: 2px 0 0;
  color: var(--dc-navy);
  font-weight: 800;
  line-height: 1.3;
}

.ticket-plato__name {
  font-size: 1.02rem;
}

.ticket-plato__var {
  font-weight: 600;
  color: var(--dc-muted);
}

.ticket-plato__cuando {
  margin: 4px 0 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8a6a00;
}

.ticket-plato__nota {
  margin: 4px 0 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--dc-ink);
}

.ticket-plato__adds {
  margin-top: 10px;
  padding: 10px 10px 8px 12px;
  border-radius: 10px;
  background: rgba(42, 157, 143, 0.08);
  border: 1px solid rgba(42, 157, 143, 0.28);
  border-left: 3px solid var(--dc-teal);
}

.ticket-plato--suelto {
  background: rgba(42, 157, 143, 0.06);
  border-color: rgba(42, 157, 143, 0.28);
}

.ticket-plato--suelto .ticket-plato__adds-label {
  margin-bottom: 8px;
}

.ticket-plato__adds-label {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--dc-teal-deep);
}

.ticket-plato__adds-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.ticket-plato__adds-list > li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.ticket-plato__add-plus {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 6px;
  background: var(--dc-teal);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  line-height: 22px;
  text-align: center;
}

.ticket-plato__add-body {
  min-width: 0;
  flex: 1 1 auto;
}

.ticket-plato__add-name {
  font-size: 0.94rem;
  font-weight: 700;
}

.ticket-plato__add-name strong {
  font-weight: 800;
}

.ticket-plato .ticket__ings {
  margin-top: 8px;
}

.ticket-plato .ticket__ings-text {
  margin-top: 4px;
}

@media print {
  .ticket-plato,
  .ticket-plato--luego,
  .ticket-plato--suelto,
  .ticket-plato__adds {
    background: #fff;
    border-color: #000;
  }

  .ticket-plato__qty,
  .ticket-plato__add-plus {
    background: #000;
    color: #fff;
  }
}

.ticket__ings {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
}

.ticket__ings li {
  margin: 0;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(26, 58, 74, 0.08);
  border: 1px solid rgba(26, 58, 74, 0.14);
  color: var(--dc-navy);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
}

.ticket__ings-text {
  margin: 6px 0 0;
  color: var(--dc-muted, #5a6b75);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.4;
}

.ticket__total {
  margin: 14px 0 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--dc-navy);
}

body.page-comandas .ticket-nota {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(232, 149, 90, 0.16);
  border: 1px solid rgba(232, 149, 90, 0.35);
}

.ticket-nota__icon {
  flex: 0 0 auto;
  color: #b86a2a;
  margin-top: 2px;
}

body.page-comandas .ticket-nota strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #b86a2a;
}

body.page-comandas .ticket-nota p {
  margin: 0;
  color: var(--dc-navy);
  font-weight: 700;
}

body.page-comandas .estado-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin: 14px 0 8px;
}

body.page-comandas .estado-actions--compact {
  gap: 0;
  margin: 6px 0 0;
}

.estado-path__track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 4px 0 0;
}

.estado-path__track::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 18px;
  height: 2px;
  background: rgba(27, 58, 92, 0.14);
  z-index: 0;
}

.estado-path__step {
  position: relative;
  z-index: 1;
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0 2px;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  font: inherit;
  font-size: 0.68rem;
  line-height: 1.2;
  color: #9aa3af;
  opacity: 0.55;
  cursor: pointer;
}

.estado-path__dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(27, 58, 92, 0.22);
  background: #fff;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.estado-path__dot::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: transparent;
}

.estado-path__label {
  max-width: 100%;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.estado-path__label-short {
  display: none;
}

.estado-actions--compact .estado-path__label-full {
  display: none;
}

.estado-actions--compact .estado-path__label-short {
  display: block;
  font-size: 0.7rem;
  line-height: 1.15;
  letter-spacing: 0.01em;
}

.estado-actions--compact .estado-path__step {
  gap: 6px;
  opacity: 0.72;
}

.estado-actions--compact .estado-path__step.is-current,
.estado-actions--compact .estado-path__step.is-done,
.estado-actions--compact .estado-path__step.is-next {
  opacity: 1;
}

.estado-path__cronos {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px 2px;
  margin-top: 6px;
  align-items: start;
}

.estado-path__cronos .pedido-crono {
  justify-self: center;
  max-width: 100%;
  min-width: 0;
  padding: 3px 5px;
  font-size: 0.68rem;
  gap: 3px;
  box-sizing: border-box;
  flex-wrap: wrap;
  justify-content: center;
}

.estado-path__cronos .pedido-crono__lbl {
  font-size: 0.52rem;
}

.estado-path__cronos .pedido-crono__val {
  font-size: 0.7rem;
}

.estado-path__cronos .pedido-crono svg {
  width: 10px;
  height: 10px;
}

.estado-path__cronos .pedido-crono--serv-suma .pedido-crono__val {
  font-weight: 800;
  font-size: 0.74rem;
}

body.page-comandas .estado-actions:not(.estado-actions--compact) .estado-path__cronos .pedido-crono {
  padding: 5px 7px;
  font-size: 0.78rem;
}

body.page-comandas .estado-actions:not(.estado-actions--compact) .estado-path__cronos .pedido-crono__val {
  font-size: 0.86rem;
}

.estado-path__step.is-done {
  opacity: 1;
  color: var(--dc-navy);
}

.estado-path__step.is-done .estado-path__dot {
  border-color: var(--dc-teal);
  background: var(--dc-teal);
}

.estado-path__step.is-done .estado-path__dot::after {
  width: 10px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  border-radius: 0;
  background: transparent;
  transform: rotate(-45deg) translate(1px, -1px);
}

.estado-path__step.is-current {
  opacity: 1;
  font-weight: 700;
}

.estado-path__step.is-current .estado-path__dot {
  background: #fff;
  transform: scale(1.08);
}

.estado-path__step.is-current .estado-path__dot::after {
  background: currentColor;
}

.estado-path__step.is-next {
  opacity: 0.95;
}

.estado-path__step.is-next .estado-path__dot {
  box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.12);
}

.estado-path__step--nuevo.is-current,
.estado-path__step--nuevo.is-next {
  color: #b42318;
}

.estado-path__step--nuevo.is-current .estado-path__dot,
.estado-path__step--nuevo.is-next .estado-path__dot {
  border-color: #b42318;
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.14);
}

.estado-path__step--prep.is-current,
.estado-path__step--prep.is-next {
  color: #b45309;
}

.estado-path__step--prep.is-current .estado-path__dot,
.estado-path__step--prep.is-next .estado-path__dot {
  border-color: #d4a017;
  box-shadow: 0 0 0 4px rgba(212, 160, 23, 0.2);
}

.estado-path__step--listo.is-current,
.estado-path__step--listo.is-next {
  color: #1f7a70;
}

.estado-path__step--listo.is-current .estado-path__dot,
.estado-path__step--listo.is-next .estado-path__dot {
  border-color: var(--dc-teal);
  box-shadow: 0 0 0 4px rgba(42, 157, 143, 0.18);
}

.estado-path__step--serv.is-current,
.estado-path__step--serv.is-next {
  color: #1b3a5c;
}

.estado-path__step--serv.is-current .estado-path__dot,
.estado-path__step--serv.is-next .estado-path__dot {
  border-color: #1b3a5c;
  box-shadow: 0 0 0 4px rgba(27, 58, 92, 0.14);
}

.estado-path__step:hover:not(:disabled) {
  opacity: 1;
}

.estado-path__step:hover:not(:disabled) .estado-path__dot {
  transform: scale(1.12);
}

.estado-path__step:focus-visible {
  outline: none;
}

.estado-path__step:focus-visible .estado-path__dot {
  box-shadow: 0 0 0 4px rgba(42, 157, 143, 0.35);
}

.estado-path__step:disabled {
  cursor: default;
}

.estado-btn {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--dc-line);
  background: #f7f8fa;
  color: var(--dc-navy);
  font: inherit;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
  text-align: center;
  line-height: 1.2;
}

.estado-btn svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.estado-btn--danger {
  background: rgba(214, 69, 69, 0.08);
  border-color: rgba(214, 69, 69, 0.25);
  color: #b42318;
  align-self: flex-end;
  min-width: 88px;
}

.estado-btn:hover {
  filter: brightness(0.98);
}

.comanda-modal[hidden] {
  display: none !important;
}

.comanda-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
}

.comanda-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 28, 46, 0.4);
}

.comanda-modal__panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  background: var(--dc-white);
  border: 1px solid var(--dc-line);
  border-radius: var(--radius-card);
  padding: 18px 20px;
  box-shadow: var(--dc-shadow-lg);
}

.comanda-modal__panel h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  color: var(--dc-navy);
}

.comanda-modal__panel p {
  margin: 0 0 16px;
  color: var(--dc-muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.comanda-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

/* Sheet detalle / ticket (mismo patrón que Cliente) */
.comanda-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 30, 40, 0.45);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.comanda-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.comanda-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  max-height: min(86vh, 820px);
  background: var(--dc-paper);
  border-radius: 22px 22px 0 0;
  box-shadow: var(--dc-shadow-lg);
  transform: translateY(110%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.comanda-sheet.is-open {
  transform: translateY(0);
}

.comanda-sheet__handle {
  width: 42px;
  height: 4px;
  border-radius: 25px;
  background: rgba(27, 58, 92, 0.2);
  margin: 10px auto 6px;
  flex: 0 0 auto;
}

.comanda-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 18px 12px;
  border-bottom: 1px solid var(--dc-line);
  flex: 0 0 auto;
}

.comanda-sheet__head-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.comanda-sheet__head-icon {
  display: inline-flex;
  color: var(--dc-teal);
  flex: 0 0 auto;
}

.comanda-sheet__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--dc-navy);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
}

.comanda-sheet__close {
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  color: var(--dc-muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px 6px;
  flex: 0 0 auto;
}

.comanda-sheet__close:hover {
  color: var(--dc-navy);
}

.comanda-sheet__body {
  overflow: auto;
  padding: 12px 16px 20px;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.comanda-sheet__body > .empty {
  margin: 36px 0;
}

@media (max-width: 900px) {
  body.page-comandas .desk-layout {
    grid-template-columns: minmax(0, 1fr);
    padding: 12px;
    max-width: none;
  }

  body.page-comandas .panel {
    min-height: 0;
  }

  body.page-comandas .panel--lista {
    min-height: 0;
  }

  .panel__head-hint {
    display: none;
  }

  body.page-comandas .estado-btn--danger {
    align-self: stretch;
  }

  .pedido-row__head {
    gap: 6px;
  }

  body.page-comandas .pedido-row__badge.badge {
    white-space: normal;
    font-size: 0.64rem;
    padding: 5px 7px;
  }
}

@media (min-width: 1100px) {
  body.page-comandas .desk-layout {
    max-width: none;
    padding: 16px 24px 28px;
  }

  body.page-comandas .panel--lista {
    min-height: calc(100vh - 210px);
  }

  body.page-comandas .panel__body {
    padding: 12px;
  }

  #listaPedidos.comandas-kanban,
  #listaPedidos.comandas-kanban.is-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-flow: row;
    gap: 14px;
    align-items: stretch;
    min-height: calc(100vh - 280px);
  }

  #listaPedidos.comandas-kanban.is-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .comandas-kanban .estado-block {
    display: flex;
    flex-direction: column;
    margin: 0;
    min-height: 100%;
    padding: 0;
    border-radius: 16px;
    overflow: hidden;
    border-width: 0;
  }

  .comandas-kanban .estado-block--nuevo {
    background: #fde8e8;
  }

  .comandas-kanban .estado-block--en_preparacion {
    background: #fdeccf;
  }

  .comandas-kanban .estado-block--listo {
    background: #d9f3ef;
  }

  .comandas-kanban .estado-block--entregado,
  .comandas-kanban .estado-block--cancelado {
    background: #e8edf3;
    opacity: 1;
  }

  .comandas-kanban .estado-group-title {
    margin: 0;
    border-radius: 0;
    padding: 12px 14px;
    gap: 8px;
  }

  .comandas-kanban .estado-block__cards {
    padding: 10px;
    flex: 1 1 auto;
    overflow-y: auto;
    max-height: calc(100vh - 340px);
  }

  .comandas-kanban .pedido-row {
    margin-bottom: 10px;
    border-radius: 12px;
    box-shadow: 0 6px 14px rgba(15, 61, 58, 0.08);
    padding: 12px;
  }

  .comandas-kanban .pedido-row:last-child {
    margin-bottom: 0;
  }

  .comandas-kanban .pedido-row__head {
    flex-wrap: wrap;
  }

  .comandas-kanban .pedido-row__status,
  .comandas-kanban .pedido-row__time {
    flex: 0 0 auto;
  }
}

@media (min-width: 901px) {
  .comanda-sheet {
    left: 50%;
    right: auto;
    width: min(640px, calc(100% - 48px));
    bottom: 24px;
    max-height: min(88vh, 860px);
    border-radius: 22px;
    transform: translate(-50%, 110%);
  }

  .comanda-sheet.is-open {
    transform: translate(-50%, 0);
  }
}

@media (orientation: landscape) and (max-height: 560px) {
  .estado-actions--compact .estado-path__cronos {
    display: none;
  }

  .estado-actions--compact .estado-path__step {
    gap: 4px;
  }

  .estado-actions--compact .estado-path__label-short {
    font-size: 0.74rem;
    font-weight: 800;
    color: inherit;
  }

  .estado-actions--compact .estado-path__dot {
    width: 18px;
    height: 18px;
  }

  .estado-actions--compact .estado-path__track::before {
    top: 14px;
  }

  .comandas-kanban .estado-block__cards {
    max-height: calc(100dvh - 196px);
    padding: 8px;
  }

  .comandas-kanban .pedido-row {
    padding: 8px 10px;
    gap: 6px;
  }

  .comandas-kanban .estado-group-title {
    padding: 8px 12px;
    font-size: 0.78rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .comanda-overlay,
  .comanda-sheet,
  .pedido-row--ghost {
    transition: none;
  }

  .pedido-row--ghost {
    transform: none;
  }
}
