/* =============================================================================
   Launch Pad header button + dropdown panel + run-detail dialog body.
   Mirrors notifications.css conventions so the two header icons look
   like a coherent set.
   ========================================================================== */

/* ---------- header button + badge ---------- */

.jbf-lp-btn-host {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.jbf-lp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #4e5e65;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
    position: relative;
    flex-shrink: 0;
}

.jbf-lp-btn:hover,
.jbf-lp-btn:focus-visible {
    background: rgba(125, 91, 129, 0.10);
    color: var(--jbf-plum);
    outline: none;
}

.jbf-lp-btn-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    vertical-align: middle;
    color: inherit;
}

/* Normalize whichever SVG ends up inside (built-in fallback OR the
   raw markup pulled from pages.icon) so it fills the 22x22 button slot.
   color: inherit lets stroke="currentColor" / fill="currentColor" SVGs
   follow the button's hover color. We deliberately do NOT set fill or
   stroke globally - that would clobber stroke-style glyphs. */
.jbf-lp-btn-icon-wrap > svg,
.jbf-lp-btn-icon {
    display: block;
    width: 22px;
    height: 22px;
    color: inherit;
}

button.jbf-lp-btn .jbf-lp-btn-badge {
    position: absolute;
    top: -10px;
    right: -18px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    /* Brand magenta -- pinned to literal #D23C77 (not the var) so the
       badge stays on-brand even on themes / shells that haven't loaded
       --jbf-magenta yet. */
    background: #D23C77;
    color: #fff;
    /* Lock the badge font to the Radzen body font (Monserrat) so the
       rendered size of the digits stays identical across every host
       layout. Without this, .public-page (preview/scenarios + event
       landing) and .onb-page (seller onboarding) inherit Overpass via
       --pl-font / --onb-font, whose 700-weight digits at 11px are
       slightly wider/heavier than Monserrat -- which made the badge
       look like it had different padding/margin on those pages compared
       to MainLayout where it inherits Monserrat. */
    font-family: var(--rz-text-font-family, Monserrat, sans-serif);
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    border: 2px solid #fff;
    box-sizing: border-box;
    pointer-events: none;
    letter-spacing: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

/* ---------- dropdown panel ---------- */

/* Click-outside catcher rendered as a sibling of .jbf-lp-btn-host. Same
   reasoning as the bell backdrop: the dropdown itself is portaled to <body>
   by JS, so this only intercepts clicks elsewhere in the header (page
   content underneath is covered by the dropdown's own z-index). */
.jbf-lp-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1099;
    background: transparent;
}

/* Position is owned by jbf-launch-pad-menu.js (fixed, anchored to button
   rect). Starts invisible to avoid the right-to-left flicker between the
   CSS-fallback position and the JS-computed final spot. */
.jbf-lp-dropdown {
    position: fixed;
    top: 64px;
    right: 12px;
    width: 380px;
    max-width: calc(100vw - 24px);
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: var(--rz-text-font-family, inherit);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.14s ease, transform 0.14s ease;
}

.jbf-lp-dropdown.jbf-lp-dropdown--ready {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .jbf-lp-dropdown {
        transition: none;
        transform: none;
    }
}

.jbf-lp-dropdown__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f3f5;
    background: #fafafa;
}

.jbf-lp-dropdown__title {
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
}

.jbf-lp-dropdown__body {
    max-height: 420px;
    overflow-y: auto;
}

.jbf-lp-dropdown__footer {
    padding: 10px 16px;
    border-top: 1px solid #f1f3f5;
    text-align: center;
    background: #fafafa;
}

.jbf-lp-dropdown__footer a {
    font-size: 13px;
    font-weight: 600;
    color: var(--jbf-plum);
    text-decoration: none;
}

.jbf-lp-dropdown__footer a:hover {
    text-decoration: underline;
}

/* ---------- list items ---------- */

.jbf-lp-item {
    display: grid;
    grid-template-columns: 1fr auto;
    column-gap: 10px;
    align-items: center;
    border-bottom: 1px solid #f5f5f5;
    background: transparent;
    transition: background-color 0.12s ease;
    padding: 0 8px;
}

.jbf-lp-item:last-child {
    border-bottom: none;
}

.jbf-lp-item:hover {
    background: #f9f7fb;
}

.jbf-lp-item__main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    text-align: left;
    padding: 12px 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    font: inherit;
    min-width: 0;
}

