html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden; /* Prevent body from scrolling */
}

*, *::before, *::after {
    box-sizing: border-box;
}

body { 
  font-family: Arial, sans-serif; 
  margin: 0; 
  display: flex; 
  height: 100vh; 
}

body.resizing, body.resizing * {
    user-select: none; /* For modern browsers */
    -webkit-user-select: none; /* For Safari */
    -moz-user-select: none; /* For Firefox */
    -ms-user-select: none; /* For Internet Explorer/Edge */
    cursor: col-resize !important;
    pointer-events: none; /* Prevent interacting with elements while resizing */
}

.main-content {
    display: flex;
    height: 100vh;
    width: 100%;
}

.column {
    /* Let flex-basis control the width, remove the width property */
    flex-grow: 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Each column will have its own scrollbar if content overflows */
    padding: 20px;
    position: relative;
    height: 100vh; /* Make columns full height */
}

.ingredients {
    flex-basis: 30%;
}

.recipes-list {
    flex-basis: 40%;
}

.recipe-detail {
    flex-basis: 30%;
}

h2 { 
  margin: 0 0 16px 0;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: #000000;
}

button { 
  cursor: pointer; 
}

.list-header { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  margin-bottom: 10px; 
  padding-left: 10px; /* Add space before the title */
}

table { 
  width: 100%; 
  border-collapse: collapse; 
  margin-bottom: 20px; 
}

th, td { 
  border: 1px solid #ccc; 
  padding: 8px; 
  text-align: left; 
}

ul { 
  list-style: none; 
  padding: 0; 
  margin: 0; 
}

ul li { 
  padding: 6px; 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  border-bottom: 1px solid #eee; 
}

ul li.selected { 
  background: #f0f8ff; 
}

/* Recipe list specific styles */
#recipe-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid #e5e7eb;
  cursor: pointer;
}

#recipe-list li span {
  flex: 1;
  cursor: pointer;
}

#recipe-list li button {
  margin-left: 8px;
  padding: 4px 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: white;
  color: #374151;
  font-size: 12px;
  cursor: pointer;
  min-width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#recipe-list li button:hover {
  background: #f9fafb;
}

/* Modal */
.modal-overlay { 
  position: fixed; 
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%; 
  background: rgba(0,0,0,0.6); 
  display: none; 
  align-items: center; 
  justify-content: center; 
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal { 
  background: #fff; 
  padding: 0; 
  border-radius: 12px; 
  width: 90%; 
  max-width: 500px; 
  max-height: 85%; 
  overflow: hidden; 
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
}

.modal-header {
  background: #bababa;
  color: black;
  padding: 20px 24px;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 { 
  margin: 0; 
  font-size: var(--font-size-large);
  font-weight: var(--font-weight-bold);
  color: #000000;
}

.modal-close-btn {
  background: none;
  border: none;
  color: #6b7280;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.modal-close-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #374151;
}

.modal-body {
  padding: 24px;
}

.modal form { 
  display: flex; 
  flex-direction: column; 
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal label { 
  font-weight: var(--font-weight-medium); 
  color: black;
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.modal input, .modal select { 
  padding: 12px 16px; 
  font-size: var(--font-size-base); 
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  transition: all 0.2s ease;
  background: #f9fafb;
}

.modal input:focus, .modal select:focus { 
  outline: none;
  border-color: #6b7280;
  background: white;
  box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.1);
}

.modal .items-table { 
  width: 100%; 
  border-collapse: collapse; 
  margin: 16px 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.modal .items-table th { 
  background: #f3f4f6;
  padding: 12px 8px;
  font-weight: var(--font-weight-medium);
  color: black;
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.modal .items-table td { 
  padding: 12px 8px; 
  border-top: 1px solid #e5e7eb;
  background: white;
}

.modal .row-actions button { 
  margin-left: 4px;
  padding: 6px 10px;
  border: none;
  background: #ef4444;
  color: black;
  border-radius: 6px;
  cursor: pointer;
  font-size: var(--font-size-small);
  transition: background 0.2s ease;
}

.modal .row-actions button:hover {
  background: #dc2626;
}

.modal .buttons { 
  display: flex; 
  justify-content: flex-end; 
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

.modal .buttons button { 
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9em;
}

.modal .buttons button[type="button"] {
  background: #ffffff;
  border: 2px solid #d1d5db;
  color: #374151;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal .buttons button[type="button"]:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.modal .buttons button[type="submit"] {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border: 1px solid #3b82f6;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.2);
}

.modal .buttons button[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(59, 130, 246, 0.3);
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-color: #2563eb;
}

.loading { 
  text-align: center; 
  padding: 20px; 
  color: #666; 
}

.error { 
  color: red; 
  padding: 10px; 
  background: #ffe6e6; 
  border: 1px solid #ff9999; 
  margin: 10px 0; 
}

.updating { 
  color: #0066cc; 
  padding: 10px; 
  background: #e6f3ff; 
  border: 1px solid #99ccff; 
  margin: 10px 0; 
}

.qty-unit-container {
  position: relative;
  margin-top: 4px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.modal-ing-qty {
  flex: 1;
  min-width: 80px;
}

.modal-ing-unit {
  flex: 1;
  min-width: 100px;
}

.suggestions { 
  position: absolute; 
  top: 100%; 
  left: 0; 
  right: 0; 
  background: white; 
  border: 2px solid #6b7280;
  border-top: none; 
  max-height: 150px; 
  overflow-y: auto; 
  z-index: 1000; 
  display: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.suggestion-item { 
  padding: 12px 16px; 
  cursor: pointer; 
  border-bottom: 1px solid #e5e7eb;
  transition: background 0.2s ease;
}

.suggestion-item:hover { 
  background: #f3f4f6; 
}

.suggestion-item.add-custom { 
  color: #bababa; 
  font-weight: var(--font-weight-medium);
  background: #f9fafb;
  border-bottom: none;
}

.suggestion-item.add-custom:hover {
  background: #f3f4f6;
}

/* Recipe modal quantity/unit input styling */
.recipe-qty-input {
  width: 60px;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 14px;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.recipe-unit-input {
  width: 60px;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 14px;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.recipe-unit-select {
  width: 70px;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 14px;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.recipe-qty-input:focus,
.recipe-unit-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Ensure proper spacing in recipe modal table */
#rec-items-table .qty-unit-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Quantity and unit column layout */
.qty-unit-col {
  display: flex !important;
  gap: 4px;
  align-items: center;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
}

/* Yields input group styling */
.yields-input-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.yields-input-group input {
  width: 60px;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 14px;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.yields-input-group select {
  width: 70px;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 14px;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.yields-input-group input:focus,
.yields-input-group select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Recipe modal - Modern UI Theme */
#rec-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}

#rec-modal {
  width: 90%;
  max-width: 1200px;
  max-height: 90vh;
  margin: 20px;
  border-radius: 12px;
  border: none;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow: hidden;
}

#rec-modal .modal-header {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#rec-modal .modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}

#rec-modal .modal-header h3 i {
  color: #3b82f6;
  font-size: 18px;
}

/* --- Recipe Modal Two-Column Layout --- */
#rec-modal .modal-body {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 16px;
  padding: 16px;
  max-height: calc(90vh - 120px);
  overflow-y: auto;
  background: #fff;
}

#rec-modal .left-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#rec-modal .right-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Modern form styling */
#rec-modal .form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 0;
}

#rec-modal .form-group label {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 1px;
}

#rec-modal input[type="text"],
#rec-modal input[type="number"],
#rec-modal select {
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 14px;
  color: #1f2937;
  background: #fff;
  transition: all 0.2s ease;
  font-family: inherit;
}

#rec-modal input[type="text"]:focus,
#rec-modal input[type="number"]:focus,
#rec-modal select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#rec-modal input[type="text"]::placeholder,
#rec-modal input[type="number"]::placeholder {
  color: #9ca3af;
}

/* Recipe form layout */
.recipe-form-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 0;
}

/* Items section */
.items-section {
  padding: 0;
  margin-bottom: 0;
}

.items-section h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.items-section h4 i {
  color: #3b82f6;
  font-size: 14px;
}

/* Modern items list styling */
.items-list {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.items-list-header, .items-list-row {
  display: grid;
  grid-template-columns: 1fr 1fr 60px;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
}

.items-list-header {
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 600;
  font-size: 12px;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.items-list-row {
  border-bottom: 1px solid #f3f4f6;
  transition: background-color 0.2s ease;
}

.items-list-row:hover {
  background: #f9fafb;
}

.items-list-row:not(:last-child) {
  border-bottom: 1px solid #f3f4f6;
}

.ingredient-col, .qty-unit-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ingredient-col, .qty-unit-col {
  position: relative;
}

.items-list-row .ingredient-container input,
.items-list-row .qty-unit-container input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 13px;
  background: #fff;
  transition: all 0.2s ease;
}

.items-list-row .ingredient-container input:focus,
.items-list-row .qty-unit-container input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.row-actions-col {
  display: flex;
  justify-content: center;
  align-items: center;
}

.items-list-row .row-actions button {
  background: none;
  border: none;
  color: #6b7280;
  padding: 4px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.items-list-row .row-actions button:hover {
  background: #f3f4f6;
  color: #dc2626;
}

/* Add item button */
#add-item-row-btn {
  background: #f8fafc;
  border: 1px dashed #d1d5db;
  border-radius: 6px;
  padding: 8px;
  color: #6b7280;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
}

#add-item-row-btn:hover {
  background: #f1f5f9;
  border-color: #3b82f6;
  color: #3b82f6;
}

#add-item-row-btn i {
  font-size: 12px;
}

/* Action buttons */
.recipe-actions {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.recipe-actions .buttons {
  display: flex;
  gap: 10px;
}

.recipe-actions button {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid;
  display: flex;
  align-items: center;
  gap: 6px;
}

.recipe-actions .cancel-btn {
  background: #ffffff;
  border: 2px solid #d1d5db;
  color: #374151;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.recipe-actions .cancel-btn:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.recipe-actions .save-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border: 1px solid #3b82f6;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.2);
}

.recipe-actions .save-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(59, 130, 246, 0.3);
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-color: #2563eb;
}

/* Ingredient modal - modern and polished design */
#ing-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

#ing-modal {
  background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
  border-radius: 24px;
  box-shadow: 0 32px 64px -12px rgba(0, 0, 0, 0.3), 0 8px 16px -4px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.2);
  width: 700px;
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.3);
  animation: slideUp 0.3s ease-out;
  backdrop-filter: blur(10px);
}

@keyframes slideUp {
  from { 
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to { 
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#ing-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(241, 245, 249, 0.8);
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
  border-radius: 24px 24px 0 0;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.modal-header-left {
  display: flex;
  align-items: center;
}

.modal-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

#ing-modal .modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.025em;
}

#ing-modal .modal-header h3 i {
  color: #059669;
  font-size: 18px;
  filter: drop-shadow(0 2px 4px rgba(5, 150, 105, 0.3));
  animation: pulse-glow 2s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
  from { filter: drop-shadow(0 2px 4px rgba(5, 150, 105, 0.3)); }
  to { filter: drop-shadow(0 2px 8px rgba(5, 150, 105, 0.5)); }
}

.add-row-btn {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  color: #475569;
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.add-row-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.add-row-btn:active {
  transform: translateY(0);
}

#ing-modal .modal-body {
  padding: 0;
  max-height: calc(90vh - 100px);
  overflow-y: auto;
  background: #ffffff;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
}

#ing-modal .modal-body::-webkit-scrollbar {
  width: 8px;
}

#ing-modal .modal-body::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

#ing-modal .modal-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

#ing-modal .modal-body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.ingredient-row {
  background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 16px;
  margin: 16px;
  position: relative;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.ingredient-row:hover {
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.12), 0 4px 8px -2px rgba(0, 0, 0, 0.06);
  border-color: #cbd5e1;
  transform: translateY(-2px);
}

