/* QC procedure help icon + popover (issue #1038) */

.qc-help-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
}

/* Stylized "i": blue exterior ring, light blue interior, navy glyph */
.qc-help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--foo-blue3, #066E9F);
    background: #d9f1fb;
    color: var(--foo-blue2, #0B3B60);
    font-family: inherit;
    font-style: normal;
    font-weight: 700;
    font-size: 11px;
    line-height: 1;
    padding: 0;
    /* Invisible until the containing grid cell is hovered, then ghosted;
       full strength only when the description/icon itself is hovered.
       Opacity (not display) so columns don't reflow. No transition — instant. */
    opacity: 0;
}

/* Plain arrow, not a hand — hovering is what opens the help, so a click
   affordance would overpromise. The :not(:disabled) is load-bearing: Bootstrap's
   reboot sets `button:not(:disabled){cursor:pointer}` (specificity 0-1-1), which
   outranks a bare .qc-help-icon (0-1-0). This ties the pseudo-class to match it. */
.qc-help-icon:not(:disabled) {
    cursor: default;
}

td:hover .qc-help-icon {
    opacity: 0.45;
}

.qc-help-wrap:hover .qc-help-icon,
.qc-help-icon:focus-visible {
    opacity: 1;
}

.qc-help-icon:hover {
    background: #bfe7f8;
}

/* Custom JS popover (qcHelp.js) */
.qc-help-popover {
    position: fixed;
    z-index: 2000;
    min-width: 260px;
    max-width: 440px;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 6px;
    box-shadow: 0 6px 24px rgba(11, 59, 96, 0.25);
}

/* Carrot for the JS popover — a rotated square straddling the border */
.qc-help-popover-arrow {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #fff;
    transform: rotate(45deg);
    display: none;
}

.qc-help-popover-arrow.qc-arrow-left {
    left: -7px;
    border-left: 1px solid #ced4da;
    border-bottom: 1px solid #ced4da;
    display: block;
}

.qc-help-popover-arrow.qc-arrow-right {
    right: -7px;
    border-right: 1px solid #ced4da;
    border-top: 1px solid #ced4da;
    display: block;
}

.qc-help-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    background: #e9ecef;
    color: #212529;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 5px 5px 0 0;
}

.qc-help-popover-close {
    background: none;
    border: none;
    color: #212529;
    font-size: 18px;
    line-height: 1;
    padding: 0 2px;
    cursor: pointer;
}

.qc-help-popover-content {
    padding: 10px 14px;
    max-height: 320px;
    overflow-y: auto;
    font-size: 0.875rem;
    color: #212529;
    border-radius: 0 0 5px 5px;
}

.qc-help-popover-content > :last-child {
    margin-bottom: 0;
}

/* Syncfusion SfTooltip variant (QcHelpIcon native mode) */

/* The tooltip's root wrapper div is display:block, so inside a grid cell it
   stretches to the full column width and Position=RightCenter anchors to that
   phantom right edge. Shrink-wrap it to the description + icon. */
.e-tooltip:has(> .qc-help-wrap) {
    display: inline-flex;
    max-width: 100%;
    vertical-align: middle;
    /* The wrapper also carries .e-control, which the theme re-bases to 12px and
       its own system-ui stack. Left alone, rows WITH help render in a different
       font than their icon-less siblings (which emit no wrapper at all).
       Hand the cell's own typography back. */
    font: inherit;
}

.qc-help-tooltip.e-tooltip-wrap {
    max-width: 440px;
    padding: 0;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 6px;
    box-shadow: 0 6px 24px rgba(11, 59, 96, 0.25);
    opacity: 1;
}

.qc-help-tooltip.e-tooltip-wrap .e-tip-content {
    padding: 0 !important;
    margin: 0;
    color: #212529;
}

