/* Mingle – konyhai időzítés (feature/konyhai-ido, A látványterv: „Pirosodó jegyek”). Csak tokenekből (tokens_a.css): világos és sötét
   módban is. A tónust nem csak a szín jelzi: a jegyen a szöveg („perce vár · késik”), az asztalon a jelvény szövege is mondja. */
:root {
  --kt-ok: var(--ok);
  --kt-warn: var(--amb-b);
  --kt-late: var(--err);
  --kt-bar2: var(--muted);
  --kt-bar3: var(--info);
  --kt-bar4: var(--amb-b);
}

/* ---- konyhai kijelző: bal sáv, pirosodó háttér, nagy perc ---- */
.kt-legend { display: flex; align-items: center; gap: 14px; margin-left: auto; color: var(--ink2); font-size: 13px; }
.kt-legend:empty { display: none; }
.kt-key { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.kt-key i { width: 9px; height: 9px; border-radius: 3px; background: var(--kt-ok); }
.kt-key-warn i { background: var(--kt-warn); }
.kt-key-late i { background: var(--kt-late); }
.ticket-list.kt-list { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }

.ticket.kt-ticket {
  --heat: 0;
  position: relative; overflow: hidden; padding-left: calc(var(--space-4) + 8px);
  background: color-mix(in srgb, var(--kt-late) calc(var(--heat) * 26%), var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--kt-late) calc(var(--heat) * 55%), var(--border));
  transition: background-color 2s linear, box-shadow 2s linear;           /* lassan pirosodik, ugrás nélkül */
}
.kt-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 8px; background: var(--kt-ok); }
.kt-warn .kt-bar { background: var(--kt-warn); }
.kt-late .kt-bar { background: var(--kt-late); }
.kt-ticket .ticket-head { align-items: flex-start; }
.kt-ticket .ticket-table { font-size: 28px; font-weight: 850; letter-spacing: -.02em; line-height: 1; }
.kt-age { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; line-height: 1; text-align: right; }
.kt-age-num { font-size: 40px; font-weight: 850; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--text); }
.kt-age-label { margin-top: 4px; color: var(--ink2); font-size: 12px; font-weight: 600; }
.kt-warn .kt-age-num { color: var(--amb); }
.kt-late .kt-age-num { color: var(--kt-late); }
.kt-ticket.is-ready { background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
@media (prefers-reduced-motion: reduce) { .ticket.kt-ticket { transition: none; } }

/* ---- pincér: „Késik N perce” az asztalon és a számlán ---- */
.tf-box .table-late {
  position: absolute; z-index: 2; bottom: 0; left: 50%; transform: translate(-50%, 40%); padding: 2px 8px; border-radius: var(--radius-pill);
  background: var(--kt-warn); color: #1A1204; font-size: 12px; font-weight: 800; white-space: nowrap; pointer-events: none;
  font-variant-numeric: tabular-nums;
}
.tf-box .table-late.is-late { background: var(--kt-late); color: var(--on-status); }
.bill-late-badge.is-warn { color: var(--amb); }
.bill-late-badge.is-late { color: var(--err); font-weight: 800; }

/* ---- riport ---- */
.kt-report-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); }
.kt-report-head > div:first-child { margin-right: auto; }
.kt-report-title { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.01em; }
.kt-report-sub { margin: 2px 0 0; color: var(--ink2); font-size: 13px; }
.kt-report-grid { display: grid; gap: var(--space-4); grid-template-columns: minmax(240px, 1fr) minmax(320px, 1.7fr) minmax(320px, 1.5fr); align-items: start; }
.kt-report-col { display: flex; flex-direction: column; gap: var(--space-3); }
@media (max-width: 1100px) { .kt-report-grid { grid-template-columns: 1fr; } }
.kt-card { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; padding: var(--space-4); background: var(--surface); border-radius: var(--radius); }
.kt-card-title { display: flex; justify-content: space-between; gap: 8px; margin: 0; color: var(--ink2); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.kt-card-meta { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.kt-kpi { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kt-kpi span { display: block; color: var(--ink2); font-size: 13px; }
.kt-kpi b { font-size: 28px; font-weight: 850; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kt-kpi small { font-size: 13px; font-weight: 600; color: var(--ink2); }
.kt-ratio { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.kt-ratio-bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--surface-2); }
.kt-ratio-in { background: var(--kt-ok); }
.kt-ratio-out { background: var(--kt-late); opacity: .8; }
.kt-nomeasure { margin: 0; color: var(--muted); font-size: 14px; }
.kt-station.is-empty { opacity: .8; }

.kt-chart { position: relative; display: flex; align-items: flex-end; gap: 6px; height: 220px; padding: 8px 0 22px 24px; }
.kt-chart-col { position: relative; flex: 1 1 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.kt-chart-bars { display: flex; align-items: flex-end; justify-content: center; gap: 3px; width: 100%; height: 100%; }
.kt-chart-bar { display: block; width: min(14px, 40%); border-radius: 4px 4px 0 0; }
.kt-chart-col em { position: absolute; bottom: -20px; color: var(--muted); font-size: 11px; font-style: normal; font-variant-numeric: tabular-nums; }
.kt-chart-target { position: absolute; left: 24px; right: 0; border-top: 1.5px dashed var(--kt-warn); pointer-events: none; margin-bottom: 22px; }
.kt-chart-target span { position: absolute; left: -24px; top: -8px; color: var(--amb); font-size: 11px; font-weight: 800; }
.kt-chart-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; color: var(--ink2); font-size: 12px; }
.kt-chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.kt-chart-legend i { width: 9px; height: 9px; border-radius: 3px; }
.kt-chart-legend-target i { height: 2px; width: 12px; background: var(--kt-warn); }

.kt-slow { width: 100%; border-collapse: collapse; font-size: 14px; }
.kt-slow th { padding: 6px 4px; color: var(--muted); font-size: 11px; font-weight: 800; text-align: left; text-transform: uppercase; letter-spacing: .06em; }
.kt-slow td { padding: 7px 4px; border-top: 1px solid var(--border); }
.kt-slow td.num, .kt-slow th:nth-child(n+3) { text-align: right; font-variant-numeric: tabular-nums; }
.kt-slow-avg { color: var(--amb); font-weight: 700; }
.kt-slow-n { color: var(--muted); }

/* ---- beállítás: léptető, kategória-felülírás ---- */
.kt-set-list { list-style: none; margin: 0; padding: 0; }
.kt-set-row { display: flex; align-items: center; gap: var(--space-3); padding: 10px 0; border-top: 1px solid var(--border); }
.kt-set-list .kt-set-row:first-child { border-top: 0; }
.kt-set-name { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.kt-set-name span { font-weight: 700; }
.kt-set-name small { color: var(--muted); font-size: 12px; }
.kt-set-cats .kt-set-name span { font-weight: 500; }
.kt-step { display: inline-flex; align-items: center; gap: 10px; }
.kt-step-btn {
  width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--text); font-size: 22px; font-weight: 700;
  line-height: 1; cursor: pointer;
}
.kt-step-btn:disabled { opacity: .4; cursor: default; }
.kt-step-val { min-width: 74px; text-align: center; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.kt-step-val small { font-size: 12px; font-weight: 600; color: var(--ink2); }
.kt-set-x { width: 44px; height: 44px; border: 0; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; }
.kt-set-add { align-self: flex-start; margin: 6px 0 10px; color: var(--acc-d); }