.ingredient-row:last-child {
  margin-bottom: 16px;
}

.ingredient-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  position: relative;
}

.ingredient-row-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #059669, #10b981, #059669);
  opacity: 0.6;
}

.ingredient-row-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #475569;
  font-size: 14px;
}

.ingredient-row-title i {
  color: #059669;
  font-size: 14px;
}

.remove-row-btn {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border: none;
  border-radius: 10px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

.remove-row-btn:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: scale(1.1) translateY(-1px);
  box-shadow: 0 6px 12px rgba(239, 68, 68, 0.4);
}

.form-content {
  padding: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 0;
  display: block;
  width: 100%;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #374151;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.4;
}

.optional-text {
  font-weight: 400;
  color: #9ca3af;
  font-style: italic;
  text-transform: none;
  letter-spacing: normal;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
  box-sizing: border-box;
  color: #374151;
  font-weight: 500;
  margin-top: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15), 0 4px 12px rgba(59, 130, 246, 0.1);
  background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
  transform: translateY(-2px);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #9ca3af;
  font-weight: 400;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 20px;
  color: #9ca3af;
  font-size: 14px;
  z-index: 1;
  transition: color 0.2s ease;
}

.input-with-icon input {
  padding-left: 48px;
  margin-top: 4px;
}

.input-with-icon input:focus + .input-icon,
.input-with-icon input:focus ~ .input-icon {
  color: #3b82f6;
}

.checkbox-group {
  margin-top: 20px;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  transition: all 0.2s ease;
  flex-wrap: nowrap;
}

.checkbox-label span:last-child {
  white-space: nowrap;
  flex-shrink: 0;
}

.checkbox-label:hover {
  color: #1f2937;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkbox-label .checkmark {
  width: 20px;
  height: 20px;
  border: 2px solid #d1d5db;
  border-radius: 6px;
  background: #ffffff;
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
  flex-grow: 0;
  margin-top: 2px;
}

.checkbox-label:hover .checkmark {
  border-color: #9ca3af;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
  background: #3b82f6;
  border-color: #3b82f6;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
  content: '\f00c';
  font-family: inherit;
  font-weight: 900;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #ffffff;
  font-size: 10px;
}

.density-input-with-presets {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}

.density-input-with-presets input {
  border-radius: 10px 0 0 10px;
  border-right: none;
  margin-top: 4px;
}

.density-input-with-presets select {
  border-radius: 0 10px 10px 0;
  border-left: none;
  background: #f9fafb;
  font-weight: 500;
  color: #374151;
  min-width: 140px;
  margin-top: 4px;
}

.density-input-with-presets select:focus {
  background: #ffffff;
}

.modal textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
  line-height: 1.5;
  margin-top: 4px;
}

.modal textarea:focus {
  min-height: 100px;
}

/* Enhanced button styling */
.btn-primary-compact {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #1d4ed8 100%);
  border: none;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.025em;
  position: relative;
  overflow: hidden;
}

.btn-primary-compact::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn-primary-compact:hover::before {
  left: 100%;
}

.btn-primary-compact:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(59, 130, 246, 0.5), 0 4px 8px rgba(0, 0, 0, 0.15);
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 50%, #1e40af 100%);
}

.btn-primary-compact:active {
  transform: translateY(0);
}

.modal-close-btn {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 2px solid #e2e8f0;
  color: #64748b;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.modal-close-btn:hover {
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  border-color: #94a3b8;
  color: #374151;
  transform: scale(1.05) translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.modal-close-btn:active {
  transform: scale(0.95);
}

/* Responsive design */
@media (max-width: 768px) {
  #ing-modal {
    width: 95vw;
    margin: 20px;
    border-radius: 16px;
  }
  
  #ing-modal .modal-header {
    padding: 20px 24px 16px 24px;
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }
  
  .modal-header-right {
    justify-content: space-between;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .form-content {
    padding: 16px;
  }
  
  .ingredient-row {
    margin: 16px;
  }
  
  .density-input-with-presets {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .density-input-with-presets input,
  .density-input-with-presets select {
    border-radius: 10px;
    border: 2px solid #e5e7eb;
  }
}

@media (max-width: 480px) {
  #ing-modal .modal-header h3 {
    font-size: 18px;
  }
  
  .add-row-btn {
    padding: 8px 12px;
    font-size: 13px;
  }
  
  .btn-primary-compact {
    padding: 10px 16px;
    font-size: 13px;
  }
}

/* Simplified Typography System */
:root {
  --font-size-small: 12px;
  --font-size-base: 14px;
  --font-size-large: 16px;
  --font-size-xl: 18px;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 600;
}

/* Unified Save and Cancel Button Styling */
.btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border: 1px solid #3b82f6;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.2);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(59, 130, 246, 0.3);
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-color: #2563eb;
}

.btn-secondary {
  background: #ffffff;
  border: 2px solid #d1d5db;
  color: #374151;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-secondary:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Compact version for headers */
.btn-primary-compact {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border: 1px solid #3b82f6;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-medium);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
  margin-left: 8px;
}

.btn-primary-compact:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.btn-secondary-compact {
  background: #ffffff;
  border: 1px solid #d1d5db;
  color: #374151;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-medium);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-secondary-compact:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#ing-modal .modal-body {
  padding: 16px;
  max-height: calc(85vh - 80px);
  overflow-y: auto;
  background: #ffffff;
}

.ingredient-row {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  position: relative;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ingredient-row:last-child {
  margin-bottom: 0;
}

.ingredient-row .remove-row-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #6b7280;
  color: white;
  border: none;
  border-radius: 4px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ingredient-row .remove-row-btn:hover {
  background: #4b5563;
}

.ingredient-row .form-group {
  margin-bottom: 8px;
  display: block;
  width: 100%;
}

.ingredient-row .form-group:last-child {
  margin-bottom: 0;
}

.ingredient-row .form-group label {
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
  color: #374151;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.ingredient-row .form-group input,
.ingredient-row .form-group select,
.ingredient-row .form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s ease;
  background: #ffffff;
  box-sizing: border-box;
}

.ingredient-row .form-group input:focus,
.ingredient-row .form-group select:focus,
.ingredient-row .form-group textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background: #ffffff;
}

/* Advanced Costing Styles */
#advanced-costing {
  margin-top: 12px;
  padding: 10px 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  max-width: 600px;
}
.costing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 6px;
}
#costing-toggle-btn {
  background: none;
  border: none;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  color: #374151;
  padding: 0 6px;
  line-height: 1;
  border-radius: 4px;
  transition: background 0.15s;
}
#costing-toggle-btn:hover {
  background: #e5e7eb;
}
#costing-panel-content {
  transition: max-height 0.2s, opacity 0.2s;
}
#costing-panel-content.collapsed {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}
.costing-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.costing-input-group {
  flex: 1;
  min-width: 90px;
  margin-bottom: 0;
}
.costing-input-group label {
  margin-bottom: 2px;
  font-size: 12px;
}
.costing-input-group input {
  padding: 4px 8px;
  font-size: 13px;
}
.costing-results {
  display: flex;
  flex-direction: row;
  gap: 10px;
}
.cost-breakdown, .pricing-suggestions {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  flex: 1;
}
.cost-breakdown h4, .pricing-suggestions h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: #000000;
  border-bottom: 1px solid #f3f4f6;
  padding-bottom: 8px;
}
.cost-item {
  padding: 2px 0;
  font-size: 12px;
}
.cost-item.total {
  margin-top: 4px;
  padding-top: 4px;
  font-size: 13px;
}
.pricing-option {
  padding: 6px 8px;
  margin-bottom: 4px;
  font-size: 13px;
}
.pricing-option h5 {
  margin: 0 0 2px 0;
  font-size: 12px;
}
.pricing-option .price {
  font-size: 15px;
  color: #059669;
}
.pricing-option .margin {
  font-size: 11px;
  color: #059669;
}
.cost-item.profit span:last-child {
  color: #059669;
  font-weight: 600;
}
@media (max-width: 700px) {
  #advanced-costing {
    max-width: 100%;
    padding: 6px 2vw;
  }
  .costing-results {
    flex-direction: column;
    gap: 6px;
  }
}