/* Tip pointer (carrot): outer triangle = border gray, inner = popup fill */
.qc-help-tooltip.e-tooltip-wrap .e-arrow-tip-outer.e-tip-left { border-right-color: #ced4da; }
.qc-help-tooltip.e-tooltip-wrap .e-arrow-tip-inner.e-tip-left { color: #fff; }
.qc-help-tooltip.e-tooltip-wrap .e-arrow-tip-outer.e-tip-right { border-left-color: #ced4da; }
.qc-help-tooltip.e-tooltip-wrap .e-arrow-tip-inner.e-tip-right { color: #fff; }
.qc-help-tooltip.e-tooltip-wrap .e-arrow-tip-outer.e-tip-top { border-bottom-color: #ced4da; }
.qc-help-tooltip.e-tooltip-wrap .e-arrow-tip-inner.e-tip-top { color: #e9ecef; }
.qc-help-tooltip.e-tooltip-wrap .e-arrow-tip-outer.e-tip-bottom { border-top-color: #ced4da; }
.qc-help-tooltip.e-tooltip-wrap .e-arrow-tip-inner.e-tip-bottom { color: #fff; }

/* Add Validation Procedure / Add Fixes dialogs — collapsible regions */

/* Label + Expand All/Collapse All row. The button group reuses the editors'
   Simple/Guided wizard styling from stepEditor.css (.view-mode-toggle-minimal),
   which centers itself by default — pin it to the right of the label here. */
.qc-add-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 0.5rem;
}

.qc-add-toolbar .view-mode-toggle-minimal {
    margin: 0;
}

/* stepEditor.css paints the wizard's filled state via `.btn-check:checked + .btn`,
   which only fires for radio inputs. These are action buttons, so reproduce the
   same greys off :hover/:active plus an explicit state class. Selectors are
   deliberately one level deeper than the stepEditor rules so they win outright
   instead of relying on stylesheet order. */
.qc-add-toolbar .view-mode-toggle-minimal .btn {
    background-color: #fff;
    color: #6c757d;
}

.qc-add-toolbar .view-mode-toggle-minimal .btn:hover {
    background-color: #f8f9fa;
    border-color: #6c757d;
    color: #495057;
}

/* Currently-true state (everything expanded, or everything collapsed) fills with
   the same grey as the editors' selected Simple/Guided pill (stepEditor.css:
   `.btn-check:checked + .btn` → #6c757d, hover #5a6268). */
.qc-add-toolbar .view-mode-toggle-minimal .btn.qc-add-toggle-on {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff;
}

.qc-add-toolbar .view-mode-toggle-minimal .btn.qc-add-toggle-on:hover,
.qc-add-toolbar .view-mode-toggle-minimal .btn.qc-add-toggle-on:active {
    background-color: #5a6268;
    border-color: #5a6268;
    color: #fff;
}

.qc-add-toolbar .view-mode-toggle-minimal .btn:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.35);
    z-index: 1;
}

.qc-add-list {
    max-height: 60vh;
    overflow-y: auto;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.qc-add-region {
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: #fff;
}

.qc-add-region.qc-add-existing {
    opacity: 0.55;
}

.qc-add-region-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
}

.qc-add-region-header.qc-add-expandable {
    cursor: pointer;
}

.qc-add-region-header.qc-add-expandable:hover {
    background: #f3f9fd;
    border-radius: 6px;
}

.qc-add-region-header .form-check-input {
    flex: 0 0 auto;
    margin-top: 0;
}

.qc-add-region-titles {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
}

.qc-add-region-title {
    font-weight: 600;
    color: var(--foo-blue2, #0B3B60);
}

.qc-add-region-subtitle {
    font-size: 0.8rem;
    color: #6c757d;
}

.qc-add-region-added {
    flex: 0 0 auto;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    border: 1px solid #ced4da;
    border-radius: 10px;
    padding: 1px 8px;
}

.qc-add-region-chevron {
    flex: 0 0 auto;
    color: var(--foo-blue2, #0B3B60);
    user-select: none;
}

.qc-add-region-body {
    border-top: 1px solid #e9ecef;
    padding: 10px 14px 10px 40px;
    font-size: 0.875rem;
    color: #212529;
}

.qc-add-region-body > :last-child {
    margin-bottom: 0;
}
