/* Küchenscreen — Mockup-Variante 3 (UI-Redesign 11.05.).
 *
 * Layout: 48px-Topbar + horizontal scrollendes Card-Grid.
 * Font: Inter. Tokens im --k-* Namespace. */

:root {
  --k-bg-app:           #0c0d10;
  --k-bg-surface:       #15171c;
  --k-bg-sunken:        #22252d;

  --k-text-1:           #f3f4f7;
  --k-text-2:           #9aa0ab;
  --k-text-3:           #737884;
  --k-text-muted:       #c7cad2;

  --k-accent-fresh:     #3FB985;
  --k-accent-warn:      #F3A52F;
  --k-accent-late:      #E84A2A;
  --k-accent-critical:  #FF2D55;
  --k-accent-coral:     #FF4D4D;

  --k-radius-pill:      4px;
  --k-radius-md:        5px;
  --k-radius-lg:        8px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }

/* HTML-hidden-Attribut muss ueber Layout-Regeln (display:flex/grid/...)
 * stehen. Auf app.tappr.ch kommt dieser Reset aus packages/ui/base.css;
 * kitchen-web hat keinen packages-Tree und keine eigene base.css, daher
 * inline hier (analog kiosk-web/css/kiosk.css). */
[hidden] { display: none !important; }

.kitchen-body {
  background: var(--k-bg-app);
  color: var(--k-text-1);
  font-family: 'Inter', 'Helvetica Neue', system-ui, sans-serif;
  font-size: 14px;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  font-feature-settings: 'tnum' 1;
}

.kitchen-boot {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--k-text-3);
  font-size: 14px;
  letter-spacing: 0.04em;
  z-index: 500;
}

.kitchen-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ─── Topbar (48px) ───────────────────────────────────────── */

.kitchen-topbar {
  flex: 0 0 48px;
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  background: var(--k-bg-surface);
  border-bottom: 1px solid var(--k-bg-sunken);
  gap: 20px;
}

.kitchen-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.3px;
  color: var(--k-text-1);
  flex-shrink: 0;
}

.kitchen-brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--k-accent-coral);
}

.kitchen-station-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--k-text-muted);
  padding-left: 14px;
  border-left: 1px solid var(--k-bg-sunken);
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

/* Filter-Segs */
.kitchen-segs {
  display: flex;
  gap: 3px;
  padding: 3px;
  background: var(--k-bg-app);
  border-radius: 7px;
  flex-shrink: 0;
}

.kitchen-seg {
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 5px;
  color: var(--k-text-2);
  background: transparent;
  line-height: 1;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}

.kitchen-seg:hover {
  color: var(--k-text-1);
}

.kitchen-seg.is-active {
  color: var(--k-bg-app);
  background: var(--k-text-1);
}

.kitchen-seg-count {
  opacity: 0.6;
  margin-left: 4px;
  font-weight: 500;
}

.kitchen-divider {
  width: 1px;
  height: 24px;
  background: var(--k-bg-sunken);
  flex-shrink: 0;
}

/* Metrics */
.kitchen-metrics {
  display: flex;
  gap: 18px;
  flex-shrink: 0;
}

.kitchen-metric {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1;
}

.kitchen-metric-k {
  font-size: 9px;
  color: var(--k-text-3);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  font-weight: 600;
}

.kitchen-metric-v {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--k-text-1);
}

.kitchen-metric-v.is-fresh { color: var(--k-accent-fresh); }
.kitchen-metric-v.is-late  { color: var(--k-accent-critical); }

/* Right cluster */
.kitchen-topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.kitchen-recent-bumps {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-right: 12px;
  border-right: 1px solid var(--k-bg-sunken);
}

.kitchen-recent-bump {
  height: 26px;
  min-width: 42px;
  padding: 0 8px;
  border: 1px solid var(--k-bg-sunken);
  background: var(--k-bg-app);
  color: var(--k-text-2);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}

.kitchen-recent-bump:hover {
  background: var(--k-bg-sunken);
  color: var(--k-text-1);
}

.kitchen-clock {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}

.kitchen-clock-time {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1;
  color: var(--k-text-1);
}

.kitchen-clock-date {
  font-size: 11px;
  color: var(--k-text-2);
  line-height: 1;
}

.kitchen-toggle {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--k-bg-sunken);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--k-text-2);
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
  padding: 0;
}

.kitchen-toggle:hover {
  background: #2a2e38;
}

.kitchen-toggle.is-on {
  background: var(--k-accent-coral);
  color: #fff;
}

.kitchen-toggle [data-sound-off] { display: none; }
.kitchen-toggle:not(.is-on) [data-sound-on] { display: none; }
.kitchen-toggle:not(.is-on) [data-sound-off] { display: inline; }

/* ─── Grid ────────────────────────────────────────────────── */

.kitchen-grid-wrap {
  flex: 1;
  display: flex;
  position: relative;
  min-height: 0;
}

.kitchen-grid {
  flex: 1;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  overflow-x: auto;
  overflow-y: hidden;
  align-content: flex-start;
  scroll-behavior: smooth;
}

.kitchen-grid::-webkit-scrollbar { height: 6px; }
.kitchen-grid::-webkit-scrollbar-track { background: transparent; }
.kitchen-grid::-webkit-scrollbar-thumb {
  background: var(--k-bg-sunken);
  border-radius: 3px;
}

.kitchen-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--k-text-3);
  font-size: 18px;
  pointer-events: none;
}

/* ─── Card ────────────────────────────────────────────────── */

