/*
 * KOrder styles · public/css/07-station.css
 * Kitchen / counter queue screens: queue layout, order cards, item lines, order actions. Ends with the shared toast styles (original position).
 *
 * public/css/*.css used to be one public/styles.css. The files are cut from it in order
 * and index.html loads them in that same order, which is the CSS cascade order: do not
 * reorder the <link> tags, and add a rule to the file that owns its screen.
 * Map: public/css/README.md
 */
.queue-layout {
  display: grid;
  gap: 14px;
  max-width: 1280px;
  margin: 0 auto;
}

.queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.95);
  box-shadow: var(--shadow);
}

.queue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  align-items: start;
  gap: 12px;
}

.queue-status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 12px;
}

.order-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.order-card.ready {
  border-color: rgba(47, 125, 72, 0.45);
}

.order-card.paid {
  border-color: rgba(8, 127, 117, 0.45);
}

.order-card.counter-kitchen-pending {
  border-color: rgba(194, 122, 24, 0.5);
  background: #fff8eb;
}

.order-card.counter-kitchen-cooking {
  border-color: rgba(36, 111, 143, 0.55);
  background: #eef8fc;
}

.order-card.counter-kitchen-ready,
.order-card.counter-kitchen-done {
  border-color: rgba(47, 125, 72, 0.62);
  background: #eef9f0;
  box-shadow: 0 18px 44px rgba(47, 125, 72, 0.18);
}

.order-card.counter-payment-due {
  border-color: rgba(214, 83, 63, 0.55);
  background: #fff2ef;
}

.order-card.counter-service {
  border-color: rgba(214, 83, 63, 0.6);
  background: #fff5f1;
  box-shadow: 0 18px 44px rgba(214, 83, 63, 0.16);
}

.table-request-card {
  animation: service-request-pulse 1.1s ease-in-out infinite;
}

.table-request-table {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 16px 12px 18px;
  border: 2px solid rgba(214, 83, 63, 0.34);
  border-radius: 8px;
  color: #fff;
  background: #20242b;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.table-request-table span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 900;
}

.table-request-table strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 46px;
  line-height: 1;
  font-weight: 950;
}

/* New order or added round. 15 x 1s matches ORDER_FLASH_MS in app.js. */
.order-card.order-card-flash {
  animation: order-card-flash 1s ease-in-out 15;
}

@keyframes order-card-flash {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(214, 83, 63, 0);
  }

  50% {
    border-color: rgba(214, 83, 63, 1);
    box-shadow: 0 0 0 5px rgba(214, 83, 63, 0.55);
  }
}

@keyframes service-request-pulse {
  0%,
  100% {
    border-color: rgba(214, 83, 63, 0.62);
    box-shadow: 0 18px 44px rgba(214, 83, 63, 0.16);
  }

  50% {
    border-color: rgba(214, 83, 63, 1);
    background: #ffe6df;
    box-shadow:
      0 0 0 5px rgba(214, 83, 63, 0.18),
      0 18px 44px rgba(214, 83, 63, 0.24);
  }
}

.order-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

/* The table number is what counter staff match against the floor, so it leads the
   card; the order number drops to a supporting line. Staff reported mixing up tables
   because the order number was the only large text. */
.order-table-name {
  font-size: 40px;
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.02em;
  word-break: break-word;
}

.order-no {
  margin-top: 2px;
  font-size: 16px;
  font-weight: 800;
  color: var(--muted);
}

.order-time {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

/* 1차 / 2차 / 3차 separators inside a single table bill. */
.order-round-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.order-round-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: currentColor;
  opacity: 0.35;
}

.order-round-divider span {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(127, 127, 127, 0.18);
}

.order-guest-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.order-guest-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.order-guest-choices {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.order-guest-chip {
  min-width: 34px;
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid rgba(127, 127, 127, 0.4);
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.order-guest-chip.active {
  border-color: transparent;
  background: var(--teal);
  color: #fff;
}

.order-guest-input {
  width: 58px;
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid rgba(127, 127, 127, 0.4);
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.status-pill {
  flex: none;
  padding: 6px 9px;
  border-radius: 999px;
  color: #fff;
  background: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.status-pill.warn {
  background: var(--amber);
}

.status-pill.done {
  background: var(--green);
}

.counter-state-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.counter-state-chip {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  color: #fff;
  background: var(--graphite);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.counter-state-chip.kitchen-pending {
  background: var(--amber);
}

.counter-state-chip.kitchen-cooking {
  background: #246f8f;
}

.counter-state-chip.kitchen-done {
  background: var(--green);
}

.counter-state-chip.out-for-delivery {
  background: #6b4fa0;
}

.button.delivery-dispatch {
  color: #fff;
  background: #6b4fa0;
}

.counter-state-chip.printed {
  background: var(--teal);
}

.counter-state-chip.payment-due {
  background: var(--coral);
}

.counter-state-chip.print-failed {
  background: #c62828;
}

.counter-state-chip.print-unconfirmed {
  background: #b26a00;
}

.printed-at {
  font-weight: 700;
}

.printed-at.print-failed {
  color: #c62828;
}

.printed-at.print-unconfirmed {
  color: #b26a00;
}

.counter-state-chip.service-request {
  background: #b94434;
}

.counter-ready-banner {
  display: grid;
  min-height: 42px;
  place-items: center;
  border-radius: var(--radius);
  color: #fff;
  background: var(--green);
  font-size: 18px;
  font-weight: 900;
}

.counter-long-open-banner {
  display: grid;
  min-height: 36px;
  place-items: center;
  padding: 4px 8px;
  border-radius: var(--radius);
  color: #fff;
  background: var(--coral);
  font-size: 15px;
  font-weight: 800;
  text-align: center;
}

.order-items {
  display: grid;
  gap: 8px;
}

.order-item-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.order-item-line:last-child {
  border-bottom: 0;
}

.kitchen-item-line {
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto auto;
  border-top: 0;
  border-right: 0;
  border-left: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.kitchen-item-line.pending {
  background: rgba(194, 122, 24, 0.08);
}

.kitchen-item-line.cooking {
  background: rgba(36, 111, 143, 0.1);
}

.kitchen-item-line.completed {
  opacity: 0.76;
  background: rgba(47, 125, 72, 0.12);
}

.kitchen-item-line.completed > span:first-child {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.counter-item-line {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.counter-item-line.completed > span:first-child {
  opacity: 0.6;
}

.kitchen-item-status {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  color: #fff;
  background: var(--amber);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.kitchen-item-status.cooking {
  background: #246f8f;
}

.kitchen-item-status.completed {
  background: var(--green);
}

.item-qty {
  font-weight: 900;
}

.memo {
  color: var(--coral);
  font-size: 13px;
  font-weight: 700;
}

.order-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.order-actions.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.order-actions.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.order-actions.one {
  grid-template-columns: 1fr;
}

.order-actions .button {
  min-height: 42px;
  padding: 0 8px;
  font-size: 14px;
}

.muted {
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  max-width: min(420px, calc(100vw - 36px));
  /* A long menu/option name without spaces wraps instead of running out of the box. */
  overflow-wrap: anywhere;
  padding: 13px 15px;
  border-radius: var(--radius);
  color: #fff;
  background: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: #c62828;
  font-weight: 700;
}

.toast.warn {
  background: #b26a00;
  font-weight: 700;
}

