/**
 * IntelligentID - Aka Copiloto IA 360°
 * Estilos modernos para el asistente de IA con soporte Glassmorphism y temas Claro / Oscuro
 */

:root {
  --aka-bg-user: var(--ds-primary, #0284c7);
  --aka-bg-user-text: #ffffff;
  --aka-bg-bot: rgba(248, 250, 252, 0.98);
  --aka-bg-bot-text: #0f172a;
  --aka-border-bot: rgba(226, 232, 240, 0.95);
  --aka-card-proposal-bg: rgba(254, 243, 199, 0.65);
  --aka-card-proposal-border: #f59e0b;
}

[data-bs-theme="dark"] {
  --aka-bg-bot: #1e293b;
  --aka-bg-bot-text: #f8fafc;
  --aka-border-bot: rgba(56, 189, 248, 0.22);
  --aka-card-proposal-bg: rgba(120, 53, 15, 0.3);
  --aka-card-proposal-border: #d97706;
}

/* ══════════════════════════════════════════════════════════════════
   OFFCANVAS / DRAWER EXPANDIDO Y CABECERA
   ══════════════════════════════════════════════════════════════════ */
.drawer-help-offcanvas {
  width: 530px !important;
  max-width: 95vw !important;
}

.drawer-help-header {
  background: linear-gradient(135deg, #0369a1 0%, #0284c7 60%, #0ea5e9 100%) !important;
  color: #ffffff !important;
  padding: 10px 16px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.aka-avatar-wrap {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(2, 132, 199, 0.35);
}

.aka-pulse-ring {
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: 50%;
  border: 2px solid rgba(56, 189, 248, 0.7);
  animation: akaPulse 2.5s infinite;
}

@keyframes akaPulse {
  0% { transform: scale(0.95); opacity: 0.85; }
  50% { transform: scale(1.08); opacity: 0.2; }
  100% { transform: scale(0.95); opacity: 0.85; }
}

/* ══════════════════════════════════════════════════════════════════
   ROBOT AVATAR CON MUECAS DINÁMICAS (FACE EXPRESSIONS)
   ══════════════════════════════════════════════════════════════════ */
.aka-robot-face {
  width: 30px;
  height: 30px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  -webkit-user-select: none;
  user-select: none;
}

.aka-rf-antenna {
  width: 2px;
  height: 4px;
  background: #cbd5e1;
  position: relative;
  margin-bottom: -1px;
}

.aka-rf-signal {
  position: absolute;
  top: -4px;
  left: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 6px #38bdf8;
  transition: all 0.2s ease;
}

.aka-rf-head {
  width: 26px;
  height: 22px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border: 1.5px solid #38bdf8;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.35);
  transition: all 0.25s ease;
}

.aka-rf-screen {
  width: 20px;
  height: 15px;
  background: #0f172a;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  padding: 1px 2px;
  overflow: hidden;
  position: relative;
}

.aka-rf-eyes {
  display: flex;
  justify-content: space-between;
  width: 14px;
  transition: transform 0.2s ease;
}

.aka-rf-eye {
  width: 4px;
  height: 4px;
  background: #38bdf8;
  border-radius: 50%;
  box-shadow: 0 0 4px #38bdf8;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.aka-rf-mouth {
  width: 6px;
  height: 1.5px;
  background: #38bdf8;
  border-radius: 2px;
  transition: all 0.2s ease;
}

/* MUECA 1: PENSAR (Cabeza inclinada, ojos mirando arriba-izquierda, boca redonda) */
.aka-mueca-pensar {
  transform: rotate(-10deg) translateY(-1px);
}
.aka-mueca-pensar .aka-rf-signal {
  background: #fbbf24;
  box-shadow: 0 0 8px #fbbf24;
  animation: akaBlinkLed 0.5s infinite alternate;
}
.aka-mueca-pensar .aka-rf-eyes {
  transform: translate(-2px, -1px);
}
.aka-mueca-pensar .aka-rf-mouth {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fbbf24;
}

/* MUECA 2: MIRAR IZQUIERDA */
.aka-mueca-mirar-izq {
  transform: rotate(-6deg) translateX(-2px);
}
.aka-mueca-mirar-izq .aka-rf-eyes {
  transform: translateX(-3px);
}
.aka-mueca-mirar-izq .aka-rf-mouth {
  width: 5px;
  transform: translateX(-1px);
}

/* MUECA 3: MIRAR DERECHA */
.aka-mueca-mirar-der {
  transform: rotate(6deg) translateX(2px);
}
.aka-mueca-mirar-der .aka-rf-eyes {
  transform: translateX(3px);
}
.aka-mueca-mirar-der .aka-rf-mouth {
  width: 5px;
  transform: translateX(1px);
}

/* MUECA 4: ESCANEO LÁSER (Ojos en barrido) */
.aka-mueca-escaneo .aka-rf-head {
  border-color: #a855f7;
}
.aka-mueca-escaneo .aka-rf-signal {
  background: #a855f7;
  box-shadow: 0 0 8px #a855f7;
}
.aka-mueca-escaneo .aka-rf-screen::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: rgba(168, 85, 247, 0.85);
  box-shadow: 0 0 6px #a855f7;
  animation: akaLaserScan 0.7s infinite alternate ease-in-out;
}
@keyframes akaLaserScan {
  0% { left: 0%; }
  100% { left: 85%; }
}

/* MUECA 5: GUIÑO PICARO ;) */
.aka-mueca-guiño {
  transform: rotate(8deg);
}
.aka-mueca-guiño .aka-rf-eye.eye-right {
  height: 1.5px;
  border-radius: 1px;
  transform: translateY(1px);
}
.aka-mueca-guiño .aka-rf-eye.eye-left {
  transform: scale(1.2);
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
}
.aka-mueca-guiño .aka-rf-mouth {
  width: 7px;
  height: 3px;
  background: transparent;
  border-bottom: 2px solid #22c55e;
  border-radius: 0 0 4px 4px;
}

/* MUECA 6: EUREKA / IDEA (Ojos amarillos brillantes, antena iluminada) */
.aka-mueca-eureka {
  transform: scale(1.1) translateY(-2px);
  animation: akaEurekaWiggle 0.4s ease;
}
.aka-mueca-eureka .aka-rf-signal {
  background: #f59e0b;
  box-shadow: 0 0 12px #f59e0b;
  transform: scale(1.3);
}
.aka-mueca-eureka .aka-rf-eye {
  background: #fbbf24;
  box-shadow: 0 0 6px #fbbf24;
  transform: scale(1.25);
}
.aka-mueca-eureka .aka-rf-mouth {
  width: 8px;
  height: 3.5px;
  background: transparent;
  border-bottom: 2px solid #fbbf24;
  border-radius: 0 0 5px 5px;
}

/* MUECA 7: FELIZ / SONRISA */
.aka-mueca-feliz .aka-rf-eye {
  height: 2px;
  border-radius: 2px 2px 0 0;
  border-top: 2px solid #38bdf8;
  background: transparent;
}
.aka-mueca-feliz .aka-rf-mouth {
  width: 8px;
  height: 3px;
  background: transparent;
  border-bottom: 2px solid #38bdf8;
  border-radius: 0 0 4px 4px;
}

@keyframes akaBlinkLed {
  0% { opacity: 0.3; }
  100% { opacity: 1; }
}

@keyframes akaEurekaWiggle {
  0%, 100% { transform: scale(1.1) translateY(-2px) rotate(0deg); }
  25% { transform: scale(1.1) translateY(-2px) rotate(-6deg); }
  75% { transform: scale(1.1) translateY(-2px) rotate(6deg); }
}

/* ══════════════════════════════════════════════════════════════════
   CARITA SVG ANIMADA SOFTY (EXPRESIONES Y REACCIONES FEMENINAS DINÁMICAS)
   ══════════════════════════════════════════════════════════════════ */
.aka-face-wrap-bot,
.aka-header-face {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  -webkit-user-select: none;
  user-select: none;
}

.aka-cute-face,
.aka-header-face {
  display: block;
  width: 28px;
  height: 28px;
  overflow: visible;
}

/* Accesorio Femenino Softy (Moñito con física y rebote) */
.softy-accessory {
  transform-origin: 26.5px 6px;
  transform-box: fill-box;
  animation: softyAccessorySway 6.5s infinite ease-in-out;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Mejillas con sonrojo reactivo */
.softy-blush {
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Pestañas femeninas */
.softy-eyelashes {
  transform-origin: 18px 14px;
  transform-box: fill-box;
  transition: transform 0.2s ease;
}

.softy-lash {
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* 1. Reacción cuando el usuario escribe en el chat (Typing Reaction - Atenta y curiosa) */
.aka-face-state-typing .fh-thinking-face,
#akaHeaderFaceWrap.aka-face-state-typing .fh-thinking-face {
  transform: scale(1.1) translateY(1.5px);
  transition: transform 0.2s ease;
}
.aka-face-state-typing .fh-brows-group,
#akaHeaderFaceWrap.aka-face-state-typing .fh-brows-group {
  transform: translateY(-2.2px) !important;
  transition: transform 0.2s ease;
}
.aka-face-state-typing .fh-pupils-group,
#akaHeaderFaceWrap.aka-face-state-typing .fh-pupils-group {
  animation: none !important;
  transform: translateY(2.2px) scale(0.96) !important; /* Mirando atentamente al input */
  transition: transform 0.2s ease;
}
.aka-face-state-typing .softy-blush,
#akaHeaderFaceWrap.aka-face-state-typing .softy-blush {
  opacity: 0.65 !important;
  transform: scale(1.1);
}
.aka-face-state-typing .fh-mouth-thinking,
#akaHeaderFaceWrap.aka-face-state-typing .fh-mouth-thinking {
  display: none !important;
}
.aka-face-state-typing .fh-mouth-happy,
#akaHeaderFaceWrap.aka-face-state-typing .fh-mouth-happy {
  display: block !important;
}