.kitchen-card {
  background: var(--k-bg-surface);
  border: 1px solid var(--k-bg-sunken);
  border-left: 3px solid var(--k-accent-fresh);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 200px;
  flex-shrink: 0;
  max-height: calc(100vh - 70px);
  transition: opacity 0.3s, transform 0.18s;
}

.kitchen-card[data-bucket="fresh"]    { border-left-color: var(--k-accent-fresh); }
.kitchen-card[data-bucket="warn"]     { border-left-color: var(--k-accent-warn); }
.kitchen-card[data-bucket="late"]     { border-left-color: var(--k-accent-late); }
.kitchen-card[data-bucket="critical"] {
  border-left-color: var(--k-accent-critical);
  box-shadow: 0 0 0 1px var(--k-accent-critical),
              0 6px 24px rgba(255, 45, 85, 0.2);
}

.kitchen-card.is-bumped {
  transform: scale(0.94);
  opacity: 0;
  pointer-events: none;
}

.kitchen-card[data-status="cancelled"] { opacity: 0.55; }
.kitchen-card[data-status="completed"] { opacity: 0.55; }

.kitchen-card-head {
  padding: 8px 10px 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-bottom: 1px dashed var(--k-bg-sunken);
  flex-shrink: 0;
}

.kitchen-card-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.kitchen-card-num {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1;
  color: var(--k-text-1);
  font-variant-numeric: tabular-nums;
}

.kitchen-card-channel {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 6px 2px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--k-text-muted);
  line-height: 1.1;
}

.kitchen-card-timer {
  margin-left: auto;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--k-accent-fresh);
  line-height: 1;
}

.kitchen-card[data-bucket="fresh"]    .kitchen-card-timer { color: var(--k-accent-fresh); }
.kitchen-card[data-bucket="warn"]     .kitchen-card-timer { color: var(--k-accent-warn); }
.kitchen-card[data-bucket="late"]     .kitchen-card-timer { color: var(--k-accent-late); }
.kitchen-card[data-bucket="critical"] .kitchen-card-timer { color: var(--k-accent-critical); }

.kitchen-card-sub {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--k-text-2);
  line-height: 1.1;
}

.kitchen-card-sub-left {
  color: var(--k-text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
}

/* ─── Items-Liste ────────────────────────────────────────── */

.kitchen-items {
  flex: 1;
  padding: 5px 4px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-height: 0;
}

.kitchen-items::-webkit-scrollbar { width: 5px; }
.kitchen-items::-webkit-scrollbar-track { background: transparent; }
.kitchen-items::-webkit-scrollbar-thumb {
  background: var(--k-bg-sunken);
  border-radius: 3px;
}

.kitchen-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 6px 7px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.12s;
  border: none;
  background: transparent;
  text-align: left;
  font-family: inherit;
  color: inherit;
  width: 100%;
}

.kitchen-item:hover { background: rgba(255, 255, 255, 0.02); }
.kitchen-item.is-done { background: rgba(63, 185, 133, 0.06); }

.kitchen-item-check {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  border-radius: 3.5px;
  border: 1.5px solid #4a4f5c;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  transition: background 0.12s, border-color 0.12s;
}

.kitchen-item.is-done .kitchen-item-check {
  background: var(--k-accent-fresh);
  border-color: var(--k-accent-fresh);
}

.kitchen-item-check svg {
  width: 11px;
  height: 11px;
  display: none;
}

.kitchen-item.is-done .kitchen-item-check svg { display: block; }

.kitchen-item-qty {
  flex: 0 0 18px;
  font-size: 12px;
  font-weight: 700;
  color: var(--k-text-3);
  line-height: 1.3;
}

.kitchen-item-body {
  flex: 1;
  min-width: 0;
}

.kitchen-item-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--k-text-1);
  word-break: break-word;
}

.kitchen-item.is-done .kitchen-item-name {
  text-decoration: line-through;
  color: var(--k-text-3);
}

/* ─── Card-Foot ──────────────────────────────────────────── */

.kitchen-card-foot {
  display: flex;
  margin-top: auto;
  flex-shrink: 0;
}

.kitchen-bump {
  flex: 1;
  padding: 9px;
  border: none;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  line-height: 1;
  background: var(--k-bg-sunken);
  color: var(--k-text-3);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.kitchen-bump.is-ready {
  background: var(--k-accent-fresh);
  color: var(--k-bg-app);
}

.kitchen-bump.is-ready:hover { background: #4cc593; }

.kitchen-card-cancel-info {
  padding: 12px 10px;
  font-size: 11px;
  color: var(--k-accent-late);
  font-style: italic;
  text-align: center;
}

/* ─── Recall-Overlay ─────────────────────────────────────── */

.kitchen-recall-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 32px;
}

.kitchen-recall-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
}

.kitchen-recall-card {
  position: relative;
  max-width: 100%;
  max-height: 80vh;
  border-radius: var(--k-radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.kitchen-recall-notice {
  background: var(--k-bg-sunken);
  color: var(--k-text-2);
  font-size: 11px;
  padding: 8px 10px;
  border-radius: var(--k-radius-md);
  margin: 8px;
  text-align: center;
  letter-spacing: 0.3px;
}

/* ─── Toast ──────────────────────────────────────────────── */

.kitchen-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  background: var(--k-accent-late);
  color: #fff;
  border-radius: var(--k-radius-md);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 200;
  animation: kitchen-toast-in 0.2s ease-out;
}

@keyframes kitchen-toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
