/* LBIZ Pantry — mobile-first, tokens shared with wp-gym-tracker */

:root {
  --lp-primary: #2563eb;
  --lp-primary-hover: #1d4ed8;
  --lp-primary-soft: #dbeafe;
  --lp-success: #16a34a;
  --lp-success-hover: #15803d;
  --lp-success-soft: #dcfce7;
  --lp-danger: #dc2626;
  --lp-danger-hover: #b91c1c;
  --lp-danger-soft: #fee2e2;
  --lp-warning: #d97706;
  --lp-warning-soft: #fef3c7;
  --lp-text: #1f2937;
  --lp-muted: #6b7280;
  --lp-border: #e5e7eb;
  --lp-bg: #f9fafb;
  --lp-white: #ffffff;
  --lp-radius: 8px;
  --lp-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

}

.lbiz-pantry {
  box-sizing: border-box;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 12px 120px;
  font-family: var(--lp-font);
  font-size: 15px;
  line-height: 1.4;
  color: var(--lp-text);
  -webkit-tap-highlight-color: transparent;
}
.lbiz-pantry *,
.lbiz-pantry *::before,
.lbiz-pantry *::after { box-sizing: inherit; }
.lbiz-pantry h2 { font-size: 20px; margin: 0 0 12px; font-weight: 700; }
.lbiz-pantry h3 { font-size: 16px; margin: 0 0 8px; font-weight: 600; }
.lbiz-pantry p { margin: 0 0 8px; }
.lbiz-pantry [hidden] { display: none !important; }
.lp-boot, .lp-loading { color: var(--lp-muted); padding: 24px 0; text-align: center; }
.lp-muted { color: var(--lp-muted); }
.lp-small { font-size: 13px; }
.lp-error { color: var(--lp-danger); }

/* ── Navigation ─────────────────────────────────────────────────────── */
.lp-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  margin: 0 -12px 12px;
  padding: 0 12px;
  background: var(--lp-white);
  border-bottom: 2px solid var(--lp-border);
}
body.admin-bar .lp-nav { top: 32px; }
@media (max-width: 782px) { body.admin-bar .lp-nav { top: 46px; } }
.lp-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.lp-nav-link {
  flex: 1 0 auto;
  min-width: 56px;
  min-height: 48px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  margin-bottom: -2px;
  border-bottom: 2px solid transparent;
  color: var(--lp-muted);
  font-weight: 600;
  text-decoration: none;
}
.lp-nav-link.is-active { color: var(--lp-primary); border-bottom-color: var(--lp-primary); }
.lp-nav-link:hover { color: var(--lp-primary); text-decoration: none; }

/* ── Buttons ────────────────────────────────────────────────────────── */
.lp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius);
  background: var(--lp-white);
  color: var(--lp-text);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.lp-btn:hover { background: var(--lp-bg); }
