/*
    My Progress Jobs - the "Show completed" toggle and the completed bookings it loads
    (OnTheGo.View.AllocatedJobs, Mobile-ProgressJobs-ShowCompleted-Design.md). The job cards
    themselves are the list's ordinary cards; this file only styles the section around them.

    Tokens only, so every rule resolves correctly under Tradie Classic, Tradie Light and
    Professional with Dark Mode on or off: Dark.css and Professional.css redefine the tokens
    themselves, and this file is always enabled. The flipswitch's "on" fill is already themed in
    Mobile.css, Dark.css and Professional.css (.ui-flipswitch-active).
*/

.ProgressCompletedSection {
    margin: 0 0 8px 0;
}

/* Label on the left, switch on the right, one row. */
.ProgressCompletedToggleRow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.ProgressCompletedToggleRow label.ProgressCompletedToggleLabel {
    margin: 0;
    color: var(--text);
    font-size: var(--type-base);
    font-weight: 600;
}

.ProgressCompletedToggleHint {
    color: var(--text-muted);
    font-weight: 400;
    font-size: var(--type-sm);
}

/* jQuery Mobile's flipswitch carries a .5em top/bottom margin meant for form rows. */
.ProgressCompletedToggleRow .ui-flipswitch {
    margin: 4px 0;
    flex: 0 0 auto;
}

/* The "On" label on the switch's brand fill. A white !important rule otherwise wins, which is
   unreadable on Professional dark's light cyan brand; --text-on-brand is white everywhere else. */
.ProgressCompletedToggleRow .ui-flipswitch.ui-flipswitch-active .ui-flipswitch-on {
    color: var(--text-on-brand) !important;
}

.ProgressCompletedArea {
    margin-top: 8px;
}

/* Section heading over the completed cards ("Completed - last 4 weeks (3)"). */
.ProgressCompletedHeading {
    display: block;
    margin: 4px 2px 6px 2px;
    color: var(--text-muted);
    font-size: var(--type-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* Loading, empty and error lines. */
.ProgressCompletedStatus {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-muted);
    font-size: var(--type-sm);
}

.ProgressCompletedStatus .fa {
    color: var(--brand);
}

/* A failed fetch: the message in the danger colour (it carries meaning), with Try again under it.
   The rest of the screen - the in-progress list below - is untouched. */
.ProgressCompletedStatus.ProgressCompletedError {
    flex-wrap: wrap;
    border-style: solid;
    border-color: var(--danger);
    color: var(--text);
}

.ProgressCompletedStatus.ProgressCompletedError .fa {
    color: var(--danger);
}

.ProgressCompletedStatus.ProgressCompletedError .ProgressCompletedErrorText {
    flex: 1 1 0;
    min-width: 0;
}

.ProgressCompletedStatus .ui-btn.ProgressCompletedRetry {
    flex: 1 0 100%;
    margin: 4px 0 0 0;
}

/* Divides the completed cards from the in-progress list that follows. */
.ProgressCompletedArea .ProgressCompletedEnd {
    height: 0;
    margin: 10px 0 8px 0;
    border-top: 1px solid var(--border-strong);
}

/* Job screen opened from the completed list: the read-only notice above the Info tab's details
   (OnTheGo.View.AllocatedJob, applyCompletedReadOnly). */
.CompletedReadOnlyNotice {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px 0;
    padding: 8px 12px;
    border: 1px solid var(--border-strong);
    border-left: 4px solid var(--ok);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-size: var(--type-sm);
}

.CompletedReadOnlyNotice .fa {
    color: var(--ok);
}
