/* Shared pieces: the page header, cards, badges, dialogs, tables, alerts, the stepper, hints. */

.qcb-container {
    max-width: var(--qcb-content-width);
    margin: 0 auto;
}

.qcb-container-wide {
    max-width: 100%;
    margin: 0;
}

/* A form's column: the whole content width, as the lists have (#438). On a wide
   screen its sections sit in two columns ("Forms on the full width" below). */
.qcb-form-column {
    max-width: var(--qcb-content-width);
    margin: 0;
}

/* Page Header: an optional context line, the title, an optional one-line
   subtitle (anything longer goes in the title's hint) and the actions on the
   right. */
.qcb-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.qcb-page-header-left {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.qcb-page-titlerow {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.qcb-page-title {
    font-family: var(--qcb-font-heading);
    color: var(--qcb-gray-900);
    margin: 0;
    overflow-wrap: anywhere;
}

.qcb-page-subtitle {
    font-size: 0.875rem;
    margin: 0;
}

.qcb-page-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* A role without the page's actions gets no empty row. */
.qcb-page-actions:empty {
    display: none;
}

@media (max-width: 720px) {

    .qcb-page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .qcb-page-actions {
        justify-content: stretch;
    }

    .qcb-page-actions > .qcb-btn {
        flex: 1;
        justify-content: center;
    }
}

/* Buttons */
.qcb-btn {
    display: inline-flex;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.qcb-btn-primary {
    background-color: var(--qcb-action-bg);
    border-color: var(--qcb-action-bg);
}

.qcb-btn-primary:hover {
    background-color: var(--qcb-action-hover-bg);
    border-color: var(--qcb-action-hover-bg);
    text-decoration: none;
}

.qcb-btn-secondary:hover {
    text-decoration: none;
}

.qcb-btn-danger {
    background-color: transparent;
    color: var(--qcb-red-600);
    border-color: transparent;
}

.qcb-btn-danger:hover {
    background-color: var(--qcb-red-50);
    color: var(--qcb-red-700);
}

.qcb-btn-icon {
    width: 2rem;
    height: 2rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}

.qcb-btn-icon:hover {
    background-color: var(--qcb-gray-100);
}

.qcb-btn-icon-danger:hover {
    background-color: var(--qcb-red-50);
    color: var(--qcb-red-600);
}

/* A Delete that waits until nothing uses the item (#652): greyed, no hover. */
.qcb-btn-icon:disabled,
.qcb-btn-icon:disabled:hover {
    cursor: not-allowed;
    background-color: transparent;
    color: var(--qcb-gray-400);
}

/* Tabs */
.qcb-tabs {
    display: flex;
    /* A tab keeps its label on one line, so the strip wraps on a phone instead of widening the page (#390). */
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0;
}

/* gray-600: a tab strip sits on the warm grey ground, where gray-500 falls short
   of 4.5:1 (#422). */
.qcb-tab {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--qcb-gray-600);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: -1px;
    white-space: nowrap;
}

.qcb-tab:hover {
    color: var(--qcb-gray-700);
}

/* The chosen tab reads as the top bar's current link does: dark text over the teal
   line. Teal text on the warm grey ground falls short of 4.5:1 (#422). */
.qcb-tab.qcb-tab--active {
    color: var(--qcb-gray-900);
    border-bottom-color: var(--qcb-teal-600);
    font-weight: 600;
}

/* Search */
.qcb-search-wrapper {
    position: relative;
    max-width: 24rem;
    margin-bottom: 1.5rem;
}

.qcb-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--qcb-gray-400);
    pointer-events: none;
}

.qcb-search-input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    font-size: 0.875rem;
    border: 1px solid var(--qcb-gray-200);
    border-radius: 0.375rem;
    outline: none;
    transition: all 0.15s ease;
}

.qcb-search-input:focus {
    border-color: var(--qcb-teal-500);
    box-shadow: 0 0 0 3px var(--qcb-teal-50);
}