.lp-btn:disabled, .lp-btn.is-busy { opacity: 0.6; cursor: default; }
.lp-btn-primary { background: var(--lp-primary); border-color: var(--lp-primary); color: #fff; }
.lp-btn-primary:hover { background: var(--lp-primary-hover); }
.lp-btn-success { background: var(--lp-success); border-color: var(--lp-success); color: #fff; }
.lp-btn-success:hover { background: var(--lp-success-hover); }
.lp-btn-danger { background: var(--lp-danger); border-color: var(--lp-danger); color: #fff; }
.lp-btn-danger:hover { background: var(--lp-danger-hover); }
.lp-btn-outline-danger { color: var(--lp-danger); border-color: var(--lp-danger); }
.lp-btn-outline-danger:hover { background: var(--lp-danger-soft); }
.lp-btn-ghost { border-color: transparent; color: var(--lp-primary); }
.lp-btn-sm { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.lp-btn-block { width: 100%; }
.lp-btn-group { display: flex; gap: 8px; }
.lp-btn-group .lp-btn { flex: 1; }

/* ── Forms ──────────────────────────────────────────────────────────── */
.lp-input, .lp-select, .lp-textarea {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius);
  background: var(--lp-white);
  color: var(--lp-text);
  font: inherit;
  font-size: 16px; /* prevents iOS zoom on focus */
}
.lp-textarea { min-height: 72px; resize: vertical; }
.lp-input:focus, .lp-select:focus, .lp-textarea:focus {
  outline: none;
  border-color: var(--lp-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.lp-input.is-saved { border-color: var(--lp-success); background: #f0fdf4; }
.lp-input.is-error { border-color: var(--lp-danger); background: #fef2f2; }
.lp-field { margin-bottom: 12px; }
.lp-label { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 600; color: var(--lp-muted); }
.lp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lp-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.lp-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 500; cursor: pointer; }
.lp-check input { width: 22px; height: 22px; margin: 0; }
.lp-form-actions { display: flex; gap: 8px; margin-top: 4px; }
.lp-form-actions .lp-btn-primary { flex: 1; }
.lp-hint { font-size: 13px; color: var(--lp-muted); margin: -4px 0 10px; }
.lp-card {
  background: var(--lp-white);
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius);
  padding: 16px;
  margin-bottom: 12px;
}
.lp-card-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }

/* ── Toolbar / filters ──────────────────────────────────────────────── */
.lp-toolbar { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.lp-toolbar-row { display: flex; gap: 8px; }
.lp-toolbar-row > * { flex: 1; min-width: 0; }
.lp-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
.lp-chip {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 6px 14px;
  border: 1px solid var(--lp-border);
  border-radius: 20px;
  background: var(--lp-white);
  color: var(--lp-text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.lp-chip.is-active { background: var(--lp-primary); border-color: var(--lp-primary); color: #fff; }
.lp-chip-count { font-weight: 500; opacity: 0.75; margin-left: 4px; }
.lp-summary { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--lp-muted); margin-bottom: 8px; }

/* ── Lists / items ──────────────────────────────────────────────────── */
.lp-list { display: flex; flex-direction: column; gap: 8px; }
.lp-item {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "name badge"
    "meta meta"
    "qty actions"
    "details details";
  gap: 6px 10px;
  align-items: center;
  padding: 12px 14px 12px 12px;
  border: 1px solid var(--lp-border);
  border-left: 4px solid var(--lp-border);
  border-radius: var(--lp-radius);
  background: var(--lp-white);
}
.lp-item[data-urgency="expired"] { border-left-color: var(--lp-danger); }
.lp-item[data-urgency="urgent"] { border-left-color: var(--lp-danger); }
.lp-item[data-urgency="soon"] { border-left-color: var(--lp-warning); }
.lp-item[data-urgency="ok"] { border-left-color: var(--lp-success); }
.lp-item.is-closed { opacity: 0.85; background: var(--lp-bg); }
.lp-item-name { grid-area: name; min-width: 0; }
.lp-item-title {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  color: var(--lp-text);
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.lp-item-sub { font-size: 13px; color: var(--lp-muted); }
.lp-item-badge { grid-area: badge; }
.lp-item-meta { grid-area: meta; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 14px; }
.lp-item-qty { grid-area: qty; }
.lp-item-actions { grid-area: actions; display: flex; gap: 8px; justify-content: flex-end; }
.lp-item-details { grid-area: details; border-top: 1px dashed var(--lp-border); padding-top: 10px; margin-top: 4px; }
@media (min-width: 720px) {
  .lp-item {
    grid-template-columns: 1fr auto 150px auto;
    grid-template-areas:
      "name badge qty actions"
      "meta badge qty actions"
      "details details details details";
    gap: 4px 12px;
  }
}
.lp-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  background: var(--lp-bg);
  border: 1px solid var(--lp-border);
  font-size: 12px;
  font-weight: 600;
  color: var(--lp-muted);
  white-space: nowrap;
}
.lp-badge-nevera { background: var(--lp-primary-soft); border-color: transparent; color: #1d4ed8; }
.lp-badge-congelador { background: #e0f2fe; border-color: transparent; color: #0369a1; }
.lp-badge-despensa { background: #fef3c7; border-color: transparent; color: #92400e; }
.lp-badge-fruta { background: var(--lp-success-soft); border-color: transparent; color: #166534; }
.lp-expiry { font-weight: 600; }
.lp-expiry--estimated { font-style: italic; }
.lp-expiry--expired, .lp-expiry--urgent { color: var(--lp-danger); }
.lp-expiry--soon { color: var(--lp-warning); }
.lp-expiry--ok { color: var(--lp-success); }
.lp-expiry--unknown { color: var(--lp-muted); font-weight: 500; }
.lp-tag { font-size: 12px; color: var(--lp-muted); }
.lp-qty { display: inline-flex; align-items: center; gap: 6px; }
.lp-qty-input { width: 92px; min-height: 40px; padding: 6px 8px; text-align: center; }
.lp-qty-unit { font-size: 14px; color: var(--lp-muted); }
.lp-item-actions .lp-btn { min-height: 44px; padding: 8px 14px; }
.lp-details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.lp-details-grid .lp-field { margin: 0; }
.lp-events { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; color: var(--lp-muted); }
.lp-events li { padding: 3px 0; border-top: 1px solid var(--lp-border); }
.lp-empty { text-align: center; color: var(--lp-muted); padding: 32px 12px; }
.lp-empty .lp-btn { margin-top: 12px; }

/* ── Product list ───────────────────────────────────────────────────── */
.lp-product {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 10px 14px;
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius);
  background: var(--lp-white);
  font: inherit;
  text-align: left;
  color: var(--lp-text);
  cursor: pointer;
}
.lp-product:hover { border-color: var(--lp-primary); }
.lp-product.is-inactive { opacity: 0.55; }
.lp-product-main { flex: 1; min-width: 0; }
.lp-product-name { font-weight: 600; font-size: 15px; }
.lp-product-sub { font-size: 13px; color: var(--lp-muted); }
.lp-shelf-rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.lp-shelf-row { display: grid; grid-template-columns: 1fr auto 84px 44px; gap: 6px; align-items: center; }
.lp-shelf-row .lp-check { min-height: 40px; font-size: 14px; }
.lp-shelf-row .lp-btn { min-height: 40px; padding: 0; }

/* ── Product picker ─────────────────────────────────────────────────── */
.lp-picker { position: relative; }
.lp-picker-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 50vh;
  overflow-y: auto;
  margin-top: 4px;
  background: var(--lp-white);
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
.lp-picker-result {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid var(--lp-border);
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.lp-picker-result:hover, .lp-picker-result.is-active { background: var(--lp-primary-soft); }
.lp-picker-result .lp-product-sub { font-size: 12px; }
.lp-picker-selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 6px 6px 6px 12px;
  border: 1px solid var(--lp-success);
  border-radius: var(--lp-radius);
  background: #f0fdf4;
  font-weight: 600;
}

/* ── Bottom bar, toast, sheet ───────────────────────────────────────── */
.lp-bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--lp-border);
  backdrop-filter: blur(6px);
}
.lp-bottom-bar-inner { max-width: 640px; margin: 0 auto; display: flex; gap: 8px; }
.lp-bottom-bar-inner .lp-btn { flex: 1; min-height: 50px; font-size: 16px; }
.lp-toast {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(82px + env(safe-area-inset-bottom));
  z-index: 40;
  max-width: 616px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--lp-radius);
  background: #1f2937;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  font-family: var(--lp-font);
  font-size: 15px;
}
.lp-toast--error { background: var(--lp-danger); }
.lp-toast--success { background: var(--lp-success-hover); }
.lp-toast-action {
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  background: none;
  color: #bfdbfe;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.lp-sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.35); }
.lp-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 51;
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  border-radius: 16px 16px 0 0;
  background: var(--lp-white);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.15);
  font-family: var(--lp-font);
  color: var(--lp-text);
}
.lp-sheet-title { font-size: 16px; font-weight: 600; margin: 0 0 8px; }
.lp-sheet .lp-btn { width: 100%; min-height: 52px; margin-top: 8px; font-size: 16px; }
.lp-sheet .lp-sheet-cancel { margin-top: 12px; }

@media (max-width: 480px) {
  .lbiz-pantry { padding-left: 8px; padding-right: 8px; }
  .lp-nav { margin-left: -8px; margin-right: -8px; padding: 0 8px; }
  .lp-row-3 { grid-template-columns: 1fr 1fr; }
}

.lp-static { display: flex; align-items: center; min-height: 44px; padding: 8px 12px; color: var(--lp-muted); }
.lp-group-title { font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--lp-muted); margin: 10px 0 0; }
.lp-group-title:first-child { margin-top: 0; }

/* ── Phase 2: cook, dishes, groups ──────────────────────────────────── */
.lp-section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 16px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--lp-muted); }
.lp-section-title:first-child { margin-top: 0; }
.lp-dish {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "name score" "meta meta" "missing missing" "body body";
  gap: 4px 10px;
  padding: 12px 14px;
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius);
  background: var(--lp-white);
}
.lp-dish.is-missing { border-style: dashed; }
.lp-dish-name { grid-area: name; }
.lp-dish-score { grid-area: score; align-self: start; }
.lp-dish-meta { grid-area: meta; font-size: 13px; color: var(--lp-muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.lp-dish-missing { grid-area: missing; font-size: 14px; color: var(--lp-warning); }
.lp-dish-body { grid-area: body; border-top: 1px dashed var(--lp-border); padding-top: 10px; margin-top: 6px; }
.lp-score {
  display: inline-block;
  min-width: 44px;
  padding: 4px 8px;
  border-radius: 10px;
  background: var(--lp-bg);
  border: 1px solid var(--lp-border);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}
.lp-score--hot { background: var(--lp-danger-soft); border-color: transparent; color: var(--lp-danger-hover); }
.lp-score--warm { background: var(--lp-warning-soft); border-color: transparent; color: #92400e; }
.lp-score--cold { color: var(--lp-muted); }
.lp-breakdown { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.lp-breakdown span { font-size: 12px; padding: 3px 8px; border-radius: 10px; background: var(--lp-bg); border: 1px solid var(--lp-border); }
.lp-breakdown .is-pos { background: var(--lp-success-soft); border-color: transparent; color: #166534; }
.lp-breakdown .is-neg { background: var(--lp-danger-soft); border-color: transparent; color: var(--lp-danger-hover); }
.lp-reasons { list-style: none; margin: 0 0 10px; padding: 0; font-size: 13px; color: var(--lp-muted); }
.lp-reasons li { padding: 2px 0; }
.lp-ings { list-style: none; margin: 0 0 10px; padding: 0; }
.lp-ing { display: flex; align-items: baseline; gap: 8px; padding: 5px 0; border-top: 1px solid var(--lp-border); font-size: 14px; }
.lp-ing:first-child { border-top: 0; }
.lp-ing-mark { flex: 0 0 20px; font-weight: 700; text-align: center; }
.lp-ing--ok .lp-ing-mark { color: var(--lp-success); }
.lp-ing--substitute .lp-ing-mark { color: var(--lp-primary); }
.lp-ing--missing .lp-ing-mark { color: var(--lp-danger); }
.lp-ing--optional { color: var(--lp-muted); }
.lp-ing-detail { flex: 1; min-width: 0; }
.lp-ing-sub { font-size: 12px; color: var(--lp-muted); }
.lp-stars { display: flex; gap: 6px; }
.lp-star {
  flex: 1;
  min-height: 44px;
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius);
  background: var(--lp-white);
  font: inherit;
  font-size: 18px;
  cursor: pointer;
}
.lp-star.is-active { background: var(--lp-warning-soft); border-color: var(--lp-warning); }
.lp-cook-panel { background: var(--lp-bg); border-radius: var(--lp-radius); padding: 12px; margin-top: 8px; }
.lp-meal {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius);
  background: var(--lp-white);
  font-size: 14px;
}
.lp-meal-main { flex: 1; min-width: 0; }
.lp-meal-sub { font-size: 12px; color: var(--lp-muted); }
.lp-ing-row { display: grid; grid-template-columns: 1fr 76px 70px 40px; gap: 6px; align-items: center; padding: 6px 0; border-top: 1px solid var(--lp-border); }
.lp-ing-row:first-child { border-top: 0; }
.lp-ing-row-name { min-width: 0; }
.lp-ing-row-name .lp-btn { width: 100%; justify-content: flex-start; text-align: left; font-weight: 600; min-height: 40px; padding: 6px 10px; overflow: hidden; }
.lp-ing-row-name .lp-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-ing-row .lp-input, .lp-ing-row .lp-select { min-height: 40px; padding: 6px 8px; }
.lp-ing-row-extra { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.lp-ing-row-extra .lp-select { flex: 1; min-width: 140px; min-height: 36px; }
.lp-ing-row-extra .lp-input { flex: 2; min-width: 140px; min-height: 36px; }
.lp-step-row { display: grid; grid-template-columns: 32px 1fr; gap: 6px; align-items: start; padding: 6px 0; border-top: 1px solid var(--lp-border); }
.lp-step-row:first-child { border-top: 0; }
.lp-step-num { font-weight: 700; color: var(--lp-muted); padding-top: 10px; text-align: center; }
.lp-step-row-controls { display: flex; gap: 6px; margin-top: 6px; }
.lp-step-row-controls .lp-select { flex: 1; min-height: 36px; }
.lp-step-row-controls .lp-input { width: 90px; min-height: 36px; }
.lp-step-row-controls .lp-btn { min-height: 36px; }
.lp-chip-check { display: inline-flex; align-items: center; gap: 6px; }
.lp-members { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.lp-member { display: inline-flex; align-items: center; gap: 6px; padding: 6px 6px 6px 12px; border-radius: 20px; background: var(--lp-primary-soft); color: #1d4ed8; font-size: 14px; font-weight: 600; }
.lp-member button { border: 0; background: none; font: inherit; font-size: 18px; line-height: 1; color: inherit; cursor: pointer; min-width: 32px; min-height: 32px; }
.lp-rating-list { list-style: none; margin: 0; padding: 0; }
.lp-rating-list li { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--lp-border); font-size: 14px; }
.lp-rating-list li:first-child { border-top: 0; }
.lp-rating-list .lp-btn { margin-left: auto; }
.lp-steps { margin: 0 0 10px; padding-left: 20px; }
.lp-steps li { margin-bottom: 4px; }
.lp-method { white-space: pre-wrap; font-size: 14px; margin-bottom: 10px; }

/* ── Phase 3: plan and shop ─────────────────────────────────────────── */
.lp-week { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.lp-week h2 { margin: 0; font-size: 17px; }
.lp-week .lp-btn { min-width: 44px; padding: 8px 10px; }
.lp-day { border: 1px solid var(--lp-border); border-radius: var(--lp-radius); background: var(--lp-white); margin-bottom: 8px; overflow: hidden; }
.lp-day.is-today { border-color: var(--lp-primary); }
.lp-day-head { display: flex; justify-content: space-between; padding: 8px 12px; background: var(--lp-bg); font-weight: 600; font-size: 14px; }
.lp-day.is-today .lp-day-head { background: var(--lp-primary-soft); color: #1d4ed8; }
.lp-slot { display: grid; grid-template-columns: 74px 1fr auto; align-items: center; gap: 8px; min-height: 48px; padding: 4px 12px; border-top: 1px solid var(--lp-border); }
.lp-slot-name { font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--lp-muted); }
.lp-slot-dish { min-width: 0; padding: 0; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 40px; color: var(--lp-text); }
.lp-slot-dish.is-empty { color: var(--lp-muted); }
.lp-slot-meta { font-size: 12px; color: var(--lp-muted); white-space: nowrap; }
.lp-slot-meta .is-cooked { color: var(--lp-success); font-weight: 600; }
.lp-slot-editor { grid-column: 1 / -1; padding: 8px 0 6px; }
.lp-shop-group { margin-bottom: 14px; }
.lp-shop-store { position: sticky; top: 48px; z-index: 5; display: flex; justify-content: space-between; padding: 8px 12px; background: var(--lp-primary); color: #fff; border-radius: var(--lp-radius); font-weight: 700; }
body.admin-bar .lp-shop-store { top: 80px; }
@media (max-width: 782px) { body.admin-bar .lp-shop-store { top: 94px; } }
.lp-shop-cat { margin: 10px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--lp-muted); }
.lp-shop-item { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; min-height: 54px; padding: 6px 10px; border: 1px solid var(--lp-border); border-radius: var(--lp-radius); background: var(--lp-white); margin-bottom: 6px; cursor: pointer; }
.lp-shop-item.is-checked { background: var(--lp-bg); }
.lp-shop-item.is-checked .lp-shop-label { text-decoration: line-through; color: var(--lp-muted); }
.lp-shop-box { width: 28px; height: 28px; border: 2px solid var(--lp-border); border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; }
.lp-shop-item.is-checked .lp-shop-box { background: var(--lp-success); border-color: var(--lp-success); }
.lp-shop-main { min-width: 0; }
.lp-shop-label { font-weight: 600; overflow-wrap: anywhere; }
.lp-shop-sub { font-size: 12px; color: var(--lp-muted); }
.lp-shop-qty { font-weight: 600; white-space: nowrap; text-align: right; }
.lp-shop-qty small { display: block; font-weight: 500; color: var(--lp-muted); font-size: 11px; }
.lp-shop-detail { grid-column: 1 / -1; border-top: 1px dashed var(--lp-border); padding-top: 8px; font-size: 13px; }
.lp-shop-detail ul { margin: 0 0 8px; padding-left: 18px; }
.lp-shop-detail .lp-row { align-items: end; }
.lp-progress { height: 6px; border-radius: 3px; background: var(--lp-border); overflow: hidden; margin: 6px 0 10px; }
.lp-progress span { display: block; height: 100%; background: var(--lp-success); }
.lp-layout-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--lp-border); }
.lp-layout-row:first-child { border-top: 0; }
.lp-layout-row span { flex: 1; }
.lp-layout-row .lp-btn { min-width: 44px; padding: 6px; }
.lp-spend { display: flex; justify-content: space-between; padding: 8px 12px; border: 1px solid var(--lp-border); border-radius: var(--lp-radius); background: var(--lp-white); margin-bottom: 6px; }

/* ── Phase 4: training, outcomes, reports ───────────────────────────── */
.lp-training-banner { border: 1px solid var(--lp-warning); background: var(--lp-warning-soft); border-radius: var(--lp-radius); padding: 10px 12px; margin-bottom: 10px; font-size: 14px; }
.lp-training-banner.is-rest { border-color: var(--lp-success); background: var(--lp-success-soft); }
.lp-training-banner ul { margin: 4px 0 0; padding-left: 18px; }
.lp-training-banner .lp-btn { margin-top: 8px; }
.lp-planned { border: 1px solid var(--lp-primary); background: var(--lp-primary-soft); border-radius: var(--lp-radius); padding: 10px 12px; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.lp-planned-main { flex: 1; min-width: 0; }
.lp-planned-main strong { display: block; }
.lp-day-training { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 12px; background: var(--lp-bg); border-top: 1px solid var(--lp-border); font-size: 12px; }
.lp-day-training .lp-badge { cursor: pointer; }
.lp-badge-high { background: var(--lp-danger-soft); border-color: transparent; color: var(--lp-danger-hover); }
.lp-badge-medium { background: var(--lp-warning-soft); border-color: transparent; color: #92400e; }
.lp-badge-low { background: var(--lp-success-soft); border-color: transparent; color: #166534; }
.lp-day-hint { flex-basis: 100%; color: var(--lp-muted); }
.lp-slot-warn { grid-column: 2 / -1; font-size: 12px; color: var(--lp-warning); padding-bottom: 4px; }
.lp-outcome { font-size: 11px; padding: 2px 6px; border-radius: 8px; border: 1px solid var(--lp-border); white-space: nowrap; }
.lp-outcome--cooked { background: var(--lp-success-soft); border-color: transparent; color: #166534; }
.lp-outcome--substituted { background: var(--lp-warning-soft); border-color: transparent; color: #92400e; }
.lp-outcome--skipped { background: var(--lp-danger-soft); border-color: transparent; color: var(--lp-danger-hover); }
.lp-training-editor { grid-column: 1 / -1; padding: 8px 12px 10px; background: var(--lp-bg); border-top: 1px solid var(--lp-border); }
.lp-report { margin-bottom: 14px; }
.lp-bars { display: flex; flex-direction: column; gap: 4px; }
.lp-bar { display: grid; grid-template-columns: 64px 1fr 70px; align-items: center; gap: 8px; font-size: 13px; }
.lp-bar-track { height: 14px; background: var(--lp-bg); border-radius: 7px; overflow: hidden; display: flex; }
.lp-bar-fill { height: 100%; background: var(--lp-primary); }
.lp-bar-fill.is-cooked { background: var(--lp-success); }
.lp-bar-fill.is-substituted { background: var(--lp-warning); }
.lp-bar-fill.is-skipped { background: var(--lp-danger); }
.lp-bar-value { text-align: right; font-weight: 600; white-space: nowrap; }
.lp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.lp-table th, .lp-table td { text-align: left; padding: 6px 4px; border-top: 1px solid var(--lp-border); vertical-align: top; }
.lp-table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--lp-muted); border-top: 0; }
.lp-table td.num, .lp-table th.num { text-align: right; white-space: nowrap; }
.lp-legend { display: flex; gap: 10px; font-size: 12px; color: var(--lp-muted); margin-bottom: 6px; }
.lp-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }

/* ── Phase 5: batch ─────────────────────────────────────────────────── */
.lp-component { border: 1px solid var(--lp-border); border-radius: var(--lp-radius); background: var(--lp-white); padding: 12px 14px; margin-bottom: 8px; }
.lp-component.is-produced { border-left: 4px solid var(--lp-success); }
.lp-component-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.lp-component-head strong { font-size: 16px; }
.lp-component-note { font-size: 13px; color: var(--lp-muted); margin: 4px 0 8px; }
.lp-component-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: end; }
.lp-component-row .lp-field { margin: 0; }
.lp-component-ings { font-size: 13px; color: var(--lp-muted); margin-top: 8px; }
.lp-component-ings span { white-space: nowrap; }
.lp-phase { margin-bottom: 12px; }
.lp-phase-title { display: flex; align-items: center; gap: 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--lp-muted); margin: 10px 0 6px; }
.lp-phase-title .lp-badge { text-transform: none; letter-spacing: 0; }
.lp-step { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; min-height: 50px; padding: 6px 10px; border: 1px solid var(--lp-border); border-radius: var(--lp-radius); background: var(--lp-white); margin-bottom: 6px; cursor: pointer; }
.lp-step.is-done { background: var(--lp-bg); }
.lp-step.is-done .lp-step-text { text-decoration: line-through; color: var(--lp-muted); }
.lp-step-who { font-size: 12px; color: var(--lp-primary); font-weight: 600; }
.lp-step-eq { font-size: 12px; color: var(--lp-muted); white-space: nowrap; text-align: right; }
.lp-step-eq.is-oven { color: var(--lp-danger); font-weight: 600; }
.lp-step-eq.is-hob { color: var(--lp-warning); font-weight: 600; }
.lp-sheet-only { display: none; }
@media print {
  body * { visibility: hidden; }
  .lbiz-pantry, .lbiz-pantry * { visibility: visible; }
  .lbiz-pantry { max-width: none; padding: 0; font-size: 12px; }
  .lp-nav, .lp-bottom-bar, .lp-toast, .lp-no-print, .lp-shop-box { display: none !important; }
  .lp-sheet-only { display: block; }
  .lp-step, .lp-component { break-inside: avoid; border-color: #999; }
  .lp-step::before { content: '☐'; font-size: 16px; }
}

/* ── Phase 6b: barcode scanner ──────────────────────────────────────── */
.lp-scan { position: fixed; inset: 0; z-index: 100000; display: flex; flex-direction: column; background: #111827; color: #fff; font-family: var(--lp-font); }
.lp-scan-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; font-weight: 600; }
.lp-scan-top .lp-btn { color: var(--lp-text); }
.lp-scan-stage { position: relative; flex: 1; min-height: 40vh; background: #000; overflow: hidden; }
.lp-scan-video { width: 100%; height: 100%; object-fit: cover; }
.lp-scan-frame { position: absolute; left: 10%; right: 10%; top: 30%; height: 40%; border: 3px solid rgba(255,255,255,0.85); border-radius: 12px; box-shadow: 0 0 0 100vmax rgba(0,0,0,0.35); pointer-events: none; }
.lp-scan-hint { margin: 0; padding: 10px 14px 0; font-size: 14px; color: #d1d5db; }
.lp-scan-manual { display: flex; gap: 8px; padding: 10px 14px; }
.lp-scan-manual .lp-input { font-size: 18px; letter-spacing: 1px; }
.lp-scan-tools { display: flex; gap: 8px; padding: 0 14px calc(14px + env(safe-area-inset-bottom)); }
.lp-scan-tools .lp-btn.is-active { background: var(--lp-warning-soft); color: #92400e; }
.lp-btn-scan::before { content: '▣ '; }
