:root {
  --primary: #10b981;
  --primary-hover: #059669;
  --primary-light: #d1fae5;
  --primary-dark: #064e3b;
  --secondary: #0ea5e9;
  --accent: #f59e0b;
  --dark: #0f172a;
  --gray-900: #1e293b;
  --gray-800: #334155;
  --gray-700: #475569;
  --gray-600: #64748b;
  --gray-400: #94a3b8;
  --gray-200: #e2e8f0;
  --gray-100: #f1f5f9;
  --gray-50: #f8fafc;
  --white: #ffffff;
  --danger: #ef4444;
  --success: #10b981;
  --radius: 12px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", sans-serif;
  background-color: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.logo-badge {
  background: linear-gradient(135deg, #10b981, #047857);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 800;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.logo-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo-title span {
  color: var(--primary);
}

.logo-subtitle {
  font-size: 0.72rem;
  color: var(--gray-600);
  display: block;
}

.nav-links {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.nav-link {
  text-decoration: none;
  color: var(--gray-700);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.nav-link:hover, .nav-link.active {
  background: var(--gray-100);
  color: var(--primary-dark);
}

.nav-link.active {
  color: var(--primary);
  font-weight: 600;
}

main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 1.5rem auto 3rem;
  padding: 0 1.25rem;
}

.hero-banner {
  background: linear-gradient(135deg, #064e3b 0%, #065f46 50%, #047857 100%);
  color: white;
  padding: 2rem 2.25rem;
  border-radius: var(--radius);
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.hero-content h1 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.4rem;
}

.hero-content p {
  color: #a7f3d0;
  font-size: 1rem;
  max-width: 580px;
}

.portion-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 0.75rem;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.7rem 1.35rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.4);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-white {
  background: white;
  color: var(--primary-dark);
}

.btn-white:hover {
  background: var(--gray-100);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--gray-200);
  color: var(--gray-700);
}

.btn-outline:hover {
  background: var(--gray-100);
  border-color: var(--gray-400);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  border-radius: 6px;
}

.grid-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.75rem;
  align-items: start;
}

@media (max-width: 960px) {
  .grid-layout {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--gray-100);
}

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.recipe-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.recipe-card {
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  overflow: hidden;
  background: white;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.recipe-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.recipe-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background-color: var(--gray-100);
}

.recipe-body {
  padding: 0.85rem 1rem;
}

.recipe-name {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.35rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recipe-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: var(--gray-600);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

table.ingredient-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

table.ingredient-table th {
  background: var(--gray-50);
  color: var(--gray-600);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-200);
}

table.ingredient-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}

table.ingredient-table tr:hover {
  background-color: #fafbfc;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.badge-pantry {
  background: var(--gray-100);
  color: var(--gray-600);
}

.product-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.product-img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--gray-200);
  flex-shrink: 0;
}

.product-info {
  display: flex;
  flex-direction: column;
}

.product-name {
  font-weight: 600;
  color: var(--gray-900);
  font-size: 0.88rem;
}

.product-size {
  font-size: 0.78rem;
  color: var(--gray-600);
}

.basket-summary-card {
  position: sticky;
  top: 80px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0;
  font-size: 0.92rem;
  color: var(--gray-700);
}

.summary-total {
  border-top: 2px dashed var(--gray-200);
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gray-900);
  display: flex;
  justify-content: space-between;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--dark);
  color: white;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 0.4rem;
}

.form-input, .form-textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 0.92rem;
  transition: border-color 0.15s ease;
}

.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.help-text {
  font-size: 0.78rem;
  color: var(--gray-600);
  margin-top: 0.25rem;
}

footer {
  margin-top: auto;
  background: white;
  border-top: 1px solid var(--gray-200);
  padding: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--gray-600);
}