/* Card Grid */
.qcb-card-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1rem;
}

@media (min-width: 768px) {
    .qcb-card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .qcb-card-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Card */
.qcb-card {
    border: 1px solid var(--qcb-gray-200);
    border-radius: 0.5rem;
    cursor: pointer;
}

.qcb-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.qcb-card-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.qcb-card-icon {
    width: 2.5rem;
    height: 2.5rem;
    align-items: center;
    justify-content: center;
    background-color: var(--qcb-teal-50);
    border-radius: 0.5rem;
    flex-shrink: 0;
}

.qcb-card-icon i {
    font-size: 1.25rem;
    color: var(--qcb-teal-600);
}

.qcb-card-icon-blue {
    background-color: var(--qcb-blue-50);
}

.qcb-card-icon-blue i {
    color: var(--qcb-blue-600);
}

.qcb-card-icon-amber {
    background-color: var(--qcb-amber-50);
}

.qcb-card-icon-amber i {
    color: var(--qcb-amber-600);
}

.qcb-card-icon-img {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.qcb-card-icon-img img {
    width: 2rem;
    height: 2rem;
    object-fit: contain;
}

.qcb-card-title-group {
    min-width: 0;
}

.qcb-card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--qcb-gray-900);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qcb-card-subtitle {
    margin: 0.125rem 0 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qcb-card-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.qcb-card-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.qcb-card-info-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
}

.qcb-card-info-row i {
    font-size: 0.875rem;
    color: var(--qcb-gray-400);
    width: 1rem;
    text-align: center;
}

.qcb-card-footer {
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px solid var(--qcb-gray-100);
}

.qcb-card-footer-link {
    font-size: 0.8125rem;
    font-weight: 500;
}

/* Badges */
.qcb-badge {
    display: inline-flex;
    align-items: center;
}

/* Empty State */
.qcb-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--qcb-surface);
    border: 1px solid var(--qcb-gray-200);
    border-radius: 0.5rem;
}

.qcb-empty-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
}

.qcb-empty-icon i {
    font-size: 2rem;
    color: var(--qcb-gray-400);
}

.qcb-empty-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--qcb-gray-900);
    margin: 0 0 0.5rem 0;
}

.qcb-empty-text {
    font-size: 0.875rem;
    color: var(--qcb-gray-500);
    margin: 0 0 1.5rem 0;
}

/* Loading State */
.qcb-loading {
    text-align: center;
    padding: 4rem 2rem;
}

.qcb-loading p {
    margin-top: 1rem;
    color: var(--qcb-gray-500);
}

/* Storage Icons */
/* Webhook channel marks. Sized to sit on the text baseline of whatever names the
   channel next to them, so a logo and a glyph occupy the same box and a row of
   mixed channels keeps one rhythm. Rendered by <WebhookChannelLogo>. */
.qcb-channel-logo,
.qcb-channel-logo-icon {
    width: 1.15rem;
    height: 1.15rem;
    flex-shrink: 0;
}

.qcb-channel-logo {
    object-fit: contain;
    vertical-align: -0.2em;
}

.qcb-channel-logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    line-height: 1;
    color: var(--qcb-gray-500, var(--qcb-gray-500));
}

/* Modal Styles */
.qcb-modal-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.qcb-modal {
    background: var(--qcb-surface);
    width: 100%;
    max-width: 28rem;
    max-height: 90vh;
    overflow: hidden;
}

.qcb-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.qcb-modal-title {
    margin: 0;
}

.qcb-modal-close {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 0.25rem;
}

.qcb-modal-close:hover {
    background-color: var(--qcb-gray-100);
    color: var(--qcb-gray-600);
}

/* A long confirmation body scrolls inside the dialog rather than pushing the
   buttons off-screen. */
.qcb-modal-body {
    padding: 1.25rem;
}

.qcb-delete-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.qcb-delete-warning i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.qcb-delete-warning p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--qcb-gray-700);
}