/* Ensure autocomplete suggestions appear above everything */
#rec-modal .suggestions,
#ing-modal .suggestions {
  position: fixed !important;
  z-index: 9999 !important;
  background: white !important;
  border: 1px solid #d1d5db !important;
  border-radius: 4px !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
  max-height: 150px !important;
  overflow-y: auto !important;
}

/* Fix ingredient autocomplete positioning */
.qty-unit-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  max-height: 150px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

/* Specific positioning for ingredient modal suggestions */
#ing-modal .qty-unit-suggestions {
  position: absolute !important;
  z-index: 10000 !important;
  background: white !important;
  border: 2px solid #3b82f6 !important;
  border-radius: 4px !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2) !important;
  max-height: 150px !important;
  overflow-y: auto !important;
  min-width: 200px !important;
}

#ing-modal .ingredient-suggestions {
  position: absolute;
  z-index: 10000;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  max-height: 150px;
  overflow-y: auto;
  display: none;
}

#ing-modal .ingredient-suggestions.show {
  display: block;
}

.qty-unit-suggestions.show {
  display: block;
}

/* Remove debug red border */
.qty-unit-suggestions, .suggestions {
  z-index: 99999 !important;
  position: absolute !important;
  background: white !important;
}

/* Ensure suggestion items are visible */
.suggestion-item {
  padding: 8px 12px !important;
  cursor: pointer !important;
  border-bottom: 1px solid #e5e7eb !important;
  transition: background 0.2s ease !important;
  background: white !important;
  color: #374151 !important;
}

.suggestion-item:hover {
  background: #f9fafb !important;
}

.suggestion-item.add-custom {
  background: #f0f9ff !important;
  color: #0369a1 !important;
  font-weight: 600 !important;
}

.suggestion-item.add-custom:hover {
  background: #e0f2fe !important;
}

.suggestion-item.recipe-suggestion {
  background: #f0f9ff !important;
  color: #0369a1 !important;
  font-weight: 500 !important;
  border-left: 3px solid #3b82f6 !important;
}

.suggestion-item.recipe-suggestion:hover {
  background: #e0f2fe !important;
}

#rec-modal .modal-body {
  max-height: calc(90vh - 120px);
  overflow-y: auto;
  padding: 24px;
}

#rec-modal .form-group {
  margin-bottom: 20px;
}

#rec-modal .form-group label {
  margin-bottom: 8px;
  display: block;
}

/* --- Recipe Modal Ingredient List (Flexbox) --- */
.items-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  margin-bottom: 12px;
}
.items-list-header, .items-list-row {
  display: flex;
  align-items: stretch;
  width: 100%;
}
.items-list-header {
  font-weight: 600;
  color: #374151;
  /* Remove background and border for minimal look */
  background: none;
  border: none;
  border-radius: 0;
  font-size: 13px;
  padding: 4px 0;
}
/* Improve ingredient list alignment and styling */
.items-list-row {
  background: none;
  border: none;
  border-radius: 0;
  padding: 6px 0;
  margin-bottom: 0;
  transition: background 0.2s;
}

.items-list-row:not(:last-child) {
  border-radius: 0;
}

/* Ingredient row columns: let them grow and fill space */
.ingredient-col, .qty-unit-col {
  display: flex;
  align-items: center;
  padding: 0 12px;
  flex: 1 1 0;
  margin-right: 0;
}
.ingredient-col, .qty-unit-col {
  min-width: 0;
}

/* Ensure input fields fill their container */
.items-list-row .ingredient-container input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* Override width for qty-unit container inputs to allow flex layout */
.items-list-row .qty-unit-col input,
.items-list-row .qty-unit-col select {
  width: auto !important;
  min-width: 0;
  box-sizing: border-box;
  display: inline-block !important;
  vertical-align: middle;
  float: none !important;
}

/* Add spacing between input boxes in ingredient rows */
.items-list-row .ingredient-container {
  position: relative !important;
  margin-right: 8px;
}

.items-list-row .qty-unit-container {
  margin-right: 0;
}

/* Style for checkbox under shipping input */
.form-group .checkbox-label {
  margin-top: 8px;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Move trash icon to the far right and make it black */
.row-actions-col {
  flex: 0 0 32px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 8px;
}
.items-list-row .row-actions button {
  background: none;
  color: #222;
  border: none;
  border-radius: 0;
  cursor: pointer;
  font-size: 18px;
  padding: 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}
.items-list-row .row-actions button:hover {
  color: #ef4444;
  background: none;
  border: none;
}

/* Remove old table styles for #rec-items-table if not used elsewhere */
#rec-items-table, #rec-items-table th, #rec-items-table td {
  display: none !important;
}

#rec-items-table {
  margin-bottom: 12px;
  width: 100%;
  border-collapse: collapse;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

#rec-items-table th {
  background: #f9fafb;
  padding: 8px 8px;
  font-weight: 600;
  color: #374151;
  font-size: 13px;
  text-align: left;
}

#rec-items-table td {
  padding: 8px 8px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
  vertical-align: middle;
}

#rec-items-table td:first-child {
  width: 45%;
}

#rec-items-table td:nth-child(2) {
  width: 45%;
}

#rec-items-table td:last-child {
  width: 10%;
  text-align: center;
}

/* Add Item button styling */
#add-item-row-btn {
  align-self: flex-start;
  margin-top: 12px !important;
  padding: 8px 16px !important;
  background: #6b7280 !important;
  color: white !important;
  border: 1px solid #6b7280 !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  transition: all 0.2s ease !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

#add-item-row-btn:hover {
  background: #4b5563 !important;
  border-color: #4b5563 !important;
} 

/* Search Bars */
.ingredient-search-bar, .recipe-search-bar {
  position: relative;
  margin-bottom: 16px;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ingredient-search-bar input, .recipe-search-bar input {
  flex: 1;
  padding: 10px 16px 10px 40px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-width: 0;
}

.ingredient-search-bar input:focus, .recipe-search-bar input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.ingredient-search-bar .search-icon, .recipe-search-bar .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 14px;
  pointer-events: none;
}

/* Search bar button styling */
.search-bar-btn {
  background: white;
  color: #374151;
  border: 1px solid #d1d5db;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: var(--font-size-base);
  transition: all 0.2s ease;
  margin-left: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
}

.search-bar-btn:hover {
  background: #f9fafb;
}

/* Icon button styles */
.list-header button {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: white;
  color: #374151;
  font-size: var(--font-size-base);
  cursor: pointer;
  min-width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.list-header button:hover {
  background: #f9fafb;
}

/* Section header icons */
.list-header h2 i,
.list-header h3 i {
  color: #000000;
} 

#cost-history-modal {
  width: 600px;
  max-width: 95vw;
  max-height: 90vh;
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

#cost-history-modal .modal-header {
  padding: 20px 24px 16px 24px;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 12px 12px 0 0;
}

#cost-history-modal .modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 8px;
}

#cost-history-modal .modal-header h3 i {
  color: #059669;
  font-size: 16px;
}

#cost-history-modal .modal-body {
  padding: 24px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

#cost-history-chart {
  width: 100% !important;
  height: 300px !important;
  display: block;
  max-width: 100%;
}

@media (max-width: 768px) {
  #cost-history-modal {
    width: 95vw;
    margin: 20px;
  }
  
  #cost-history-modal .modal-header {
    padding: 16px 20px 12px 20px;
  }
  
  #cost-history-modal .modal-header h3 {
    font-size: 16px;
  }
  
  #cost-history-modal .modal-body {
    padding: 20px;
    min-height: 250px;
  }
  
  #cost-history-chart {
    height: 250px !important;
  }
}

@media (max-width: 480px) {
  #cost-history-modal {
    width: 98vw;
    margin: 10px;
  }
  
  #cost-history-modal .modal-header {
    padding: 12px 16px 8px 16px;
  }
  
  #cost-history-modal .modal-header h3 {
    font-size: 15px;
  }
  
  #cost-history-modal .modal-body {
    padding: 16px;
    min-height: 200px;
  }
  
  #cost-history-chart {
    height: 200px !important;
  }
} 

@media (max-width: 900px) {
  #rec-modal .modal-body {
    grid-template-columns: 1fr;
    gap: 16px;
  }
} 

#rec-modal-form {
  display: contents;
} 

/* Recipe Scaling Controls */
.scale-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  padding: 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.scale-controls label {
  font-weight: var(--font-weight-medium);
  color: #374151;
  font-size: var(--font-size-base);
  margin: 0;
  white-space: nowrap;
}

.scale-presets {
  display: flex;
  gap: 4px;
}

.scale-preset {
  padding: 6px 12px;
  border: 1px solid #d1d5db;
  background: white;
  color: #374151;
  border-radius: 6px;
  cursor: pointer;
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-medium);
  transition: all 0.2s ease;
}

