/* Workforce Presence & Time product page. Builds on site.css and the shared product page pieces in time.css.
   Colour roles: green is verified presence and a task done, blue is work started by the arrival,
   red is a failed check, and amber is the issue it opened. */

/* The opening card: one arrival and the opening work it starts */

.opencard {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 0 var(--line), 0 24px 48px -24px rgba(20, 33, 61, 0.28);
    overflow: hidden;
}

.oc-rows {
    padding: 8px 0;
}

.oc-row {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    column-gap: 12px;
    align-items: center;
    padding: 8px 22px;
    font-size: 0.9rem;
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
}

.oc-row.is-pending {
    opacity: 0;
    transform: translateY(6px);
}

.oc-what {
    display: flex;
    flex-direction: column;
    font-weight: 600;
}

.oc-detail {
    font-weight: 400;
    font-size: 0.78rem;
    color: var(--ink-soft);
}

.oc-val {
    font-variant-numeric: tabular-nums;
    font-weight: 650;
    color: var(--ink-soft);
}

/* Marks: a tick for done, a tag ring for the check-in, a play arrow for work started,
   a cross for a failed check and an exclamation mark for the issue */
.oc-mark {
    position: relative;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--verified);
}

.oc-mark::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid var(--surface);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.oc-arrive .oc-mark {
    background: var(--verified-soft);
    box-shadow: inset 0 0 0 2px var(--verified);
}

.oc-arrive .oc-mark::after {
    left: 4px;
    top: 4px;
    width: 8px;
    height: 8px;
    border: 0;
    border-radius: 50%;
    background: var(--verified);
    transform: none;
}

.oc-arrive .oc-val {
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--verified-soft);
    color: var(--verified);
    font-weight: 700;
}

.oc-start .oc-mark {
    background: var(--signal);
}

.oc-start .oc-mark::after {
    left: 6px;
    top: 4px;
    width: 0;
    height: 0;
    border-style: solid;
    border-color: transparent transparent transparent var(--surface);
    border-width: 4px 0 4px 6px;
    transform: none;
}

.oc-start .oc-what {
    color: var(--signal);
}

.oc-row.is-fail .oc-mark {
    background: var(--stop);
}

.oc-row.is-fail .oc-mark::after,
.oc-issue .oc-mark::after {
    left: 0;
    top: 0;
    width: 16px;
    height: 16px;
    border: 0;
    transform: none;
    color: var(--surface);
    font-weight: 800;
    line-height: 16px;
    text-align: center;
}

.oc-row.is-fail .oc-mark::after {
    content: "\00d7";
    font-size: 0.8rem;
}

.oc-row.is-fail .oc-detail {
    color: var(--stop);
}

.oc-row.is-fail.is-open {
    background: var(--stop-soft);
}

.oc-issue .oc-mark {
    background: var(--escalate);
}

.oc-issue .oc-mark::after {
    content: "!";
    font-size: 0.68rem;
}

.oc-issue.is-open {
    background: var(--escalate-soft);
}

.oc-summary {
    padding: 12px 22px;
    border-top: 1px solid var(--line);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--verified);
}

.oc-summary.is-live {
    color: var(--ink-soft);
}

.oc-summary.is-open {
    color: var(--escalate);
}

@media (max-width: 640px) {
    .oc-row,
    .oc-summary {
        padding-left: 16px;
        padding-right: 16px;
    }

    .opencard .timecard-head,
    .opencard .timecard-caption {
        padding-left: 16px;
        padding-right: 16px;
    }
}
