/* ===== Recipes page ===== */

/* Create item */
.rec-add {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.15rem 1.25rem; margin-bottom: 1.5rem;
}
.rec-add h3 { font-size: 0.95rem; margin-bottom: 0.85rem; }
.rec-add-row { display: flex; gap: 0.6rem; align-items: center; }
.rec-add-row input {
  flex: 1 1 auto; min-width: 0;
  padding: 0.55rem 0.7rem; border: 1px solid var(--border);
  border-radius: 8px; font-family: inherit; font-size: 0.88rem; background: var(--bg);
}
.rec-add-row input:focus { outline: none; border-color: var(--text); }
.rec-add-row .btn { flex: 0 0 auto; }
.rec-note { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.7rem; }

/* Items list */
.rec-list { display: flex; flex-direction: column; gap: 0.7rem; }
.rec-list .empty { text-align: center; padding: 3rem 0; color: var(--text-faint); font-size: 0.9rem; }

.rec-card {
  display: flex; align-items: center; gap: 1rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 0.9rem 1.1rem;
}
.rec-card-main { flex: 1 1 auto; min-width: 0; }
.rec-card-name { font-weight: 600; font-size: 0.98rem; }
.rec-card-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.15rem; }

.rec-card-figures { display: flex; gap: 1.4rem; align-items: baseline; }
.fig { display: flex; flex-direction: column; align-items: flex-end; }
.fig-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); }
.fig-val { font-weight: 600; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.fig.price .fig-val { color: var(--text); }

.rec-edit-btn { flex: 0 0 auto; }

@media (max-width: 640px) {
  .rec-card { flex-wrap: wrap; }
  .rec-card-figures { gap: 1rem; width: 100%; justify-content: space-between; }
  .rec-edit-btn { width: 100%; }
}

/* ===== Editor modal ===== */
.rec-editor { max-width: 860px; width: 96vw; }
.rec-editor-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1rem; }
.rec-editor-name {
  flex: 1 1 auto; font-size: 1.1rem; font-weight: 600;
  border: 1px solid transparent; border-radius: 8px; padding: 0.4rem 0.5rem;
  font-family: inherit; background: transparent; color: var(--text);
}
.rec-editor-name:hover { border-color: var(--border); }
.rec-editor-name:focus { outline: none; border-color: var(--text); background: var(--bg); }
.rec-close {
  flex: 0 0 auto; width: 34px; height: 34px; border: 1px solid var(--border);
  background: transparent; border-radius: 8px; font-size: 1.3rem; line-height: 1;
  color: var(--text-muted); cursor: pointer;
}
.rec-close:hover { color: var(--text); border-color: var(--text); }

.rec-lines-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.rec-lines { width: 100%; border-collapse: collapse; font-size: 0.85rem; min-width: 720px; }
.rec-lines th {
  text-align: left; font-weight: 500; color: var(--text-muted);
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.rec-lines th.num { text-align: right; }
.rec-lines td { padding: 0.3rem 0.5rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.rec-lines td.num { text-align: right; font-variant-numeric: tabular-nums; }
.rec-empty-line { text-align: center; color: var(--text-faint); padding: 1.5rem 0 !important; }

.li {
  width: 100%; border: 1px solid transparent; background: transparent;
  padding: 0.35rem 0.45rem; border-radius: 6px; font-family: inherit;
  font-size: 0.85rem; color: var(--text);
}
.li:hover { border-color: var(--border); }
.li:focus { outline: none; border-color: var(--text); background: var(--bg); }
.li.num { text-align: right; font-variant-numeric: tabular-nums; }
select.li { cursor: pointer; }
.col-ing { min-width: 150px; }
.col-u { min-width: 66px; }
.rec-lines td.num .li { min-width: 84px; }
.li-cost { font-weight: 600; white-space: nowrap; }

/* Hide number spinners */
.li[type="number"]::-webkit-outer-spin-button,
.li[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.li[type="number"] { -moz-appearance: textfield; appearance: textfield; }

.li-del {
  width: 28px; height: 28px; border: 1px solid var(--border); border-radius: 7px;
  background: transparent; color: var(--text-faint); font-size: 1.1rem; line-height: 1; cursor: pointer;
}
.li-del:hover { color: var(--danger); border-color: var(--danger); }

.rec-lines-actions { margin: 0.8rem 0 1.2rem; }

/* Pricing block */
.rec-pricing { border-top: 1px solid var(--border); padding-top: 1rem; }
.rec-cost-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.9rem; }
.rec-cost-label { font-size: 0.85rem; color: var(--text-muted); }
.rec-cost-value { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.rec-price-controls { display: flex; gap: 0.8rem; margin-bottom: 0.9rem; }
.rec-field { flex: 1 1 0; display: flex; flex-direction: column; gap: 0.3rem; }
.rec-field span { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.rec-field input {
  padding: 0.5rem 0.6rem; border: 1px solid var(--border); border-radius: 8px;
  font-family: inherit; font-size: 0.92rem; background: var(--bg); text-align: right;
  font-variant-numeric: tabular-nums;
}
.rec-field input:focus { outline: none; border-color: var(--text); }
.rec-field input[type="number"]::-webkit-outer-spin-button,
.rec-field input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.rec-field input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

.rec-price-summary { background: var(--accent-soft); border-radius: 10px; padding: 0.7rem 0.9rem; }
.ps-row { display: flex; justify-content: space-between; align-items: baseline; padding: 0.2rem 0; font-size: 0.88rem; }
.ps-row span { color: var(--text-muted); }
.ps-row strong { font-variant-numeric: tabular-nums; }

.rec-editor-foot { display: flex; align-items: center; gap: 0.6rem; margin-top: 1.2rem; }
.rec-editor-foot .spacer { flex: 1 1 auto; }

@media (max-width: 640px) {
  .rec-price-controls { flex-direction: column; }
  .rec-editor-foot { flex-wrap: wrap; }
  .rec-editor-foot .spacer { display: none; }
  .rec-editor-foot .btn { flex: 1 1 auto; }
}