/* 2. Pensando / Analizando solicitud */
.aka-face-state-pensar .fh-thinking-face {
  animation: softyFaceSway 2.4s infinite ease-in-out;
}
.aka-face-state-pensar .softy-accessory {
  animation: softyAccessorySway 2.4s infinite ease-in-out;
}
.aka-face-state-pensar .fh-pupils-group {
  animation: fhPupilsThinking 2.8s infinite ease-in-out !important;
}

/* 3. Mirar a la izquierda (Revisando contexto clínico) */
.aka-face-state-mirar-izq .fh-thinking-face {
  transform: rotate(-6deg) translateY(-0.5px);
}
.aka-face-state-mirar-izq .fh-pupils-group {
  animation: none !important;
  transform: translate(-3px, -0.5px) !important;
}

/* 4. Mirar a la derecha (Cotejando coberturas / profesionales) */
.aka-face-state-mirar-der .fh-thinking-face {
  transform: rotate(6deg) translateY(-0.5px);
}
.aka-face-state-mirar-der .fh-pupils-group {
  animation: none !important;
  transform: translate(3px, -0.5px) !important;
}

/* 5. Escaneo activo */
.aka-face-state-escaneo .fh-pupils-group {
  animation: akaPupilsScan 0.8s infinite alternate ease-in-out !important;
}
@keyframes akaPupilsScan {
  0% { transform: translate(-3px, 1px); }
  50% { transform: translate(0, -2px); }
  100% { transform: translate(3px, 1px); }
}

