body {
    background: rgb(247, 248, 250);
}

#results p {
    font-weight: bold;
}

#results .label {
    float: left;
}

#results .metadata,
#results .label {
    font-size: small;
}

#results .metadata {
    margin-left: 0px;
}

#results .metadata-col,
#datos .metadata-col {
    padding-left: 5px;
    padding-right: 5px;
}

.element-list {
    border: none;
    border-bottom: 1px solid #7b213d;
}

.element-list a {
    font-size: 20px;
}

.custom-card .card-list {
    margin-bottom: 10px;
    background-color: #fafafa !important;
}

.custom-card .card-list :hover {
    /*background-color: #f4e1f099;*/
    background-color: none;
}

.head-list {
    margin-bottom: 25px;
    border-bottom: 1px solid #7b213d;
}

.btn-sclose {
    width: 100%;
}

#boxSearch,
#btnSearch {
    -o-transition: all .9s ease-out;
    -webkit-transition: all .9s ease-out;
    -moz-transition: all .9s ease-out;
}

.btn-outline-register {
    color: #868485;
    border-color: #868485;
}

.btn-outline-register:hover {
    color: #ffffff;
    background-color: #868485;
    border-color: #868485;
}

.admin-head {
    margin-bottom: 10px;
    border-bottom: 1px solid #7b213d;
}

.modal-scroll {
    max-height: 500px;
    overflow-y: auto;
}

.descripcion {
    color: black;
}

a {
    color: var(--first-color)
}

.main-search {
    margin-top: 100px;
}

#datos .metadata {
    margin-left: 0px;
}

#datos h4 {
    color: #868485;
}

#datos a {
    text-decoration: underline;
}

.title-leg {
    border-bottom: var(--first-color) 0.5px solid;
}

.title-leg p {
    font-weight: bold;
    font-size: 20px;
    color: var(--first-color);
}

.pdf-view {
    padding: 0px;
}

.session.justify-content-end.row {
    padding: 8px;
    margin-right: 0px;
}

.btn-register {
    color: #FFFFF1;
    /* border-color: #868485; */
    background: #181818a3;
    font-weight: normal;
    /*box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);*/
}

.btn-register:hover {
    color: #FFFFF1;
    /* border-color: #868485; */
    background: #181818a3;
    font-weight: normal;
}

.btn-session {
    background-color: #ffffff;
    border: 1px solid;
}

.btn-menu {
    border: solid 1px;
    margin-bottom: 1rem;
}

.link-settings {
    vertical-align: middle;
}

/* ═══════════════════════════════════════════════════════
   Chat UI — Buscador IA (tab #buscador-ia / #ai)
   ═══════════════════════════════════════════════════════ */

#buscador-ia {
    background-color: transparent !important;
}

/* Contenedor principal del chat */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 150px);
    min-height: 300px;
    border: 1px solid #e0e0e0;
    border-radius: .75rem;
    background: #f8f9fa;
    overflow: hidden;
}

/* Área de historial con scroll */
.chat-history {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

/* Burbujas de chat — base compartida */
.chat-bubble {
    max-width: 85%;
    padding: .65rem 1rem;
    border-radius: 1rem;
    line-height: 1.5;
    word-wrap: break-word;
    font-size: .95rem;
}

/* Burbuja del usuario — alineada a la derecha */
.chat-bubble-user {
    align-self: flex-end;
    background: #7b213d;
    color: #fff;
    border-bottom-right-radius: .25rem;
}

/* Burbuja del agente — alineada a la izquierda */
.chat-bubble-agent {
    align-self: flex-start;
    background: #fff;
    color: #212529;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: .25rem;
}

/* Contenido dentro de burbuja agente: títulos y párrafos */
.chat-bubble-agent .ia-title {
    font-size: calc(1rem + 1px);
    margin: .5rem 0 .35rem;
    color: inherit;
    line-height: 1.25;
}

.chat-bubble-agent p {
    margin: 0 0 .6rem;
    line-height: 1.5;
}

.chat-bubble-agent a.source-link {
    text-decoration: underline;
    color: #0b5ed7;
}

/* Resultados ES dentro de burbuja */
.chat-bubble-agent .es-item {
    border-bottom: 1px solid #eee;
    padding-bottom: .5rem;
    margin-bottom: .5rem;
}

.chat-bubble-agent .es-title {
    color: #7b213d;
    text-decoration: none;
    font-weight: 600;
}

.chat-bubble-agent .es-meta {
    color: #6c757d;
    font-size: .9rem;
}

.chat-bubble-agent .es-snippet {
    color: #333;
    font-size: .92rem;
    white-space: pre-wrap;
}

/* Burbuja de estatus (spinner / "pensando…") */
.chat-bubble-status {
    align-self: flex-start;
    background: #f1f3f5;
    color: #868e96;
    border-radius: 1rem;
    padding: .5rem 1rem;
    font-size: .9rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.chat-bubble-status .spinner-border {
    width: 1rem;
    height: 1rem;
    border-width: .15em;
}

/* Barra de input fija al fondo del chat */
.chat-input-bar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .65rem .75rem;
    border-top: 1px solid #e0e0e0;
    background: #fff;
}

.chat-input-bar input {
    flex: 1 1 0%;
    /* Updated width behavior */
    min-width: 0;
    /* Added min-width */
    border: 1px solid #ced4da;
    border-radius: 1.25rem;
    padding: .4rem .85rem;
    font-size: .95rem;
    outline: none;
    transition: border-color .15s;
}

.chat-input-bar input:focus {
    border-color: var(--first-color, #7b213d);
    /* Updated color */
    box-shadow: 0 0 0 2px rgba(123, 33, 61, .15);
}

.chat-input-bar button {
    flex: 0 0 auto;
    border: none;
    background: var(--first-color, #7b213d);
    /* Updated color */
    color: #fff;
    border-radius: .25rem;
    /* Updated border-radius */
    padding: .4rem 1rem;
    font-size: .95rem;
    font-weight: 600;
    /* Added font-weight */
    cursor: pointer;
    transition: background .15s;
    box-shadow: 0 4px 6px rgba(50, 50, 93, .11), 0 1px 3px rgba(0, 0, 0, .08);
    /* Added box-shadow */
}

.chat-input-bar button:hover {
    background: #5e1830;
}

.chat-input-bar button:disabled {
    opacity: .55;
    /* Updated disabled style */
    cursor: not-allowed;
}

/* Acciones del chat (limpiar conversación) */
.chat-actions {
    display: flex;
    justify-content: flex-end;
    padding: .35rem .75rem 0;
}

.chat-actions button {
    background: none;
    border: 1px solid #ced4da;
    /* Updated border */
    color: #6c757d;
    font-size: .8rem;
    cursor: pointer;
    padding: .25rem .6rem;
    /* Updated padding */
    border-radius: .25rem;
    /* Added border-radius */
    transition: all .15s;
    /* Added transition */
}

.chat-actions button:hover {
    color: var(--first-color, #7b213d);
    /* Updated color */
    border-color: var(--first-color, #7b213d);
    /* Updated border-color */
    background: rgba(123, 33, 61, .05);
    /* Added background */
}

/* Copiar respuesta - dentro de burbuja agente */
.chat-copy-btn {
    display: inline-block;
    margin-top: .35rem;
    background: none;
    border: none;
    color: #868e96;
    font-size: .8rem;
    cursor: pointer;
    padding: 0;
}

.chat-copy-btn:hover {
    color: #7b213d;
}

.chat-copy-feedback {
    font-size: .8rem;
    color: #0a7f37;
    margin-left: .4rem;
    display: none;
}