/* Mingle – éttermi funkciók (feature/etterem): fogás-választó, allergén-jelölés és -szűrő, „Következő fogás” sáv a számlán,
   várakozó fogások a konyhai kijelzőn, „Étterem” beállítás-lap. Csak a meglévő tokeneket használja (világos és sötét téma). */

/* ---- rendelés-képernyő ---- */
.order-resto { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-4) 0; }
.order-resto[hidden] { display: none; }
.order-resto-label { color: var(--muted); font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.order-course-seg { flex: 1 1 auto; min-width: 0; }
.order-course-seg .seg-btn { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 0 var(--space-2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-allergen-btn { min-height: 44px; }
.order-allergen-btn.is-active { background: var(--sel-bg); color: var(--sel-fg); border-color: var(--primary); font-weight: 700; }
.ptile-allergen { color: var(--muted); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.ptile-sub .ptile-allergen::before { content: "· "; font-weight: 400; }
.ptile-sub .ptile-allergen:first-child::before { content: none; }

.allergen-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-2); margin-top: var(--space-3); }
.allergen-chip {
  display: flex; align-items: center; gap: var(--space-2); min-height: 48px; padding: 0 var(--space-3);
  background: var(--surface-2); color: var(--text); border: 1px solid var(--control-line, var(--border)); border-radius: var(--radius); text-align: left; font-size: 14px;
}
.allergen-chip.is-active { background: var(--err-bg); border-color: var(--red); color: var(--text); font-weight: 700; }
.allergen-no {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface-3, var(--surface)); color: var(--ink2); font-family: var(--font-num); font-size: 12px; font-weight: 700;
}
.allergen-chip.is-active .allergen-no { background: var(--red); color: var(--surface); }

.order-cart .cart-line .cart-line-course,
.cart-line-course {
  grid-column: 2; justify-self: start; min-height: 30px; margin-top: 2px; padding: 0 10px; border: 1px solid var(--primary);
  border-radius: var(--radius-pill); background: var(--sel-bg); color: var(--sel-fg); font-size: 12.5px; font-weight: 700;
}

/* ---- rendelés-képernyő, az asztal panelja: következő fogás ---- */
.order-course {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin: var(--space-2) var(--space-3);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3); background: var(--info-bg); border-radius: var(--radius);
  box-shadow: inset 4px 0 0 var(--info);
}
.order-course-info { display: flex; flex-direction: column; min-width: 0; }
.order-course-kicker { color: var(--info); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.order-course-name { font-size: 15px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-course-fire { flex: none; min-height: 44px; padding: 0 16px; background: var(--info); color: var(--surface); border-color: var(--info); font-weight: 700; }
.order-course-fire:disabled { opacity: .55; }

/* ---- számla: következő fogás ---- */
.bill-course {
  flex-direction: row; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4);
  background: var(--info-bg); border-radius: var(--radius); box-shadow: inset 4px 0 0 var(--info);
}
.bill-course-info { display: flex; flex-direction: column; min-width: 0; }
.bill-course-kicker { color: var(--info); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.bill-course-name { font-size: 18px; line-height: 1.2; }
.bill-course-sub { color: var(--ink2); font-size: 13px; }
.bill-course-fire { flex: none; min-height: 52px; padding: 0 22px; background: var(--info); color: var(--surface); border-color: var(--info); font-weight: 700; }
.bill-course-fire:disabled { opacity: .55; }

/* ---- konyhai kijelző: várakozó fogások ---- */
.ticket-list > .ticket-section-title, .ticket-list > .ticket-list-waiting { grid-column: 1 / -1; }
.ticket-section-title { display: flex; align-items: center; gap: var(--space-2); margin: var(--space-4) 0 var(--space-2); color: var(--ink2); font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.ticket-section-count { padding: 0 8px; border-radius: var(--radius-pill); background: var(--surface-2); font-family: var(--font-num); }
.ticket-list-waiting { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); align-items: start; }
.ticket.ticket-held { opacity: .62; background: transparent; outline: 1.5px dashed var(--border-strong, var(--border)); outline-offset: -1.5px; }
.ticket-mark-course.tone-info { background: var(--sel-bg); color: var(--sel-fg); }

/* ---- „Étterem” beállítás-lap ---- */
.resto-view { display: flex; flex-direction: column; gap: var(--space-4); max-width: 760px; }
.resto-lead { margin: 0; color: var(--ink2); }
.resto-body { display: flex; flex-direction: column; gap: var(--space-4); }
.resto-section { display: flex; flex-direction: column; gap: var(--space-3); }
.resto-toggle { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.resto-toggle-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 260px; min-width: 0; }
.resto-toggle-label { font-weight: 700; }
.resto-hint { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.resto-toggle .theme-seg { flex: 0 0 160px; }
.resto-opt {
  position: relative; flex: 1 1 0; min-width: 0; min-height: 44px; padding: 0 var(--space-2); border: 0; border-radius: var(--radius-pill);
  background: transparent; color: var(--ink2); font-size: var(--text-sm); font-weight: 600;
}
.resto-opt[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); font-weight: 700; }
.resto-courses { display: flex; flex-direction: column; gap: var(--space-2); align-items: flex-start; }
.resto-course-list { display: flex; flex-direction: column; gap: var(--space-2); width: 100%; margin: 0; padding: 0; list-style: none; }
.resto-course { display: flex; align-items: center; gap: var(--space-2); }
.resto-course-no { flex: none; width: 24px; color: var(--muted); font-family: var(--font-num); font-weight: 700; }
.resto-course-input { flex: 1 1 auto; min-width: 0; }
.resto-save-row { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-3); flex-wrap: wrap; }
.resto-save-hint { margin: 0; color: var(--muted); font-size: 13px; }
.resto-save { min-width: 180px; }
.resto-station-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--border); }
.resto-station { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
.resto-station-main { display: flex; flex-direction: column; min-width: 0; flex: 1 1 220px; }
.resto-station-name { font-weight: 700; }
.resto-station-meta { color: var(--muted); font-size: 13px; }
.resto-station-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.resto-station-add { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.resto-station-input { flex: 1 1 220px; min-width: 0; }
@media (max-width: 600px) {
  .resto-toggle .theme-seg { flex: 1 1 100%; }
  .resto-save { width: 100%; }
  .bill-course { flex-wrap: wrap; }
  .bill-course-fire { width: 100%; }
}
/* az állomás fajtája (Konyha / Pult / Egyéb): a felvétel sorában és a „Módosít” lapon */
.resto-kind { flex: 1 1 300px; }

/* táblázatos számjegy CSAK a számokon (a test arányos számjegyű: az Inter táblázatos kötőjele széles rést hagyott a szövegben – lásd style.css) */
.allergen-no, .ticket-section-count, .resto-course-no { font-variant-numeric: tabular-nums; }

/* ---- feature/etterem-2: „kész” jelzés a pincérnek ---- */
/* értesítő sáv a képernyő tetején (a saját asztalok kész tételei); koppintásra a számla nyílik */
.ready-bar {
  position: fixed; z-index: 190; left: var(--space-2); right: var(--space-2); top: calc(env(safe-area-inset-top) + 4px);
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2); pointer-events: none;
}
.ready-bar[hidden] { display: none; }
.ready-row {
  pointer-events: auto; display: flex; align-items: stretch; width: 100%; max-width: 520px; min-height: 52px;
  background: var(--ok-bg); color: var(--text); border-radius: var(--radius); box-shadow: inset 4px 0 0 var(--ok), var(--glass-sh);
  animation: toast-in 0.16s ease-out;
}
.ready-open {
  flex: 1 1 auto; display: flex; align-items: center; gap: var(--space-3); min-width: 0; min-height: 52px; padding: 0 var(--space-4);
  background: transparent; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.ready-icon { flex: none; width: 22px; height: 22px; color: var(--ok); }
.ready-text { flex: 1 1 auto; min-width: 0; font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ready-go { flex: none; color: var(--ok); font-size: 14px; font-weight: 700; }
.ready-close {
  flex: none; width: 52px; min-height: 52px; background: transparent; border: 0; border-left: 1px solid var(--border); color: var(--ink2);
  font-size: 22px; line-height: 1; cursor: pointer;
}
/* asztal-jelvény: „2 kész” az asztal tetején (az alaprajzon és a rácsban is) */
.tf-box .table-ready {
  position: absolute; z-index: 2; top: 0; left: 50%; transform: translate(-50%, -40%); display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: var(--radius-pill); background: var(--ok); color: var(--on-status); font-size: 12px; font-weight: 800;
  white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums;
}
.table-ready-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
/* számla: „Kész a konyhán” sáv és a tétel „Kivittem” gombja */
.bill-ready {
  flex-direction: row; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4);
  background: var(--ok-bg); border-radius: var(--radius); box-shadow: inset 4px 0 0 var(--ok);
}
.bill-ready .bill-course-kicker { color: var(--ok); }
.bill-ready-all { flex: none; min-height: 52px; padding: 0 22px; font-weight: 700; }
.bill-serve { min-height: 48px; padding: 0 16px; font-weight: 700; }
@media (max-width: 599px) {
  .bill-ready { flex-wrap: wrap; }
  .bill-ready-all { width: 100%; }
}
/* a kész-sáv a tételek FÖLÖTT (telefonon a hasábok sorrendje az `order`-rel megy, bill.css) */
.bill-col > .bill-ready { order: 2; }
.bill-line-sub .badge.bill-ready-badge { color: var(--ok); font-weight: 700; }

/* ---- feature/etterem-2: allergén a konyhai kijelzőn (tételenként szám + rövid név) ---- */
.ticket-item-allergens { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.ticket-allergen-kicker { color: var(--err); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.ticket-allergen {
  display: inline-flex; align-items: center; gap: 4px; min-height: 26px; padding: 0 8px 0 3px; border-radius: var(--radius-pill);
  background: var(--err-bg); color: var(--text); font-size: 13px; font-weight: 700;
}
.ticket-allergen .allergen-no { width: 20px; height: 20px; font-size: 11px; background: var(--red); color: var(--surface); }

/* ---- feature/etterem-2: „Kész” a konyhai jegyen (étterem-mód) ---- */
.ticket-ready-btn { min-height: 52px; margin-top: var(--space-3); gap: var(--space-2); background: var(--ok); color: var(--on-status); border-color: var(--ok); font-size: 17px; font-weight: 800; }
.ticket-ready-btn .icon { width: 22px; height: 22px; }
.ticket-ready-btn:disabled { opacity: .6; }
.ticket-ready-done {
  display: flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 48px; margin-top: var(--space-3);
  border-radius: var(--radius); background: var(--ok-bg); color: var(--ok); font-weight: 800;
}
.ticket-ready-done .icon { width: 20px; height: 20px; }
.ticket.is-ready { opacity: .78; }

/* ---- feature/etterem-2: napi menü ---- */
.ptile-menu { color: var(--acc-d); font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.mod-group-course {
  display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; margin-left: var(--space-2); border-radius: var(--radius-pill);
  background: var(--info-bg); color: var(--info); font-size: 12px; font-weight: 700;
}
.bill-line.is-menu-part { padding-left: var(--space-5, 24px); grid-template-columns: 1fr; }
.bill-line.is-menu-part .bill-line-name { color: var(--ink2); font-weight: 500; }
.bill-menu-mark { color: var(--muted); }

/* ---- feature/etterem-2: szék szerinti rendelés és számla ---- */
.order-seat-seg { flex: 1 1 auto; min-width: 0; overflow-x: auto; }
.order-seat-seg .seg-btn { flex: 0 0 auto; min-width: 48px; min-height: 44px; padding: 0 12px; font-size: 14px; }
.order-cart .cart-line .cart-line-seat,
.cart-line-seat {
  grid-column: 2; justify-self: start; min-height: 30px; margin-top: 2px; padding: 0 10px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill); background: var(--surface-2); color: var(--text); font-size: 12.5px; font-weight: 700;
}
.cart-line-seat.is-common { color: var(--ink2); font-weight: 600; }
.bill-seat-no {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 24px; height: 24px; border-radius: 50%;
  background: var(--acc-t); color: var(--acc-l); font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums;
}
/* a fogás- és a szék-választó a címkéjével együtt tördelődik (a címke nem marad egyedül a sor végén) */
.order-resto-group { display: flex; align-items: center; gap: var(--space-2); flex: 1 1 100%; min-width: 0; }