.qcb-delete-details {
    font-size: 0.875rem;
    color: var(--qcb-gray-500);
    margin: 0;
}

.qcb-filter-select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--qcb-gray-200);
    border-radius: 0.375rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.25rem;
    appearance: none;
    cursor: pointer;
    min-width: 140px;
}

.qcb-filter-select:focus {
    outline: none;
    border-color: var(--qcb-teal-500);
    box-shadow: 0 0 0 3px var(--qcb-teal-50);
}

/* Segmented control: text-bearing
   and full-width. Use when the choices need labels (e.g. Project Type). */
.qcb-segmented {
    display: flex;
    background: var(--qcb-gray-100);
    border-radius: 0.5rem;
    padding: 0.25rem;
    gap: 0.25rem;
}

.qcb-segmented-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    background: transparent;
    color: var(--qcb-gray-600);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.qcb-segmented-btn:hover:not(.active):not(:disabled) {
    color: var(--qcb-gray-900);
}

.qcb-segmented-btn.active {
    background: var(--qcb-surface);
    color: var(--qcb-teal-700);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.qcb-segmented-btn:disabled {
    cursor: not-allowed;
    opacity: 0.75;
}

/* Job-type badge (B = Backup, R = Restore). Reusable wherever backup and
   restore jobs/runs appear together (schedule trigger picker, Activity feed). */
.qcb-jobtype-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.3rem;
    height: 1.3rem;
    border-radius: 5px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--qcb-on-fill);
    line-height: 1;
}

.qcb-jobtype-badge--backup {
    background: #5EB1A5;
}

/* Tables */
.qcb-table-card {
    background: var(--qcb-surface);
    border: 1px solid var(--qcb-gray-200);
    border-radius: 0.5rem;
    overflow: hidden;
}

.qcb-table {
    width: 100%;
    border-collapse: collapse;
}

.qcb-table thead {
    background-color: var(--qcb-gray-50);
}

.qcb-table th {
    padding: 0.875rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--qcb-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.025em;
    text-align: left;
    border-bottom: 1px solid var(--qcb-gray-200);
}

.qcb-table td {
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    color: var(--qcb-gray-700);
    border-bottom: 1px solid var(--qcb-gray-100);
    vertical-align: middle;
}

.qcb-table tbody tr:last-child td {
    border-bottom: none;
}

.qcb-table tbody tr:hover {
    background-color: var(--qcb-gray-50);
}

.qcb-table-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qcb-user-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.qcb-user-avatar {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
}

.qcb-user-avatar i {
    font-size: 1rem;
}

.qcb-form-card {
    background: var(--qcb-surface);
    border: 1px solid var(--qcb-gray-200);
    border-radius: 0.5rem;
    padding: 1.5rem;
}

.qcb-form-section {
    margin-bottom: 1.5rem;
}

.qcb-form-section:last-child {
    margin-bottom: 0;
}

.qcb-form-group {
    margin-bottom: 1rem;
}

.qcb-form-group:last-child {
    margin-bottom: 0;
}

/* Ensure Tooltip wrappers don't break input width */
.qcb-form-group > [data-bs-toggle="tooltip"],
.qcb-form-group > div:has(> .qcb-form-input),
.qcb-form-group > div:has(> select.qcb-form-input) {
    display: block;
    width: 100%;
}

.qcb-form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--qcb-gray-700);
    margin-bottom: 0.375rem;
}

.qcb-form-input,
.qcb-form-select,
select.qcb-form-input,
input.qcb-form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    border: 1px solid var(--qcb-gray-200);
    border-radius: 0.375rem;
    background-color: var(--qcb-surface);
    transition: all 0.15s ease;
    box-sizing: border-box;
}

.qcb-form-input:focus,
.qcb-form-select:focus {
    outline: none;
    border-color: var(--qcb-teal-500);
    box-shadow: 0 0 0 3px var(--qcb-teal-50);
}

.qcb-form-input:disabled,
.qcb-form-select:disabled {
    background-color: var(--qcb-gray-50);
    color: var(--qcb-gray-500);
    cursor: not-allowed;
}

