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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding-bottom: 100px;
  display: flex;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="%23ffffff" opacity="0.15"/><circle cx="20" cy="60" r="0.5" fill="%23ffffff" opacity="0.1"/><circle cx="80" cy="30" r="0.5" fill="%23ffffff" opacity="0.15"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  pointer-events: none;
  z-index: 1;
}

.main-content {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 2;
  margin-right: 340px;
}

.sidebar {
  width: 320px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.1);
  position: fixed;
  right: 16px;
  top: 16px;
  bottom: 80px;
  overflow-y: auto;
  z-index: 100;
  transition: all 0.3s ease;
}

.sidebar:hover {
  transform: translateY(-2px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.2);
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.8) 0%,
    rgba(255, 255, 255, 0.6) 100%
  );
  border-radius: 20px 20px 0 0;
  backdrop-filter: blur(10px);
}

.sidebar-title {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
  text-align: center;
  letter-spacing: -0.5px;
}

.view-toggle {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(255, 255, 255, 0.7) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 16px;
  width: 100%;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.view-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 1) 0%,
    rgba(255, 255, 255, 0.9) 100%
  );
}

.view-toggle.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* Daily Goals Section */
.daily-goals-section {
  margin-bottom: 16px;
  background: linear-gradient(
    135deg,
    rgba(227, 242, 253, 0.8) 0%,
    rgba(227, 242, 253, 0.6) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  padding: 16px;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.daily-goals-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.daily-goals-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #495057;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.toggle-goals-btn {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  font-size: 14px;
}

.toggle-goals-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.daily-goals-form {
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.goal-input-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.goal-input-group label {
  font-size: 12px;
  font-weight: 600;
  color: #495057;
  flex: 1;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.goal-input-group input {
  width: 65px;
  padding: 6px 10px;
  border: 1px solid rgba(102, 126, 234, 0.2);
  border-radius: 6px;
  font-size: 12px;
  text-align: center;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.9);
  transition: all 0.2s ease;
}

.goal-input-group input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
  background: white;
}

.goal-input-group input[readonly] {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
  color: #6c757d;
  cursor: not-allowed;
  border-color: rgba(0, 0, 0, 0.1);
}

.goal-input-group small {
  margin-left: 6px;
  font-size: 10px;
  font-style: italic;
  color: #6c757d;
  font-weight: 500;
}

.sidebar-meal-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.sidebar-meal-tab {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
  z-index: 2;
}

.sidebar-meal-tab::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transition: left 0.5s;
  z-index: 1;
  pointer-events: none;
}

.sidebar-meal-tab:hover::before {
  left: 100%;
}

.sidebar-meal-tab:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.sidebar-meal-tab.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.sidebar-meal-tab.active:hover {
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.sidebar-current-macros {
  background: linear-gradient(
    135deg,
    rgba(227, 242, 253, 0.8) 0%,
    rgba(227, 242, 253, 0.6) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.sidebar-macros-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sidebar-macro-item {
  text-align: center;
}

.sidebar-macro-value {
  font-size: 16px;
  font-weight: 700;
  color: #007bff;
}

.sidebar-macro-label {
  font-size: 10px;
  color: #6c757d;
  margin-top: 1px;
}

.sidebar-content {
  padding: 16px;
}

.meal-item {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  border: 1px solid #e9ecef;
  position: relative;
  cursor: pointer;
  transition: all 0.2s;
}

.meal-item:hover {
  background: #e9ecef;
  border-color: #007bff;
}

.meal-item-name {
  font-size: 14px;
  font-weight: 500;
  color: #212529;
  margin-bottom: 4px;
}

.meal-item-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.meal-item-qty {
  font-size: 12px;
  color: #6c757d;
}

.meal-item-macros {
  font-size: 11px;
  color: #6c757d;
}

.meal-item-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.2s;
}

.meal-item:hover .meal-item-delete {
  opacity: 1;
}

.meal-item-delete:hover {
  background: #c82333;
  transform: scale(1.1);
}

.sidebar-empty {
  text-align: center;
  color: #6c757d;
  font-size: 14px;
  padding: 32px 16px;
}

.sidebar-totals {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e9ecef;
}

.sidebar-totals-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.sidebar-total-value {
  font-weight: 600;
  color: #007bff;
}

.sidebar-save-btn {
  background: #28a745;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-top: 16px;
  transition: all 0.2s;
}

.sidebar-save-btn:hover {
  background: #218838;
}

.sidebar-save-btn:disabled {
  background: #6c757d;
  cursor: not-allowed;
}

.overview-mode {
  display: none;
}

.overview-mode.active {
  display: block;
}

.edit-mode.hidden {
  display: none;
}

.overview-meals {
  display: grid;
  gap: 16px;
}

.overview-meal {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 12px;
  border: 1px solid #e9ecef;
}

.overview-meal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #dee2e6;
}

.overview-meal-name {
  font-weight: 600;
  font-size: 14px;
  color: #212529;
}

.overview-meal-total {
  font-size: 12px;
  color: #007bff;
  font-weight: 600;
}

.overview-meal-items {
  font-size: 11px;
  color: #6c757d;
  line-height: 1.4;
}

.overview-meal-item {
  margin-bottom: 2px;
}

.overview-edit-btn {
  background: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 10px;
  cursor: pointer;
}

.overview-edit-btn:hover {
  background: #0056b3;
}

.header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border-radius: 0 0 20px 20px;
  margin-bottom: 20px;
}

