/* Remove grey focus/active overlay on AIAssistView toolbar buttons */
.ai-chat-container .e-toolbar-item .e-tbar-btn:focus,
.ai-chat-container .e-toolbar-item .e-tbar-btn:active {
    background-color: transparent !important;
    box-shadow: none !important;
}

/*Draw Toast Message on top of everything*/
.e-control.e-toast.e-lib.e-toast-container {
    z-index: 10000 !important;
}

/* Wider scrollbars app-wide — the default ~6px is hard to grab by drag (the only option for
   users who can't use a mouse wheel). !important beats Syncfusion's non-important per-component widths. */
::-webkit-scrollbar {
    width: 15px !important;
    height: 15px !important;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, .4) !important;
    background-clip: content-box !important;
    border: 3px solid transparent !important;
    border-radius: 15px !important;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, .6) !important;
    background-clip: content-box !important;
}

/*Better Indentation on TreeGrid*/
.e-treegrid .e-table *[class$="Level1"] .e-treecolumn-container{
    margin-left:20px;
}

.e-treegrid .e-table *[class$="Level2"] .e-treecolumn-container {
    margin-left: 40px;
}

.e-treegrid .e-table *[class$="Level3"] .e-treecolumn-container {
    margin-left: 60px;
}

.e-treegrid .e-table *[class$="Level4"] .e-treecolumn-container {
    margin-left: 80px;
}

.e-treegrid .e-table *[class$="Level5"] .e-treecolumn-container {
    margin-left: 100px;
}

.e-treegrid .e-table *[class$="Level6"] .e-treecolumn-container {
    margin-left: 120px;
}

.e-treegrid .e-table *[class$="Level7"] .e-treecolumn-container {
    margin-left: 140px;
}

.e-treegrid .e-table *[class$="Level8"] .e-treecolumn-container {
    margin-left: 160px;
}

/*Reduce Visibility of fields not in layout*/
.excluded-field {
    opacity: 0.5;
}

/*Remove Cell Selection Focus*/
.e-grid .e-rowcell.e-focus.e-focused {
    box-shadow: unset !important;
}

/*Enhance Visibility of Filtered Icon in grid headers*/
.e-grid .e-filtered {
    background: rgba(34, 87, 255, .5);
    border-radius: 4px;
}

.e-grid .e-filtered::before {
    color:blue !important;
}

/*Remove Search Box in Grid Filters*/
.sf-grid .e-checkboxfilter .e-searchbox {
    display: none !important;
}

/*Grid Status and Filter Reset Buttons Styling*/
.status-completed {
    color: green;
    font-weight: bold;
}

.status-processing {
    color: blue;
    font-weight: bold;
}

.status-queued {
    color: blue;
    font-weight: bold;
}

.status-uploading {
    color: blue;
    font-weight: bold;
}

.status-review {
    color: red;
    font-weight: bold;
}

.status-cancelled {
    color: purple;
    font-weight: bold;
}

.cursor-default {
    cursor: default !important;
}

.tooltip-filter {
    display: inline;
}

/* Enhanced styling for invalid rows - make them highly visible */
.e-grid .e-gridcontent .e-row.invalid-field td {
    background-color: #ffbfbf !important;
    color: #c62828 !important;
    font-weight: 600 !important;
    box-shadow: inset 0 4px 0 0 #d32f2f, inset 0 -4px 0 0 #d32f2f;
}

/*Generated code styling on Schema Config*/
.generated-code-textbox {
    height: 100%;
    width: 100%;
    font-family: Consolas, 'Courier New', monospace;
}

.e-textbox.generated-code-textbox {
    height: calc(100% - 10px);
}

/*Read Only SfSwitch*/
.readonly-switch {
    pointer-events: none;
    cursor: default;
}

/* Status Badge Styling for Job Filters*/
.status-badge {
    padding: 8px 16px;
    border-radius: 6px;
    border: 2px solid transparent;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #f5f5f5;
    color: #333;
}

.status-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.status-badge:active {
    transform: translateY(0);
}

.status-badge.status-completed {
    background-color: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
}

.status-badge.status-completed:hover {
    background-color: #c8e6c9;
}

.status-badge.status-processing {
    background-color: #e3f2fd;
    border-color: #2196f3;
    color: #1565c0;
}

.status-badge.status-processing:hover {
    background-color: #bbdefb;
}

.status-badge.status-queued {
    background-color: #e1f5fe;
    border-color: #03a9f4;
    color: #01579b;
}

.status-badge.status-queued:hover {
    background-color: #b3e5fc;
}

.status-badge.status-uploading {
    background-color: #e0f2f1;
    border-color: #009688;
    color: #004d40;
}

.status-badge.status-uploading:hover {
    background-color: #b2dfdb;
}

.status-badge.status-review {
    background-color: #fff3e0;
    border-color: #ff9800;
    color: #e65100;
}

