:root {
  --color-principal: #f5c542;
}

/* ========== OVERLAY PRINCIPAL ========== */
.alimentacion-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #f2f4f7;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  font-family: 'Segoe UI', sans-serif;
}

/* ========== HEADER ========== */
.alimentacion-header {
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  gap: 10px;
}

.alimentacion-header-top {
  display: flex;
  align-items: center;
  gap: 16px;
}

.alimentacion-back {
  background: none;
  border: none;
  font-size: 24px;
  color: #333;
  cursor: pointer;
  padding: 0;
}

.alimentacion-progress {
  flex: 1;
  height: 8px;
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
}

.alimentacion-progress-fill {
  height: 100%;
  background: var(--color-principal, #f5c542);
  width: 0%;
  transition: width 0.3s ease;
}

.alimentacion-step-text {
  text-align: center;
  font-size: 13px;
  color: #999;
  font-weight: 500;
}

/* ========== CONTENIDO ========== */
.alimentacion-body {
  flex: 1;
  padding: 30px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.alimentacion-avatar {
  text-align: center;
  margin-bottom: 8px;
  font-size: 42px;
}

.alimentacion-title {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 4px;
  color: #1a1a1a;
}

.alimentacion-subtitle {
  font-size: 14px;
  color: #777;
  text-align: center;
  margin-bottom: 24px;
  line-height: 1.4;
}

/* ========== FILAS DEL FORMULARIO ========== */
.alimentacion-field {
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--color-principal, #f5c542) 6%, white);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  gap: 12px;
}

.alimentacion-field-icon {
  font-size: 20px;
  width: 28px;
  text-align: center;
  color: #b0986a;
}

.alimentacion-field-label {
  flex: 1;
  font-size: 15px;
  color: #333;
}

.alimentacion-field-value {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #555;
  font-weight: 500;
}

.alimentacion-field-value input {
  width: 60px;
  border: none;
  background: transparent;
  font-size: 15px;
  text-align: right;
  color: #333;
  outline: none;
  font-weight: 500;
}

.alimentacion-field-value input[type="number"]::-webkit-inner-spin-button,
.alimentacion-field-value input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.alimentacion-field select {
  border: none;
  background: transparent;
  font-size: 15px;
  color: #333;
  outline: none;
  cursor: pointer;
  font-weight: 500;
}

/* ========== TARJETAS DE OBJETIVO ========== */
.alimentacion-goals {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.alimentacion-goal-card {
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--color-principal, #f5c542) 6%, white);
  border-radius: 12px;
  padding: 16px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: 0.2s;
}

.alimentacion-goal-card.selected {
  border-color: var(--color-principal, #f5c542);
  background: color-mix(in srgb, var(--color-principal, #f5c542) 10%, white);
}

.alimentacion-goal-icon {
  font-size: 24px;
  margin-right: 14px;
  color: #555;
  width: 36px;
  text-align: center;
}

.alimentacion-goal-info {
  flex: 1;
}

.alimentacion-goal-title {
  font-weight: 600;
  font-size: 15px;
  color: #1a1a1a;
}

.alimentacion-goal-desc {
  font-size: 12px;
  color: #888;
}

/* ========== TARJETAS DE SELECCIÓN ========== */
.alimentacion-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.alimentacion-option-card {
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--color-principal, #f5c542) 6%, white);
  border-radius: 12px;
  padding: 16px 18px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: 0.2s;
  gap: 14px;
}

.alimentacion-option-card:hover {
  background: color-mix(in srgb, var(--color-principal, #f5c542) 12%, white);
}

.alimentacion-option-card.selected {
  border-color: var(--color-principal, #f5c542);
  background: color-mix(in srgb, var(--color-principal, #f5c542) 10%, white);
}

.alimentacion-option-emoji {
  font-size: 26px;
  width: 40px;
  text-align: center;
  flex-shrink: 0;
}

.alimentacion-option-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.alimentacion-option-title {
  font-weight: 600;
  font-size: 15px;
  color: #1a1a1a;
}

.alimentacion-option-desc {
  font-size: 12px;
  color: #888;
  line-height: 1.3;
}

/* ========== TAGS DE ALIMENTOS ========== */
.alimentacion-alimentos-section {
  margin-bottom: 24px;
}

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

.alimentacion-categoria-nombre {
  font-size: 16px;
  font-weight: 700;
  color: #444;
}

.alimentacion-select-all {
  font-size: 13px;
  color: var(--color-principal, #f5c542);
  background: none;
  border: none;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.alimentacion-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.alimentacion-tag {
  background: white;
  border: 1.5px solid #e0ddd5;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 13px;
  color: #555;
  cursor: pointer;
  transition: 0.2s;
  user-select: none;
}

.alimentacion-tag.selected {
  background: color-mix(in srgb, var(--color-principal, #f5c542) 10%, white);
  border-color: var(--color-principal, #f5c542);
  color: #333;
  font-weight: 500;
}

/* ========== RESULTADOS (PRE-DASHBOARD) ========== */
.alimentacion-result-card {
  background: color-mix(in srgb, var(--color-principal, #f5c542) 6%, white);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  text-align: center;
}

.alimentacion-kcal {
  font-size: 44px;
  font-weight: 800;
  color: #1a1a1a;
  margin-bottom: 8px;
}

.alimentacion-kcal-label {
  font-size: 13px;
  color: #888;
  margin-bottom: 16px;
}

.alimentacion-range-bar {
  height: 12px;
  background: #e8f5e9;
  border-radius: 6px;
  margin: 0 20px 8px;
  position: relative;
}

.alimentacion-range-fill {
  height: 100%;
  background: #4caf50;
  border-radius: 6px;
  width: 70%;
}

.alimentacion-range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #888;
  padding: 0 20px;
  margin-bottom: 24px;
}

.alimentacion-macros {
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-top: 1px solid #eee;
  padding-top: 20px;
}

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

.alimentacion-macro-label {
  font-size: 12px;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.alimentacion-macro-value {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a1a;
  position: relative;
  display: inline-block;
}

.alimentacion-macro-value::after {
  content: '';
  display: block;
  width: 100%;
  height: 3px;
  background: var(--color-principal, #f5c542);
  border-radius: 2px;
  margin-top: 4px;
}

/* ========== BOTONES Y NOTAS ========== */
.alimentacion-btn {
  width: 100%;
  padding: 16px;
  background: var(--color-principal, #f5c542);
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: 1px;
  cursor: pointer;
  margin-top: auto;
  margin-bottom: 8px;
  transition: background 0.2s;
}

.alimentacion-btn:hover {
  background: #e5b63a;
}

.alimentacion-footer-note {
  text-align: center;
  font-size: 13px;
  color: #aaa;
  margin-bottom: 8px;
}

/* ========== CLASES DE VISIBILIDAD ========== */
.alimentacion-pantalla {
  display: none;
  flex-direction: column;
  flex: 1;
}

.alimentacion-pantalla.active {
  display: flex;
}

/* ========== DASHBOARD DE ALIMENTACIÓN ========== */
.alimentacion-dashboard {
  display: none;
  flex-direction: column;
  flex: 1;
  background: #f2f4f7;
}

.alimentacion-dashboard.active {
  display: flex;
}

.dash-alimentacion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.dash-header-back,
.dash-header-settings {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #f5f5f5;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-principal, #f5a623);
}

.dash-header-title {
  text-align: center;
}

.dash-header-subtitle {
  font-size: 12px;
  color: var(--color-principal, #f5a623);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.dash-header-main {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
}

.dash-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Tarjeta Score Diario */
.dash-score-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.dash-score-label {
  font-size: 12px;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.dash-score-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dash-score-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 4px solid #f44336;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #f44336;
  background: #fff;
}

.dash-score-info h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.dash-score-info p {
  margin: 2px 0 0;
  font-size: 13px;
  color: #888;
}

/* CONTENEDOR DE ACCIONES IA UNIFICADAS */
.dash-ia-actions-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Botón Generar Plan */
.dash-generar-btn {
  width: 100%;
  background: var(--color-principal, #f5a623);
  color: white;
  border: none;
  border-radius: 16px;
  padding: 18px;
  text-align: center;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(245,166,35,0.25);
  transition: transform 0.1s, background 0.2s;
}

.dash-generar-btn:active {
  transform: scale(0.99);
}

.dash-generar-btn small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  margin-top: 4px;
  opacity: 0.95;
}

/* ESTILOS DEL BOTÓN ACCESO AL NUTRIBOT IA */
.dash-bot-acceso-btn {
  width: 100%;
  background: #1e293b;
  color: var(--color-principal, #f5c542);
  border: 1.5px solid var(--color-principal, #f5c542);
  border-radius: 16px;
  padding: 18px;
  text-align: center;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(30,41,59,0.15);
  transition: all 0.2s;
}

.dash-bot-acceso-btn:hover {
  background: #0f172a;
}

.dash-bot-acceso-btn small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  margin-top: 4px;
  color: #cbd5e1;
}

/* Tarjeta Mis Alimentos */
.dash-alimentos-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.dash-alimentos-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.dash-alimentos-header h3 {
  font-size: 14px;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0;
}

.dash-alimentos-cambiar {
  font-size: 13px;
  color: var(--color-principal, #f5a623);
  font-weight: 700;
  background: none;
  border: none;
  cursor: pointer;
}

.dash-alimentos-sub {
  font-size: 12px;
  color: #888;
  margin-bottom: 12px;
}

.dash-alimentos-empty {
  border: 2px dashed #ddd;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  color: #aaa;
  font-weight: 500;
  font-size: 13px;
}

.dash-alimentos-empty a {
  color: var(--color-principal, #f5a623);
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

/* Estadísticas */
.dash-stats-title {
  font-size: 14px;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 12px;
}

.dash-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.dash-stat-card {
  background: white;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.dash-stat-title {
  font-size: 11px;
  color: #607d8b;
  font-weight: 600;
  margin-bottom: 8px;
}

.dash-stat-value {
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.dash-stat-sub {
  font-size: 11px;
  color: #888;
  margin-bottom: 8px;
}

.dash-mini-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 40px;
}

.dash-bar {
  flex: 1;
  background: #eceff1;
  border-radius: 3px 3px 0 0;
  height: 60%;
}

.dash-bar.highlight {
  background: #f44336;
  height: 100%;
}

.dash-bar-label {
  font-size: 10px;
  text-align: center;
  color: #aaa;
}

.dash-weight-timeline {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #aaa;
  margin-top: 8px;
}

.dash-weight-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Tarjeta Objetivo */
.dash-objetivo-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.dash-objetivo-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 14px;
}

.dash-objetivo-badge {
  background: #e8f5e9;
  color: #4caf50;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
}

.dash-objetivo-peso {
  font-size: 28px;
  font-weight: 800;
  text-align: center;
  margin: 12px 0;
}

.dash-progress-bar {
  height: 8px;
  background: #f0f0f0;
  border-radius: 4px;
  margin: 8px 0 16px;
  position: relative;
}

.dash-progress-fill {
  height: 100%;
  background: #4caf50;
  border-radius: 4px;
  width: 50%;
  position: relative;
}

.dash-progress-dot {
  position: absolute;
  right: -10px;
  top: -6px;
  width: 20px;
  height: 20px;
  background: white;
  border: 3px solid #4caf50;
  border-radius: 50%;
}

.dash-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #888;
}

.dash-config-btn {
  width: 100%;
  padding: 14px;
  background: #f5f5f5;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  color: #444;
  cursor: pointer;
  margin-top: 16px;
  }

  /* ==================== CHAT NUTRIÓLOGO IA ==================== */
.nutri-chat-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #0f172a;
    color: white;
}

.nutri-chat-header {
    padding: 16px 20px;
    background: #1e2937;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #334155;
    flex-shrink: 0;
}

.nutri-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: #475569 #1e2937;
}

.nutri-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.nutri-chat-messages::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 20px;
}

.nutri-mensaje {
    display: flex;
    margin-bottom: 8px;
}

.nutri-mensaje.usuario {
    justify-content: flex-end;
}

.nutri-mensaje.ia {
    justify-content: flex-start;
}

.mensaje-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.4;
    font-size: 15px;
    word-wrap: break-word;
}

.nutri-mensaje.usuario .mensaje-bubble {
    background: #4caf50;
    color: white;
    border-bottom-right-radius: 4px;
}

.nutri-mensaje.ia .mensaje-bubble {
    background: #1e2937;
    border-bottom-left-radius: 4px;
    border: 1px solid #334155;
}

.nutri-chat-input-area {
    padding: 12px 16px;
    background: #1e2937;
    display: flex;
    gap: 8px;
    border-top: 1px solid #334155;
    flex-shrink: 0;
}

.nutri-chat-input-area input {
    flex: 1;
    padding: 14px 18px;
    border: none;
    border-radius: 30px;
    background: #334155;
    color: white;
    font-size: 15px;
}

.nutri-chat-input-area input:focus {
    outline: none;
    background: #475569;
}

.nutri-chat-input-area button {
    flex-shrink: 0;
}