.meal-selector {
  padding: 16px;
  border-bottom: 1px solid #e9ecef;
}

.meal-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.meal-tab {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.meal-tab.active {
  background: #007bff;
  color: white;
  border-color: #007bff;
}

.meal-tab:hover {
  background: #f8f9fa;
}

.meal-tab.active:hover {
  background: #0056b3;
}

.categories {
  padding: 24px 20px;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.05) 100%
  );
  scrollbar-width: none;
  -ms-overflow-style: none;
  justify-content: center;
  flex-wrap: wrap;
}

.categories::-webkit-scrollbar {
  display: none;
}

.category-btn {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 25px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  scroll-snap-align: start;
  z-index: 2;
}

.category-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transition: left 0.5s;
  z-index: 1;
  pointer-events: none;
}

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

.category-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
  transform: translateY(-2px);
}

.category-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 1);
}

.category-btn.active:hover {
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
  transform: translateY(-2px);
}

.content {
  padding: 0;
  margin-right: 352px;
  min-height: calc(100vh - 120px);
}

.menu-items-container {
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  min-height: calc(100vh - 200px);
}

.menu-item {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  min-height: 140px;
}

.menu-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s;
  z-index: 1;
  pointer-events: none;
}

.menu-item:hover::before {
  left: 100%;
}

.menu-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
  border-color: rgba(102, 126, 234, 0.3);
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  position: relative;
  z-index: 2;
}

.item-info h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #212529;
  line-height: 1.3;
}

.item-macros {
  font-size: 13px;
  color: #6c757d;
  font-weight: 500;
}

.item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  position: relative;
  z-index: 2;
}

.quantity-section {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.8);
  padding: 8px 12px;
  border-radius: 15px;
  backdrop-filter: blur(10px);
}

.item-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 2;
}

.quantity-btn {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(255, 255, 255, 0.7) 100%
  );
  backdrop-filter: blur(10px);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  color: #667eea;
  position: relative;
  overflow: hidden;
}

.quantity-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
  pointer-events: none;
}

.quantity-btn:hover::before {
  opacity: 1;
}