.status-badge.status-review:hover {
    background-color: #ffe0b2;
}

.status-badge.status-cancelled {
    background-color: #f3e5f5;
    border-color: #9c27b0;
    color: #4a148c;
}

.status-badge.status-cancelled:hover {
    background-color: #e1bee7;
}

/* Disable last page double arrow in Syncfusion Grids*/
.e-grid .e-pager .e-lastpage,
.e-grid .e-pager .e-lastpagedisabled {
    display: none !important;
}

/*Make Checkbox popup grid filters wider*/
.e-grid .e-dialog.e-filter-popup.e-checkboxfilter {
    width: 400px !important;
    max-width: 400px !important;
}

/*Hide Grid rows when CONTAINS search 10K limit is reached (workaround for grid behavior*/
.hide-rows-on-limit .e-gridcontent .e-row {
    display: none !important;
}

/* ===== Custom Query Builder ===== */
.qb-group { padding: 12px; margin-bottom: 8px; border-radius: 6px; }
.qb-group.qb-and { border-left: 4px solid #2196f3; background-color: #f0f7ff; }
.qb-group.qb-or { border-left: 4px solid #ff9800; background-color: #fff8f0; }
.qb-group.qb-not-and { border-left: 4px solid #e91e63; background-color: #fce4ec; }
.qb-group.qb-not-or { border-left: 4px solid #9c27b0; background-color: #f3e5f5; }
.qb-depth-0 { margin-left: 0; }
.qb-depth-1 { margin-left: 16px; }
.qb-depth-2 { margin-left: 32px; }
.qb-depth-3 { margin-left: 48px; }
.qb-depth-4 { margin-left: 64px; }
.qb-rule { transition: background-color 0.15s; }
.qb-rule:hover { background-color: #f8f9fa; }
.qb-condition-toggle { min-width: 120px; }
.qb-field-level { min-width: 150px; }
.qb-quantifier { min-width: 70px; }
.qb-summary {
    font-family: Consolas, 'Courier New', monospace;
    font-size: 0.85em;
    white-space: pre-wrap;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 12px;
    max-height: 200px;
    overflow-y: auto;
}

/* PDF viewer fit: Syncfusion pins .e-pdfviewer and its main container to min-height:500px, which overflows the
   shorter AI-Chat-view PDF pane and adds a redundant outer scrollbar. Let it fit whatever splitter pane it's in. */
.e-pdfviewer,
.e-pdfviewer .e-pv-main-container {
    min-height: 0 !important;
}

/* ===== Search page ===== */
.results-popup { position: absolute; top: calc(100% + 4px); right: 0; width: 420px; max-width: 90vw; max-height: 60vh; display: flex; flex-direction: column; z-index: 1055; }
.results-popup-list { position: relative; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.results-popup-backdrop { position: fixed; inset: 0; z-index: 1050; background: transparent; }
/* The PDF viewer is a later-painted sibling pane that covers the split bar's right collapse arrow. The arrow's own
   z-index can't escape the static bar's flattening, so promote the bar itself to a positioned stacking context
   above the pane (z below the Results popup/dialogs). Verified via DevTools elementFromPoint. */
.search-splitter .e-split-bar { position: relative !important; z-index: 200 !important; }
/* Inset the AI-chat scrollbar so it clears the splitter bar; flush against it, the splitter
   intercepts drag attempts meant for the scrollbar. */
.ai-chat-container .e-view-content { margin-right: 3px !important; }

/* Citation badge: cursor/size previously rode an inline style attribute — moved here so the HTML sanitizer
   (which strips style attributes) needn't allow inline styles on sanitized AI output. */
.citation-badge { cursor: pointer; font-size: 0.75em; }

/* Working-set change chip — a tooling/system event line in the AI chat (a manual search or an AI re-scope),
   styled to read as tooling, not an LLM answer: a centered, muted pill rather than a left-aligned response. */
.ai-chat-container .ws-change-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: fit-content;
    max-width: 92%;
    margin: 0.3rem auto 0.5rem;
    padding: 0.2rem 0.8rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #084298;
    background-color: #e7f1ff;
    border: 1px solid #9ec5fe;
    border-radius: 999px;
}
.ai-chat-container .ws-change-chip .e-icons { font-size: 0.8125rem; }
/* A working-set chip row carries no user prompt (empty Prompt), so collapse its empty prompt bubble — the chip
   then stands alone as a system event. Real prompts have non-empty .e-prompt-text and keep the default styling. */
.ai-chat-container .e-prompt-container:has(.e-prompt-text:empty) { display: none; }
/* Hide the per-response toolbar footer (Copy / thumbs-up "like" / thumbs-down "dislike"). Syncfusion exposes no
   toggle and renders it under every response; scoped to response items so the top toolbar (also .e-toolbar) stays. */
.ai-chat-container .e-response-item-template .e-content-footer { display: none !important; }