.qcb-form-hint {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* A day-of-month that occurs in none of the months a yearly schedule selects.
   Picking it would produce a rule with no occurrences, so the button is disabled
   unless it is already selected -- disabling a selected one would leave no way to
   remove it, hence the separate treatment here. */
.qcb-monthday-btn--unreachable {
    color: var(--qcb-gray-400);
    text-decoration: line-through;
    opacity: 0.65;
}

.qcb-monthday-btn--unreachable:disabled {
    cursor: not-allowed;
}

.qcb-form-actions {
    display: flex;
    /* Wraps on a phone, where each .qcb-btn is full width, instead of running off the page (#390). */
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--qcb-gray-100);
}

.qcb-text-muted {
    color: var(--qcb-gray-400);
}

/* Alerts */
.qcb-alert {
    display: flex;
    align-items: flex-start;
}

.qcb-alert i {
    flex-shrink: 0;
}

.qcb-alert-warning {
    border: 1px solid var(--qcb-amber-100);
}

.qcb-alert-danger {
    border: 1px solid var(--qcb-red-100);
}

/* Information that needs no action: the storage's own retention rules (#300). */
.qcb-alert-info {
    border: 1px solid var(--qcb-blue-100);
}

/* A link inside an alert takes the alert's own colour, underlined so it still reads as
   a link (#375). */
.qcb-alert a.qcb-alert-link {
    font-weight: 600;
}

/* The scheduler is paused (#340): one of the app shell's banners since #605, styled
   as qcb-app-banner. */

/* Email isn't set up (#375): the notice above the recipients, the Send Test result below. */
.qcb-email-setup-notice {
    margin-bottom: 1rem;
}

.qcb-test-email-result {
    margin: 0.75rem 0 0 0;
}

/* Icon Links */
.qcb-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    color: var(--qcb-gray-500);
    border-radius: 0.25rem;
    transition: all 0.15s ease;
}

.qcb-icon-link:hover {
    background-color: var(--qcb-gray-100);
    color: var(--qcb-teal-600);
}

.qcb-icon-link i {
    font-size: 1rem;
}

/* Toggle Switch */
.qcb-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.qcb-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.qcb-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: var(--qcb-gray-200);
    transition: 0.3s ease;
    border-radius: 26px;
}

.qcb-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: var(--qcb-surface);
    transition: 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.qcb-switch input:checked + .qcb-slider {
    background-color: var(--qcb-teal-600);
}

.qcb-switch input:checked + .qcb-slider:before {
    transform: translateX(22px);
}

.qcb-switch input:focus + .qcb-slider {
    box-shadow: 0 0 0 3px var(--qcb-teal-50);
}

/* Consistent form field label across the job editor. */
.qcb-flabel {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--qcb-gray-700);
    margin-bottom: 0.4rem;
}

/* Auto job config modal type cards */
.qcb-auto-type-card {
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--qcb-gray-300);
    border-radius: 10px;
    background: var(--qcb-gray-50);
    transition: border-color 0.15s;
}

.qcb-auto-type-card:hover {
    border-color: #5EB1A5;
}

.qcb-auto-type-card--disabled {
    opacity: 0.55;
}

.qcb-auto-type-card-title {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Cap BootstrapBlazor Select dropdown height inside modals */
.modal .dropdown-menu {
    --bb-dropdown-max-height: 280px;
}

/* ---------------------------------------------------------------------------
   Run dialog (#279)

   A restore's Run dialog leads with what the restore does; the one-off time
   limit is folded under "Run options".
   --------------------------------------------------------------------------- */
.qcb-restore-confirm-heading {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--qcb-gray-500);
    margin-bottom: 0.375rem;
}

.qcb-restore-counts {
    list-style: none;
    padding: 0;
    margin: 0 0 0.75rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
    gap: 0.25rem 1.5rem;
}

.qcb-restore-counts li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--qcb-gray-200);
}

