/* ==========================================================================
   Nutrition Styles - Health & Vitality Hub
   ========================================================================== */

.daily-summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
}

.daily-summary-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.daily-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.daily-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: capitalize;
}

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

.macro-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
}

.macro-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.8rem;
  margin-bottom: 6px;
}

.macro-name {
  color: var(--text-muted);
  font-weight: 600;
}

.macro-val {
  font-family: var(--font-mono);
  color: var(--text-main);
}

.macro-val strong {
  color: var(--color-primary);
  font-size: 0.95rem;
}

.macro-hint {
  display: block;
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.daily-substats {
  display: flex;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.substat-value {
  color: var(--text-main);
}

/* Sélecteur de type de repas */
.meal-type-selector {
  display: flex;
  gap: 6px;
}

.type-pill {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.type-pill.active {
  background: var(--color-primary-soft);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

/* Plats Express Défilement */
.preset-plates-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0;
  margin-bottom: 14px;
}

.preset-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.preset-btn {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-btn:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Liste des aliments de l'assiette */
.plate-items-container {
  margin-top: 10px;
}

.empty-plate-hint {
  text-align: center;
  padding: 28px 16px;
  background: var(--bg-card-subtle);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-color);
}

.empty-icon {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 8px;
}

.empty-plate-hint p {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.empty-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  max-width: 380px;
  margin: 6px auto 0 auto;
}

.plate-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.plate-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}

.item-info {
  flex: 1;
}

.item-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.item-darija {
  font-size: 0.72rem;
  color: var(--color-cyan);
}

.item-macros-detail {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.item-stepper-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.step-btn {
  width: 26px;
  height: 26px;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.grams-input {
  width: 44px;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
}

.grams-input:focus {
  outline: none;
}

.unit-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  padding-right: 4px;
}

.btn-remove-item {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.2s ease;
}

.btn-remove-item:hover {
  color: var(--color-rose);
}

/* Verdict Métabolique de l'Assiette */
.plate-verdict-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 14px;
}

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

.verdict-tag {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--color-primary);
}

.amorti-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.verdict-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
}

.verdict-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

.verdict-metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 14px 0;
  text-align: center;
}

.v-metric {
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 2px;
}

.vm-val {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--color-primary);
}

.vm-lbl {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.plate-actions-row {
  display: flex;
  gap: 10px;
}

/* Catalogue & Recherche */
.search-box-wrap {
  margin-top: 12px;
  margin-bottom: 10px;
}

.search-input {
  width: 100%;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  color: var(--text-main);
  font-size: 0.88rem;
}

.search-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.categories-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.cat-pill {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cat-pill.active {
  background: var(--color-primary-soft);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.foods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.food-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.food-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.food-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.food-darija {
  font-size: 0.7rem;
  color: var(--color-cyan);
  display: block;
}

.btn-add-food {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-soft);
  border: 1px solid var(--border-active);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.btn-add-food:hover {
  background: var(--color-primary);
  color: #ffffff;
}

.food-portion-hint {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin: 6px 0;
}

.food-macros-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.chip-macro {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.chip-carbs { background: rgba(244, 63, 94, 0.15); color: #fda4af; }
.chip-prot  { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }
.chip-gi    { background: rgba(245, 158, 11, 0.15); color: #fde047; }

/* Journal des repas du jour */
.meals-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.meal-log-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.meal-log-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.meal-type-tag {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--color-primary);
}

.meal-log-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.btn-delete-meal {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}

.btn-delete-meal:hover {
  color: var(--color-rose);
}

.meal-items-summary {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 6px 0 8px 0;
}

.meal-log-footer {
  display: flex;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-carb { color: #fda4af; }
.badge-prot { color: #6ee7b7; }
.badge-gl   { color: #fde047; }
