/* Onsite Vendor & Contractor Management product page. Builds on site.css and the shared product page pieces in time.css.
   Colour roles: blue is the contractor's visit and a location they scanned, green is a completed step,
   and amber is an issue the contractor reported. */

/* Phone */

.phone-figure {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.device {
    width: 100%;
    max-width: 360px;
    padding: 12px;
    border-radius: 44px;
    /* The handset stays dark in both themes; the ink token turns light in dark mode */
    background: #121a2b;
    box-shadow: 0 30px 60px -28px rgba(20, 33, 61, 0.55);
}

.device-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 22px 8px;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.device-signal {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 12px;
}

.device-signal span {
    width: 3px;
    border-radius: 1px;
    background: #fff;
    transition: opacity 0.3s ease;
}

.device-signal span:nth-child(1) { height: 4px; }
.device-signal span:nth-child(2) { height: 6px; }
.device-signal span:nth-child(3) { height: 9px; }
.device-signal span:nth-child(4) { height: 12px; }

.visit-app {
    min-height: 540px;
    border-radius: 32px;
    background: var(--surface);
    overflow: hidden;
}

.visit-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    padding: 20px 18px 14px;
    background: var(--signal-soft);
}

.visit-company {
    font-weight: 700;
}

.visit-person {
    font-size: 0.8rem;
    color: var(--ink-soft);
}

.visit-pill {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    background: var(--signal);
    color: var(--surface);
}

.visit-pill[data-state="area"] {
    background: var(--surface);
    color: var(--signal);
    box-shadow: inset 0 0 0 1.5px var(--signal);
}

.visit-pill[data-state="done"] {
    background: var(--verified);
}

.visit-pill[data-state="start"] {
    background: var(--line);
    color: var(--ink-soft);
}

.visit-banner {
    margin: 12px 14px 0;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
}

.visit-banner[data-state="hidden"] {
    display: none;
}

.visit-banner[data-state="issue"] {
    background: var(--escalate-soft);
    color: var(--escalate);
}

.visit-banner[data-state="synced"] {
    background: var(--verified-soft);
    color: var(--verified);
}

.visit-timeline {
    position: relative;
    padding: 14px 18px 8px 18px;
}

.vt-item {
    position: relative;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    column-gap: 10px;
    align-items: start;
    padding: 8px 0 8px 14px;
    border-left: 2px solid var(--line);
    font-size: 0.84rem;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.vt-item::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 13px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--verified);
    box-shadow: 0 0 0 3px var(--surface);
}

.vt-area::before {
    background: var(--signal);
}

.vt-issue::before {
    background: var(--escalate);
}

.vt-issue .vt-what {
    color: var(--escalate);
}

.vt-done::before {
    background: var(--verified);
    box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--verified);
}

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

.vt-time {
    font-variant-numeric: tabular-nums;
    font-weight: 650;
}

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

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

.vt-thumb {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    background:
        linear-gradient(135deg, #8c96a6 0%, #5f6b7d 60%, #3e4757 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.visit-actions {
    display: grid;
    gap: 8px;
    padding: 6px 18px 20px;
}

.va-btn {
    padding: 10px;
    border-radius: 12px;
    text-align: center;
    font-size: 0.84rem;
    font-weight: 600;
    border: 1.5px solid var(--line);
    color: var(--ink);
}

.va-scan {
    border-color: var(--signal);
    background: var(--signal);
    color: var(--surface);
}

.phone-caption {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 360px;
    margin-top: 14px;
    font-size: 0.85rem;
    color: var(--ink-soft);
}

/* Area access record */

.areas {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    overflow: hidden;
}

.areas-row {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) 60px 60px 80px;
    column-gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--line);
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
}

.areas-row span:first-child {
    font-weight: 600;
}

.areas-headrow {
    background: var(--base);
    color: var(--ink-soft);
    font-size: 0.8rem;
}

.areas-headrow span:first-child {
    font-weight: 600;
}

.areas-row.is-unverified {
    background: var(--escalate-soft);
}

.areas-row.is-unverified span:nth-child(3) {
    color: var(--escalate);
    font-weight: 700;
}

.areas-note {
    padding: 14px 20px;
    font-size: 0.85rem;
    color: var(--escalate);
    font-weight: 600;
}

/* A visit that exited every critical location reads as cleared */

.areas-note.is-clear {
    color: var(--verified);
}

/* Scenario: the invoice above the visit recorded against it */

.scenario-docs {
    display: grid;
    gap: 16px;
}

.doc {
    padding: 22px 24px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--base);
}

.doc-invoice {
    border-top: 4px solid var(--ink-soft);
}

.doc-visit {
    border-top: 4px solid var(--verified);
    background: var(--verified-soft);
}

.doc-kind {
    font-variation-settings: "wdth" 112;
    font-weight: 700;
    font-size: 1.1rem;
}

.doc-from {
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--ink-soft);
}

.doc-lines div {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 12px;
    align-items: baseline;
    padding: 10px 0;
    border-top: 1px dashed var(--line);
}

.doc-lines dt {
    font-size: 0.85rem;
    color: var(--ink-soft);
}

.doc-lines dd {
    font-weight: 600;
}

/* Responsive */

@media (max-width: 640px) {
    .device {
        border-radius: 38px;
        padding: 10px;
    }

    .visit-app {
        min-height: 0;
        border-radius: 28px;
    }

    .areas-row {
        grid-template-columns: minmax(0, 1fr) 48px 48px 64px;
        column-gap: 8px;
        padding: 12px 14px;
        font-size: 0.84rem;
    }

    .doc {
        padding: 18px;
    }

    .doc-lines div {
        grid-template-columns: minmax(0, 1fr);
        gap: 2px;
    }
}
