/* Palette from lims/frontend/src/styles/index.scss + core/themes/myome/myome.sass */
:root {
  --bs-primary: #2a4884;
  --bs-primary-rgb: 42, 72, 132;
  --bs-secondary: #7287af;
  --bs-secondary-rgb: 114, 135, 175;
  --bs-success: #00a027;
  --bs-success-rgb: 0, 160, 39;
  --bs-danger: #a00010;
  --bs-danger-rgb: 160, 0, 16;
  --bs-warning: #a07a00;
  --bs-link-color: #2a4884;
  --bs-link-color-rgb: 42, 72, 132;
  --preview-canvas-bg: #f0f3f6;
  --my-tasks-nav-offset: 3.5rem;
  --my-tasks-footer-height: 4.75rem;
}
/* frontend/src/styles/index.scss body */
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
.btn-primary { --bs-btn-bg: #2a4884; --bs-btn-border-color: #2a4884; --bs-btn-hover-bg: #243d70; --bs-btn-hover-border-color: #223969; --bs-btn-active-bg: #223969; --bs-btn-disabled-bg: #2a4884; --bs-btn-disabled-border-color: #2a4884; }
.btn-outline-primary { --bs-btn-color: #2a4884; --bs-btn-border-color: #2a4884; --bs-btn-hover-bg: #2a4884; --bs-btn-hover-border-color: #2a4884; --bs-btn-active-bg: #2a4884; }
.btn-danger { --bs-btn-bg: #a00010; --bs-btn-border-color: #a00010; --bs-btn-hover-bg: #88000e; --bs-btn-hover-border-color: #80000d; }
.btn-outline-danger { --bs-btn-color: #a00010; --bs-btn-border-color: #a00010; --bs-btn-hover-bg: #a00010; --bs-btn-hover-border-color: #a00010; --bs-btn-active-bg: #a00010; }
.btn-success { --bs-btn-bg: #00a027; --bs-btn-border-color: #00a027; --bs-btn-hover-bg: #008821; --bs-btn-hover-border-color: #00801f; --bs-btn-disabled-bg: #00a027; --bs-btn-disabled-border-color: #00a027; }
.btn-secondary { --bs-btn-bg: #7287af; --bs-btn-border-color: #7287af; --bs-btn-hover-bg: #617395; --bs-btn-hover-border-color: #5b6c8c; }
.bg-danger { background-color: #a00010 !important; }
.border-primary { --bs-border-color: #2a4884; border-color: #2a4884 !important; }
.text-primary { color: #2a4884 !important; }
.form-control:focus, .form-select:focus { border-color: #95a4c2; box-shadow: 0 0 0 .25rem rgba(42, 72, 132, .25); }
.form-check-input:checked { background-color: #2a4884; border-color: #2a4884; }
.nav-tabs .nav-link.active { color: #2a4884; font-weight: 500; }
.nav-tabs .nav-link { color: #495057; }

/* ---- full-height layout (pages/MyTasks/MyTasks.scss) ---- */
html, body.my-tasks-layout { height: 100dvh; margin: 0; overflow: hidden; background: #fff; }
.lims-navbar { height: var(--my-tasks-nav-offset); padding-top: .25rem; padding-bottom: .25rem; }
.lims-navbar .nav-link { color: rgba(255,255,255,.85); }
.lims-navbar .nav-link.active, .lims-navbar .nav-link:hover { color: #fff; }
.lims-navbar .nav-search .form-control { width: 16rem; border-radius: .375rem 0 0 .375rem; }
.lims-navbar .nav-search .btn { border-radius: 0 .375rem .375rem 0; white-space: nowrap; }
.my-tasks { display: flex; height: calc(100dvh - var(--my-tasks-nav-offset)); min-height: 0; }
/* MyTasks.scss: task header scrolls away in .my-tasks-main; the workspace sticks below the nav */
.my-tasks-main { flex: 1 1 0; min-width: 0; min-height: 0; overflow-x: hidden; overflow-y: auto; padding-left: .5rem; padding-right: .5rem; }
.my-tasks-task-body { min-width: 0; }
.my-tasks-workspace { position: sticky; top: 0; z-index: 10; display: flex; flex-direction: column; min-width: 0; min-height: 0; height: calc(100dvh - var(--my-tasks-nav-offset)); overflow: hidden; background: #fff; }
.reporting-tabs-root { flex-shrink: 0; padding-top: .5rem; }
.reporting-tabs-root .nav-link { background: transparent; border-bottom-color: transparent; }
.tab-content--fill { flex: 1 1 0; min-height: 0; display: flex; }
.reporting-task-form-pane, .reporting-igv-pane { flex: 1 1 0; min-height: 0; min-width: 0; display: flex; }
.my-tasks-task-footer { position: sticky; bottom: 0; z-index: 20; flex-shrink: 0; background: #fff; box-shadow: 0 -4px 12px rgba(0,0,0,.06); }
.my-tasks-task-footer .card { border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0; }

/* ---- sidebar (MyTasks.scss .sidebar-row/.sidebar-panel/.sidebar-toggle, TaskList.scss) ---- */
.sidebar-row { display: flex; flex-direction: row; flex-shrink: 0; align-self: stretch; min-height: 0; max-height: 100%; overflow: hidden; }
.sidebar-panel { width: 22rem; padding: .5rem 1rem; display: flex; overflow-y: auto; flex-direction: column; min-height: 0; }
.sidebar-panel--closed { display: none; }
.sidebar-toggle { align-self: flex-start; }
/* When one item is hovered, dim its siblings; when none hovered, all full opacity */
.task-list-group-item { cursor: pointer; opacity: 1; transition: opacity .2s ease-in-out; }
.task-list-group-item:hover ~ .task-list-group-item { opacity: .5; }
.task-list-group-item:has(~ .task-list-group-item:hover) { opacity: .5; }

/* ---- split pane (FlexTaskForm.scss / SeparatorWithHandle.scss) ---- */
.flex-task-form { display: flex; flex: 1 1 0; min-height: 0; min-width: 0; width: 100%; }
.flex-task-form__panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; flex-basis: 0; }
.flex-task-form__separator { flex: 0 0 9px; cursor: col-resize; position: relative; background: transparent; }
.flex-task-form__separator::before { content: ""; position: absolute; top: 0; bottom: 0; left: 4px; width: 1px; background: #dee2e6; }
.flex-task-form__separator::after { content: ""; position: absolute; top: 50%; left: 1px; width: 7px; height: 2.5rem; margin-top: -1.25rem; border-radius: 4px; background: #c9d1e0; }
.flex-task-form__separator:hover::after, .flex-task-form__separator.dragging::after { background: #2a4884; }

/* ---- inner tab bar (TaskForm/Forms/InnerTabBar.scss) ---- */
.inner-tab-bar-root { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; height: 100%; overflow: hidden; }
.inner-tab-bar-wrapper { flex-shrink: 0; z-index: 10; background: #fff; flex-wrap: nowrap; }
.inner-tab-bar { flex: 1; min-width: 0; overflow-x: auto; display: flex; flex-direction: row; scrollbar-width: thin; }
.inner-tab-bar__tab { white-space: nowrap; flex-shrink: 0; padding: .5rem .8rem; color: #6c757d; }
.inner-tab-bar__tab.active { color: #2a4884; border-bottom: 2px solid #2a4884 !important; }
.inner-tab-bar__trailing { flex-shrink: 0; }
.inner-tab-bar__trailing .btn { height: 100%; border-radius: 0; padding: 0 .8em; color: #6c757d; }
.inner-tab-bar__trailing .btn:hover { background: rgba(114,135,175,.1); }
.inner-tab-bar__content { flex: 1 1 0; min-height: 0; overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; }
/* MyTasks.scss: the sticky footer is a sibling below the workspace; reserve its height inside the scrolling panes */
.my-tasks-workspace--has-sticky-footer .inner-tab-bar__content { padding-bottom: var(--my-tasks-footer-height); }

/* ---- Entry form (JSONSchemaForm.scss / ObjectFieldTemplate.scss look) ---- */
.report-form { padding: 1.5rem 1.5rem 2rem; }
.report-form h5 { font-size: 1.25rem; font-weight: 500; margin: .25rem 0 0; }
.report-form .title-field hr { height: 1px; border: 0; background: #7287af; opacity: .5; margin: .5rem 0 1rem; }
.report-form .form-label { margin-bottom: .375rem; }
.report-form .form-group { margin-bottom: .75rem; }
.report-form .form-group-section { margin-top: .25rem; }
.report-form .nested-section { margin-left: 24px; }
.report-form .array-field-item-template { margin-bottom: .5rem; }
.report-form .array-item-toolbar .btn { flex: 1; padding-left: 6px; padding-right: 6px; font-weight: bold; }
.report-form .array-item-toolbar .btn-light { background: #f8f9fa; border-color: #f8f9fa; }
.report-form .array-add-row { display: flex; justify-content: flex-end; margin: .5rem 0 1.5rem; }
.report-form .array-add-row .btn { width: 25%; min-width: 3rem; }
.report-form textarea.form-control { min-height: calc(1.5em + .75rem + 2px); }
.report-form .hidden { display: none; }
.report-form .form-control.is-invalid, .report-form .form-select.is-invalid { border-color: #a00010; }
.section-spacer { height: 1.5rem; }

/* ---- Preview (HtmlDocumentPreview.scss) ---- */
.preview-wrap { background: #fff; border-radius: .375rem; min-width: 400px; }
.html-document-preview { background-color: var(--preview-canvas-bg); padding: 1rem 1.5rem; width: 100%; height: 100%; min-width: 0; }
.html-document-preview__content { width: 100%; height: var(--preview-height, 400px); min-height: 400px; }
.html-document-preview__paper { width: 816px; margin-left: auto; margin-right: auto; background: #fff; border-radius: .5rem; height: var(--paper-height, 400px); transform: scale(var(--preview-scale, 1)); transform-origin: top left; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.html-document-preview__iframe { display: block; width: 100%; height: 100%; border: none; border-radius: .5rem; }
.preview-loading { display: flex; justify-content: center; align-items: center; padding: 3rem; color: #2a4884; }
.preview-subtabs { padding: .5rem 1.5rem 0; }

/* ---- notes panes ---- */
.notes-pane { padding: 1.5rem; }
.notes-pane .note { border: 1px solid #dee2e6; border-radius: .375rem; padding: .625rem .75rem; margin-bottom: .5rem; }
.notes-pane .note-meta { font-size: .8125rem; color: #6c757d; }

/* ---- action bar (ReportActions.scss) ---- */
.report-actions { width: 100%; }
.report-actions-card-body { padding: 1rem; }
.report-actions-body { display: flex; flex-direction: row; align-items: center; flex-wrap: wrap; gap: .5rem; width: 100%; }
.report-actions-row-1 { display: flex; flex-direction: row; gap: .5rem; }
.report-actions-row-2 { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.report-actions-row-2 .btn:not(:disabled) { --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff; }
.report-actions-row-2 .btn:disabled { --bs-btn-disabled-bg: #e9ecef; --bs-btn-disabled-color: #6c757d; --bs-btn-disabled-border-color: #dee2e6; opacity: .8; }

.toast { --bs-toast-max-width: 22rem; }

/* ---- Report QC agent ---- */
:root {
  --qc-C1: #b8860b; --qc-C1-bg: rgba(255, 193, 7, .40);
  --qc-C2: #a00010; --qc-C2-bg: rgba(220, 53, 69, .30);
  --qc-C3: #6f42c1; --qc-C3-bg: rgba(111, 66, 193, .25);
  --qc-C4: #2a4884; --qc-C4-bg: rgba(42, 72, 132, .22);
  --qc-C5: #0f766e; --qc-C5-bg: rgba(20, 184, 166, .28);
  --qc-C6: #c2185b; --qc-C6-bg: rgba(233, 30, 99, .25);
}
.btn-qc { --bs-btn-color: #fff; --bs-btn-bg: #6f42c1; --bs-btn-border-color: #6f42c1; --bs-btn-hover-bg: #5a32a3; --bs-btn-hover-border-color: #5a32a3; --bs-btn-hover-color: #fff; --bs-btn-active-bg: #5a32a3; --bs-btn-disabled-bg: #6f42c1; --bs-btn-disabled-border-color: #6f42c1; --bs-btn-disabled-color: #fff; }
.btn-qc .qc-count { background: #fff; color: #6f42c1; border-radius: 999px; padding: 0 .4rem; font-size: .75rem; font-weight: 600; }

.qc-chip { display: inline-block; font-size: .7rem; font-weight: 700; line-height: 1; padding: .2rem .4rem; border-radius: .25rem; color: #fff; background: #6c757d; letter-spacing: .02em; }
.qc-chip.qc-C1 { background: var(--qc-C1); } .qc-chip.qc-C2 { background: var(--qc-C2); } .qc-chip.qc-C3 { background: var(--qc-C3); }
.qc-chip.qc-C4 { background: var(--qc-C4); } .qc-chip.qc-C5 { background: var(--qc-C5); } .qc-chip.qc-C6 { background: var(--qc-C6); }
.qc-sev { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; margin-right: .3rem; vertical-align: middle; }
.qc-sev.high { background: #a00010; } .qc-sev.medium { background: #d39e00; } .qc-sev.low { background: #6c757d; }

/* summary bar above the preview paper */
.qc-bar { background: #fff; border-bottom: 1px solid #dee2e6; padding: .5rem 1rem; font-size: .8125rem; position: sticky; top: 0; z-index: 5; }
.qc-bar__row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.qc-bar__title { font-weight: 600; color: #6f42c1; white-space: nowrap; }
.qc-bar__overall { color: #495057; flex: 1 1 12rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qc-bar .qc-filter { border: 1px solid transparent; background: transparent; padding: .1rem .3rem; border-radius: .3rem; display: inline-flex; align-items: center; gap: .3rem; cursor: pointer; color: #495057; }
.qc-filter.active { border-color: #6f42c1; background: rgba(111,66,193,.08); }
.qc-filter.empty { opacity: .4; }
.qc-bar .btn-nav { padding: 0 .4rem; line-height: 1.4; }
.qc-bar__stale { color: #a07a00; font-weight: 600; }
.qc-list { margin-top: .5rem; border-top: 1px dashed #dee2e6; padding-top: .5rem; max-height: 14rem; overflow-y: auto; }
.qc-list__item { display: flex; align-items: baseline; gap: .5rem; padding: .25rem .25rem; border-radius: .25rem; cursor: pointer; }
.qc-list__item:hover, .qc-list__item.active { background: rgba(111,66,193,.08); }
.qc-list__item.dismissed { opacity: .55; text-decoration: line-through; }
.qc-list__item .qc-list__where { margin-left: auto; color: #6c757d; white-space: nowrap; font-size: .75rem; }
.qc-list__item .qc-unanchored { color: #a07a00; font-size: .7rem; }

/* popover */
.qc-popover { position: fixed; z-index: 1080; width: 22rem; max-width: calc(100vw - 2rem); background: #fff; border: 1px solid #ced4da; border-radius: .5rem; box-shadow: 0 .5rem 1.5rem rgba(0,0,0,.18); font-size: .8125rem; }
.qc-popover__head { display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem; border-bottom: 1px solid #e9ecef; }
.qc-popover__head .qc-title { font-weight: 600; flex: 1; }
.qc-popover__head .btn-close { font-size: .65rem; }
.qc-popover__body { padding: .6rem .75rem; }
.qc-popover__body p { margin-bottom: .4rem; }
.qc-popover__fix { background: #f8f9fa; border-left: 3px solid #6f42c1; padding: .35rem .5rem; margin: .4rem 0; }
.qc-popover__fields .btn { text-align: left; }
.qc-popover__foot { display: flex; gap: .5rem; align-items: center; padding: .5rem .75rem; border-top: 1px solid #e9ecef; flex-wrap: wrap; }
.qc-popover__nav { margin-left: auto; color: #6c757d; display: flex; gap: .25rem; align-items: center; }
.qc-popover__dismiss textarea { font-size: .8125rem; }
.qc-popover__dismissed { color: #6c757d; font-style: italic; }

/* flagged fields in the Entry form */
.report-form .form-control.qc-flag, .report-form .form-select.qc-flag { border-color: #6f42c1; box-shadow: inset 3px 0 0 #6f42c1; }
.report-form .qc-field-note { display: flex; align-items: center; gap: .4rem; margin-top: .3rem; font-size: .78rem; color: #495057; cursor: pointer; }
.report-form .qc-field-note:hover .qc-field-note__title { text-decoration: underline; }
.report-form .qc-field-note .fa-arrow-right { color: #6f42c1; font-size: .7rem; }
.report-form .qc-flash { animation: qcFlash 1.6s ease-out; }
@keyframes qcFlash { 0% { box-shadow: 0 0 0 .35rem rgba(111,66,193,.55); } 100% { box-shadow: 0 0 0 .35rem rgba(111,66,193,0); } }

/* QC finding source: reference lookup (fact) / rule (fact) / LLM (judgement) */
.qc-src { display: inline-block; font-size: .62rem; font-weight: 600; line-height: 1; padding: .18rem .35rem; border-radius: .25rem; border: 1px solid transparent; letter-spacing: .02em; white-space: nowrap; }
.qc-src.ref { color: #0b5e3b; background: #e3f6ec; border-color: #9fd8b8; }
.qc-src.rule { color: #1d4f91; background: #e6eefb; border-color: #a9c2ea; }
.qc-src.llm { color: #5a3d99; background: #efe8fb; border-color: #c9b6ee; }
.qc-bar__sources { display: inline-flex; gap: .55rem; font-size: .7rem; color: #6c757d; white-space: nowrap; }
.qc-src-status.ok { color: #198754; } .qc-src-status.unavailable, .qc-src-status.error { color: #dc3545; } .qc-src-status.unused, .qc-src-status.skipped { color: #adb5bd; }

/* check names next to the codes, and the "What are C1-C6?" legend */
.qc-filter__name { font-size: .72rem; color: #495057; }
.qc-filter.empty .qc-filter__name { color: #6c757d; }
.qc-legend-toggle.active { font-weight: 600; }
.qc-legend { margin-top: .5rem; border-top: 1px dashed #dee2e6; padding-top: .5rem; display: grid; gap: .35rem; font-size: .8rem; }
.qc-legend__intro { color: #495057; margin-bottom: .2rem; }
.qc-legend__row { display: grid; grid-template-columns: 2.2rem 1fr; gap: .5rem; align-items: start; }
.qc-legend__row .qc-chip { margin-top: .15rem; }
.qc-field-note .qc-chip { white-space: nowrap; }
.qc-filter__count { font-weight: 600; min-width: 1ch; }
.qc-bar .qc-filter { gap: .25rem; padding: .1rem .25rem; }
.qc-bar__row { gap: .4rem; }