/* 6. Eureka / Idea brillante (Rebote alegre y destello) */
.aka-face-state-eureka .fh-thinking-face {
  transform: scale(1.16) translateY(-2.5px);
}
.aka-face-state-eureka .softy-accessory {
  transform: scale(1.18) rotate(6deg);
}
.aka-face-state-eureka .softy-blush {
  opacity: 0.85 !important;
  transform: scale(1.22);
}
.aka-face-state-eureka .fh-brows-group {
  transform: translateY(-3.8px) !important;
}
.aka-face-state-eureka .fh-pupils-group {
  animation: none !important;
  transform: translateY(-1px) scale(1.12) !important;
}
.aka-face-state-eureka .fh-mouth-thinking {
  display: none !important;
}
.aka-face-state-eureka .fh-mouth-happy {
  display: block !important;
}

/* 7. Guiño cómplice y femenino ;) */
.aka-face-state-guiño .fh-thinking-face {
  transform: rotate(7deg) scale(1.08);
}
.aka-face-state-guiño .softy-accessory {
  transform: rotate(8deg) scale(1.12);
}
.aka-face-state-guiño .softy-blush.softy-blush-r {
  opacity: 0.88 !important;
  transform: scale(1.25);
}
.aka-face-state-guiño .fh-pupil-r {
  transform: scaleY(0.1) !important;
  transform-origin: 24.5px 16.5px;
}
.aka-face-state-guiño .softy-lash-r1,
.aka-face-state-guiño .softy-lash-r2 {
  transform: translateY(2.5px) scaleY(0.4);
}
.aka-face-state-guiño .fh-mouth-thinking {
  display: none !important;
}
.aka-face-state-guiño .fh-mouth-happy {
  display: block !important;
}

/* 8. Feliz / Respuesta lista (Sonrisa y mejillas cálidas) */
.aka-face-state-feliz .softy-blush {
  opacity: 0.72 !important;
  transform: scale(1.12);
}
.aka-face-state-feliz .fh-mouth-thinking {
  display: none !important;
}
.aka-face-state-feliz .fh-mouth-happy {
  display: block !important;
}

@keyframes softyFaceSway {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  25% { transform: rotate(-4.5deg) translateY(-1.2px); }
  75% { transform: rotate(4.5deg) translateY(-1.2px); }
}

/* Botón directo en la cabecera para alternar a la Guía Manual */
.aka-header-mode-toggle {
  background: rgba(15, 23, 42, 0.4) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  font-size: 0.76rem !important;
  padding: 0.25rem 0.65rem !important;
  border-radius: 9999px !important;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.aka-header-mode-toggle:hover {
  background: rgba(15, 23, 42, 0.7) !important;
  border-color: #fbbf24 !important;
  color: #fbbf24 !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

/* Envoltorio y píldora de créditos de alto contraste */
.aka-credits-badge-wrap {
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.45) !important;
  border: 1px solid rgba(251, 191, 36, 0.4) !important;
  border-radius: 9999px;
  padding: 2px 3px 2px 8px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.aka-credits-pill {
  font-size: 0.75rem;
  font-weight: 700;
  color: #fbbf24 !important;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-right: 5px;
  background: transparent !important;
  border: none !important;
}

.aka-credits-pill .bi-coin {
  filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.6));
}

.aka-btn-recharge {
  font-size: 0.7rem !important;
  padding: 0.15rem 0.55rem !important;
  border-radius: 9999px !important;
  line-height: 1.3 !important;
  font-weight: 700 !important;
  background: #f59e0b !important;
  border: none !important;
  color: #0f172a !important;
  transition: all 0.2s ease;
}

.aka-btn-recharge:hover {
  background: #fbbf24 !important;
  transform: scale(1.05);
}

/* ══════════════════════════════════════════════════════════════════
   BARRA DE PESTAÑAS SEGMENTADAS (SEGMENTED CONTROL)
   ══════════════════════════════════════════════════════════════════ */
.aka-tab-bar-container {
  background: var(--bs-body-bg);
  border-bottom: 1px solid var(--bs-border-color);
  padding: 8px 12px;
}

.aka-segmented-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  padding: 3px;
  gap: 4px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

