.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.stat-card .num { font-family: 'Fraunces', serif; font-size: 26px; color: var(--maroon-deep); }
.stat-card .label { font-size: 12px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-card.alert .num { color: #B3261E; }

.ingredients-table-wrap { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.ingredients-table { width: 100%; border-collapse: collapse; }
.ingredients-table th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--ink-soft); padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--cream);
}
.ingredients-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 13.5px; vertical-align: middle; }
.ingredients-table tr:last-child td { border-bottom: none; }
.ing-name { font-weight: 700; color: var(--maroon-deep); }
.ing-unit { color: var(--ink-soft); font-size: 12px; }

.stock-bar-wrap { display: flex; align-items: center; gap: 10px; }
.stock-bar-track { width: 100px; height: 8px; background: var(--cream); border-radius: 999px; overflow: hidden; }
.stock-bar-fill { height: 100%; background: var(--olive); }
.stock-bar-fill.low { background: #B3261E; }
.stock-value { font-family: 'Fraunces', serif; font-weight: 700; font-size: 13px; }

.status-badge { font-size: 11px; font-weight: 800; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.status-ok { background: #E4EDDE; color: var(--olive); }
.status-low { background: #F8DADA; color: #B3261E; }

.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mini-btn {
  background: none; border: 1.5px solid var(--line); color: var(--maroon-deep); padding: 6px 12px;
  border-radius: 999px; font-weight: 700; font-size: 11.5px; cursor: pointer;
}
.mini-btn:hover { border-color: var(--gold); }

.empty-msg { text-align: center; padding: 40px; color: var(--ink-soft); }

/* Modals */
.ing-modal {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -46%);
  width: min(420px, 92vw); max-height: 88vh; overflow-y: auto;
  background: var(--paper); border-radius: 20px; padding: 32px 28px 26px;
  box-shadow: 0 30px 60px -20px rgba(43,27,18,0.45);
  z-index: 71; opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.ing-modal.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%); }
.ing-modal h3 { font-family: 'Fraunces', serif; color: var(--maroon-deep); margin-bottom: 18px; }
.modal-close { position: absolute; top: 16px; right: 18px; background: none; border: none; font-size: 24px; color: var(--ink-soft); cursor: pointer; }

#addForm, #adjustForm { display: flex; flex-direction: column; gap: 14px; }
#addForm label, #adjustForm label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--maroon-deep); }
.opt { font-weight: 400; color: var(--ink-soft); font-size: 11.5px; }
#addForm input, #addForm select, #adjustForm input, #adjustForm select, #adjustForm textarea {
  padding: 11px 13px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--cream); font-family: inherit; font-size: 14.5px;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.save-msg { font-size: 13px; }

.history-list { display: flex; flex-direction: column; gap: 10px; max-height: 400px; overflow-y: auto; }
.history-item { border-bottom: 1px solid var(--line); padding-bottom: 10px; font-size: 13px; }
.history-item:last-child { border-bottom: none; }
.history-type { font-weight: 700; text-transform: capitalize; }
.history-type.restock { color: var(--olive); }
.history-type.waste, .history-type.adjustment { color: #B3261E; }
.history-meta { color: var(--ink-soft); font-size: 11.5px; margin-top: 2px; }


@media (max-width: 700px) {
  .admin-header { flex-direction: column; gap: 12px; align-items: flex-start; padding: 16px; }
  .admin-header-actions { flex-wrap: wrap; }
  .ingredients-table-wrap { overflow-x: auto; }
  .ingredients-table { min-width: 560px; }
  .stock-bar-track { width: 60px; }
}