.qcb-restore-count {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.qcb-restore-replace-list {
    list-style: none;
    padding: 0;
    margin: 0 0 0.25rem;
}

.qcb-restore-replace-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.5rem;
    padding: 0.125rem 0;
}

.qcb-restore-replace-name {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.qcb-restore-replace-setting {
    font-size: 0.75rem;
    padding: 0 0.375rem;
    border-radius: 0.25rem;
    background: rgba(0, 0, 0, 0.06);
}

.qcb-run-options {
    border-top: 1px solid var(--qcb-gray-200);
    padding-top: 0.5rem;
}

.qcb-run-options-toggle {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.5rem;
    width: 100%;
    padding: 0.25rem 0;
    border: 0;
    background: none;
    text-align: start;
    color: inherit;
}

.qcb-run-options-toggle > i {
    width: 0.75rem;
    font-size: 0.75rem;
    color: var(--qcb-gray-500);
}

.qcb-run-options-title {
    font-weight: 600;
}

.qcb-run-options-current {
    font-size: 0.875rem;
    color: var(--qcb-gray-500);
}

.qcb-run-options-body {
    padding: 0.5rem 0 0 1.25rem;
}

/* The hours and minutes lists used to be as wide as half the dialog, for values
   like "4 h". Each control is as wide as its longest value, and its list is as
   wide as the control or its own content, whichever is wider. Two of them side
   by side still fit a phone. */
.qcb-run-timeout {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
}

.qcb-run-timeout .select {
    width: 7.5rem;
}

.qcb-run-timeout .select:not(.cascade) .dropdown-menu {
    width: max-content;
    min-width: 100%;
}

/* ---------------------------------------------------------------------------
   Scrollable data tables (#130)

   A wide data table used to widen the PAGE on a narrow screen: the whole
   layout - nav, header, toolbar - slid sideways with the table and the user
   had to scroll the document back to reach anything. Every data table is
   wrapped in this container instead, so the overflow is confined to the
   table's own box and the page itself never scrolls horizontally.

   `overflow-x: auto` also establishes a clipping context. That is safe here:
   the only floating UI inside these tables (BootstrapBlazor Tooltip /
   PopConfirmButton) renders its tip into document.body through Bootstrap's
   popover, so it is not clipped by the wrapper.
   --------------------------------------------------------------------------- */
.qcb-table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* Contains the absolutely positioned visually-hidden header text ("Actions").
       Without it that text is placed at the table's far right, outside the
       scroll box, and widens the whole page on a phone (#384). */
    position: relative;
}

/* Below this width the columns crush into unreadable slivers, so the wrapper
   scrolls instead of the cells shrinking. A no-op on a desktop viewport. */
.qcb-table-scroll > table {
    min-width: 40rem;
}

/* Column-heavy tables (the job list, the platform lists) need more room
   before the columns stop being readable. */
.qcb-table-scroll--wide > table {
    min-width: 60rem;
}

/* Compact tables inside a narrow modal must not be forced wider than the
   dialog that holds them. */
.qcb-table-scroll--auto > table {
    min-width: 0;
}

/* Solid destructive button. `.qcb-btn-danger` above is the quiet, borderless
   variant used for row actions; a confirm dialog's primary action needs the
   filled one that the delete modals previously inlined as a style attribute. */
.qcb-btn-danger-solid {
    background-color: var(--qcb-red-600);
    color: var(--qcb-on-fill);
    border-color: var(--qcb-red-600);
}

.qcb-btn-danger-solid:hover {
    background-color: var(--qcb-red-700);
    border-color: var(--qcb-red-700);
    color: var(--qcb-on-fill);
    text-decoration: none;
}

.qcb-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* A disabled primary button (Run while the job is running, #382) does not darken on hover. */
.qcb-btn-primary:disabled:hover {
    background-color: var(--qcb-action-bg);
    border-color: var(--qcb-action-bg);
}

/* The dialog box is focused programmatically when it opens so a screen reader
   announces the dialog before its first control; that focus ring would be
   noise. Keyboard focus rings on the controls INSIDE it are untouched. */
.qcb-modal:focus {
    outline: none;
}

/* The progress row sits between the body and the footer while the confirmed
   action runs. It is not part of the scrolling body: a progress bar that can
   scroll out of sight defeats the point of showing it. */
.qcb-modal-progress {
    padding: 0 1.25rem 1.25rem;
}

/* Responsive adjustments */
@media (max-width: 640px) {

    .qcb-page-header {
        flex-direction: column;
        gap: 1rem;
    }

    .qcb-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   Job editor stepper

   One rule set drives both shapes of the job editor header: a gated 1-2-3
   stepper while creating a job, and a plain tab strip while editing one. Each
   step is a real <button>, so focus styling has to be explicit here rather
   than inherited from .qcb-tab.
   ========================================================================== */
.qcb-stepper-nav {
    margin-bottom: 1.5rem;
}

.qcb-stepper {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: stretch;
    list-style: none;
    margin: 0;
    padding: 0 0 0.75rem;
    border-bottom: 1px solid var(--qcb-gray-200);
}

.qcb-step-item {
    display: flex;
    align-items: center;
    flex: 0 1 auto;
    min-width: 0;
}

/* The connector between steps. Decorative, so it lives on the list item
   rather than in the markup where a screen reader would announce it. */
.qcb-step-item + .qcb-step-item::before {
    content: "";
    flex: 0 0 1.5rem;
    height: 1px;
    margin-right: 0.5rem;
    background-color: var(--qcb-gray-200);
}

.qcb-step {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.875rem;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--qcb-gray-500);
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.qcb-step:hover:not(:disabled) {
    background-color: var(--qcb-gray-100);
    color: var(--qcb-gray-700);
}

.qcb-step:focus-visible {
    outline: 2px solid var(--qcb-teal-600);
    outline-offset: 2px;
}

.qcb-step--current {
    color: var(--qcb-teal-700);
}

.qcb-step--complete {
    color: var(--qcb-gray-700);
}

/* A step that is not reachable yet is disabled, not hidden — the user can see
   what is still ahead of them. */
.qcb-step--locked {
    opacity: 0.55;
    cursor: not-allowed;
}

.qcb-step-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 600;
}

.qcb-step--current .qcb-step-marker {
    background-color: var(--qcb-action-bg);
    color: var(--qcb-on-fill);
}

.qcb-step-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.qcb-step-title {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
}

.qcb-step-desc {
    font-size: 0.75rem;
    color: var(--qcb-gray-500);
    line-height: 1.3;
}

.qcb-step--current .qcb-step-desc {
    color: var(--qcb-teal-700);
}

/* Panels. A hidden panel stays in the DOM — the object tabset holds the
   objects retrieved so far and a @ref the page calls into, so it is hidden
   with the `hidden` attribute rather than removed from the render tree. */
.qcb-step-panel[hidden] {
    display: none !important;
}

.qcb-step-panel-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--qcb-gray-900);
    margin: 0 0 0.25rem;
}