.scale-preset:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.scale-preset.active {
  background: #6b7280;
  color: white;
  border-color: #6b7280;
}

.scale-input {
  width: 80px !important;
  padding: 6px 8px !important;
  border: 1px solid #d1d5db !important;
  border-radius: 4px !important;
  font-size: 14px !important;
  text-align: center !important;
  background: white !important;
}

.scale-input:focus {
  outline: none !important;
  border-color: #6b7280 !important;
  box-shadow: 0 0 0 2px rgba(107, 114, 128, 0.1) !important;
}

.reset-scale-btn {
  padding: 6px 12px;
  border: 1px solid #d1d5db;
  background: white;
  color: #6b7280;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.reset-scale-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

/* Yields Info Display */
.yields-info {
  margin: 12px 0;
  padding: 8px 12px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 6px;
}

.original-yields {
  margin: 0 0 4px 0;
  font-size: 13px;
  color: #0369a1;
  font-weight: 500;
}

.scaled-yields {
  margin: 0;
  font-size: 14px;
  color: #0c4a6e;
  font-weight: 600;
}

.scale-to-one-btn {
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.scale-to-one-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.scale-to-one-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Missing data warning styles */
.missing-data-row {
  background-color: rgba(245, 158, 11, 0.15);
  border-left: 4px solid #f59e0b;
  border-right: 2px solid #f59e0b;
}

.missing-data-row:hover {
  background-color: rgba(245, 158, 11, 0.25);
}

.no-cost-warning {
  color: #d97706;
  font-weight: 600;
}

/* Mark element styling for recipe detail missing data */
#recipe-detail mark {
  background-color: rgba(245, 158, 11, 0.3);
  color: inherit;
  padding: 2px 4px;
  border-radius: 3px;
  font-weight: 500;
}

/* Subrecipe expansion button styling */
.expand-subrecipe-btn {
  transition: transform 0.2s ease;
  display: inline-block;
  vertical-align: middle;
}

.expand-subrecipe-btn:hover {
  transform: scale(1.1);
  color: #3b82f6 !important;
}

/* Recipe header with print button */
.recipe-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

/* Pure margin inputs layout */
.pure-margin-inputs {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 15px 0;
}

.pure-margin-inputs .input-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.pure-margin-inputs .or-separator {
  color: #6b7280;
  font-weight: 500;
  font-size: 14px;
  padding: 0 10px;
  align-self: center;
  margin-top: 25px;
}

.pure-margin-inputs .calculated-value {
  color: #9ca3af;
  font-size: 12px;
  font-style: italic;
  min-height: 16px;
  margin-top: 2px;
}

/* Responsive design for pure margin inputs */
@media (max-width: 768px) {
  .pure-margin-inputs {
    flex-direction: column;
    gap: 15px;
  }
  
  .pure-margin-inputs .or-separator {
    margin-top: 0;
    margin-bottom: 0;
  }
}

/* Markup info box styles */
.markup-info-box {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 12px;
  margin-top: 10px;
}

.markup-info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.markup-info-item:last-child {
  margin-bottom: 0;
}

.markup-label {
  font-weight: 500;
  color: #495057;
  font-size: 14px;
}

.markup-value {
  font-weight: 600;
  color: #28a745;
  font-size: 14px;
}

/* Markup input display in pricing results */
.markup-input-display {
  background: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 15px;
}

.markup-input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.markup-input-group label {
  font-weight: 500;
  color: #495057;
  font-size: 14px;
}

.markup-input-group input {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 14px;
  width: 100%;
  max-width: 200px;
}

.markup-input-group small {
  color: #6b7280;
  font-size: 12px;
}

/* Markup info display in pricing results */
.markup-info-display {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 15px;
}

.recipe-header h2 {
  margin: 0;
  flex: 1;
}

.print-recipe-btn {
  padding: 8px 16px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: white;
  color: #374151;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.print-recipe-btn:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.print-recipe-btn i {
  font-size: 12px;
}

/* Expanded subrecipe row styling */
.expanded-subrecipe-row {
  background-color: rgba(59, 130, 246, 0.05);
}

.expanded-subrecipe-cell {
  color: #6b7280;
  padding-left: 20px;
}

/* Recipe table improvements */
.recipe-content table {
  margin-top: 16px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.recipe-content table th {
  background: #f9fafb;
  padding: 12px 8px;
  font-weight: 600;
  color: #374151;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.recipe-content table td {
  padding: 10px 8px;
  border-top: 1px solid #e5e7eb;
  background: white;
  font-size: 14px;
}

.recipe-content table tr:hover {
  background-color: #f1f5f9;
}

/* Drag and drop styles for recipe ingredients */
#recipe-ingredients-table tbody tr {
  transition: background-color 0.2s ease;
}

#recipe-ingredients-table tbody tr:hover {
  background-color: #f8fafc;
}

#recipe-ingredients-table tbody tr.dragging {
  opacity: 0.5;
}

.drag-handle {
  cursor: grab !important;
  user-select: none;
  font-size: 14px;
  font-weight: bold;
}

.drag-handle:active {
  cursor: grabbing !important;
}

#recipe-ingredients-table tbody tr.drag-over {
  border-top: 2px solid #3b82f6;
}

#total-cost {
  margin-top: 16px;
  padding: 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  font-weight: 600;
  color: #166534;
  font-size: 16px;
}

#cost-per-unit {
  margin-top: 8px;
  padding: 10px;
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: 6px;
  font-weight: 600;
  color: #92400e;
  font-size: 14px;
}

.cost-per-unit-container {
  position: relative;
  margin: 8px 0;
  background-color: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: 6px;
  padding: 8px 12px;
}

.clickable-unit {
  color: inherit;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.2s ease;
  padding: 2px 4px;
  border-radius: 3px;
}

.clickable-unit:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

.unit-selector-popup {
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 8px 0;
  min-width: 120px;
  max-height: 200px;
  overflow-y: auto;
  position: absolute;
  z-index: 9999;
}

.unit-selector-title {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 4px;
}

.unit-option {
  padding: 6px 12px;
  cursor: pointer;
  font-size: 14px;
  color: #374151;
  transition: background-color 0.2s ease;
}

.unit-option:hover {
  background-color: #f3f4f6;
}

.unit-option.selected {
  background-color: #3b82f6;
  color: white;
  font-weight: 500;
} 

/* Modern checkbox styling */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  padding: 8px 0;
  user-select: none;
  position: relative;
  transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
  z-index: -1;
}

.checkbox-label .checkmark {
  height: 16px;
  width: 16px;
  background-color: #fff;
  border: 2px solid #d1d5db;
  border-radius: 3px;
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
  display: block;
}

.checkbox-label:hover .checkmark {
  border-color: #3b82f6;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
  background-color: #3b82f6;
  border-color: #3b82f6;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 3px;
  height: 7px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-label i {
  color: #6b7280;
  font-size: 14px;
  transition: color 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked ~ i {
  color: #3b82f6;
}

/* Mixed units warning styling */
.mixed-units-warning {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 8px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: #dc2626;
}

.mixed-units-warning i {
  color: #dc2626;
  font-size: 14px;
  margin-top: 1px;
  flex-shrink: 0;
}

.mixed-units-warning span {
  line-height: 1.4;
}

/* Auto-calculate active state - Hide yield inputs */
.auto-calculate-active #modal-rec-yields-qty,
.auto-calculate-active #modal-rec-yields-unit {
  display: none !important;
}

.auto-calculate-active .form-group:has(#modal-rec-yields-qty),
.auto-calculate-active .form-group:has(#modal-rec-yields-unit) {
  display: none !important;
}

#manual-calculate-yield-btn {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  color: #374151;
  transition: all 0.2s ease;
}

#manual-calculate-yield-btn:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
  transform: translateY(-1px);
}

#manual-calculate-yield-btn:active {
  transform: translateY(0);
}

/* Toast Notification System */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 16px;
  min-width: 300px;
  max-width: 400px;
  border-left: 4px solid;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  pointer-events: auto;
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.3s ease;
  animation: slideIn 0.3s ease forwards;
}

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

.toast.hide {
  transform: translateX(100%);
  opacity: 0;
}

/* Toast Types */
.toast.error {
  border-left-color: #dc2626;
  background: #fef2f2;
}

.toast.success {
  border-left-color: #059669;
  background: #f0fdf4;
}

.toast.info {
  border-left-color: #2563eb;
  background: #eff6ff;
}

/* Toast Content */
.toast-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.toast-icon {
  font-size: 18px;
  margin-top: 2px;
  flex-shrink: 0;
}

.toast.error .toast-icon {
  color: #dc2626;
}

.toast.success .toast-icon {
  color: #059669;
}

.toast.info .toast-icon {
  color: #2563eb;
}

.toast-message {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
  color: #374151;
  font-weight: 500;
}

.toast.error .toast-message {
  color: #991b1b;
}

.toast.success .toast-message {
  color: #065f46;
}

.toast.info .toast-message {
  color: #1e40af;
}

/* Progress Bar */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background: rgba(0, 0, 0, 0.1);
  transition: width linear;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.toast-progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
  pointer-events: none;
}

.toast.error .toast-progress {
  background: linear-gradient(90deg, #dc2626, #ef4444);
}

.toast.success .toast-progress {
  background: linear-gradient(90deg, #059669, #10b981);
}

.toast.info .toast-progress {
  background: linear-gradient(90deg, #2563eb, #3b82f6);
}

/* Close Button */
.toast-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  font-size: 16px;
  line-height: 1;
  transition: all 0.2s ease;
}

.toast-close:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #374151;
}

/* Animations */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Hover Effects */
.toast:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Progress bar pause effect */
.toast:hover .toast-progress {
  opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 768px) {
  #toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
  }
  
  .toast {
    min-width: auto;
    max-width: none;
  }
} 

