/* Lo propio de esta página alrededor del tablero: el ingreso, la barra de la sesión y el asistente.
   Marca CADIT: azul #004A93, marino #212844, niebla #F3F6FB, amarillo solo de acento; IBM Plex Sans. */
[hidden] { display: none !important; }

.ap-ingreso { min-height: 100vh; display: grid; place-items: center; padding: 24px; box-sizing: border-box; }
.ap-ingreso-caja { background: #fff; border: 1px solid #e3e7ef; border-radius: 12px; padding: 32px 36px; max-width: 440px; width: 100%;
  box-shadow: 0 1px 2px rgba(33, 40, 68, .06), 0 4px 16px rgba(33, 40, 68, .05); display: grid; gap: 14px; }
.ap-ingreso-caja .ap-logo { width: 190px; height: 46px; }
.ap-ingreso-caja h1 { margin: 0; font-size: 22px; font-weight: 600; color: #212844; letter-spacing: -.01em; }
.ap-ingreso-caja p { margin: 0; color: #5b6475; font-size: 14px; line-height: 1.5; }
.ap-ingreso-caja button { font: inherit; font-size: 14px; border-radius: 8px; padding: 9px 14px; cursor: pointer; justify-self: start;
  background: #004A93; color: #fff; border: 1px solid #004A93; }
.ap-ingreso-caja button + button { background: #fff; color: #004A93; }

.ap-barra { display: flex; justify-content: flex-end; align-items: center; gap: 12px; font-size: 12.5px; color: #5b6475; margin: 0 0 8px; }
.ap-barra button { font: inherit; background: none; border: 0; color: #004A93; cursor: pointer; padding: 0; }

/* El asistente */
.ap-chat-abrir { position: fixed; right: 20px; bottom: 20px; z-index: 50; font: inherit; font-size: 14px; font-weight: 600;
  background: #004A93; color: #fff; border: 0; border-radius: 999px; padding: 6px 18px 6px 6px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 10px;
  box-shadow: 0 2px 0 #FFD300, 0 6px 18px rgba(33, 40, 68, .22); }
.ap-buho { width: 34px; height: 34px; border-radius: 50%; background-color: #fff; background-size: 26px auto; flex: none; }
.ap-chat-tit { display: flex; align-items: center; gap: 10px; }
.ap-buho-cab { width: 40px; height: 40px; border-radius: 10px; background-color: #F3F6FB; background-size: 30px auto; flex: none; }
.ap-chat-abrir:focus-visible, .ap-chat button:focus-visible, .ap-chat textarea:focus-visible { outline: 2px solid #004A93; outline-offset: 2px; }
.ap-chat { position: fixed; right: 20px; bottom: 20px; z-index: 50; width: min(420px, calc(100vw - 32px)); height: min(640px, calc(100vh - 40px));
  background: #fff; border: 1px solid #e3e7ef; border-radius: 12px; box-shadow: 0 10px 32px rgba(33, 40, 68, .2);
  display: grid; grid-template-rows: auto 1fr auto auto; overflow: hidden; font-size: 14px; color: #1d2433; }
.ap-chat-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px 16px 12px; border-bottom: 1px solid #e3e7ef; }
.ap-chat-cab strong { display: block; color: #212844; font-size: 15px; }
.ap-chat-cab span { color: #5b6475; font-size: 12.5px; }
.ap-chat-cerrar { font: inherit; font-size: 22px; line-height: 1; background: none; border: 0; color: #5b6475; cursor: pointer; padding: 0 2px; }
.ap-chat-hilo { overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.ap-chat-sug { display: grid; gap: 8px; }
.ap-chat-sug p { margin: 0; color: #5b6475; font-size: 13px; }
.ap-chat-sug button { font: inherit; font-size: 13px; text-align: left; background: #F3F6FB; border: 1px solid #e3e7ef; border-radius: 8px;
  padding: 8px 10px; color: #212844; cursor: pointer; }
.ap-chat-sug button:hover { border-color: #004A93; }
.ap-msg { max-width: 92%; line-height: 1.5; border-radius: 10px; padding: 9px 12px; }
.ap-msg p { margin: 0 0 6px; } .ap-msg p:last-child { margin-bottom: 0; }
.ap-msg ul { margin: 0 0 6px; padding-left: 18px; } .ap-msg li { margin: 2px 0; }
.ap-msg strong { font-weight: 600; color: #212844; }
.ap-msg-user { align-self: flex-end; background: #004A93; color: #fff; white-space: pre-wrap; }
.ap-msg-assistant { align-self: flex-start; background: #F3F6FB; }
.ap-msg-espera { align-self: flex-start; color: #5b6475; font-style: italic; background: none; padding-left: 2px; }
.ap-msg-error { align-self: flex-start; color: #b3261e; background: #fdf0ef; }
.ap-chat-forma { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid #e3e7ef; align-items: flex-end; }
.ap-chat-forma textarea { flex: 1; font: inherit; font-size: 14px; resize: none; border: 1px solid #e3e7ef; border-radius: 8px; padding: 8px 10px; color: #1d2433; }
.ap-chat-forma button { font: inherit; font-size: 14px; font-weight: 600; background: #004A93; color: #fff; border: 0; border-radius: 8px; padding: 9px 14px; cursor: pointer; }
.ap-chat-forma button:disabled { opacity: .5; cursor: default; }
.ap-chat-pie { margin: 0; padding: 0 14px 10px; color: #5b6475; font-size: 11.5px; line-height: 1.4; }
@media (max-width: 600px) {
  .ap-chat { right: 8px; bottom: 8px; width: calc(100vw - 16px); height: calc(100vh - 16px); }
  .ap-chat-abrir { right: 12px; bottom: 12px; }
}