.qcb-step-panel-desc {
    font-size: 0.8125rem;
    color: var(--qcb-gray-500);
    margin: 0 0 1.25rem;
}

/* A callout sitting inside a form, rather than standing in for a whole page. */
.qcb-empty-state--inline {
    padding: 2rem 1.5rem;
    max-width: 45em;
    margin: 1rem 0;
}

@media (max-width: 640px) {
    /* Four steps (#332): two by two, names only, so the step itself stays in view. */
    .qcb-stepper {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .qcb-step-item + .qcb-step-item::before {
        display: none;
    }

    .qcb-step {
        width: 100%;
        padding: 0.375rem 0.5rem;
    }

    .qcb-step-desc {
        display: none;
    }
}

/* ==========================================================================
   Accessibility primitives (#134)
   ==========================================================================
   Small cross-cutting rules the accessibility pass leans on. They live here
   rather than in a page's scoped stylesheet because a scoped .razor.css file
   would not reach the shared components that also use them. */

/* A control that renders as bare inline content: no button chrome, but a real
   <button> underneath, so it is keyboard-focusable and announced as a button.
   Replaces the <a> elements that carried an @onclick but no href - those were
   mouse-only, because an anchor without href is not in the tab order. */
.qcb-icon-btn {
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    color: inherit;
    font: inherit;
    line-height: inherit;
    cursor: pointer;
}

/* A card or table row that behaves as a link or a button. The markup side adds
   role, tabindex and an Enter/Space key handler; this rule gives it the focus
   ring a native control would have drawn for free. */
.qcb-activatable {
    cursor: pointer;
}

/* :focus-visible rather than :focus, so a mouse click leaves no ring behind
   while keyboard focus is always visible (WCAG 2.4.7). The outline is drawn
   outside the box so it never reflows the card. */
.qcb-activatable:focus-visible,
.qcb-icon-btn:focus-visible {
    outline: 3px solid var(--qcb-teal-600);
    outline-offset: 2px;
    box-shadow: 0 0 0 5px rgba(13, 148, 136, 0.18);
}

/* Safety net: any focusable element shows a ring on keyboard focus, including
   one whose outline a component stylesheet removed.

   Deliberately UNSCOPED, and deliberately the last rule in the file. An earlier
   version scoped this to `.qcb-page` to avoid fighting BootstrapBlazor's
   widgets, which left two holes a keyboard walk of the running app found at
   once: Pages/Overview/Overview.razor does not use the .qcb-page shell, so the
   entire landing page drew no focus ring at all, and neither did the footer in
   MainLayout, which sits outside the shell on every page.

   Bare element selectors have specificity 0,0,1, so any component rule that
   wants a different focus treatment still wins - the scoping bought nothing
   that specificity does not already give. :focus-visible keeps it off mouse
   clicks. */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--qcb-teal-600);
    outline-offset: 2px;
}

