﻿:root {
  font-family: "Segoe UI", "PingFang SC", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #0f172a;
  background-color: #f1f5f9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #f8fafc, #e2e8f0 70%);
  color: #0f172a;
}

.hero {
  padding: 3rem clamp(1.5rem, 5vw, 4rem) 1.5rem;
  background: linear-gradient(135deg, #0f172a, #1d4ed8);
  color: white;
}

.hero-text {
  max-width: 720px;
}

.eyebrow {
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.75);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  padding: 2rem clamp(1.5rem, 5vw, 4rem) 3rem;
}

.card {
  background: white;
  border-radius: 20px;
  padding: 1.75rem;
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.selector-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.selector-top > div:first-child {
  flex: 1;
  min-width: 200px;
}

.selector-buttons {
  display: flex;
  gap: 0.5rem;
}

.selector-top h2 {
  margin: 0 0 0.25rem;
}

.primary,
.ghost {
  border: none;
  border-radius: 999px;
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.primary {
  background: linear-gradient(120deg, #1d4ed8, #22d3ee);
  color: white;
  box-shadow: 0 8px 20px rgba(34, 211, 238, 0.35);
}

.primary:active {
  transform: translateY(1px);
}

.ghost {
  background: transparent;
  color: #475569;
  border: 1px solid #cbd5f5;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.result-card {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1rem 1.25rem;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: #f8fafc;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
}

.pill-meat {
  background: rgba(220, 38, 38, 0.15);
  color: #b91c1c;
}

.pill-veg {
  background: rgba(34, 197, 94, 0.15);
  color: #15803d;
}

.pill-mixed {
  background: rgba(251, 146, 60, 0.2);
  color: #92400e;
}

.result-card .dish-name {
  font-size: 1.2rem;
}

.dish-preview {
  border-top: 1px dashed #e2e8f0;
  padding-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.preview-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.preview-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1rem;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.preview-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.preview-count {
  font-size: 0.9rem;
  color: #475569;
}

.preview-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 220px;
  overflow-y: auto;
}

.preview-list li {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.4);
}

.preview-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.preview-list strong {
  font-size: 0.95rem;
}

.preview-note {
  font-size: 0.85rem;
  color: #64748b;
}

.preview-empty {
  color: #94a3b8;
  font-size: 0.9rem;
}

.inventory-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

.inventory-header h2 {
  margin: 0;
}

.inventory-search {
  margin-left: auto;
}

.inventory-search input {
  border: 1px solid #cbd5f5;
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  font-size: 0.95rem;
  min-width: 220px;
  background: #f8fafc;
}

.dish-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.dish-row {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 0.8rem 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 1rem;
  align-items: center;
}

.dish-row strong {
  display: block;
  margin-bottom: 0.25rem;
}

.type-pill {
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.85rem;
  text-align: center;
  background: #e2e8f0;
  color: #0f172a;
}

.actions {
  display: flex;
  gap: 0.5rem;
}

.actions button {
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
}

.actions button[data-action="edit"] {
  border-color: #2563eb;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
}

.actions button[data-action="delete"] {
  border-color: #ef4444;
  color: #b91c1c;
  background: rgba(248, 113, 113, 0.1);
}

.dish-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.form-grid label {
  font-size: 0.9rem;
  color: #475569;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  border: 1px solid #cbd5f5;
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
}

.full-width {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.form-status {
  margin: 0;
  font-size: 0.95rem;
  color: #047857;
  background: #ecfdf5;
  padding: 0.6rem 0.9rem;
  border-radius: 12px;
  display: none;
}

.form-status.is-error {
  color: #b91c1c;
  background: #fef2f2;
}

.empty-state {
  text-align: center;
  color: #94a3b8;
  border: 1px dashed #cbd5f5;
  border-radius: 14px;
  padding: 1.2rem;
}

@media (max-width: 720px) {
  .selector-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .dish-row {
    grid-template-columns: 1fr;
  }

  .actions {
    justify-content: flex-start;
  }
}
