/* PanelFood Agent UX — terracotta bubbles MUST stay visible */
:root {
  --pf-terracotta: #F97316;
  --pf-terracotta-soft: #FFF7ED;
  --pf-terracotta-deep: #C2410C;
  --pf-agent-ai-bg: #F8FAFC;
  --pf-agent-user-bg: #0B1F3A;
}

/* Force page flag styles even if body class timing lags */
body.pf-agent-page #agent-messages,
#agent-messages {
  min-height: 12rem;
}

/* === Chat bubbles (assistant + user) — always visible === */
body.pf-agent-page .agent-bubble,
#agent-messages .agent-bubble,
.agent-bubble {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  max-width: 85% !important;
  padding: 10px 14px !important;
  border-radius: 14px !important;
  margin-bottom: 10px !important;
  white-space: pre-wrap !important;
  line-height: 1.45 !important;
  word-break: break-word;
}

body.pf-agent-page .agent-bubble.assistant,
body.pf-agent-page .pf-agent-bubble--ai,
#agent-messages .agent-bubble.assistant,
.agent-bubble.assistant {
  background: var(--pf-agent-ai-bg) !important;
  color: #0B1F3A !important;
  border: 1px solid #E6EAF0 !important;
  border-bottom-left-radius: 4px !important;
  margin-right: auto !important;
  margin-left: 0 !important;
}

body.pf-agent-page .agent-bubble.user,
body.pf-agent-page .pf-agent-bubble--user,
#agent-messages .agent-bubble.user,
.agent-bubble.user {
  background: var(--pf-agent-user-bg) !important;
  color: #FFFFFF !important;
  border: 0 !important;
  border-bottom-right-radius: 4px !important;
  margin-left: auto !important;
  margin-right: 0 !important;
}

body.pf-agent-page .agent-bubble.assistant a,
#agent-messages .agent-bubble.assistant a {
  color: var(--pf-terracotta-deep) !important;
}

/* Nuevo button */
body.pf-agent-page .pf-agent-new-btn,
body.pf-agent-page #agent-new.btn-primary,
body.pf-agent-page #agent-new,
#agent-new {
  background: #0B1F3A !important;
  border-color: #0B1F3A !important;
  color: #fff !important;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(11, 31, 58, 0.28);
}
body.pf-agent-page #agent-new:hover,
#agent-new:hover {
  background: #143056 !important;
  border-color: #143056 !important;
}

/* Active conversation */
body.pf-agent-page #agent-conv-list .list-group-item.active,
body.pf-agent-page #agent-conv-list button.active,
body.pf-agent-page .pf-agent-conv--active {
  background: #FFF7ED !important;
  color: #C2410C !important;
  border-left: 3px solid #F97316 !important;
  font-weight: 700;
}

/* Safety banner */
body.pf-agent-page .pf-agent-safety {
  max-width: 42rem;
  background: #fff3cd;
  color: #1A1A1A;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 700;
}
body.pf-agent-page .pf-agent-safety--compact {
  background: transparent;
  padding: 0;
  font-weight: 600;
  font-size: .8rem;
  color: rgba(255, 255, 255, 0.92);
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  max-width: 28rem;
}
body.pf-agent-page .pf-agent-safety__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: rgba(255, 243, 205, 0.95);
  color: #92400e;
  cursor: help;
  font-weight: 800;
}

/* Empty-state chips */
body.pf-agent-page .pf-agent-empty-suggest {
  margin: 2.5rem auto;
  max-width: 32rem;
  text-align: center;
  padding: 1.5rem 1rem;
}
body.pf-agent-page .pf-agent-empty-suggest__title {
  font-size: .85rem;
  font-weight: 700;
  color: #6B7280;
  margin-bottom: .85rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
body.pf-agent-page .pf-agent-chip {
  display: inline-flex;
  align-items: center;
  margin: .25rem;
  padding: .55rem 1rem;
  border-radius: 999px;
  border: 1px solid #E8D9CE;
  background: #fff;
  color: #1F2937;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
}
body.pf-agent-page .pf-agent-chip:hover {
  background: var(--pf-terracotta-soft);
  border-color: var(--pf-terracotta);
  color: var(--pf-terracotta-deep);
}

body.pf-agent-page #agent-send {
  background: var(--pf-terracotta) !important;
  border-color: var(--pf-terracotta) !important;
}

/* Sidebar Completo: secciones desplegables */
.pf-nav-accordion {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pf-nav-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin: .65rem .75rem .2rem;
  padding: .45rem .55rem;
  border-radius: .55rem;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45) !important;
  cursor: pointer;
  user-select: none;
  transition: background-color .15s ease, color .15s ease;
}

.pf-nav-section:hover {
  color: #FFFFFF !important;
  background: rgba(255,255,255,.08);
  text-decoration: none;
}

.pf-nav-section:focus {
  outline: none;
  text-decoration: none;
}

.pf-nav-section__label {
  flex: 1;
  min-width: 0;
}

.pf-nav-section__chevron {
  font-size: .55rem;
  line-height: 1;
  opacity: .85;
  transition: transform .2s ease;
}

.pf-nav-section[aria-expanded="true"] .pf-nav-section__chevron {
  transform: rotate(180deg);
}

.pf-nav-section__items {
  padding-left: 0;
  margin-bottom: .15rem;
}

.pf-nav-section__items > .nav-item > .nav-link {
  padding-left: 1rem;
}