/* ---------------------------------------------------------------------------
   Hints (<QcbHint>). A small "i" beside a label; the bubble is positioned by
   wwwroot/js/qcb-hint.js against <body> so no scroll container can clip it.
   --------------------------------------------------------------------------- */

/* A label with a hint beside it. The hint sits OUTSIDE the <label> on purpose:
   inside it, clicking the "i" would also activate the label and focus the field. */
.qcb-form-label-row {
    display: flex;
    align-items: center;
    margin-bottom: 0.35rem;
}

.qcb-form-label-row .qcb-form-label {
    margin-bottom: 0;
}

.qcb-hint-wrap {
    display: inline-flex;
    align-items: center;
}

.qcb-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15rem;
    height: 1.15rem;
    margin-inline-start: 0.35rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--qcb-gray-400, var(--qcb-gray-400));
    font-size: 0.95rem;
    line-height: 1;
    cursor: help;
    transition: color 0.12s ease, background-color 0.12s ease;
}

.qcb-hint:hover {
    color: var(--qcb-teal-600, var(--qcb-teal-700));
}

/* Never remove the ring without replacing it: this control is reachable only by
   keyboard for some users, and it is small enough to lose on a busy form. */
.qcb-hint:focus-visible {
    outline: 2px solid var(--qcb-teal-600, var(--qcb-teal-700));
    outline-offset: 2px;
    color: var(--qcb-teal-600, var(--qcb-teal-700));
}

/* Visually clipped, still in the accessibility tree. display:none or [hidden]
   would take it out of both, and aria-describedby cannot point at either. */
/* A column heading whose meaning needs a sentence. The hint sits on the heading
   rather than on the cell, so the explanation appears once instead of once per
   row. */
.qcb-th-with-hint {
    display: inline-flex;
    align-items: center;
}