.jbf-lp-item__title {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.jbf-lp-item__category {
    font-size: 11px;
    font-weight: 500;
    color: #7d5b81;
    color: var(--jbf-plum, #7d5b81);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.jbf-lp-item__meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.jbf-lp-item__status {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 11px;
    font-weight: 600;
}

.jbf-lp-item.is-in-progress .jbf-lp-item__status {
    background: rgba(125, 91, 129, 0.10);
    color: var(--jbf-plum, #7d5b81);
}

.jbf-lp-item.is-assigned .jbf-lp-item__status {
    background: rgba(210, 60, 119, 0.10);
    color: var(--jbf-magenta, #d23c77);
}

.jbf-lp-item__progress {
    font-variant-numeric: tabular-nums;
    color: #6b7280;
}

.jbf-lp-item__start {
    flex-shrink: 0;
    align-self: center;
    background: var(--jbf-plum, #7d5b81);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    margin-right: 4px;
    transition: filter 0.12s ease, transform 0.12s ease;
}

.jbf-lp-item__start:hover:not(:disabled) {
    filter: brightness(1.05);
}

.jbf-lp-item__start:active:not(:disabled) {
    transform: translateY(1px);
}

.jbf-lp-item__start:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ---------- empty / error / loading states ---------- */

.jbf-lp-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 28px 16px;
    color: #6b7280;
}

.jbf-lp-empty--error {
    color: var(--jbf-red, #d80f3d);
}

.jbf-lp-empty__title {
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
}

.jbf-lp-empty__hint {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}

/* xs/sm tier (max-width 767.98px). Mirrors the bell dropdown's mobile
   bounds so the JS-fallback compute() result matches. */
@media (max-width: 767.98px) {
    .jbf-lp-dropdown {
        left: 12px;
        right: 12px;
        width: auto;
        max-width: none;
        max-height: calc(100vh - 120px);
    }

    .jbf-lp-dropdown__body {
        max-height: calc(100vh - 220px);
    }
}

/* =============================================================================
   Checklist run dialog body (opened via DialogService).
   .jbf-launch-pad-run-dialog is the wrapper class set on DialogOptions.
   ========================================================================== */

.jbf-lp-run-dialog {
    display: flex;
    flex-direction: column;
    min-height: 0;
    outline: none;
}

.jbf-lp-run-dialog__header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px 12px;
    border-bottom: 1px solid #f1f3f5;
    background: #fafafa;
}

.jbf-lp-run-dialog__header-text {
    flex: 1 1 0;
    min-width: 0;
}

.jbf-lp-run-dialog__title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.3;
}

.jbf-lp-run-dialog__category {
    margin-top: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--jbf-plum, #7d5b81);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.jbf-lp-run-dialog__meta {
    margin-top: 6px;
    font-size: 12px;
    color: #6b7280;
}

.jbf-lp-run-dialog__close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #6b7280;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.jbf-lp-run-dialog__close:hover {
    background: #f3f4f6;
    color: var(--jbf-plum, #7d5b81);
}

.jbf-lp-run-dialog__body {
    padding: 16px 20px;
    overflow-y: auto;
    max-height: 70vh;
}

.jbf-lp-run-dialog__empty,
.jbf-lp-run-dialog__error {
    text-align: center;
    color: #6b7280;
    padding: 24px 12px;
}

.jbf-lp-run-dialog__error {
    color: var(--jbf-red, #d80f3d);
}

.jbf-lp-run-dialog__steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.jbf-lp-run-dialog__step {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 14px;
    background: #fff;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.jbf-lp-run-dialog__step:hover {
    border-color: #d6d6d6;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.jbf-lp-run-dialog__step-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.jbf-lp-run-dialog__step-body {
    flex: 1 1 0;
    min-width: 0;
}

.jbf-lp-run-dialog__step-title {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.35;
}

.jbf-lp-run-dialog__step-desc {
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.45;
}

.jbf-lp-run-dialog__step-actions {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.jbf-lp-run-dialog__footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px 16px;
    border-top: 1px solid #f1f3f5;
    background: #fafafa;
}

/* Radzen wrapper class -- align dialog content padding so our internal
   chrome (header / body / footer) is the only padding the user sees. */
.jbf-launch-pad-run-dialog .rz-dialog-content {
    padding: 0 !important;
}
