/* /kitchen-ops — owner's cross-kitchen view. Follows the ops-screen
   conventions established on /inventory and /kitchen-routing. */

body.ko .ops-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* A ghost button is transparent, which on this page's ivory ground would
   leave Reload and the row actions reading as plain text. */
body.ko .btn.ghost {
  background: var(--zy-white, #fff);
  border: 1px solid var(--zy-emerald, #0f766e);
  color: var(--zy-emerald, #0f766e);
  font-weight: 600;
}

body.ko .btn.ghost:hover:not(:disabled) {
  background: var(--zy-emerald-soft, #ecfdf5);
}

body.ko .btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Section nav: links on a bare strip read as body text. */
body.ko .ops-bar {
  gap: 0.4rem;
}

body.ko .ops-bar a {
  padding: 0.3rem 0.7rem;
  border: 1px solid transparent;
  border-radius: 999px;
  text-decoration: none;
}

body.ko .ops-bar a:hover {
  background: rgb(255 255 255 / 14%);
  text-decoration: none;
}

body.ko .ops-bar a[aria-current='page'] {
  background: var(--zy-white, #fff);
  border-color: var(--zy-white, #fff);
  color: var(--zy-emerald-dark, #0b3d35);
  font-weight: 600;
}

body.ko .ops-actions {
  align-items: center;
  gap: 0.75rem;
}

.ko-auto {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--zy-ink-muted, #4b5563);
}

.ko-auto input {
  width: 1.1rem;
  height: 1.1rem;
}

/* ── Branch tiles ───────────────────────────────────────────────────────── */

.ko-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.75rem;
}

.ko-tile {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--zy-border, #e2e8f0);
  border-left: 4px solid var(--zy-border-strong, #cbd5e1);
  border-radius: 10px;
  background: var(--zy-white, #fff);
}

.ko-tile.is-waiting {
  border-left-color: var(--zy-amber-500, #f59e0b);
}

.ko-tile.is-preparing {
  border-left-color: var(--zy-emerald, #0f766e);
}

.ko-tile.is-ready {
  border-left-color: var(--zy-success, #15803d);
}

.ko-tile.is-oldest.is-alert {
  border-left-color: var(--zy-error, #b91c1c);
  background: #fef2f2;
}

.ko-tile-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--zy-ink-muted, #4b5563);
}

.ko-tile-value {
  font-size: 1.85rem;
  line-height: 1.1;
  color: var(--zy-emerald-dark, #0b3d35);
}

.ko-tile-meta {
  font-size: 0.8rem;
  color: var(--zy-ink-muted, #4b5563);
}

/* ── Unassigned-display callout ─────────────────────────────────────────── */

.ko-callout[hidden] {
  display: none;
}

.ko-callout {
  padding: 0.75rem 1rem;
  border: 1px solid var(--zy-amber-500, #f59e0b);
  border-radius: 10px;
  background: var(--zy-amber-50, #fffbeb);
  color: #92400e;
}

.ko-callout p {
  margin: 0 0 0.4rem;
}

.ko-callout p:last-child {
  margin-bottom: 0;
}

/* ── Kitchen cards ──────────────────────────────────────────────────────── */

.ko-kitchens {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  gap: 0.85rem;
}

.ko-kitchen {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1rem;
  border: 1px solid var(--zy-border, #e2e8f0);
  border-radius: 12px;
  background: var(--zy-white, #fff);
}

.ko-kitchen.has-alert {
  border-color: var(--zy-amber-500, #f59e0b);
}

.ko-kitchen-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.ko-kitchen-head h2 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--zy-emerald-dark, #0b3d35);
}

.ko-kitchen-code {
  margin: 0.1rem 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--zy-ink-muted, #4b5563);
}

.ko-tag {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: var(--zy-emerald-soft, #ecfdf5);
  color: var(--zy-emerald, #0f766e);
  font-size: 0.68rem;
  font-weight: 600;
  vertical-align: middle;
}

.ko-displays {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.ko-pill {
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--zy-border-strong, #cbd5e1);
  border-radius: 999px;
  background: var(--zy-surface, #f8fafc);
  font-size: 0.74rem;
  white-space: nowrap;
}

.ko-pill.is-active {
  border-color: var(--zy-success, #15803d);
  background: #f0fdf4;
  color: #14532d;
}

/* Not approved, or nothing paired at all — the only states this page can
   actually assert. There is no offline state: see displayHealth. */
.ko-pill.is-inactive {
  border-color: var(--zy-amber-500, #f59e0b);
  background: var(--zy-amber-50, #fffbeb);
  color: #92400e;
}

.ko-pill.is-none {
  border-color: var(--zy-error, #b91c1c);
  background: #fef2f2;
  color: #7f1d1d;
}

/* Last-seen is a dated fact, not a status — keep it visually quiet. */
.ko-seen {
  margin: -0.3rem 0 0;
  font-size: 0.74rem;
  color: var(--zy-ink-muted, #4b5563);
}

/* ── Lanes ──────────────────────────────────────────────────────────────── */

.ko-lanes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}

.ko-lane {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: var(--zy-surface, #f8fafc);
  border-top: 3px solid var(--zy-border-strong, #cbd5e1);
}

.ko-lane.is-waiting {
  border-top-color: var(--zy-amber-500, #f59e0b);
}

.ko-lane.is-preparing {
  border-top-color: var(--zy-emerald, #0f766e);
}

.ko-lane.is-ready {
  border-top-color: var(--zy-success, #15803d);
}

.ko-lane-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--zy-ink-muted, #4b5563);
}

.ko-lane-value {
  font-size: 0.85rem;
  color: var(--zy-ink, #1f2937);
}

.ko-alert {
  margin: 0;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  font-size: 0.83rem;
}

.ko-alert.is-warn {
  background: var(--zy-amber-50, #fffbeb);
  border: 1px solid var(--zy-amber-500, #f59e0b);
  color: #92400e;
}

.ko-kitchen-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* ── Ticket list ────────────────────────────────────────────────────────── */

.ko-tickets {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ko-ticket {
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  background: var(--zy-surface, #f8fafc);
  border-left: 3px solid var(--zy-border-strong, #cbd5e1);
}

.ko-ticket.is-queued {
  border-left-color: var(--zy-amber-500, #f59e0b);
}

.ko-ticket.is-preparing {
  border-left-color: var(--zy-emerald, #0f766e);
}

.ko-ticket.is-ready {
  border-left-color: var(--zy-success, #15803d);
}

.ko-ticket.is-empty {
  border-left-color: transparent;
  color: var(--zy-ink-muted, #4b5563);
  font-size: 0.85rem;
}

.ko-ticket-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.ko-ticket-age {
  font-variant-numeric: tabular-nums;
  color: var(--zy-ink-muted, #4b5563);
  font-weight: 500;
}

.ko-ticket-meta {
  font-size: 0.78rem;
  color: var(--zy-ink-muted, #4b5563);
}

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

.ko-toast {
  position: fixed;
  left: 50%;
  top: max(1rem, env(safe-area-inset-top));
  transform: translate(-50%, -160%);
  z-index: 80;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  max-width: min(30rem, calc(100vw - 2rem));
  padding: 0.7rem 1rem;
  border-radius: 8px;
  background: #1f231d;
  color: #fff;
  font-size: 0.9rem;
  line-height: 1.4;
  box-shadow: 0 10px 30px rgb(0 0 0 / 18%);
  opacity: 0;
  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
  pointer-events: none;
}

.ko-toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}

.ko-toast.is-success {
  background: var(--zy-success, #15803d);
}

.ko-toast.is-error {
  background: var(--zy-error, #b91c1c);
}

.ko-toast-text {
  flex: 1 1 auto;
}

.ko-toast-close {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 18%);
  color: inherit;
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 640px) {
  .ko-lanes {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ko-toast {
    transition: opacity 0.2s ease;
  }
}