.qcb-hint-target {
    cursor: help;
    /* Dotted underline is the long-standing convention for "there is more here".
       Kept off the icon variant, where the icon already says so. */
    text-decoration: underline dotted;
    text-underline-offset: 0.2em;
    text-decoration-color: var(--qcb-gray-400, var(--qcb-gray-400));
}

.qcb-hint-target:focus-visible {
    outline: 2px solid var(--qcb-teal-600, var(--qcb-teal-700));
    outline-offset: 2px;
}

.qcb-hint-content {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.qcb-hint-bubble {
    position: fixed;
    z-index: 1080; /* above modals, which is where many hints live */
    max-width: 22rem;
    padding: 0.55rem 0.7rem;
    border-radius: 0.5rem;
    background: var(--qcb-gray-800, var(--qcb-gray-800));
    color: var(--qcb-on-fill);
    font-size: 0.8rem;
    line-height: 1.45;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.12s ease;
    pointer-events: none;
}

.qcb-hint-bubble--visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* so a long hint can be read without it vanishing */
}

.qcb-hint-bubble code {
    padding: 0.05rem 0.25rem;
    border-radius: 0.25rem;
    background: rgba(255, 255, 255, 0.14);
    color: inherit;
    font-size: 0.95em;
}

.qcb-hint-bubble p {
    margin: 0 0 0.4rem;
}

.qcb-hint-bubble p:last-child,
.qcb-hint-bubble ul:last-child {
    margin-bottom: 0;
}

.qcb-hint-bubble ul {
    margin: 0.2rem 0 0.4rem;
    padding-inline-start: 1.1rem;
}

@media (prefers-reduced-motion: reduce) {
    .qcb-hint,
    .qcb-hint-bubble {
        transition: none;
    }
}

/* ── Job editor: webhook coverage (#167) ──────────────────────────────────
   Who gets told when this job finishes. Deliberately quiet: it is a fact about
   the job, not a control, so it reads as a note rather than competing with the
   fields around it. The exception is a subscription that has stopped
   delivering, which is the one thing on the panel worth interrupting for. */
.qcb-coverage {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--qcb-border, var(--qcb-gray-200));
}

.qcb-coverage-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
}

.qcb-coverage-empty {
    margin: 0;
    color: var(--qcb-text-muted, var(--qcb-gray-500));
    font-size: 0.875rem;
}

.qcb-coverage-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.qcb-coverage-item {
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--qcb-border, var(--qcb-gray-200));
    border-radius: 0.5rem;
    background: var(--qcb-surface, var(--qcb-surface));
}

.qcb-coverage-item-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.qcb-coverage-logo {
    width: 1.125rem;
    height: 1.125rem;
    flex: 0 0 auto;
}

.qcb-coverage-name {
    font-weight: 600;
    /* A long subscription name wraps instead of pushing the badge off the row. */
    min-width: 0;
    overflow-wrap: anywhere;
}

.qcb-coverage-item-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    color: var(--qcb-text-muted, var(--qcb-gray-500));
}

.qcb-coverage-gap-reason {
    margin: 0.375rem 0 0;
    font-size: 0.8125rem;
    color: var(--qcb-danger-text, var(--qcb-red-700));
}

/* ── Connection editor: what the auth type costs (#173) ───────────────────
   A note, not an alert. The customer has not done anything wrong by choosing
   an API key, and dressing a consequence as a warning at the moment of choice
   reads as the product objecting to a supported option. Quiet enough to sit
   under a field, specific enough to be read. */
.qcb-auth-consequences {
    margin-top: 0.625rem;
    padding: 0.625rem 0.75rem;
    font-size: 0.8125rem;
    line-height: 1.5;
}

.qcb-auth-consequences ul {
    margin: 0.375rem 0;
    /* Enough to hang the markers without pushing the text into a narrow column
       inside an already-narrow form. */
    padding-left: 1.1rem;
}

.qcb-auth-consequences li + li {
    margin-top: 0.25rem;
}

.qcb-auth-consequences strong {
    color: var(--qcb-text, var(--qcb-gray-900));
}