/* Unified Metrics Section Card Style */
.metrics-section {
  margin: 32px auto 0 auto;
  padding: 20px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  max-width: 800px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.metrics-section .costing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
  font-weight: 600;
  color: #1e293b;
  font-size: 16px;
  border-bottom: none;
  padding-bottom: 0;
}

/* Remove separate background and max-width for advanced costing */
#advanced-costing {
  margin: 0 auto;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  font-size: 14px;
  max-width: none;
  box-shadow: none;
}

#costing-panel-content {
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
}

/* Remove extra margin-top for advanced costing */
#advanced-costing .metrics-section {
  margin-top: 0;
}

/* Responsive Design */
@media (max-width: 900px) {
  .metrics-section {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
}

/* Metrics Sections - Less Cluttered */
.metrics-section {
  margin-top: 32px;
  padding: 20px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.metrics-section .costing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
  font-weight: 600;
  color: #1e293b;
  font-size: 16px;
  border-bottom: none;
  padding-bottom: 0;
}

.section-toggle-btn {
  background: #e2e8f0;
  border: none;
  color: #64748b;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.section-toggle-btn:hover {
  background: #cbd5e1;
  color: #475569;
}

.section-content {
  margin-top: 20px;
  transition: all 0.3s ease;
  overflow: hidden;
}

.section-content.collapsed {
  margin-top: 0;
  max-height: 0;
  opacity: 0;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.metric-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
}

.metric-card h4 {
  margin: 0 0 16px 0;
  font-size: 14px;
  font-weight: 600;
  color: #000000;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 8px;
}

.metric-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.metric-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 13px;
}

.metric-label {
  color: #64748b;
  font-weight: 500;
}

.metric-value {
  color: #1e293b;
  font-weight: 600;
}

/* Advanced Costing - Cleaner Design */
#advanced-costing {
  margin-top: 32px;
  padding: 24px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-size: 14px;
  max-width: 800px;
}

.costing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  font-weight: 600;
  color: #1e293b;
  font-size: 18px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 12px;
}

#costing-toggle-btn {
  background: #e2e8f0;
  border: none;
  color: #64748b;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

#costing-toggle-btn:hover {
  background: #cbd5e1;
  color: #475569;
}

#costing-panel-content {
  transition: all 0.3s ease;
  overflow: hidden;
}

#costing-panel-content.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
}

.costing-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px;
}

.costing-input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.costing-input-group label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.costing-input-group input {
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s ease;
}

.costing-input-group input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.costing-input-group small {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
  line-height: 1.3;
}

/* Pricing Calculator Styles */
.pricing-mode-selector {
  margin-bottom: 20px;
  padding: 15px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.pricing-mode-selector label {
  display: block;
  font-weight: 600;
  margin-bottom: 10px;
  color: #374151;
}

.mode-buttons {
  display: flex;
  gap: 10px;
}

.mode-btn {
  flex: 1;
  padding: 10px 15px;
  border: 2px solid #d1d5db;
  background: white;
  color: #6b7280;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.mode-btn:hover {
  border-color: #3b82f6;
  color: #3b82f6;
}

.mode-btn.active {
  border-color: #3b82f6;
  background: #3b82f6;
  color: white;
}

.pricing-controls {
  margin-bottom: 25px;
}

.control-group {
  margin-bottom: 20px;
}

.control-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #374151;
}

.control-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.control-group input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.control-group small {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
  line-height: 1.3;
}

.pricing-results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.your-pricing, .store-pricing {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 20px;
}

.your-pricing h4, .store-pricing h4 {
  margin: 0 0 15px 0;
  font-size: 16px;
  font-weight: 600;
  color: #374151;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 8px;
}

.pricing-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
}

.pricing-item:last-child {
  border-bottom: none;
}

.pricing-item span:first-child {
  font-weight: 500;
  color: #374151;
}

.pricing-item span:last-child {
  font-weight: 600;
  color: #1f2937;
}

.pricing-item.profit span:last-child {
  color: #059669;
}

.pricing-item.total span:last-child {
  color: #3b82f6;
  font-size: 18px;
}

.manual-pricing {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

.manual-pricing h4 {
  margin-bottom: 15px;
  color: #1f2937;
  font-size: 1.1rem;
  font-weight: 600;
}

.manual-pricing-results {
  margin-top: 15px;
}

.manual-pricing-results-container {
  background: #f9fafb;
  border-radius: 6px;
  padding: 15px;
  border: 1px solid #e5e7eb;
}

.manual-pricing-results-container .pricing-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
}

.manual-pricing-results-container .pricing-item:last-child {
  border-bottom: none;
}

.manual-pricing-results-container .pricing-value.positive {
  color: #059669;
  font-weight: 600;
}

.manual-pricing-results-container .pricing-value.negative {
  color: #dc2626;
  font-weight: 600;
}

.costing-results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.cost-breakdown, .pricing-suggestions {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px;
  font-size: 13px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.cost-breakdown h4, .pricing-suggestions h4 {
  margin: 0 0 20px 0;
  font-size: 14px;
  font-weight: 600;
  color: #000000;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 12px;
}

.cost-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  font-size: 13px;
  border-bottom: 1px solid #f8fafc;
}

.cost-item:last-child {
  border-bottom: none;
}

.cost-item.total {
  margin-top: 16px;
  padding-top: 16px;
  font-size: 14px;
  font-weight: 600;
  border-top: 2px solid #e2e8f0;
  border-bottom: none;
}

.cost-item.profit {
  color: #059669;
  font-weight: 600;
}

.pricing-option {
  padding: 16px;
  margin-bottom: 16px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 13px;
  border-left: 3px solid #64748b;
  transition: all 0.2s ease;
}

.pricing-option:hover {
  background: #f1f5f9;
  border-left-color: #3b82f6;
}

.pricing-option:last-child {
  margin-bottom: 0;
}

.pricing-option h5 {
  margin: 0 0 8px 0;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
}

.pricing-option .price {
  font-size: 18px;
  color: #059669;
  font-weight: 700;
  margin-bottom: 6px;
}

.pricing-option .margin {
  font-size: 12px;
  color: #059669;
  font-weight: 500;
}

.pricing-option .margin-percent {
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
}

/* Margin Analysis - Cleaner Design */
.margin-analysis {
  margin-top: 24px;
  padding: 20px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
}

.margin-analysis h4 {
  margin: 0 0 16px 0;
  font-size: 14px;
  font-weight: 600;
  color: #000000;
  border-bottom: 1px solid #e0f2fe;
  padding-bottom: 8px;
}

.margin-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}

.margin-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 12px;
}

.margin-label {
  color: #0369a1;
  font-weight: 500;
}

.margin-value {
  color: #1e293b;
  font-weight: 600;
}

/* Break-Even Analysis - Cleaner Design */
.break-even-analysis {
  margin-top: 24px;
  padding: 20px;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 8px;
}

.break-even-analysis h4 {
  margin: 0 0 16px 0;
  font-size: 14px;
  font-weight: 600;
  color: #000000;
  border-bottom: 1px solid #fef3c7;
  padding-bottom: 8px;
}

.break-even-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}

.break-even-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 12px;
}

.break-even-label {
  color: #d97706;
  font-weight: 500;
}

.break-even-value {
  color: #1e293b;
  font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
  .recipe-detail {
    padding: 16px;
  }
  
  .recipe-content {
    padding: 16px;
  }
  
  .scale-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .yields-info {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
  
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  
  .costing-results {
    grid-template-columns: 1fr;
  }
  
  .costing-controls {
    grid-template-columns: 1fr;
  }
  
  #advanced-costing {
    padding: 16px;
  }
  
  .margin-metrics,
  .break-even-metrics {
    grid-template-columns: 1fr;
  }
  
  .cost-breakdown, .pricing-suggestions {
    padding: 16px;
  }
} 

/* Recipe List Styling */
#recipe-list {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

#recipe-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  margin-bottom: 6px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

#recipe-list li:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

#recipe-list li.selected {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1e40af;
}

#recipe-list li span {
  flex: 1;
  font-weight: 500;
  color: #374151;
}

#recipe-list li .recipe-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  background: none;
  border: none;
}

#recipe-list li button {
  background: none;
  border: none;
  color: #6b7280;
  padding: 4px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

#recipe-list li button:hover {
  color: #374151;
}

#recipe-list li button:first-child:hover {
  color: #3b82f6;
}

#recipe-list li button:last-child:hover {
  color: #dc2626;
}

/* Folders section styles */
.folders-section {
  margin-bottom: 20px;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 15px;
}

.folders-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.folders-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.folders-header button {
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 12px;
  transition: background-color 0.2s ease;
}

.folders-header button:hover {
  background: #2563eb;
}

#folders-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.folder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-size: 12px;
}

.folder-item:hover {
  background-color: #f3f4f6;
}

.folder-item.selected {
  background-color: #dbeafe;
  color: #1e40af;
}

.folder-item .folder-info {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.folder-item .folder-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}

.folder-item .folder-name {
  font-weight: 500;
}

.folder-item .folder-count {
  color: #6b7280;
  font-size: 11px;
}

.folder-item .folder-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.folder-item:hover .folder-actions {
  opacity: 1;
}

.folder-item .folder-actions button {
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  color: #6b7280;
  font-size: 10px;
  border-radius: 2px;
  transition: all 0.2s ease;
}

.folder-item .folder-actions button:hover {
  background-color: #e5e7eb;
  color: #374151;
}