.quantity-btn:hover {
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.quantity-btn:active {
  transform: scale(0.95) translateY(-2px);
}

.quantity-display {
  min-width: 24px;
  text-align: center;
  font-weight: 600;
  font-size: 16px;
}

.meal-labels {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 120px;
  justify-content: flex-end;
  z-index: 3;
}

.meal-label {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 12px;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
}

.meal-label.breakfast {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
}
.meal-label.lunch {
  background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
}
.meal-label.dinner {
  background: linear-gradient(135deg, #45b7d1 0%, #2980b9 100%);
}
.meal-label.snacks {
  background: linear-gradient(135deg, #96ceb4 0%, #27ae60 100%);
}

.save-meal-btn {
  background: #28a745;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin: 16px;
  width: calc(100% - 32px);
  transition: all 0.2s;
}

.save-meal-btn:hover {
  background: #218838;
}

.save-meal-btn:disabled {
  background: #6c757d;
  cursor: not-allowed;
}

.meal-overview {
  padding: 0 16px 16px;
}

.meal-summary-item {
  background: white;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  border: 1px solid #dee2e6;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.meal-summary-item.empty {
  opacity: 0.5;
  border-style: dashed;
}

.meal-summary-info {
  flex: 1;
}

.meal-summary-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.meal-summary-macros {
  font-size: 12px;
  color: #6c757d;
}

.edit-meal-btn {
  background: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}

.edit-meal-btn:hover {
  background: #0056b3;
}

.edit-meal-btn:disabled {
  background: #6c757d;
  cursor: not-allowed;
}

.macro-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 352px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  border-radius: 20px 20px 0 0;
}

.daily-totals {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.05) 100%
  );
  border-radius: 20px 20px 0 0;
}

.macro-item {
  text-align: center;
  flex: 1;
}

.macro-value {
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 2px;
  transition: all 0.3s ease;
}

/* Goal progress color coding */
.macro-value.under-goal {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.macro-value.on-goal {
  background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.macro-value.over-goal {
  background: linear-gradient(135deg, #ffd43b 0%, #fab005 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.macro-label {
  font-size: 11px;
  color: #6c757d;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hidden {
  display: none;
}

/* Mobile Toggle Button */
.mobile-sidebar-toggle {
  display: none;
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1001;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  color: white;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
}

.mobile-sidebar-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(102, 126, 234, 0.6);
}

.mobile-sidebar-toggle.active {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
  box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  backdrop-filter: blur(5px);
}

.sidebar-overlay.active {
  display: block;
}

@media (max-width: 768px) {
  .mobile-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .main-content {
    margin-right: 0;
  }

  .sidebar {
    width: 100%;
    height: auto;
    max-height: 70vh;
    position: fixed;
    top: 0;
    right: 0;
    bottom: auto;
    left: 0;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    border-radius: 0 0 20px 20px;
    z-index: 1000;
  }

  .sidebar.mobile-open {
    transform: translateY(0);
  }

  .sidebar-header {
    border-radius: 0 0 20px 20px;
    padding-top: 80px;
  }

  .content {
    margin-right: 0;
    padding-top: 20px;
  }

  .menu-items-container {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
  }

  .macro-bar {
    right: 0;
  }

  .categories {
    padding: 16px 12px;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .category-btn {
    padding: 10px 16px;
    font-size: 13px;
  }

  .menu-item {
    padding: 20px;
    min-height: 120px;
  }

  .item-info h3 {
    font-size: 15px;
  }

  .item-macros {
    font-size: 11px;
  }

  .quantity-btn {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }

  .macro-value {
    font-size: 16px;
  }

  .macro-label {
    font-size: 10px;
  }

  .daily-totals {
    padding: 12px 16px;
  }

  .sidebar-meal-tabs {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .sidebar-meal-tab {
    padding: 8px 10px;
    font-size: 11px;
  }

  .view-toggle {
    padding: 8px 12px;
    font-size: 12px;
  }

  .overview-meals {
    gap: 12px;
  }

  .overview-meal {
    padding: 12px;
  }
}

@media (max-width: 480px) {
  .categories {
    padding: 12px 8px;
  }

  .category-btn {
    padding: 8px 12px;
    font-size: 12px;
  }

  .menu-items-container {
    padding: 12px;
    gap: 10px;
  }

  .menu-item {
    padding: 16px;
    min-height: 100px;
  }

  .item-info h3 {
    font-size: 16px;
  }

  .quantity-section {
    justify-content: center;
    width: 100%;
  }

  .sidebar-meal-tabs {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .daily-totals {
    flex-wrap: wrap;
    gap: 8px;
  }

  .macro-item {
    flex: 1 1 calc(50% - 4px);
    min-width: 80px;
  }
}