[data-bs-theme="dark"] .aka-segmented-tabs {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

.aka-seg-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 7px 12px;
  border-radius: 9px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--bs-secondary-color, #64748b);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.aka-seg-btn:hover:not(.active) {
  background: rgba(0, 0, 0, 0.04);
  color: var(--bs-body-color, #0f172a);
}

[data-bs-theme="dark"] .aka-seg-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
}

.aka-seg-btn.active {
  background: var(--bs-body-bg, #ffffff);
  color: var(--bs-body-color, #0f172a);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  font-weight: 700;
}

[data-bs-theme="dark"] .aka-seg-btn.active {
  background: #1e293b;
  color: #38bdf8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(56, 189, 248, 0.2);
}

/* ══════════════════════════════════════════════════════════════════
   STREAM DE CHAT Y MENSAJES
   ══════════════════════════════════════════════════════════════════ */
.aka-chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.aka-chat-stream {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1.15rem 1rem;
  scroll-behavior: smooth;
  scrollbar-width: thin;
}

.aka-chat-stream::-webkit-scrollbar {
  width: 6px;
}

.aka-msg {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.15rem;
  animation: akaFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes akaFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.aka-msg-user {
  flex-direction: row-reverse;
}

.aka-msg-bubble {
  max-width: 86%;
  padding: 0.85rem 1.05rem;
  border-radius: 18px;
  font-size: 0.88rem;
  line-height: 1.48;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  word-break: break-word;
}

.aka-msg-user .aka-msg-bubble {
  background: linear-gradient(135deg, var(--ds-primary, #0284c7), #0369a1);
  color: var(--aka-bg-user-text);
  border-bottom-right-radius: 4px;
}

.aka-msg-bot .aka-msg-bubble {
  background: var(--aka-bg-bot);
  color: var(--aka-bg-bot-text);
  border: 1px solid var(--aka-border-bot);
  border-bottom-left-radius: 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

[data-bs-theme="dark"] .aka-msg-bot .aka-msg-bubble {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.aka-msg-meta {
  font-size: 0.7rem;
  opacity: 0.7;
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* ══════════════════════════════════════════════════════════════════
   TARJETA DE CONFIRMACIÓN INTERACTIVA (HUMAN-IN-THE-LOOP)
   ══════════════════════════════════════════════════════════════════ */
.aka-proposal-card {
  margin-top: 0.75rem;
  background: var(--aka-card-proposal-bg);
  border: 1.5px solid var(--aka-card-proposal-border);
  border-radius: 12px;
  padding: 0.85rem;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.12);
  transition: all 0.25s ease;
}

.aka-proposal-card.executed {
  background: rgba(34, 197, 94, 0.14);
  border-color: #22c55e;
}

.aka-proposal-card.undone {
  background: rgba(148, 163, 184, 0.15);
  border-color: #94a3b8;
  opacity: 0.8;
}

.aka-param-tag {
  display: inline-block;
  background: rgba(0, 0, 0, 0.06);
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 500;
  margin-right: 0.3rem;
  margin-bottom: 0.3rem;
}

[data-bs-theme="dark"] .aka-param-tag {
  background: rgba(255, 255, 255, 0.08);
}

/* ══════════════════════════════════════════════════════════════════
   CALENDARIO PROYECTADO INTERACTIVO DENTRO DE LA TARJETA
   ══════════════════════════════════════════════════════════════════ */
.aka-calendar-widget {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 10px;
  padding: 0.75rem;
  margin-top: 0.5rem;
}

[data-bs-theme="light"] .aka-calendar-widget {
  background: rgba(248, 250, 252, 0.95);
  border-color: rgba(2, 132, 199, 0.2);
}

.aka-cal-header-row {
  margin-bottom: 0.5rem;
}

.aka-weekdays-chips {
  display: flex;
  justify-content: space-between;
  gap: 3px;
}

.aka-weekday-pill {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3px 2px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 0.72rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

[data-bs-theme="dark"] .aka-weekday-pill {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

.aka-weekday-pill.is-active {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.25), rgba(14, 165, 233, 0.45));
  border-color: #0284c7;
  color: #38bdf8;
  box-shadow: 0 0 6px rgba(2, 132, 199, 0.3);
}

[data-bs-theme="light"] .aka-weekday-pill.is-active {
  color: #0369a1;
  border-color: #0284c7;
  background: rgba(2, 132, 199, 0.12);
}

.aka-wp-name {
  font-size: 0.68rem;
  font-weight: 700;
}

.aka-wp-icon {
  font-size: 0.7rem;
  margin-top: 1px;
}

.aka-cal-time-strip {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.76rem;
}

[data-bs-theme="dark"] .aka-cal-time-strip {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

.aka-cal-nav-bar {
  padding: 2px 0;
}

.aka-cal-nav-btn {
  padding: 1px 7px !important;
  font-size: 0.72rem !important;
  border-radius: 5px !important;
  background: rgba(148, 163, 184, 0.15) !important;
  border: 1px solid rgba(148, 163, 184, 0.25) !important;
  color: inherit !important;
}

.aka-cal-nav-btn:hover {
  background: rgba(2, 132, 199, 0.25) !important;
  border-color: #0284c7 !important;
}

.aka-cal-month-title {
  font-size: 0.8rem;
  letter-spacing: 0.3px;
}

.aka-cal-table-wrap {
  width: 100%;
}

.aka-cal-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 2px;
  table-layout: fixed;
}

.aka-cal-table th {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--bs-secondary-color);
  text-align: center;
  padding: 1px 0;
}

.aka-cal-day {
  height: 28px;
  vertical-align: middle;
  text-align: center;
  border-radius: 6px;
  padding: 0;
  position: relative;
  transition: all 0.15s ease;
}

.aka-cal-cell-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
}

.aka-cal-day-num {
  font-size: 0.72rem;
  line-height: 1;
}

.aka-cal-day.aka-cal-active {
  background: #0284c7;
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(2, 132, 199, 0.4);
}

.aka-cal-day.aka-cal-active:hover {
  background: #0369a1;
  transform: scale(1.08);
}

.aka-cal-day.aka-cal-today {
  outline: 2px solid #f59e0b;
  outline-offset: -1px;
}

.aka-cal-day.aka-cal-inactive {
  background: rgba(0, 0, 0, 0.03);
  color: var(--bs-secondary-color);
  opacity: 0.55;
}

[data-bs-theme="dark"] .aka-cal-day.aka-cal-inactive {
  background: rgba(255, 255, 255, 0.03);
}

.aka-cal-day.aka-cal-empty {
  background: transparent;
}

.aka-cal-dot {
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #facc15;
  margin-top: 1px;
}

.aka-cal-metrics-row {
  margin-top: 0.45rem;
}

.aka-cal-metric-box {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 6px;
  padding: 3px 2px;
}

[data-bs-theme="dark"] .aka-cal-metric-box {
  background: rgba(255, 255, 255, 0.04);
}

.aka-cal-m-num {
  display: block;
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1.15;
}

.aka-cal-m-lbl {
  display: block;
  font-size: 0.62rem;
  color: var(--bs-secondary-color);
  text-transform: uppercase;
}

.aka-btn-open-editor {
  font-size: 0.72rem !important;
  padding: 3px 8px !important;
  border: 1px dashed rgba(2, 132, 199, 0.5) !important;
  color: var(--ds-primary, #0284c7) !important;
  background: transparent !important;
  border-radius: 6px !important;
  transition: all 0.2s ease !important;
}

.aka-btn-open-editor:hover {
  background: rgba(2, 132, 199, 0.1) !important;
  border-color: #0284c7 !important;
}

/* ══════════════════════════════════════════════════════════════════
   QUICK PROMPTS PILLS (MULTI-ROW WRAP, SIN TEXTO CORTADO NI FLECHAS INVASIVAS)
   ══════════════════════════════════════════════════════════════════ */
.aka-quick-prompts-container {
  position: relative;
  background: var(--bs-body-bg);
  border-top: 1px solid var(--bs-border-color);
  padding: 8px 12px 6px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.aka-quick-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 2px;
}

.aka-quick-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--bs-secondary-color, #64748b);
  display: inline-flex;
  align-items: center;
}

.aka-toggle-pills {
  border: none;
  background: transparent;
  color: var(--bs-secondary-color, #64748b);
  padding: 2px 4px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
  line-height: 1;
}

.aka-toggle-pills:hover {
  color: var(--ds-primary, #0284c7);
  background: rgba(2, 132, 199, 0.08);
}

.aka-quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  max-height: 140px;
  overflow-y: auto;
  padding: 2px 2px 4px 2px;
  transition: max-height 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
  scrollbar-width: thin;
}

.aka-quick-prompts.is-collapsed {
  max-height: 0 !important;
  opacity: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  pointer-events: none;
}

/* Ocultar flechas flotantes que tapaban texto de botones */
.aka-quick-nav-btn {
  display: none !important;
}

.aka-quick-pill {
  flex: 0 0 auto;
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid rgba(2, 132, 199, 0.22);
  color: var(--ds-primary, #0284c7);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.32rem 0.65rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-user-select: none;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

[data-bs-theme="dark"] .aka-quick-pill {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.25);
  color: #38bdf8;
}

.aka-quick-pill:hover {
  background: var(--ds-primary, #0284c7);
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(2, 132, 199, 0.25);
}

[data-bs-theme="dark"] .aka-quick-pill:hover {
  background: #38bdf8;
  color: #0f172a !important;
}

.aka-quick-pill-manual {
  background: rgba(245, 158, 11, 0.12) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
  color: #d97706 !important;
}

[data-bs-theme="dark"] .aka-quick-pill-manual {
  color: #fbbf24 !important;
}

.aka-quick-pill-manual:hover {
  background: #f59e0b !important;
  color: #0f172a !important;
}

/* ══════════════════════════════════════════════════════════════════
   INPUT DE CHAT FLOTANTE / INFERIOR (SIN SCROLLBAR NI RECORTE)
   ══════════════════════════════════════════════════════════════════ */
.aka-input-area {
  padding: 8px 12px 8px 12px;
  border-top: 1px solid var(--bs-border-color);
  background: var(--bs-body-bg);
}

.aka-input-group {
  display: flex;
  align-items: center;
  background: var(--bs-body-bg);
  border: 1.5px solid var(--bs-border-color);
  border-radius: 24px;
  padding: 3px 6px;
  gap: 4px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.aka-input-group:focus-within {
  border-color: var(--ds-primary, #0284c7);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.18);
}

.aka-input-box {
  flex: 1;
  resize: none;
  border: none !important;
  background: transparent !important;
  color: var(--bs-body-color) !important;
  font-size: 0.85rem;
  padding: 0.42rem 0.65rem;
  line-height: 1.35;
  min-height: 38px;
  max-height: 120px;
  outline: none !important;
  box-shadow: none !important;
  overflow-y: hidden; /* Evita scrollbar vertical cuando el texto es de 1 sola línea */
}

.aka-btn-attach {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--bs-secondary-color, #64748b);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.aka-btn-attach:hover {
  color: var(--ds-primary, #0284c7);
  background: rgba(2, 132, 199, 0.08);
}

.aka-btn-mic {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--bs-secondary-color, #64748b);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
  font-size: 1.05rem;
}

.aka-btn-mic:hover {
  color: var(--ds-primary, #0284c7);
  background: rgba(2, 132, 199, 0.08);
}

.aka-btn-mic.is-recording {
  color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.12) !important;
}

.aka-btn-mic.is-recording::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #ef4444;
  animation: akaMicPulse 1.2s infinite ease-out;
}

@keyframes akaMicPulse {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}

.aka-btn-send {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--ds-primary, #0284c7), #0369a1);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.28);
  padding: 0;
}

.aka-btn-send:hover:not(:disabled) {
  background: linear-gradient(135deg, #0284c7, #075985);
  transform: scale(1.08);
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.4);
}

.aka-btn-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Typing indicator con puntitos animados y frase */
.aka-typing-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 2px 4px;
}

.aka-typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ds-primary, #0284c7);
  box-shadow: 0 0 5px rgba(2, 132, 199, 0.5);
  animation: akaBlink 1.3s infinite ease-in-out both;
}

.aka-typing-dots span:nth-child(2) { animation-delay: 0.18s; }
.aka-typing-dots span:nth-child(3) { animation-delay: 0.36s; }

@keyframes akaBlink {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.75); }
  40% { opacity: 1; transform: scale(1.25); background: #38bdf8; }
}

.aka-thinking-bubble {
  min-width: 170px;
  padding: 9px 14px !important;
}

.aka-thinking-phrase {
  font-size: 0.76rem;
  letter-spacing: 0.2px;
  font-style: italic;
  color: var(--bs-secondary-color);
  animation: akaFadePhrase 0.3s ease;
  white-space: nowrap;
}

@keyframes akaFadePhrase {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════════════════
   AISLAMIENTO Y VISIBILIDAD DE PESTAÑAS
   ══════════════════════════════════════════════════════════════════ */
#drawerAyudaContextual .tab-pane {
  display: none !important;
}

#drawerAyudaContextual .tab-pane.active {
  display: block !important;
}

#drawerAyudaContextual #pane-aka-chat.active {
  display: block !important;
  height: 100% !important;
}

/* ══════════════════════════════════════════════════════════════════
   TARJETAS INTERACTIVAS DE PACIENTES EN EL CHAT (AKA IA)
   ══════════════════════════════════════════════════════════════════ */
.aka-pacientes-cards-grid {
  width: 100%;
}

.aka-paciente-card {
  background: var(--bs-body-bg, #ffffff);
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: 12px;
  padding: 10px 12px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.aka-paciente-card:hover {
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

[data-bs-theme="dark"] .aka-paciente-card {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .aka-paciente-card:hover {
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.aka-paciente-card .avatar-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(14, 165, 233, 0.12);
  color: #0284c7;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

[data-bs-theme="dark"] .aka-paciente-card .avatar-icon {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
}

.aka-paciente-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.btn-xs {
  padding: 3px 9px !important;
  font-size: 0.72rem !important;
  line-height: 1.35 !important;
}

/* ==========================================================================
   SOPORTE MULTIMODAL (IMÁGENES, ÓRDENES, RECETAS EN GEMINI 3.8 FLASH)
   ========================================================================== */

.aka-btn-attach {
  flex: 0 0 38px;
  width: 38px;
  border: none;
  background: transparent;
  color: var(--bs-secondary-color, #64748b);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 1.15rem;
}

.aka-btn-attach:hover {
  color: var(--ds-primary, #0284c7);
  background: rgba(2, 132, 199, 0.08);
}

.aka-btn-attach:active {
  transform: scale(0.92);
}

/* Contenedor de miniaturas pendientes de envío */
.aka-attachments-preview {
  max-height: 85px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px;
}

.aka-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.25);
  border-radius: 12px;
  padding: 3px 8px 3px 4px;
  font-size: 0.75rem;
  color: var(--bs-body-color);
  animation: akaFadeInUp 0.25s ease-out;
  position: relative;
}

[data-bs-theme="dark"] .aka-attachment-chip {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
}

.aka-attachment-chip img {
  width: 30px;
  height: 30px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.aka-attachment-chip .aka-attachment-name {
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.aka-attachment-chip .aka-attachment-size {
  font-size: 0.68rem;
  color: var(--bs-secondary-color);
}

.aka-attachment-chip .aka-attachment-remove {
  background: none;
  border: none;
  color: #ef4444;
  padding: 0 2px;
  font-size: 0.85rem;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  opacity: 0.75;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.aka-attachment-chip .aka-attachment-remove:hover {
  opacity: 1;
  transform: scale(1.2);
}

/* Efecto Drag and Drop sobre el panel de chat */
.aka-chat-dragover {
  border: 2px dashed var(--ds-primary, #0284c7) !important;
  background: rgba(14, 165, 233, 0.06) !important;
}

/* Grilla de imágenes en el mensaje del usuario */
.aka-user-images-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.aka-user-image-thumb {
  width: 70px;
  height: 70px;
  border-radius: 10px;
  object-fit: cover;
  cursor: pointer;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.aka-user-image-thumb:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Lightbox Modal para ver imágenes ampliadas en alta resolución */
.aka-image-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 10600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: akaFadeIn 0.2s ease-out;
}

.aka-image-lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  object-fit: contain;
}

.aka-image-lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #ffffff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.aka-image-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* ══════════════════════════════════════════════════════════════════
   SLASH COMMANDS AUTOCOMPLETE MENU (/)
   ══════════════════════════════════════════════════════════════════ */
.aka-slash-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 380px;
  overflow-y: auto;
  background: var(--aka-bg-bot, #ffffff);
  border: 1px solid var(--aka-border-bot, #e2e8f0);
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18), 0 3px 12px rgba(0, 0, 0, 0.08);
  z-index: 1055;
  padding: 6px;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  animation: akaSlashSlideUp 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes akaSlashSlideUp {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.aka-slash-header {
  padding: 6px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(226, 232, 240, 0.7);
  margin-bottom: 4px;
}

[data-bs-theme="dark"] .aka-slash-header {
  color: #94a3b8;
  border-bottom-color: rgba(51, 65, 85, 0.7);
}

.aka-slash-category-header {
  padding: 6px 10px 3px 10px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ds-primary, #0284c7);
  opacity: 0.95;
  display: flex;
  align-items: center;
  gap: 4px;
}

.aka-slash-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--aka-bg-bot-text, #0f172a);
}

.aka-slash-item:hover,
.aka-slash-item.active {
  background: rgba(2, 132, 199, 0.12);
  transform: translateX(2px);
}

[data-bs-theme="dark"] .aka-slash-item:hover,
[data-bs-theme="dark"] .aka-slash-item.active {
  background: rgba(56, 189, 248, 0.18);
}

.aka-slash-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  background: rgba(2, 132, 199, 0.08);
  flex-shrink: 0;
}

[data-bs-theme="dark"] .aka-slash-item-icon {
  background: rgba(255, 255, 255, 0.06);
}

.aka-slash-item-content {
  flex-grow: 1;
  min-width: 0;
}

.aka-slash-item-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.2;
}

.aka-slash-item-cmd {
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-weight: 700;
  color: var(--ds-primary, #0284c7);
  background: rgba(2, 132, 199, 0.1);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.78rem;
}

.aka-slash-item-desc {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-bs-theme="dark"] .aka-slash-item-desc {
  color: #94a3b8;
}

.aka-slash-empty {
  padding: 18px 12px;
  text-align: center;
  color: #64748b;
  font-size: 0.82rem;
}

/* ══════════════════════════════════════════════════════════════════
   TARJETA DE HISTORIAL DE CHARLAS (GRATIS)
   ══════════════════════════════════════════════════════════════════ */
.aka-history-card {
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.04);
  padding: 12px;
  margin-top: 6px;
}

[data-bs-theme="dark"] .aka-history-card {
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(6, 78, 59, 0.15);
}

.aka-history-kpi-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.aka-history-kpi {
  flex: 1 1 auto;
  min-width: 90px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 8px;
  padding: 6px 10px;
  text-align: center;
}

[data-bs-theme="dark"] .aka-history-kpi {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(51, 65, 85, 0.8);
}

.aka-history-kpi-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

[data-bs-theme="dark"] .aka-history-kpi-val {
  color: #f8fafc;
}

.aka-history-kpi-lbl {
  font-size: 0.65rem;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 600;
}

.aka-history-item {
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 8px;
  background: var(--aka-bg-bot, #ffffff);
  padding: 10px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

[data-bs-theme="dark"] .aka-history-item {
  border-color: rgba(51, 65, 85, 0.8);
  background: rgba(30, 41, 59, 0.6);
}

.aka-history-item:hover {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  border-color: var(--ds-primary, #0284c7);
}

.aka-history-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.aka-history-item-prompt {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ds-primary, #0284c7);
  margin-bottom: 6px;
  line-height: 1.3;
}

.aka-history-item-resp {
  font-size: 0.78rem;
  color: var(--aka-bg-bot-text, #334155);
  background: rgba(241, 245, 249, 0.7);
  border-radius: 6px;
  padding: 6px 8px;
  line-height: 1.4;
  max-height: 140px;
  overflow-y: auto;
}

[data-bs-theme="dark"] .aka-history-item-resp {
  background: rgba(15, 23, 42, 0.5);
  color: #cbd5e1;
}

/* ══════════════════════════════════════════════════════════════════
   TARJETA EJECUTIVA DE RESUMEN DE CONSUMO Y CRÉDITOS (/creditos)
   ══════════════════════════════════════════════════════════════════ */
.aka-consumo-card {
  border: 1px solid rgba(14, 165, 233, 0.35);
  border-radius: 12px;
  background: rgba(14, 165, 233, 0.04);
  padding: 12px;
  margin-top: 6px;
}

[data-bs-theme="dark"] .aka-consumo-card {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(15, 23, 42, 0.55);
}

.aka-consumo-hero {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08) 0%, rgba(2, 132, 199, 0.14) 100%);
  border: 1px solid rgba(14, 165, 233, 0.25);
  border-radius: 10px;
  padding: 10px 12px;
}

[data-bs-theme="dark"] .aka-consumo-hero {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
  border-color: rgba(56, 189, 248, 0.3);
}

.aka-consumo-hero-lbl {
  font-size: 0.68rem;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--ds-primary, #0284c7);
}

.aka-consumo-hero-val {
  font-size: 1.45rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
  margin-top: 2px;
}

[data-bs-theme="dark"] .aka-consumo-hero-val {
  color: #f8fafc;
}

.aka-consumo-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.aka-consumo-user-item {
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 8px;
  background: var(--aka-bg-bot, #ffffff);
  padding: 8px 10px;
  transition: all 0.2s ease;
}

[data-bs-theme="dark"] .aka-consumo-user-item {
  border-color: rgba(51, 65, 85, 0.8);
  background: rgba(30, 41, 59, 0.65);
}

.aka-consumo-user-item:hover {
  border-color: var(--ds-primary, #0284c7);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.aka-user-avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.aka-user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.2;
}

[data-bs-theme="dark"] .aka-user-name {
  color: #f1f5f9;
}

.aka-consumo-mod-item {
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 8px;
  background: var(--aka-bg-bot, #ffffff);
  padding: 8px 10px;
  transition: all 0.2s ease;
}

[data-bs-theme="dark"] .aka-consumo-mod-item {
  border-color: rgba(51, 65, 85, 0.8);
  background: rgba(30, 41, 59, 0.65);
}

.aka-mod-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: #1e293b;
}

[data-bs-theme="dark"] .aka-mod-title {
  color: #e2e8f0;
}

/* ══════════════════════════════════════════════════════════════════
   TABLAS MARKDOWN RESPONSIVAS EN EL CHAT
   ══════════════════════════════════════════════════════════════════ */
.aka-table-responsive-wrap {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.9);
}

[data-bs-theme="dark"] .aka-table-responsive-wrap {
  border-color: rgba(51, 65, 85, 0.8);
}

.aka-markdown-table {
  font-size: 0.76rem;
  margin-bottom: 0;
  border-collapse: collapse;
}

.aka-markdown-table th {
  background: rgba(14, 165, 233, 0.12) !important;
  color: var(--ds-primary, #0284c7) !important;
  font-weight: 700;
  padding: 6px 10px;
  white-space: nowrap;
  border-bottom: 1px solid rgba(14, 165, 233, 0.25) !important;
}

[data-bs-theme="dark"] .aka-markdown-table th {
  background: rgba(15, 23, 42, 0.85) !important;
  color: #38bdf8 !important;
  border-bottom-color: rgba(56, 189, 248, 0.25) !important;
}

.aka-markdown-table td {
  padding: 6px 10px;
  vertical-align: middle;
  border-color: rgba(226, 232, 240, 0.8) !important;
}

[data-bs-theme="dark"] .aka-markdown-table td {
  border-color: rgba(51, 65, 85, 0.6) !important;
  color: #cbd5e1;
}

.aka-markdown-table tbody tr:hover {
  background-color: rgba(14, 165, 233, 0.05);
}

[data-bs-theme="dark"] .aka-markdown-table tbody tr:hover {
  background-color: rgba(30, 41, 59, 0.7);
}

/* ══════════════════════════════════════════════════════════════════
   AJUSTE COMPACTO DE CABECERA DEL DRAWER Y HUD DE CAPTURA DE PANTALLA
   ══════════════════════════════════════════════════════════════════ */
.drawer-help-header {
  gap: 8px;
  flex-wrap: nowrap;
}

.drawer-help-header > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}

.drawer-help-header > div:first-child > div:last-child {
  min-width: 0;
}

.drawer-help-header .offcanvas-title {
  white-space: nowrap;
  font-size: 0.92rem !important;
}

.drawer-help-header > div:first-child small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 195px;
}

.drawer-help-header > div:last-child {
  flex-shrink: 0;
}

/* Ocultar el texto duplicado de "Guía Manual" en la cabecera (dejar el ícono con tooltip) para que no desborde el botón X */
#btnHeaderToggleManual #btnHeaderToggleText,
#btnHeaderToggleManual span {
  display: none !important;
}

#btnNuevaCharlaAka {
  white-space: nowrap;
  padding: 0.22rem 0.45rem !important;
}

/* HUD de feedback visual inmediato durante la captura de pantalla */
#softyCaptureHud {
  position: fixed;
  inset: 0;
  z-index: 200050;
  pointer-events: all;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.35);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

#softyCaptureHud .softy-capture-flash {
  position: fixed;
  inset: 0;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
  animation: softyCameraFlash 0.45s ease-out forwards;
}

@keyframes softyCameraFlash {
  0% { opacity: 0.75; }
  100% { opacity: 0; }
}

#softyCaptureHud .softy-capture-card {
  background: rgba(15, 23, 42, 0.94);
  color: #ffffff;
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 14px;
  padding: 18px 26px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45), 0 0 20px rgba(14, 165, 233, 0.25);
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 90vw;
  animation: akaFadeIn 0.18s ease-out;
}