.folder-item .folder-actions .delete-btn:hover {
  background-color: #fef2f2;
  color: #dc2626;
}

.folder-item.drag-over {
  background-color: #dbeafe;
  border: 2px dashed #3b82f6;
}

/* Folder rows in recipe table */
.folder-row {
  background-color: #f8fafc;
  border-left: 3px solid #3b82f6;
  position: relative;
}

.folder-row:hover {
  background-color: #f1f5f9;
}

.folder-row.drag-over {
  background-color: #dbeafe;
  border: 2px dashed #3b82f6;
}

.folder-name-cell {
  font-weight: 600;
  color: #1e293b;
  user-select: none;
}

.folder-name-cell:hover {
  background-color: #e0e7ff;
  border-radius: 4px;
}

.folder-toggle {
  transition: transform 0.2s ease;
}

.folder-row.collapsed .folder-toggle {
  transform: rotate(-90deg);
}

.folder-recipe {
  background-color: #fafbfc;
}

.folder-recipe:hover {
  background-color: #f3f4f6;
}

/* Subfolder styling */
.folder-row[data-folder-level="1"] {
  background-color: #f8fafc;
  border-left: 3px solid #10b981;
}

.folder-row[data-folder-level="2"] {
  background-color: #f0f9ff;
  border-left: 3px solid #f59e0b;
}

.folder-row[data-folder-level="3"] {
  background-color: #fef3c7;
  border-left: 3px solid #ef4444;
}

.folder-row[data-folder-level="1"]:hover {
  background-color: #f1f5f9;
}

.folder-row[data-folder-level="2"]:hover {
  background-color: #e0f2fe;
}

.folder-row[data-folder-level="3"]:hover {
  background-color: #fde68a;
}

/* Recipe indentation for subfolders */
.folder-recipe[data-folder-level="1"] {
  background-color: #fafbfc;
  padding-left: 24px;
}

.folder-recipe[data-folder-level="2"] {
  background-color: #f8fafc;
  padding-left: 48px;
}

.folder-recipe[data-folder-level="3"] {
  background-color: #f6f7f8;
  padding-left: 72px;
}

.unassigned-drop-zone {
  transition: all 0.2s ease;
}

.unassigned-drop-zone:hover {
  background-color: #f8fafc;
}

/* Recipe table styles */
#recipe-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-top: 8px;
  font-size: 12px;
}

#recipe-table thead {
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

#recipe-table th {
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border: none;
}

#recipe-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f3f4f6;
  border-left: none;
  border-right: none;
  border-top: none;
  font-size: 12px;
  vertical-align: middle;
}

#recipe-table tbody tr {
  transition: all 0.2s ease;
}

#recipe-table tbody tr:hover {
  background: #f9fafb;
}

#recipe-table tbody tr.selected {
  background-color: #dbeafe !important;
  border-left: 3px solid #3b82f6;
}

#recipe-table tbody tr:last-child td {
  border-bottom: none;
}

/* Recipe table specific column styles */
.recipe-name-cell {
  font-weight: 500;
  color: #1f2937;
  cursor: pointer;
  transition: color 0.2s ease;
  max-width: 120px;
  word-wrap: break-word;
  word-break: break-word;
  white-space: normal;
  line-height: 1.4;
  vertical-align: top;
  padding: 8px 4px;
}

.recipe-name-cell:hover {
  color: #3b82f6;
}

.recipe-yield-cell {
  color: #6b7280;
  font-family: inherit;
  font-size: 11px;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.recipe-yield-cell.yield-updated {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
  transform: scale(1.02);
}

.recipe-folder-cell {
  padding: 8px 10px;
  font-size: 12px;
  vertical-align: middle;
}

.folder-indicator {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 12px;
  color: white;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.no-folder {
  color: #9ca3af;
  font-style: italic;
  font-size: 11px;
}

.recipe-actions-cell {
  text-align: right;
  width: 80px;
}

.recipe-actions-cell button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  margin-left: 2px;
  border-radius: 4px;
  color: #6b7280;
  font-size: 11px;
  transition: all 0.2s ease;
}

.recipe-actions-cell button:hover {
  background-color: #f3f4f6;
  color: #374151;
}

.recipe-actions-cell button:first-child:hover {
  color: #3b82f6;
}

.recipe-actions-cell button:last-child:hover {
  color: #dc2626;
}

/* Recipe table drag and drop styles */
#recipe-table tbody tr.dragging {
  opacity: 0.5;
}

.recipe-drag-handle {
  cursor: grab !important;
  user-select: none;
  font-size: 12px;
  font-weight: bold;
}

.recipe-drag-handle:active {
  cursor: grabbing !important;
}

#recipe-table tbody tr.drag-over {
  border-top: 2px solid #3b82f6;
} 

/* Enhanced Ingredients Table */
#ingredient-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-top: 8px;
  font-size: 12px;
}

#ingredient-table thead {
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

#ingredient-table th {
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border: none;
}

#ingredient-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease;
}

#ingredient-table th.sortable:hover {
  background-color: #f3f4f6;
}

#ingredient-table th.sortable i {
  margin-left: 4px;
  font-size: 10px;
  color: #9ca3af;
  transition: color 0.2s ease;
}

#ingredient-table th.sortable:hover i {
  color: #6b7280;
}

#ingredient-table th.sortable.sort-asc i::before {
  content: "\f0de"; /* fa-sort-up */
  color: #3b82f6;
}

#ingredient-table th.sortable.sort-desc i::before {
  content: "\f0dd"; /* fa-sort-down */
  color: #3b82f6;
}

#ingredient-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f3f4f6;
  border-left: none;
  border-right: none;
  border-top: none;
  font-size: 12px;
  vertical-align: middle;
}

#ingredient-table tbody tr:hover {
  background: #f9fafb;
  transition: background-color 0.2s ease;
}

#ingredient-table tbody tr.newly-created {
  background-color: #fef3c7 !important;
  border: 2px solid #f59e0b !important;
  animation: pulse-highlight 2s ease-in-out;
}

#ingredient-table tbody tr.newly-created:hover {
  background-color: #fde68a !important;
  border-color: #d97706 !important;
}

#ingredient-table tbody tr:last-child td {
  border-bottom: none;
}

/* Ingredient table specific column styles */
.ingredient-name-cell {
  font-weight: 500;
  color: #1f2937;
  cursor: pointer;
  transition: color 0.2s ease;
  max-width: 120px;
  word-wrap: break-word;
  word-break: break-word;
  white-space: normal;
  line-height: 1.4;
  vertical-align: top;
  padding: 8px 4px;
}

.ingredient-name-cell:hover {
  color: #3b82f6;
}

.ingredient-quantity-cell {
  color: #6b7280;
  font-family: inherit;
  font-size: 11px;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ingredient-cost-cell {
  font-weight: 600;
  color: #059669;
  font-family: inherit;
  font-size: 11px;
  text-align: right;
  min-width: 60px;
}

.ingredient-actions-cell {
  text-align: right;
  white-space: nowrap;
  width: 80px;
}

.ingredient-actions-cell button {
  background: none;
  border: none;
  color: #6b7280;
  padding: 4px;
  margin-left: 2px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
}

.ingredient-actions-cell button:hover {
  color: #374151;
}

.ingredient-actions-cell button:first-child:hover {
  color: #3b82f6;
}

.ingredient-actions-cell button:nth-child(2):hover {
  color: #dc2626;
}

.ingredient-actions-cell button:last-child:hover {
  color: #f59e0b;
} 

/* Comprehensive Autocomplete Styles */
.suggestions, .ingredient-suggestions, .qty-unit-suggestions {
  position: absolute;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  max-height: 150px;
  overflow-y: auto;
  z-index: 99999;
  display: none;
  min-width: 200px;
}

.suggestions.show, .ingredient-suggestions.show, .qty-unit-suggestions.show {
  display: block;
} 

.suggestion-item {
  padding: 8px 12px !important;
  cursor: pointer !important;
  border-bottom: 1px solid #f3f4f6 !important;
  transition: background 0.2s ease !important;
  color: #000000 !important; /* Ensure text is visible */
}

.suggestion-item:hover {
  background: #f9fafb !important;
}

.suggestion-item:last-child {
  border-bottom: none !important;
}

.suggestion-item.add-custom {
  background: #f0f9ff !important;
  color: #0369a1 !important;
  font-weight: 600 !important;
}

.suggestion-item.add-custom:hover {
  background: #e0f2fe !important;
} 

/* Modern autocomplete suggestions */
#rec-modal .suggestions,
#rec-modal .ingredient-suggestions,
#rec-modal .qty-unit-suggestions {
  position: absolute;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  max-height: 200px;
  overflow-y: auto;
  z-index: 10000;
  font-size: 13px;
  min-width: 200px;
  display: none;
}

#rec-modal .suggestions.show,
#rec-modal .ingredient-suggestions.show,
#rec-modal .qty-unit-suggestions.show {
  display: block;
}

/* Handle suggestions that might get cut off at bottom of modal */
#rec-modal .ingredient-suggestions {
  max-height: 150px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

/* If suggestions would go below modal, position them above the input */
#rec-modal .ingredient-suggestions.bottom-overflow {
  top: auto !important;
  bottom: 100% !important;
  margin-bottom: 4px !important;
  max-height: 120px !important; /* Smaller max-height when positioned above */
}

#rec-modal .suggestion-item {
  padding: 10px 12px !important;
  cursor: pointer !important;
  border-bottom: 1px solid #f3f4f6 !important;
  transition: background-color 0.2s ease !important;
  color: #374151 !important;
  font-size: 13px !important;
}

