/* Workflow PEC theme - Panel Runner (administrador_pec/runner/static/runner/css/theme.css)
   Barras lila/rosa como asistente, cards colapsables, grupos arcoíris. Cargado en base_runner.html ?v=4 */
:root {
  --heading-font: "Nunito", sans-serif;
  --body-font: "Nunito", sans-serif;
  --h1: 30px;
  --h1-huge: 42px;
  --h1-huge-md: 56px;
  --h2: 26px;
  --h3: 22px;
  --h4: 20px;
  --h5: 18px;
  --h6: 16px;
  --font-hugest: 28px;
  --font-huge: 24px;
  --font-largest: 20px;
  --font-large: 18px;
  --font-big: 16px;
  --font-base: 14px;
  --font-small: 12px;
  --font-smallest: 10px;
  --title-font-weight: 700;

  --header-bg: #f1dd75;
  --body-bg: #fff;
  --text-color: #000;
  --border-header: rgba(0, 0, 0, 0.1);
  --accent-primary: #0050C3;
  --accent-pink: #D8446E;
  --accent-fuchsia: #D8446E;
  --accent-lilac: #9B7EBD;
  --accent-lilac-light: #E8DDF2;
  --accent-green: #00C87B;
  --gray-muted: #6D6D6D;
  /* Pastel gradients for form buttons (unified style) */
  --btn-pastel-primary: linear-gradient(135deg, #E8B4BC 0%, #D4A5E8 100%);
  --btn-pastel-primary-hover: linear-gradient(135deg, #dd9faa 0%, #c490d6 100%);
  --btn-pastel-primary-border: #c99ab0;
  --btn-pastel-secondary: linear-gradient(135deg, #B8C5D6 0%, #A8B8CC 100%);
  --btn-pastel-secondary-hover: linear-gradient(135deg, #a3b2c4 0%, #93a3b8 100%);
  --btn-pastel-secondary-border: #8f9fb2;
  --btn-pastel-success: linear-gradient(135deg, #A8E6CF 0%, #88D4AB 100%);
  --btn-pastel-success-hover: linear-gradient(135deg, #8fd9b8 0%, #72c296 100%);
  --btn-pastel-success-border: #6bb88f;
  --btn-pastel-warning: linear-gradient(135deg, #FFE5B4 0%, #FFD89B 100%);
  --btn-pastel-warning-hover: linear-gradient(135deg, #f5d89e 0%, #f0c87a 100%);
  --btn-pastel-warning-border: #e0b86a;
  --btn-pastel-danger: linear-gradient(135deg, #F5B7B7 0%, #E8A0A0 100%);
  --btn-pastel-danger-hover: linear-gradient(135deg, #e8a0a0 0%, #d98888 100%);
  --btn-pastel-danger-border: #d07878;
  --btn-pastel-info: linear-gradient(135deg, #B5D4E8 0%, #9BC4E0 100%);
  --btn-pastel-info-hover: linear-gradient(135deg, #9fc5dc 0%, #85b5d0 100%);
  --btn-pastel-info-border: #7aadc8;
}

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

html {
  box-sizing: border-box;
  height: 100%;
}

body {
  margin: 0;
  color: var(--text-color);
  font-family: var(--body-font);
  font-size: var(--font-base);
  background-color: var(--body-bg);
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

body > main {
  flex: 1 0 auto;
  min-height: 0;
}

/* Footer simple runner */
footer.runner-footer {
  flex-shrink: 0;
  margin-top: auto;
  border-top: 1px solid rgba(155, 126, 189, 0.4);
  background-color: rgba(245, 242, 250, 0.95);
  color: var(--gray-muted);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
}

/* Header estilo referencia */
.head-main {
  color: var(--text-color);
  fill: var(--text-color);
  background-color: var(--header-bg);
  border-bottom: 1px solid rgba(155, 126, 189, 0.4);
  padding: 0.75rem 0;
}

.head-main .head-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 100%;
}

.head-main .logo-img {
  height: 48px;
  width: auto;
  object-fit: contain;
}

.head-main .head-title {
  font-family: var(--heading-font);
  font-weight: var(--title-font-weight);
  font-size: var(--h3);
  margin: 0;
}

.head-main .head-sub {
  font-size: var(--font-small);
  color: var(--gray-muted);
  margin: 0.25rem 0 0 0;
}

/* Staff/Admin header: lila→fucsia + badge so it's clearly not the client portal (yellow) */
.head-main--staff {
  background: linear-gradient(135deg, var(--accent-lilac) 0%, var(--accent-fuchsia) 100%);
  color: #fff;
  fill: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}
.head-main--staff .head-sub {
  color: rgba(255, 255, 255, 0.9);
}
.head-main--staff .head-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.head-main--staff .head-staff-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: var(--font-smallest);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  white-space: nowrap;
}
.head-main--staff .btn-outline-secondary {
  border-color: rgba(255, 255, 255, 0.6);
  color: #fff;
}
.head-main--staff .btn-outline-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: #fff;
  color: #fff;
}
.head-main--staff .btn-outline-danger {
  border-color: rgba(255, 255, 255, 0.7);
  color: #fff;
}
.head-main--staff .btn-outline-danger:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: #fff;
  color: #fff;
}
.head-main--staff .text-muted {
  color: rgba(255, 255, 255, 0.85) !important;
}
.head-main--staff .offcanvas-end {
  /* offcanvas stays default */
}

/* Mobile: prevent header overflow when opened via QR */
@media (max-width: 991.98px) {
  .head-main .head-inner {
    flex-wrap: nowrap;
  }
  .head-main .head-title {
    font-size: var(--h5);
  }
  .head-main .logo-img {
    height: 36px;
  }
}
@media (max-width: 575.98px) {
  .head-main {
    padding: 0.5rem 0;
  }
  .head-main .head-title {
    font-size: 1rem;
  }
}

/* Prevent horizontal scroll on mobile (e.g. when opening via QR) */
@media (max-width: 991.98px) {
  body {
    overflow-x: hidden;
  }
}

/* Cards: barra de título lila→fucsia como el asistente, cuerpo blanco */
.workflow-card {
  transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
  border: none !important;
  border-left: 4px solid #D49BE8;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(212, 155, 232, 0.2), 0 0 0 1px rgba(212, 155, 232, 0.15);
  overflow: hidden;
}

/* Barra de título de cada card = mismo estilo que panel-header del chat */
.workflow-card .card-header {
  position: relative;
  border: none !important;
  border-color: transparent !important;
  border-radius: 10px 10px 0 0 !important;
  border-bottom: 1px solid rgba(212, 155, 232, 0.5) !important;
  background: linear-gradient(135deg, #fff 0%, #D49BE8 100%) !important;
  color: #333 !important;
  cursor: pointer;
  padding: 0.75rem 1rem !important;
  font: inherit;
}
.workflow-card .card-header:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(212, 155, 232, 0.6);
}

.workflow-card .card-header .card-title,
.workflow-card .card-header .card-header__status,
.workflow-card .card-header .provider-logo,
.workflow-card .card-header .min-width-0 {
  color: #333 !important;
}

.workflow-card .card-header .card-header__status--ok {
  background: rgba(212, 155, 232, 0.3) !important;
  color: #4c1d95 !important;
  border-color: rgba(212, 155, 232, 0.6) !important;
}

.workflow-card .card-header .card-header__status--pending {
  background: rgba(212, 155, 232, 0.2) !important;
  color: #4c1d95 !important;
  border-color: rgba(212, 155, 232, 0.5) !important;
}

.workflow-card .card-body {
  border-radius: 0;
  background: #fff;
}

.workflow-card:hover {
  border-left-width: 5px;
  border-left-color: var(--accent-fuchsia);
  box-shadow: 0 4px 14px rgba(155, 126, 189, 0.22), 0 0 0 1px rgba(155, 126, 189, 0.15);
  transform: translateY(-2px);
}

/* Chevron de card colapsable: siempre a la derecha, rota cuando está colapsado */
.card-header-chevron {
  font-size: 0.75rem;
  opacity: 0.9;
  transition: transform 0.25s ease;
  flex-shrink: 0;
  margin-left: auto;
}
.workflow-card .card-header[aria-expanded="true"] .card-header-chevron {
  transform: rotate(0deg);
}
.workflow-card .card-header[aria-expanded="false"] .card-header-chevron {
  transform: rotate(-90deg);
}

/* Steps sin permiso: barra más apagada, no clickeables */
.workflow-card-disabled {
  opacity: 0.75;
  pointer-events: none;
}

.workflow-card-disabled .card-header {
  background: linear-gradient(135deg, #f5f0f9 0%, #e8d5f0 100%) !important;
  border-color: transparent !important;
}

.workflow-card .card-header .provider-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  margin-right: 0.5rem;
}

/* Portal/Runner buttons: see "Unified form buttons" block below (pastel gradients). */

/* ----- Unified form buttons: pastel gradients (Runner + Portal, same style) ----- */
.btn:not(.btn-link) {
  font-family: var(--heading-font);
  font-weight: 600;
  border-radius: 10px;
  border-width: 2px;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
.btn:not(.btn-link):hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}
.btn:not(.btn-link):active {
  transform: translateY(0);
}

/* Solid pastel gradient buttons */
.btn-primary {
  background: var(--btn-pastel-primary) !important;
  border-color: var(--btn-pastel-primary-border) !important;
  color: #2d2d2d !important;
}
.btn-primary:hover {
  background: var(--btn-pastel-primary-hover) !important;
  border-color: var(--btn-pastel-primary-border) !important;
  color: #1a1a1a !important;
}
.btn-secondary {
  background: var(--btn-pastel-secondary) !important;
  border-color: var(--btn-pastel-secondary-border) !important;
  color: #2d2d2d !important;
}
.btn-secondary:hover {
  background: var(--btn-pastel-secondary-hover) !important;
  border-color: var(--btn-pastel-secondary-border) !important;
  color: #1a1a1a !important;
}
.btn-success {
  background: var(--btn-pastel-success) !important;
  border-color: var(--btn-pastel-success-border) !important;
  color: #1a3d2e !important;
}
.btn-success:hover {
  background: var(--btn-pastel-success-hover) !important;
  border-color: var(--btn-pastel-success-border) !important;
  color: #0f261c !important;
}
.btn-warning {
  background: var(--btn-pastel-warning) !important;
  border-color: var(--btn-pastel-warning-border) !important;
  color: #5c4a1a !important;
}
.btn-warning:hover {
  background: var(--btn-pastel-warning-hover) !important;
  border-color: var(--btn-pastel-warning-border) !important;
  color: #3d3212 !important;
}
.btn-danger {
  background: var(--btn-pastel-danger) !important;
  border-color: var(--btn-pastel-danger-border) !important;
  color: #5c2525 !important;
}
.btn-danger:hover {
  background: var(--btn-pastel-danger-hover) !important;
  border-color: var(--btn-pastel-danger-border) !important;
  color: #3d1919 !important;
}
.btn-info {
  background: var(--btn-pastel-info) !important;
  border-color: var(--btn-pastel-info-border) !important;
  color: #1a3547 !important;
}
.btn-info:hover {
  background: var(--btn-pastel-info-hover) !important;
  border-color: var(--btn-pastel-info-border) !important;
  color: #0f2433 !important;
}

/* Outline pastel (same style, transparent fill, pastel border) */
.btn-outline-primary {
  background: transparent !important;
  border-color: var(--btn-pastel-primary-border) !important;
  color: #6b4d6b !important;
}
.btn-outline-primary:hover {
  background: rgba(212, 165, 232, 0.2) !important;
  border-color: var(--btn-pastel-primary-border) !important;
  color: #4a354a !important;
}
.btn-outline-secondary {
  background: transparent !important;
  border-color: var(--btn-pastel-secondary-border) !important;
  color: #4a5568 !important;
}
.btn-outline-secondary:hover {
  background: rgba(168, 184, 204, 0.25) !important;
  border-color: var(--btn-pastel-secondary-border) !important;
  color: #2d3748 !important;
}
.btn-outline-success {
  background: transparent !important;
  border-color: var(--btn-pastel-success-border) !important;
  color: #2d6b4f !important;
}
.btn-outline-success:hover {
  background: rgba(136, 212, 171, 0.25) !important;
  border-color: var(--btn-pastel-success-border) !important;
  color: #1a3d2e !important;
}
.btn-outline-warning {
  background: transparent !important;
  border-color: var(--btn-pastel-warning-border) !important;
  color: #8b6914 !important;
}
.btn-outline-warning:hover {
  background: rgba(255, 216, 155, 0.35) !important;
  border-color: var(--btn-pastel-warning-border) !important;
  color: #5c4a1a !important;
}
.btn-outline-danger {
  background: transparent !important;
  border-color: var(--btn-pastel-danger-border) !important;
  color: #8b4545 !important;
}
.btn-outline-danger:hover {
  background: rgba(232, 160, 160, 0.3) !important;
  border-color: var(--btn-pastel-danger-border) !important;
  color: #5c2525 !important;
}
.btn-outline-info {
  background: transparent !important;
  border-color: var(--btn-pastel-info-border) !important;
  color: #2d5a7b !important;
}
.btn-outline-info:hover {
  background: rgba(155, 196, 224, 0.25) !important;
  border-color: var(--btn-pastel-info-border) !important;
  color: #1a3547 !important;
}

/* Header staff: keep white outline buttons on gradient header (override pastel) */
.head-main--staff .btn-outline-secondary {
  border-color: rgba(255, 255, 255, 0.6) !important;
  color: #fff !important;
  background: transparent !important;
}
.head-main--staff .btn-outline-secondary:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  border-color: #fff !important;
  color: #fff !important;
}
.head-main--staff .btn-outline-danger {
  border-color: rgba(255, 255, 255, 0.7) !important;
  color: #fff !important;
  background: transparent !important;
}
.head-main--staff .btn-outline-danger:hover {
  background: rgba(255, 255, 255, 0.25) !important;
  border-color: #fff !important;
  color: #fff !important;
}

/* Footer nav: same family (shape + font), keep brand colors for WA/email/IG */
.portal-body .portal-footer .btn-whatsapp,
.portal-body .portal-footer .btn-email,
.portal-body .portal-footer .btn-instagram {
  font-family: var(--heading-font);
  font-weight: 600;
  border-radius: 8px;
  border: 2px solid transparent;
  padding: 0.45rem 0.85rem;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.portal-body .portal-footer .btn-whatsapp:hover,
.portal-body .portal-footer .btn-email:hover,
.portal-body .portal-footer .btn-instagram:hover {
  transform: translateY(-1px);
}
.portal-body .portal-footer .btn-footer-dropdown {
  font-family: var(--heading-font);
  font-weight: 600;
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
}

/* Botón flotante PEC (estilo WhatsApp) */
.chat-float-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1001;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  background: var(--body-bg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-float-btn img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.chat-float-btn:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Panel de chat flotante */
.chat-float-panel {
  position: fixed;
  bottom: 90px;
  right: 24px;
  z-index: 1000;
  width: 340px;
  max-height: 400px;
  background: var(--body-bg);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-header);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.chat-float-panel.is-open {
  display: flex;
}

.chat-float-panel .panel-header {
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, var(--accent-lilac) 0%, var(--accent-fuchsia) 100%);
  color: #fff;
  border-bottom: 1px solid var(--accent-lilac);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-float-panel .panel-header .panel-title {
  font-family: var(--heading-font);
  font-weight: var(--title-font-weight);
  font-size: var(--font-big);
  margin: 0;
  color: #fff;
}

/* Títulos de grupo (banners arcoíris): texto oscuro sobre fondo pastel */
h2.runner-group__header-title,
.runner-group__header-title,
.runner-group__header-title-wrap {
  font-family: var(--heading-font) !important;
  font-weight: var(--title-font-weight) !important;
  font-size: var(--font-big) !important;
  margin: 0 !important;
  color: #1a1a1a !important;
  -webkit-text-fill-color: #1a1a1a !important;
  opacity: 1 !important;
  background: none !important;
  background-clip: unset !important;
}
.runner-group__header-title,
h2.runner-group__header-title {
  margin: 0 0 0.25rem 0 !important;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(255,255,255,0.8);
}

/* Títulos de cards: texto oscuro sobre fondo blanco→#D49BE8 */
.workflow-card .card-header .card-title,
.workflow-card .card-header h2.card-title {
  font-family: var(--heading-font) !important;
  font-weight: var(--title-font-weight) !important;
  font-size: var(--font-big) !important;
  margin: 0 !important;
  color: #333 !important;
  -webkit-text-fill-color: #333 !important;
  letter-spacing: 0.01em;
}

/* Panel cuerpo: espacioso, estilos tienda PEC */
.chat-float-panel .panel-body.chat-panel-body {
  padding: 1.25rem 1.25rem 1rem;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-family: var(--body-font);
}

.chat-float-panel .chat-intro {
  font-size: var(--font-small);
  margin: 0 0 0.25rem 0;
  line-height: 1.4;
}

.chat-float-panel .chat-messages,
.chat-float-panel #agentMessages {
  max-height: 280px;
  min-height: 120px;
  overflow-y: auto;
  flex-shrink: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.25rem 0;
}

/* Asistente Marketing: input siempre visible, área de mensajes con scroll */
.chat-float-panel--marketing .panel-body.chat-panel-body--marketing {
  padding: 0.75rem 1rem 1rem;
  gap: 0;
  min-height: 0;
}
.chat-float-panel--marketing .chat-marketing-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.25rem;
  margin-bottom: 0.5rem;
}
.chat-float-panel--marketing .chat-marketing-scroll #agentMessages {
  max-height: none;
  min-height: 80px;
}
.chat-float-panel--marketing .chat-marketing-input-zone {
  flex-shrink: 0;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(155, 126, 189, 0.2);
  background: #fff;
}
.chat-float-panel--marketing .chat-input-wrap {
  flex-wrap: nowrap;
}
.chat-float-panel--marketing .chat-input-wrap .form-control {
  min-width: 0;
}
@media (max-width: 480px) {
  .chat-float-panel--marketing {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: none !important;
    bottom: 0 !important;
    top: 0 !important;
    max-height: none !important;
    height: 100dvh !important;
    height: 100vh !important;
    border-radius: 0 !important;
    padding-bottom: env(safe-area-inset-bottom, 0) !important;
  }
  .chat-float-panel--marketing .panel-header {
    padding: 0.5rem 0.75rem !important;
    flex-shrink: 0;
  }
  .chat-float-panel--marketing .panel-header .panel-title {
    font-size: 0.95rem !important;
  }
  .chat-float-panel--marketing .chat-usage-header {
    padding: 0.35rem 0 !important;
    margin-bottom: 0.35rem !important;
  }
  .chat-float-panel--marketing .chat-usage-header .progress {
    height: 4px !important;
  }
  .chat-float-panel--marketing .chat-intro {
    font-size: 0.75rem !important;
    margin-bottom: 0.5rem !important;
  }
  .chat-float-panel--marketing .chat-marketing-input-zone {
    padding: 0.5rem 0.75rem !important;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0)) !important;
    flex-shrink: 0;
  }
  .chat-float-panel--marketing .chat-input-wrap .form-control {
    font-size: 16px !important; /* avoids zoom on focus on iOS */
    min-height: 44px !important;
  }
  .chat-float-panel--marketing .btn-chat-send {
    padding: 0.5rem 0.75rem !important;
    min-height: 44px !important;
  }
}
/* When panel is open on mobile, hide the float button so it doesn't cover the input */
@media (max-width: 480px) {
  .chat-float-panel--marketing.is-open ~ .chat-float-btn--marketing {
    opacity: 0 !important;
    pointer-events: none !important;
  }
}

/* Burbujas de mensaje: lila/fucsia */
.chat-msg-wrap {
  display: flex;
  width: 100%;
}

.chat-msg-wrap.chat-msg-user {
  justify-content: flex-end;
}

.chat-msg-wrap.chat-msg-assistant {
  justify-content: flex-start;
}

.chat-msg {
  max-width: 88%;
  padding: 0.65rem 1rem;
  border-radius: 12px;
  font-size: var(--font-small);
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-msg-user-bubble {
  background: var(--accent-fuchsia);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-msg-assistant-bubble {
  background: var(--accent-lilac-light);
  color: var(--text-color);
  border: 1px solid rgba(155, 126, 189, 0.3);
  border-bottom-left-radius: 4px;
}

.chat-input-wrap {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--accent-lilac);
}

.chat-float-panel .btn-chat-send {
  background: var(--accent-fuchsia);
  color: #fff;
  border-color: var(--accent-fuchsia);
  font-weight: 600;
  padding: 0.5rem 1rem;
}

.chat-float-panel .btn-chat-send:hover {
  background: #c23a62;
  border-color: #c23a62;
  color: #fff;
}

/* Markdown beautify en mensajes del asistente */
.chat-msg-markdown .chat-md-h2 { font-size: 1em; font-weight: 700; margin: 0.5em 0 0.25em 0; }
.chat-msg-markdown .chat-md-h3 { font-size: 0.95em; font-weight: 700; margin: 0.5em 0 0.2em 0; }
.chat-msg-markdown .chat-md-h4 { font-size: 0.9em; font-weight: 700; margin: 0.4em 0 0.2em 0; }
.chat-msg-markdown .chat-md-ul { margin: 0.25em 0; padding-left: 1.2em; }
.chat-msg-markdown .chat-md-li { margin-bottom: 0.15em; }
.chat-msg-markdown .chat-md-code { background: rgba(0,0,0,0.08); padding: 0.1em 0.35em; border-radius: 4px; font-size: 0.9em; }
.chat-msg-markdown strong { font-weight: 700; }
.chat-msg-markdown em { font-style: italic; }
.chat-msg-markdown br { line-height: 1.3; }

/* Prompt IA: input de texto grande para pegar prompts */
.ai-prompt-input {
  min-height: 120px;
  font-family: var(--body-font);
  font-size: var(--font-small);
  resize: vertical;
  border-color: var(--accent-lilac);
}

.ai-prompt-input::placeholder {
  color: var(--gray-muted);
}

/* Listas con emoji visibles */
.list-emoji {
  list-style: none;
  padding-left: 1.25rem;
  margin-bottom: 0;
}
.list-emoji li {
  position: relative;
  padding-left: 0.15rem;
  margin-bottom: 0.25rem;
}
.list-emoji li::before {
  content: "🔹 ";
  position: absolute;
  left: -1.25rem;
}

/* ---------- Group banners: arcoíris, cápsula, sombras y estrellitas ---------- */
.runner-group {
  margin-bottom: 1.5rem;
  border: none;
  border-radius: 24px;
  overflow: visible;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.runner-group__header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  cursor: pointer;
  user-select: none;
  font-family: var(--heading-font);
  border: none;
  border-radius: 9999px;
  margin: 0 0.5rem;
  margin-bottom: 0.5rem;
  margin-top: 0.35rem;
  color: #1a1a1a;
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.25s ease, filter 0.25s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* Capa de fondo por grupo: el gradiente va aquí para que siempre se vea */
.runner-group__header-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
}

.runner-group__header-icon,
.runner-group__header-title-wrap,
.runner-group__header-chevron {
  position: relative;
  z-index: 1;
}

/* Estrellitas decorativas en el banner */
.runner-group__header::before,
.runner-group__header::after {
  content: "✦";
  position: absolute;
  font-size: 0.9rem;
  opacity: 0.5;
  pointer-events: none;
  animation: runnerStarTwinkle 2.5s ease-in-out infinite;
}
.runner-group__header::before {
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  animation-delay: 0s;
}
.runner-group__header::after {
  right: 3.25rem;
  top: 50%;
  transform: translateY(-50%);
  animation-delay: 1s;
}

.runner-group__header:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.08);
  filter: brightness(1.03);
}

/* 1. Validaciones – amarillo (arcoíris) */
.runner-group__header--validaciones .runner-group__header-bg {
  background: linear-gradient(135deg, #fef9c3 0%, #fef08a 35%, #fde047 70%, #facc15 100%);
  background-size: 200% 200%;
  animation: runnerBannerShimmer 8s ease-in-out infinite;
}
.runner-group__header--validaciones {
  box-shadow: 0 4px 14px rgba(250, 204, 21, 0.35), 0 2px 6px rgba(0, 0, 0, 0.06);
}
.runner-group__header--validaciones:hover {
  box-shadow: 0 8px 24px rgba(250, 204, 21, 0.4), 0 4px 10px rgba(0, 0, 0, 0.08);
}
.runner-group__header--validaciones .runner-group__header-list li::before { color: #b45309; }
.runner-group__header--validaciones .runner-group__header-chevron { color: #a16207; }

/* 2. Proveedor – naranja (arcoíris) */
.runner-group__header--proveedor .runner-group__header-bg {
  background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 35%, #fdba74 70%, #fb923c 100%);
  background-size: 200% 200%;
  animation: runnerBannerShimmer 8s ease-in-out infinite 0.5s;
}
.runner-group__header--proveedor {
  box-shadow: 0 4px 14px rgba(251, 146, 60, 0.35), 0 2px 6px rgba(0, 0, 0, 0.06);
}
.runner-group__header--proveedor:hover {
  box-shadow: 0 8px 24px rgba(251, 146, 60, 0.4), 0 4px 10px rgba(0, 0, 0, 0.08);
}
.runner-group__header--proveedor .runner-group__header-list li::before { color: #c2410c; }
.runner-group__header--proveedor .runner-group__header-chevron { color: #9a3412; }

/* 3. Preparación – rojizo (arcoíris) */
.runner-group__header--preparacion .runner-group__header-bg {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 35%, #f87171 70%, #ef4444 100%);
  background-size: 200% 200%;
  animation: runnerBannerShimmer 8s ease-in-out infinite 1s;
}
.runner-group__header--preparacion {
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3), 0 2px 6px rgba(0, 0, 0, 0.06);
}
.runner-group__header--preparacion:hover {
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.38), 0 4px 10px rgba(0, 0, 0, 0.08);
}
.runner-group__header--preparacion .runner-group__header-list li::before { color: #b91c1c; }
.runner-group__header--preparacion .runner-group__header-chevron { color: #991b1b; }

/* 4. TN acciones – verde (arcoíris) */
.runner-group__header--tn_acciones .runner-group__header-bg {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 35%, #86efac 70%, #22c55e 100%);
  background-size: 200% 200%;
  animation: runnerBannerShimmer 8s ease-in-out infinite 1.5s;
}
.runner-group__header--tn_acciones {
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.3), 0 2px 6px rgba(0, 0, 0, 0.06);
}
.runner-group__header--tn_acciones:hover {
  box-shadow: 0 8px 24px rgba(34, 197, 94, 0.38), 0 4px 10px rgba(0, 0, 0, 0.08);
}
.runner-group__header--tn_acciones .runner-group__header-list li::before { color: #15803d; }
.runner-group__header--tn_acciones .runner-group__header-chevron { color: #166534; }

/* 5. Pipeline – violeta (arcoíris) */
.runner-group__header--pipeline .runner-group__header-bg {
  background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 35%, #c084fc 70%, #a855f7 100%);
  background-size: 200% 200%;
  animation: runnerBannerShimmer 8s ease-in-out infinite 2s;
}
.runner-group__header--pipeline {
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.35), 0 2px 6px rgba(0, 0, 0, 0.06);
}
.runner-group__header--pipeline:hover {
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.4), 0 4px 10px rgba(0, 0, 0, 0.08);
}
.runner-group__header--pipeline .runner-group__header-list li::before { color: #6b21a8; }
.runner-group__header--pipeline .runner-group__header-chevron { color: #581c87; }

@keyframes runnerBannerShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes runnerStarTwinkle {
  0%, 100% { opacity: 0.4; transform: translateY(-50%) scale(1); }
  50% { opacity: 0.8; transform: translateY(-50%) scale(1.15); }
}

.runner-group__header-icon {
  font-size: 1.75rem;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
  position: relative;
  z-index: 1;
}

.runner-group__header-title-wrap {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.runner-group__header-list {
  list-style: none;
  padding: 0;
  margin: 0.2rem 0 0 0;
  font-size: var(--font-big);
  font-family: var(--heading-font);
  font-weight: var(--title-font-weight);
  color: #1a1a1a;
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
}

.runner-group__header-list li {
  display: inline;
  font-weight: var(--title-font-weight);
  color: inherit;
}

.runner-group__header-list li::before {
  content: "✦ ";
  font-size: 0.6rem;
  vertical-align: middle;
  margin-right: 0.15rem;
}

.runner-group__header-chevron {
  flex-shrink: 0;
  font-size: 0.85rem;
  transition: transform 0.25s ease;
  opacity: 0.95;
  position: relative;
  z-index: 1;
}

.runner-group.runner-group--collapsed .runner-group__header-chevron {
  transform: rotate(-90deg);
}

.runner-group__body {
  padding: 1rem 0.5rem 1rem;
  transition: max-height 0.3s ease-out;
}

.runner-group.runner-group--collapsed .runner-group__body {
  display: none;
}

/* ========== Banner principal: idéntico a .panel-header del chat (lila→fucsia, texto blanco) ========== */
.runner-panel-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--accent-lilac);
  box-shadow: 0 2px 8px rgba(155, 126, 189, 0.25);
  font-family: var(--heading-font);
}

/* Capa de fondo: gradiente fijo para que siempre se vea */
.runner-panel-header__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, #9B7EBD 0%, #D8446E 100%);
}

.runner-panel-header__icon,
.runner-panel-header__content,
.runner-panel-header__title,
.runner-panel-header__list,
.runner-panel-header__list li {
  position: relative;
  z-index: 1;
  color: #fff !important;
}

.runner-panel-header__icon {
  font-size: 1.75rem;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

.runner-panel-header__title {
  display: block;
  font-weight: var(--title-font-weight);
  font-size: var(--font-big);
  margin: 0 0 0.25rem 0;
  letter-spacing: 0.02em;
}

.runner-panel-header__list {
  list-style: none;
  padding: 0;
  margin: 0.25rem 0 0 0;
  font-size: var(--font-big);
  font-family: var(--heading-font);
  font-weight: var(--title-font-weight);
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
  color: #fff !important;
}

.runner-panel-header__list li {
  display: inline;
  color: #fff !important;
  -webkit-text-fill-color: #fff;
  font-weight: var(--title-font-weight);
}

.runner-panel-header__list li::before {
  content: "✦ ";
  color: rgba(255,255,255,0.95);
  font-size: 0.6rem;
  vertical-align: middle;
  margin-right: 0.15rem;
}

@keyframes runnerBannerPulse {
  0% {
    background-position: 0% 0;
    box-shadow: 0 1px 3px rgba(155, 126, 189, 0.08);
  }
  50% {
    background-position: 60% 0;
    box-shadow: 0 3px 10px rgba(155, 126, 189, 0.15);
  }
  100% {
    background-position: 100% 0;
    box-shadow: 0 2px 6px rgba(216, 68, 110, 0.12);
  }
}

/* Card: check icon top-left; grey = button to verify */
.workflow-card .card-header {
  position: relative;
  padding-left: 2.5rem;
}

.workflow-card .card-header .card-header__status {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  flex-shrink: 0;
}

.workflow-card .card-header .card-header__status.card-header__status--ok {
  background: rgba(0, 200, 123, 0.15);
  color: var(--accent-green);
  border: 1px solid var(--accent-green);
}

.workflow-card .card-header .card-header__status.card-header__status--pending {
  background: #f0f0f0;
  color: var(--gray-muted);
  border: 1px solid #dee2e6;
  cursor: pointer;
  font-size: 0.85rem;
}

.workflow-card .card-header .card-header__status.card-header__status--pending:hover {
  background: #e9ecef;
  color: var(--accent-lilac);
}

.workflow-card .card-header .min-width-0 {
  min-width: 0;
}

/* Cards grow with content (dynamic height) */
.workflow-card.workflow-card--dynamic {
  height: auto;
  min-height: 140px;
}

/* Main content area (runner layout) */
main.container-fluid {
  color: rgba(175, 83, 208, 1);
  border-radius: 10px;
  opacity: 0.8;
  border: 1px solid rgba(175, 83, 208, 1);
}

/* Runner dashboard layout - panel administrativo */
.runner-dashboard {
  background-color: #f0f2f5;
  padding: 1rem 0;
  min-height: 100%;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.runner-section-card {
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: none;
  overflow: hidden;
  margin-bottom: 1.5rem;
  background: #fff;
}

.runner-section-card__header {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1rem 1.25rem;
  color: #333 !important;
  cursor: pointer;
  user-select: none;
  transition: filter 0.2s ease;
  border: none !important;
  background: linear-gradient(90deg, rgba(240, 240, 240, 1) 0%, rgba(212, 155, 232, 1) 100%) !important;
  text-align: left;
  font: inherit;
  border-radius: 12px 12px 0 0;
}
.runner-section-card__header:hover {
  filter: brightness(1.08);
}
.runner-section-card__header-icon {
  font-size: 1.1em;
  line-height: 1;
  margin-right: 0.35rem;
  vertical-align: -0.1em;
}

.runner-section-card__header-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: none;
}

.runner-section-card__title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  color: #333 !important;
  border: none;
}

.runner-section-card__subtitle {
  font-size: 0.875rem;
  margin: 0.25rem 0 0 0;
  opacity: 0.85;
  color: #4c1d95 !important;
}

/* Chevron a la derecha, a la altura del título; icono SVG */
.runner-section-card__header-chevron {
  flex-shrink: 0;
  margin-left: auto;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.95;
  transition: transform 0.25s ease;
}
.runner-section-card__header-chevron .runner-chevron-icon {
  display: block;
  color: currentColor;
}
.runner-section-card__header[aria-expanded="false"] .runner-section-card__header-chevron {
  transform: rotate(-90deg);
}

/* Fondo lineal blanco → #D49BE8 en todos los section card headers; texto legible #333; sin borde */
.runner-section-card--validaciones .runner-section-card__header { background: linear-gradient(90deg, rgba(240, 240, 240, 1) 0%, rgba(212, 155, 232, 1) 100%) !important; color: #333 !important; border: none !important; }
.runner-section-card--validaciones .runner-section-card__body { background: #fefce8; }

.runner-section-card--proveedor .runner-section-card__header { background: linear-gradient(90deg, rgba(240, 240, 240, 1) 0%, rgba(212, 155, 232, 1) 100%) !important; color: #333 !important; border: none !important; }
.runner-section-card--proveedor .runner-section-card__body { background: #fff7ed; }

.runner-section-card--preparacion .runner-section-card__header { background: linear-gradient(90deg, rgba(240, 240, 240, 1) 0%, rgba(212, 155, 232, 1) 100%) !important; color: #333 !important; border: none !important; }
.runner-section-card--preparacion .runner-section-card__body { background: #fef2f2; }

.runner-section-card--tn_acciones .runner-section-card__header { background: linear-gradient(90deg, rgba(240, 240, 240, 1) 0%, rgba(212, 155, 232, 1) 100%) !important; color: #333 !important; border: none !important; }
.runner-section-card--tn_acciones .runner-section-card__body { background: #f0fdf4; }

.runner-section-card--pipeline .runner-section-card__header { background: linear-gradient(90deg, rgba(240, 240, 240, 1) 0%, rgba(212, 155, 232, 1) 100%) !important; color: #333 !important; border: none !important; }
.runner-section-card--pipeline .runner-section-card__body { background: #faf5ff; }

.runner-section-card--panel .runner-section-card__header {
  background: linear-gradient(90deg, rgba(240, 240, 240, 1) 0%, rgba(212, 155, 232, 1) 100%) !important;
  color: #333 !important;
  border: none !important;
}
.runner-section-card--panel .runner-section-card__header-text,
.runner-section-card--panel .runner-section-card__title {
  border: none !important;
}
.runner-section-card--panel .runner-section-card__body {
  background: #fdf2f8;
}

.runner-section-card:not([class*="runner-section-card--"]) .runner-section-card__header {
  background: linear-gradient(90deg, rgba(240, 240, 240, 1) 0%, rgba(212, 155, 232, 1) 100%) !important;
  color: #333 !important;
  border: none !important;
}
.runner-section-card:not([class*="runner-section-card--"]) .runner-section-card__body {
  background: #f8f6fb;
}

.runner-section-card__body {
  padding: 20px;
}

