/* Основные утилиты стилей jurex: переменные, структура и интерактивные элементы. */



:root
{
    --jurex_primary_color: #0d6efd;
    --jurex_sidebar_width: 340px;
    --jurex_bg_color: #f4f7fb;
    --jurex_border_color: #e5e7eb;
}

*
{
    box-sizing: border-box;
}

body
{
    margin: 0;
    padding: 0;
    font-family: "Inter", "Segoe UI", Roboto, sans-serif;
    background-color: var(--jurex_bg_color);
    color: #1f2937;
    min-height: 100vh;
}

.sidebar-toggle-btn
{
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1050;
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(13, 110, 253, 0.25);
}

.sidebar-panel
{
    position: fixed;
    top: 0;
    left: calc(-1 * var(--jurex_sidebar_width));
    width: var(--jurex_sidebar_width);
    height: 100vh;
    background: #ffffff;
    border-right: 1px solid var(--jurex_border_color);
    z-index: 1040;
    transition: left 0.25s ease-in-out;
    overflow-y: auto;
}

.sidebar-panel.show
{
    left: 0 !important;
}

.sidebar-content
{
    padding: 84px 16px 20px 16px;
}

.sidebar-block
{
    background: #ffffff;
}

.sidebar-block-title
{
    font-size: 0.85rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.list-render-area
{
    min-height: 64px;
}

.placeholder-card
{
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px dashed #cfd4dc;
    border-radius: 10px;
    background: #fbfcfe;
}

.placeholder-card-lg
{
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 18px;
}

.main-content-wrap
{
    margin-left: 0;
    padding: 84px 16px 16px 16px;
    max-width: 1200px;
}

.main-header
{
    background: #ffffff;
    border: 1px solid var(--jurex_border_color);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 12px;
    position: relative;
    z-index: 1000;
}

.page-title-clickable
{
    font-size: 1.7rem;
    font-weight: 700;
    cursor: pointer;
    margin: 0;
}

.chat-header-bar
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(90deg, #0d6efd, #4f46e5);
    color: #ffffff;
    border-radius: 12px;
    padding: 10px 12px;
}

.alerts-wrap
{
    margin-bottom: 12px;
}

.content-section
{
    background: #ffffff;
    border: 1px solid var(--jurex_border_color);
    border-radius: 14px;
    overflow: hidden;
}

.chat-container-wrap
{
    height: 72vh;
    min-height: 520px;
    display: flex;
    flex-direction: column;
}

.chat-area
{
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8fafc;
}

.chat-message
{
    display: flex;
    margin-bottom: 12px;
}

.chat-message.user
{
    justify-content: flex-end;
}

.chat-message.assistant
{
    justify-content: flex-start;
}

.message-bubble
{
    max-width: 80%;
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    word-break: break-word;
}

.message-bubble.user
{
    background: #0d6efd;
    color: #ffffff;
}

.message-bubble.assistant
{
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
}

.message-time
{
    margin-top: 6px;
    font-size: 0.75rem;
    opacity: 0.7;
}

.chat-input-wrap
{
    border-top: 1px solid var(--jurex_border_color);
    background: #ffffff;
    padding: 12px;
}

.chat-input-wrap textarea.form-control
{
    resize: none;
    min-height: 44px;
    max-height: 120px;
}

.sidebar-link
{
    display: block;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 8px 10px;
    margin-bottom: 6px;
    text-decoration: none;
    color: #111827;
    background: #ffffff;
    transition: all 0.15s ease-in-out;
}

.sidebar-link:hover
{
    background: #eff6ff;
    border-color: #bfdbfe;
}

.sidebar-link.active
{
    background: #0d6efd;
    color: #ffffff;
    border-color: #0d6efd;
}

.edit-thread-modal
{
    position: fixed;
    inset: 0;
    z-index: 1060;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
}

.edit-thread-card
{
    width: 100%;
    max-width: 560px;
    background: #ffffff;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.ai-response p
{
    margin-bottom: 0.7rem;
}

.ai-response ul,
.ai-response ol
{
    padding-left: 1.2rem;
}

.cursor-pointer
{
    cursor: pointer;
}

.offcanvas
{
    transition: transform 0.3s ease-in-out;
}

.offcanvas-end
{
    transition: transform 0.3s ease-in-out;
}

.page-title-clickable
{
    cursor: pointer;
    transition: opacity 0.2s;
}

.page-title-clickable:hover
{
    opacity: 0.8;
}

@media (min-width: 992px)
{
    .sidebar-panel
    {
        left: 0;
    }

    .sidebar-toggle-btn
    {
        display: none;
    }

    .main-content-wrap
    {
        margin-left: var(--jurex_sidebar_width);
        padding: 20px;
    }
}

/* Унификация заголовков */
.header-title-item
{
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

/* Кликабельность и курсоры */
#menuToggleButton
{
    cursor: pointer;
    z-index: 10;
}

#folderTitle
{
    cursor: pointer;
    user-select: none;
    transition: opacity 0.2s;
}

#folderTitle:hover
{
    opacity: 0.9;
}

#pageTitle,
#folderTitle
{
    cursor: pointer;
}

#folderTitleWrapper
{
    margin-left: auto;
}

#chatHeader
{
    display: none;
}


#caseDataMissingText .badge
{
    white-space: normal;
    text-align: left;
    line-height: 1.35;
    font-weight: 500;
}

#missingDataBadgesWrap
{
    max-height: 180px;
    overflow-y: auto;
}

.missing-data-badge
{
    cursor: pointer;
}

/**
* Ограничивает длину названия дела, добавляя троеточие.
*/
.folder-title-truncate
{
    display: inline-block;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

/* Индикатор изменений дела в заголовке */
#folderTitleChangeDot {
    display: inline-block;
    position: relative;
    width: 8px;
    height: 8px;
    margin-left: 2px;
}

#folderTitleChangeDotBadge {
    width: 8px;
    height: 8px;
    padding: 0 !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
}


/**
 * Интерактивная карточка узла карты дела.
 */
.case-node-card
{
    cursor: pointer;
}

/**
 * Компактный индикатор статуса узла дела.
 */
.case-node-status-badge
{
    font-size: 0.7rem;
}




.outgoing-document-card,
.case-node-card
{
    cursor: pointer;
}

.outgoing-document-status
{
    font-size: 0.7rem;
}

.outgoing-document-type
{
    font-size: 0.75rem;
}

#documentRoutesDebugRawResponse,
#documentRoutesDebugCleanJson
{
    max-height: 320px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 10px;
    color: #212529;
}


#missingDataContent
{
    border-left: 4px solid #ffc107;
}

#missingDataContentCriticalList,
#missingDataContentOptionalList
{
    max-height: 220px;
    overflow-y: auto;
}

.missing-data-content-item
{
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: pointer;
}

.missing-data-content-item:hover
{
    background: #e9ecef;
}

.material-card
{
    cursor: pointer;
}

.material-body
{
    cursor: pointer;
}

.material-body *
{
    cursor: pointer;
}

.missing-data-content-item.text-danger {
    cursor: pointer;
}

.missing-data-content-item.text-danger:hover {
    background: #f8d7da;
}


#nodeRequirementsContent
{
    border-left: 4px solid var(--jurex_primary_color);
}

#nodeRequirementsCriticalList,
#nodeRequirementsOptionalList
{
    max-height: 520px;
    overflow-y: auto;
}

.node-requirement-input
{
    min-height: 86px;
}

.node-requirement-input:focus
{
    border-color: var(--jurex_primary_color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

#nodeRequirementsOptionalList.d-flex
{
    flex-direction: column;
}



/* Стили для вкладок внутри карточки узла */
#nodeDetailsSection .nav-tabs .nav-link {
    color: #4b5563;
    font-weight: 500;
    border: none;
    border-bottom: 2px solid transparent;
}

#nodeDetailsSection .nav-tabs .nav-link.active {
    color: var(--jurex_primary_color);
    border-bottom-color: var(--jurex_primary_color);
    background: transparent;
}

#nodeChatArea {
    background-color: #f9fafb;
    border: 1px solid var(--jurex_border_color);
}

.chat-message.user {
    display: flex;
    justify-content: flex-end;
}

.chat-message.assistant {
    display: flex;
    justify-content: flex-start;
}

.message-bubble.user {
    background-color: #eff6ff;
    border-color: #bfdbfe !important;
    color: #1e3a8a;
}

.message-bubble.assistant {
    background-color: #ffffff;
    border-color: #e5e7eb !important;
    color: #1f2937;
}

#globalAjaxSpinnerBackdrop {
    background-color: rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    pointer-events: all;
}

#globalAjaxSpinner {
    pointer-events: all;
}