#rec-modal .suggestion-item:hover {
  background: #f9fafb !important;
  color: #1f2937 !important;
}

#rec-modal .suggestion-item:last-child {
  border-bottom: none !important;
}

#rec-modal .suggestion-item.add-custom {
  background: #f0f9ff !important;
  color: #0369a1 !important;
  font-weight: 500 !important;
  border-bottom: 1px solid #e0f2fe !important;
}

#rec-modal .suggestion-item.add-custom:hover {
  background: #e0f2fe !important;
  color: #075985 !important;
}

#rec-modal .suggestion-item.recipe-suggestion {
  background: #f0f9ff !important;
  color: #0369a1 !important;
  font-weight: 500 !important;
  border-bottom: 1px solid #e0f2fe !important;
}

#rec-modal .suggestion-item.recipe-suggestion:hover {
  background: #e0f2fe !important;
  color: #075985 !important;
} 

/* Ingredient Detail Modal - Modern Design */
#ingredient-detail-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
}

#ingredient-detail-modal {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1);
  width: 700px;
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: slideUp 0.3s ease-out;
}

#ingredient-detail-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px 20px 32px;
  border-bottom: 1px solid #f1f5f9;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 20px 20px 0 0;
}

#ingredient-detail-modal .modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: -0.025em;
}

#ingredient-detail-modal .modal-header h3 i {
  color: #059669;
  font-size: 18px;
  filter: drop-shadow(0 2px 4px rgba(5, 150, 105, 0.2));
}

#ingredient-detail-modal .modal-body {
  padding: 0;
  max-height: calc(90vh - 100px);
  overflow-y: auto;
  background: #ffffff;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
}

#ingredient-detail-modal .modal-body::-webkit-scrollbar {
  width: 8px;
}

#ingredient-detail-modal .modal-body::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

#ingredient-detail-modal .modal-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

#ingredient-detail-modal .modal-body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.ingredient-detail-container {
  padding: 24px;
}

.detail-section {
  margin-bottom: 32px;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #f1f5f9;
  overflow: hidden;
  transition: all 0.2s ease;
}

.detail-section:hover {
  border-color: #e2e8f0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.detail-section:last-child {
  margin-bottom: 0;
}

.detail-section-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid #e2e8f0;
}

.detail-section-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-section-header h4 i {
  color: #6b7280;
  font-size: 12px;
}

.detail-section-content {
  padding: 20px;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid #f3f4f6;
}

.detail-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.detail-label {
  font-weight: 600;
  color: #374151;
  font-size: 14px;
  min-width: 120px;
  flex-shrink: 0;
}

.detail-value {
  color: #6b7280;
  font-size: 14px;
  text-align: right;
  flex: 1;
  margin-left: 16px;
}

.detail-link {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.detail-link:hover {
  color: #2563eb;
  text-decoration: underline;
}

.recipe-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recipe-link {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.recipe-link:hover {
  color: #2563eb;
  background: #f1f5f9;
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.no-recipes {
  color: #9ca3af;
  font-style: italic;
  text-align: center;
  padding: 20px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px dashed #d1d5db;
}

/* Recipe Ingredient Popup Modal */
#recipe-ingredient-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

#recipe-ingredient-popup-modal {
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  margin: 20px;
  border-radius: 12px;
  border: none;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow: hidden;
}

#recipe-ingredient-popup-modal .modal-header {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#recipe-ingredient-popup-modal .modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 10px;
}

#recipe-ingredient-popup-modal .modal-header h3 i {
  color: #3b82f6;
  font-size: 16px;
}

#recipe-ingredient-popup-modal .modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.recipe-overview {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.recipe-basic-info {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
}

.recipe-basic-info p {
  margin: 8px 0;
  font-size: 14px;
  color: #374151;
}

.recipe-ingredients h4 {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 8px;
}

.recipe-ingredients ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.recipe-ingredients li {
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 14px;
  color: #374151;
}

.recipe-ingredients li:last-child {
  border-bottom: none;
}

.modal-actions {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: center;
}

.modal-actions button {
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}

.modal-actions button:hover {
  background: #2563eb;
  border-color: #2563eb;
}

/* Optional field styling */
.optional-text {
  color: #6b7280;
  font-size: 12px;
  font-weight: normal;
  font-style: italic;
  margin-left: 4px;
}

/* No cost warning styling */
.no-cost-row {
  background-color: #fef3c7;
}

.no-cost-warning {
  color: #d97706;
  font-weight: 500;
}

.no-cost-row:hover {
  background-color: #fde68a;
}



/* Read-only input styling */
input[readonly] {
  background-color: #f3f4f6 !important;
  cursor: not-allowed !important;
  color: #6b7280 !important;
}

/* Newly created ingredient highlighting */
.ingredient-row.newly-created,
#ingredient-table tbody tr.newly-created {
  background-color: #fef3c7 !important;
  border: 2px solid #f59e0b !important;
  animation: pulse-highlight 2s ease-in-out;
}

.ingredient-row.newly-created:hover,
#ingredient-table tbody tr.newly-created:hover {
  background-color: #fde68a !important;
  border-color: #d97706 !important;
}

@keyframes pulse-highlight {
  0% { 
    background-color: #fef3c7;
    transform: scale(1);
  }
  50% { 
    background-color: #fbbf24;
    transform: scale(1.02);
  }
  100% { 
    background-color: #fef3c7;
    transform: scale(1);
  }
}

/* Advanced Settings Styles */
.advanced-settings-content {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px;
  margin-top: 8px;
  transition: all 0.3s ease;
  max-width: 100%;
  box-sizing: border-box;
}

.advanced-settings-content.collapsed {
  max-height: 0;
  padding: 0 16px;
  border-color: transparent;
}

.toggle-btn {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.toggle-btn:hover {
  color: #374151;
  background: #f3f4f6;
}

.toggle-btn i {
  transition: transform 0.3s ease;
}

.advanced-settings-content.collapsed + .list-header .toggle-btn i {
  transform: rotate(-90deg);
}

.settings-section {
  margin-bottom: 8px;
}

.settings-section h4 {
  margin: 0 0 4px 0;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 4px;
}

.settings-section h4 i {
  color: #3b82f6;
  font-size: 12px;
}

.settings-description {
  margin: 0 0 6px 0;
  font-size: 10px;
  color: #6b7280;
  line-height: 1.2;
}

.density-controls {
  display: flex;
  gap: 4px;
  align-items: end;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.density-input-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.density-input-group label {
  font-size: 9px;
  font-weight: 500;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.density-input-group input {
  padding: 3px 4px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 10px;
  color: #1f2937;
  background: #fff;
  width: 100%;
  box-sizing: border-box;
}

.density-input-group input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.density-input-with-presets {
  display: flex;
  gap: 12px;
  align-items: center;
}

.density-input-with-presets input {
  flex: 1;
  min-width: 0;
}

.density-input-with-presets select {
  flex: 1;
  min-width: 0;
}

/* Notes and website input styling */
.modal textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
  transition: all 0.2s ease;
  background: #ffffff;
  line-height: 1.4;
  box-sizing: border-box;
}

.modal textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background: #ffffff;
}

.modal input[type="url"] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s ease;
  background: #ffffff;
  box-sizing: border-box;
}

.modal input[type="url"]:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background: #ffffff;
}

/* Shipping cost input styling */
.modal input[type="number"] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s ease;
  background: #ffffff;
  box-sizing: border-box;
}

.modal input[type="number"]:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background: #ffffff;
}

/* Color input styling */
.modal input[type="color"] {
  width: 60px;
  height: 40px;
  border: 2px solid #e5e7eb;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  background: none;
  transition: all 0.2s ease;
}

.modal input[type="color"]:hover {
  border-color: #d1d5db;
  transform: scale(1.05);
}

.modal input[type="color"]:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
  outline: none;
}

.modal input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
  border-radius: 4px;
  overflow: hidden;
}

.modal input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 4px;
}

.density-preset-select {
  padding: 3px 4px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 10px;
  color: #1f2937;
  background: #fff;
  cursor: pointer;
  min-width: 80px;
  max-width: 100px;
  box-sizing: border-box;
}

.density-preset-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.add-density-btn {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 9px;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.add-density-btn:hover {
  background: #2563eb;
}

#custom-densities-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  font-size: 11px;
}

#custom-densities-table th {
  background: #f3f4f6;
  padding: 6px 8px;
  font-weight: 600;
  color: #374151;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
}

#custom-densities-table td {
  padding: 6px 8px;
  border-top: 1px solid #e5e7eb;
  background: white;
}

#custom-densities-table td:last-child {
  text-align: right;
  width: 60px;
}

#custom-densities-table button {
  background: none;
  border: none;
  color: #dc2626;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 2px;
  font-size: 10px;
  transition: all 0.2s ease;
}

#custom-densities-table button:hover {
  background: #fef2f2;
}

/* Professional Resizable Columns (VS Code inspired) */
.column-resizer {
  flex-basis: 4px;
  flex-shrink: 0;
  flex-grow: 0;
  height: 100vh;
  background: #e2e8f0;
  cursor: col-resize;
  z-index: 10;
  transition: all 0.2s ease;
}

.column-resizer:hover,
.column-resizer.is-resizing {
  background: #3b82f6;
  flex-basis: 6px;
  margin: 0 -1px;
}

body.is-resizing {
  cursor: col-resize;
  user-select: none;
}

.column.resizing {
  user-select: none;
  pointer-events: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.column.resizing * {
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* Make columns relative positioned for resizer positioning */
.ingredients,
.recipes-list,
.recipe-detail {
  position: relative;
}

/* Collapsed state for recipe detail */
.recipe-detail.collapsed {
  min-width: 50px !important;
  max-width: 50px !important;
  width: 50px !important;
  overflow: hidden;
  transition: all 0.3s ease;
}

.recipe-detail.collapsed .recipe-content {
  opacity: 0;
  pointer-events: none;
}

.recipe-detail.collapsed .column-resizer {
  background: rgba(59, 130, 246, 0.5);
  width: 8px;
  cursor: col-resize;
}

/* Hover effect to show collapsed column can be expanded */
.recipe-detail.collapsed:hover {
  background: #f8fafc;
}

.recipe-detail.collapsed:hover .column-resizer {
  background: rgba(59, 130, 246, 0.8);
}




/* VS Code-style pointer events management */
.pointer-events-disabled {
  pointer-events: none !important;
}

.column-resizer {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* Hide resizers when any modal is open */
body.modal-open .column-resizer {
  display: none !important;
  pointer-events: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  cursor: default !important;
}

/* Ensure resizers are visible when no modals are open */
.column-resizer:not([data-modal-disabled="true"]) {
  display: block !important;
  pointer-events: auto !important;
}

/* Additional protection for disabled resizers */
.column-resizer[data-modal-disabled="true"] {
  display: none !important;
  pointer-events: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  cursor: default !important;
}

/* Recipe Update Loading Styles */
.loading-spinner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Recipe Cost Comparison Modal Styles */
#recipe-comparison-modal-overlay {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

#recipe-comparison-modal {
  width: 95%;
  max-width: 1200px;
  max-height: 90vh;
  background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
  border-radius: 24px;
  box-shadow: 0 32px 64px -12px rgba(0, 0, 0, 0.3), 0 8px 16px -4px rgba(0, 0, 0, 0.1);
}

#recipe-comparison-modal .modal-header {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
  border-bottom: 1px solid rgba(241, 245, 249, 0.8);
  border-radius: 24px 24px 0 0;
  padding: 20px 24px;
}

#recipe-comparison-modal .modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

#recipe-comparison-modal .modal-header h3 i {
  color: #059669;
  font-size: 18px;
  filter: drop-shadow(0 2px 4px rgba(5, 150, 105, 0.3));
}

#recipe-comparison-modal .modal-body {
  padding: 24px;
  max-height: calc(90vh - 120px);
  overflow-y: auto;
}

.comparison-controls {
  margin-bottom: 24px;
}

.recipe-selector-section h4 {
  font-size: 16px;
  font-weight: 600;
  color: #374151;
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.recipe-selector-section h4::before {
  content: '📊';
  font-size: 14px;
}

.recipe-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.recipe-selector {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recipe-selector label {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.recipe-selector select {
  padding: 10px 14px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
  color: #374151;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.recipe-selector select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15), 0 4px 12px rgba(59, 130, 246, 0.1);
  background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
}

.comparison-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.comparison-results {
  border-top: 2px solid #e5e7eb;
  padding-top: 24px;
}

.comparison-summary,
.comparison-details,
.comparison-charts {
  margin-bottom: 32px;
}

.comparison-summary h4,
.comparison-details h4,
.comparison-charts h4 {
  font-size: 16px;
  font-weight: 600;
  color: #374151;
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.comparison-summary h4::before {
  content: '📈';
  font-size: 14px;
}

.comparison-details h4::before {
  content: '📋';
  font-size: 14px;
}

.comparison-charts h4::before {
  content: '📊';
  font-size: 14px;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.08);
}

.comparison-table th {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: #374151;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #e5e7eb;
}

.comparison-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
  color: #374151;
}

.comparison-table tr:hover {
  background: #f8fafc;
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.cost-highlight {
  font-weight: 600;
  color: #059669;
}

.cost-highlight.expensive {
  color: #dc2626;
}

.cost-highlight.cheap {
  color: #059669;
}

.comparison-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.metric-card h5 {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 8px 0;
}

.metric-card .metric-value {
  font-size: 18px;
  font-weight: 700;
  color: #374151;
  margin: 0;
}

.metric-card .metric-difference {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

.metric-card .metric-difference.positive {
  color: #059669;
}

.metric-card .metric-difference.negative {
  color: #dc2626;
}

.comparison-chart {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin-bottom: 16px;
}

.chart-bar {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  gap: 12px;
}

.chart-bar-label {
  min-width: 120px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
}

.chart-bar-container {
  flex: 1;
  height: 24px;
  background: #f1f5f9;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.chart-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #1d4ed8);
  border-radius: 12px;
  transition: width 0.8s ease;
  position: relative;
}

.chart-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.chart-bar-value {
  min-width: 80px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  text-align: right;
}

.recipe-cost-breakdown {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.recipe-cost-breakdown h5 {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.recipe-cost-breakdown h5::before {
  content: '🍽️';
  font-size: 12px;
}

.ingredient-cost-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}

.ingredient-cost-item:last-child {
  border-bottom: none;
  font-weight: 600;
  color: #374151;
  padding-top: 8px;
  border-top: 2px solid #e5e7eb;
}

.ingredient-cost-item .ingredient-name {
  color: #6b7280;
}

.ingredient-cost-item .ingredient-cost {
  font-weight: 500;
  color: #374151;
}

/* Responsive design for comparison modal */
@media (max-width: 768px) {
  #recipe-comparison-modal {
    width: 95vw;
    margin: 10px;
  }
  
  .recipe-selector-grid {
    grid-template-columns: 1fr;
  }
  
  .comparison-metrics {
    grid-template-columns: 1fr;
  }
  
  .comparison-actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .comparison-actions button {
    width: 100%;
  }
}

/* VS Code Inspired SplitView/Sash styles */
.sash {
    background-color: transparent;
    transition: background-color 0.1s ease-out;
}

.sash.vertical {
    top: 0;
}

.sash.horizontal {
    left: 0;
}

.sash:hover {
    background-color: #007acc; /* VS Code's sash hover color */
}

/* Remove default flex behavior that conflicts with SplitView */
.column {
    min-width: 55px; /* Prevent columns from collapsing completely */
}

.expand-subrecipe-btn {
    background: none;
    border: none;
    padding: 0 5px;
    cursor: pointer;
    font-size: 0.8em;
    color: #64748b;
}

#recipe-ingredients-table tbody tr {
    transition: background-color 0.2s ease;
}

/* ----------------------------------------------------------------------
   Override: Keep autocomplete suggestion dropdowns above modal content   
   ------------------------------------------------------------------- */
/* Only apply fixed positioning when suggestions are actually shown */
#rec-modal .suggestions.show,
#rec-modal .ingredient-suggestions.show,
#rec-modal .qty-unit-suggestions.show,
#ing-modal  .suggestions.show,
#ing-modal  .ingredient-suggestions.show,
#ing-modal  .qty-unit-suggestions.show {
  position: absolute !important; /* Let JavaScript control positioning */
  z-index: 999999 !important; /* absolutely top of modal stacking */
}

/* Recipe Steps Section */
.recipe-steps .steps-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.recipe-steps .step-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid #f0f0f0;
  transition: none;
  position: relative;
}

.recipe-steps .step-item:last-child {
  border-bottom: none;
}

.recipe-steps .step-item:hover {
  background: transparent;
  border-color: #f0f0f0;
}

.recipe-steps .step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #f8f9fa;
  color: #495057;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 0;
  border: 2px solid #e9ecef;
}

.recipe-steps .step-content {
  flex: 1;
  line-height: 1.7;
  color: #212529;
  font-size: 15px;
  padding: 0;
  min-height: auto;
  display: block;
  font-weight: 400;
}

.recipe-steps .step-textarea {
  flex: 1;
  min-height: 80px;
  padding: 16px;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background: white;
  width: 100%;
  line-height: 1.6;
}

.recipe-steps .step-textarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.recipe-steps .step-actions {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 0;
}

.recipe-steps .step-actions button {
  width: 32px;
  height: 32px;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: white;
  color: #6c757d;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.recipe-steps .step-actions button:hover {
  background: #f8f9fa;
  color: #495057;
  border-color: #adb5bd;
}

.recipe-steps .step-actions .move-up-btn:hover {
  background: #d4edda;
  color: #155724;
  border-color: #c3e6cb;
}

.recipe-steps .step-actions .move-down-btn:hover {
  background: #fff3cd;
  color: #856404;
  border-color: #ffeaa7;
}

.recipe-steps .step-actions .remove-step-btn:hover {
  background: #f8d7da;
  color: #721c24;
  border-color: #f5c6cb;
}

.recipe-steps .steps-header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.recipe-steps .add-step-btn,
.recipe-steps .edit-steps-btn {
  padding: 8px 16px;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: white;
  color: #495057;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
}

.recipe-steps .add-step-btn:hover,
.recipe-steps .edit-steps-btn:hover {
  background: #f8f9fa;
  border-color: #adb5bd;
  color: #212529;
}

.recipe-steps .edit-steps-btn.editing {
  background: #28a745;
  color: white;
  border-color: #28a745;
}

.recipe-steps .edit-steps-btn.editing:hover {
  background: #218838;
  border-color: #1e7e34;
}

.recipe-steps .no-steps-message {
  text-align: center;
  color: #6c757d;
  padding: 40px 20px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #dee2e6;
  font-size: 15px;
  font-style: italic;
}

/* Print styles for recipe steps */
@media print {
  .recipe-steps .section-content {
    display: block !important;
  }
  
  .recipe-steps .costing-header {
    display: none;
  }
  
  .recipe-steps .step-item {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  
  .recipe-steps .step-actions,
  .recipe-steps .steps-header-actions {
    display: none !important;
  }
}