/* ==================================================================
   Skiptrak Solo – styles
   ------------------------------------------------------------------
   Colours are taken from the Skiptrak logo and set once here.
   Change them and the whole app follows.
   ================================================================== */

:root {
    /* Logo colours */
    --skip-teal:      #309CAE;   /* logo teal ring */
    --skip-teal-dark: #23808F;   /* darker teal – buttons (readable with white text) */
    --skip-red:       #E30613;   /* logo red ring */
    --skip-grey:      #575756;   /* logo skip grey – main text */

    /* Supporting colours */
    --skip-ink:      var(--skip-grey);
    --skip-muted:    #85857F;   /* hints, small print */
    --skip-field:    #F1F3F3;   /* input background */
    --skip-surface:  #FFFFFF;   /* page background */
    --skip-line:     #DDE1E2;   /* borders */
    --skip-page:     #F4F6F6;   /* background behind app pages */
    --skip-accent-text: var(--skip-teal-dark);   /* teal used for text/icons */
    --skip-supplier: #7A5AA6;   /* supplier jobs (driver jobs from a company stay grey) */

    --radius-field:  14px;

    /* Hand our colours to Bootstrap */
    --bs-body-font-family: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-body-color:   var(--skip-ink);
    --bs-body-bg:      var(--skip-surface);
    --bs-border-color: var(--skip-line);
    --bs-focus-ring-color: rgba(48, 156, 174, .35);
    --bs-danger:       var(--skip-red);
}

/* Tell the browser which mode is showing (form controls, scrollbars, and no forced darkening) */
:root                   { color-scheme: light; }
[data-bs-theme="dark"]  { color-scheme: dark; }

[data-bs-theme="dark"] {
    --skip-ink:      #ECEDED;
    --skip-muted:    #A3A6A6;
    --skip-field:    #2A2D2E;
    --skip-surface:  #1D1F20;
    --skip-line:     #383C3D;
    --skip-page:     #141617;
    --skip-accent-text: #5EC0D1;
    --skip-supplier: #B49BDB;

    --bs-body-color: var(--skip-ink);
    --bs-body-bg:    var(--skip-surface);
}

/* Keep content clear of the phone home bar */
:root {
    box-sizing: border-box;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

html, body { height: 100%; }

body {
    background: var(--skip-surface);
    font-feature-settings: "tnum" 1;   /* numbers line up neatly */
    -webkit-tap-highlight-color: transparent;
}


/* ==================================================================
   LOGIN PAGE LAYOUT
   Phone: logo panel on top, form below.
   PC:    logo panel on the left, form on the right.
   ================================================================== */

.login-shell {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

/* ---- Brand panel ---- */
.brand-panel {
    position: relative;
    background: var(--skip-surface);
    padding: calc(env(safe-area-inset-top, 0px) + 2rem) 1.5rem 2.5rem;
}

.brand-inner { max-width: 26rem; }

.brand-logo {
    width: 104px;
    height: auto;
    display: block;
    margin-bottom: 1rem;
    animation: logo-in .8s cubic-bezier(.3, 1.3, .5, 1) both;
}

/* The one bit of motion: the logo grows gently into place when the page opens */
@keyframes logo-in {
    from { transform: scale(.85); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.brand-name {
    font-stretch: 125%;                   /* Archivo's wide cut */
    font-weight: 800;
    font-size: clamp(2.4rem, 9vw, 3.6rem);
    line-height: .95;
    letter-spacing: -.02em;
    color: var(--skip-ink);
    margin: 0;
    display: inline;
}

.brand-edition {
    display: inline-block;
    vertical-align: .55em;
    margin-left: .4rem;
    padding: .15rem .55rem;
    background: var(--skip-red);
    color: #FFFFFF;
    border-radius: 6px;
    font-weight: 700;
    font-size: .95rem;
    font-stretch: 100%;
}

.brand-line {
    margin: .9rem 0 0;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--skip-muted);
    max-width: 22rem;
}

/* Divider split teal | red, like the two halves of the logo rings */
.brand-split {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 8px;
    background: linear-gradient(90deg, var(--skip-teal) 50%, var(--skip-red) 50%);
}

/* ---- Form ---- */
.login-sheet {
    flex: 1;
    background: var(--skip-surface);
    padding: 2rem 1.5rem 1.5rem;
}

.login-sheet form,
.login-sheet .alert,
.sheet-title { max-width: 26rem; }

.sheet-title {
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
}

.app-version {
    margin: 2rem 0 0;
    font-size: .8rem;
    color: var(--skip-muted);
}


/* ==================================================================
   FORM CONTROLS
   ================================================================== */

.login-sheet .form-control {
    background: var(--skip-field);
    border: 2px solid transparent;
    border-radius: var(--radius-field);
    color: var(--skip-ink);
    min-height: 3.75rem;                  /* big enough for thumbs */
    font-size: 1.05rem;
}

.login-sheet .form-control:focus {
    background: var(--skip-surface);
    border-color: var(--skip-teal);
    box-shadow: 0 0 0 4px var(--bs-focus-ring-color);
}

.login-sheet .form-floating > label { color: var(--skip-muted); }
.login-sheet .form-text { color: var(--skip-muted); }

/* Serial number: slightly spaced digits so they're easy to check */
.serial-input {
    letter-spacing: .12em;
    font-weight: 600;
}

/* Password field + eye button share one rounded box */
.login-sheet .input-group .form-floating .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.btn-reveal {
    background: var(--skip-field);
    border: 2px solid transparent;
    border-left: 0;
    border-radius: 0 var(--radius-field) var(--radius-field) 0 !important;
    color: var(--skip-muted);
    padding: 0 1.1rem;
    font-size: 1.2rem;
}
.btn-reveal:hover,
.btn-reveal:focus-visible { color: var(--skip-teal); background: var(--skip-field); }

/* Red edge when a field fails the check */
.was-validated .form-control:invalid { border-color: var(--skip-red); }
.was-validated .input-group:has(.form-control:invalid) .btn-reveal { border-color: var(--skip-red); }
.was-validated .input-group:has(.form-control:invalid) > .invalid-feedback { display: block; }
.invalid-feedback { color: var(--skip-red); }

.form-check-input:checked {
    background-color: var(--skip-teal);
    border-color: var(--skip-teal);
}
.form-check-input:focus { box-shadow: 0 0 0 4px var(--bs-focus-ring-color); border-color: var(--skip-teal); }

/* Sign-in button */
.btn-signin {
    background: var(--skip-teal-dark);
    color: #FFFFFF;
    border: 0;
    border-radius: var(--radius-field);
    min-height: 3.75rem;
    font-weight: 700;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
}
.btn-signin:hover,
.btn-signin:disabled { background: var(--skip-teal-dark); color: #FFFFFF; filter: brightness(1.1); }
.btn-signin:active   { transform: scale(.985); }
.btn-signin:focus-visible { box-shadow: 0 0 0 4px var(--bs-focus-ring-color); }

/* Error message box */
.login-sheet .alert-danger {
    border-radius: var(--radius-field);
    border: 0;
    border-left: 4px solid var(--skip-red);
    background: rgba(227, 6, 19, .08);
    color: var(--skip-ink);
}
.login-sheet .alert-danger .bi { color: var(--skip-red); }


/* ==================================================================
   BIGGER SCREENS (tablet landscape / PC)
   ================================================================== */
@media (min-width: 992px) {
    .login-shell {
        flex-direction: row;
        height: 100%;
    }

    .brand-panel {
        flex: 1 1 50%;
        display: flex;
        align-items: center;
        padding: 4rem;
        background: var(--skip-field);
    }

    .brand-logo { width: 180px; margin-bottom: 2rem; }

    /* split runs down the edge on PC: teal top, red bottom */
    .brand-split {
        left: auto; top: 0; right: 0; bottom: 0;
        width: 8px; height: auto;
        background: linear-gradient(180deg, var(--skip-teal) 50%, var(--skip-red) 50%);
    }

    .login-sheet {
        flex: 1 1 50%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 4rem 5rem;
        overflow-y: auto;
    }

    .app-version { margin-top: 3rem; }
}


/* ==================================================================
   ACCESSIBILITY
   ================================================================== */
@media (prefers-reduced-motion: reduce) {
    .brand-logo { animation: none; }
    .btn-signin:active { transform: none; }
}


/* ==================================================================
   APP PAGES (after login)
   Phone: top bar + bottom bar.   PC: sidebar on the left.
   ================================================================== */

.app-page { background: var(--skip-page); }

.app-shell {
    min-height: 100%;
    display: flex;
}

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-content {
    flex: 1;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    /* bottom space so the phone bottom bar never covers content */
    padding: 1.25rem 1rem calc(6rem + env(safe-area-inset-bottom, 0px));
}

/* Round badge with the user's initials */
.avatar {
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    border: 0;
    border-radius: 50%;
    background: var(--skip-teal-dark);
    color: #FFFFFF;
    font-weight: 700;
    font-size: .9rem;
    display: grid;
    place-items: center;
}


/* ---- Phone top bar ---- */
.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(env(safe-area-inset-top, 0px) + .6rem) 1rem .6rem;
    background: color-mix(in srgb, var(--skip-surface) 90%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
/* teal | red line under the bar, like the logo */
.app-topbar::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--skip-teal) 50%, var(--skip-red) 50%);
}

.app-brand {
    display: flex;
    align-items: center;
    gap: .55rem;
    color: var(--skip-ink);
    text-decoration: none;
}
.app-brand img { width: 34px; height: 34px; }
.app-brand .brand-name { font-size: 1.35rem; }
.app-brand .brand-edition { margin-left: 0; vertical-align: middle; font-size: .72rem; }   /* "PDA" badge (drivers app) */


/* ---- Phone bottom bar ---- */
.bottom-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 1030;
    display: flex;
    padding: .4rem .25rem calc(.4rem + env(safe-area-inset-bottom, 0px));
    background: color-mix(in srgb, var(--skip-surface) 92%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--skip-line);
}

.bottom-nav a,
.bottom-nav button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .2rem;
    padding: .2rem 0;
    background: none;
    border: 0;
    color: var(--skip-muted);
    font-size: .72rem;
    font-weight: 600;
    text-decoration: none;
}

.bottom-nav .bi {
    font-size: 1.3rem;
    line-height: 1;
    padding: .3rem 1.15rem;
    border-radius: 999px;
    transition: background-color .2s;
}

.bottom-nav .active { color: var(--skip-accent-text); }
.bottom-nav .active .bi { background: rgba(48, 156, 174, .16); }


/* ---- Phone "More" sheet ---- */
.more-sheet {
    height: auto !important;
    border-radius: 24px 24px 0 0;
    border: 0 !important;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.sheet-handle {
    width: 40px;
    height: 4px;
    margin: .6rem auto 0;
    border-radius: 2px;
    background: var(--skip-line);
}
.more-sheet .offcanvas-header { gap: .75rem; }
.more-user { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.more-user small { color: var(--skip-muted); }
.more-sheet .offcanvas-body { padding-top: 0; }

.more-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .95rem 1rem;
    border-radius: 14px;
    color: var(--skip-ink);
    font-weight: 600;
    text-decoration: none;
}
.more-link .bi { font-size: 1.25rem; color: var(--skip-muted); }
.more-link:hover,
.more-link.active { background: var(--skip-field); }
.more-link.signout,
.more-link.signout .bi { color: var(--skip-red); }


/* ---- PC sidebar ---- */
.app-sidebar {
    position: sticky;
    top: 0;
    width: 264px;
    height: 100vh;
    flex-shrink: 0;
    flex-direction: column;
    padding: 1.5rem 1rem;
    background: var(--skip-surface);
    border-right: 1px solid var(--skip-line);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 0 .5rem 1.75rem;
    color: var(--skip-ink);
    text-decoration: none;
}
.sidebar-brand img { width: 40px; height: 40px; }
.sidebar-brand .brand-name { font-size: 1.45rem; }
.sidebar-brand .brand-edition { margin-left: 0; vertical-align: middle; font-size: .72rem; }

.sidebar-nav { display: flex; flex-direction: column; gap: .2rem; }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .7rem .85rem;
    border-radius: 12px;
    color: var(--skip-ink);
    font-weight: 500;
    text-decoration: none;
}
.sidebar-link .bi { font-size: 1.2rem; color: var(--skip-muted); }
.sidebar-link:hover { background: var(--skip-field); }
.sidebar-link.active {
    background: rgba(48, 156, 174, .12);
    color: var(--skip-accent-text);
    font-weight: 700;
}
.sidebar-link.active .bi { color: var(--skip-accent-text); }

.sidebar-user {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1rem .5rem 0;
    border-top: 1px solid var(--skip-line);
}
.sidebar-user-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.sidebar-user-text small { color: var(--skip-muted); }
.sidebar-signout {
    color: var(--skip-muted);
    font-size: 1.25rem;
    padding: .25rem .4rem;
    border-radius: 8px;
}
.sidebar-signout:hover { color: var(--skip-red); background: var(--skip-field); }


/* ==================================================================
   DASHBOARD
   ================================================================== */

.dash-greeting { margin: .5rem 0 1.5rem; }
.dash-greeting h1,
.page-head h1 {
    margin: 0;
    font-stretch: 115%;
    font-weight: 800;
    font-size: clamp(1.7rem, 6vw, 2.4rem);
    letter-spacing: -.02em;
    line-height: 1.1;
}
.dash-greeting p,
.page-head p {
    margin: .35rem 0 0;
    color: var(--skip-muted);
    font-weight: 500;
}

.dash-grid { display: grid; gap: 1rem; }

/* ---- Big Jobs tile ---- */
.dash-hero {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 210px;
    padding: 1.5rem;
    border-radius: 24px;
    background: var(--skip-teal-dark);
    color: #FFFFFF;
    text-decoration: none;
}
.dash-hero:hover { color: #FFFFFF; }

/* Two half-red rings in the corner, echoing the logo */
.dash-hero::before,
.dash-hero::after {
    content: "";
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    border-style: solid;
    transform: rotate(45deg);
}
.dash-hero::before {               /* outer ring: red on the right */
    width: 300px; height: 300px;
    right: -110px; bottom: -170px;
    border-width: 22px;
    border-color: var(--skip-red) var(--skip-red) rgba(255,255,255,.14) rgba(255,255,255,.14);
}
.dash-hero::after {                /* inner ring: red on the left */
    width: 196px; height: 196px;
    right: -58px; bottom: -118px;
    border-width: 16px;
    border-color: rgba(255,255,255,.14) rgba(255,255,255,.14) var(--skip-red) var(--skip-red);
}

.hero-icon {
    width: 3.5rem;
    height: 3.5rem;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: rgba(255, 255, 255, .16);
    font-size: 1.75rem;
}

.hero-go {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 2.75rem;
    height: 2.75rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #FFFFFF;
    color: var(--skip-teal-dark);
    font-size: 1.25rem;
    transition: transform .2s;
}
.dash-hero:hover .hero-go { transform: translateX(4px); }

.hero-text h2 {
    margin: 1.75rem 0 .3rem;
    font-stretch: 125%;
    font-weight: 800;
    font-size: 2.4rem;
    line-height: 1;
}
.hero-text p { margin: 0; max-width: 16rem; opacity: .9; }

/* ---- Section rows ---- */
.dash-list { display: flex; flex-direction: column; gap: .75rem; }

.dash-row {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-radius: 18px;
    background: var(--skip-surface);
    border: 1px solid var(--skip-line);
    color: var(--skip-ink);
    text-decoration: none;
    transition: border-color .2s;
}
.dash-row:hover { border-color: var(--skip-teal); color: var(--skip-ink); }

.row-icon {
    width: 3rem;
    height: 3rem;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 14px;
    font-size: 1.35rem;
    background: var(--skip-field);
    color: var(--skip-ink);
}
.tone-teal .row-icon { background: rgba(48, 156, 174, .14); color: var(--skip-accent-text); }
.tone-red  .row-icon { background: rgba(227, 6, 19, .09);   color: var(--skip-red); }

.row-text  { flex: 1; min-width: 0; }
.row-title { display: block; font-weight: 700; font-size: 1.08rem; }
.row-desc  { display: block; color: var(--skip-muted); font-size: .9rem; }
.row-chevron { color: var(--skip-muted); }

/* ---- Business details reminder ---- */
.setup-note {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding: 1.1rem 1.25rem;
    border-radius: 18px;
    border: 1.5px dashed var(--skip-line);
}
.setup-note .row-icon { background: rgba(227, 6, 19, .09); color: var(--skip-red); }
.setup-text { flex: 1 1 14rem; display: flex; flex-direction: column; }
.setup-text span { color: var(--skip-muted); font-size: .92rem; }

.btn-setup {
    border: 1.5px solid var(--skip-teal-dark);
    border-radius: 12px;
    color: var(--skip-accent-text);
    font-weight: 700;
    padding: .55rem 1.1rem;
}
.btn-setup:hover { background: var(--skip-teal-dark); border-color: var(--skip-teal-dark); color: #FFFFFF; }

@media (max-width: 575.98px) {
    .setup-note .btn-setup { width: 100%; }
}

/* ---- Placeholder section pages ---- */
.page-head { margin: .5rem 0 1.5rem; }

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 3rem 1.5rem;
    border-radius: 24px;
    background: var(--skip-surface);
    border: 1px solid var(--skip-line);
}
.empty-state .row-icon { width: 4rem; height: 4rem; font-size: 1.8rem; background: rgba(48, 156, 174, .14); color: var(--skip-accent-text); }
.empty-state h2 { margin: 1.25rem 0 .35rem; font-size: 1.25rem; font-weight: 700; }
.empty-state p  { color: var(--skip-muted); margin-bottom: 1.5rem; }


/* ---- PC sizes ---- */
@media (min-width: 768px) {
    .dash-grid { grid-template-columns: 1.15fr 1fr; }
    .dash-hero { min-height: 280px; padding: 2rem; }
    .hero-go   { top: 2rem; right: 2rem; }
    .hero-text h2 { font-size: 3rem; }
}

@media (min-width: 992px) {
    .app-content { padding: 2.5rem 3rem; }
    .dash-greeting { margin-bottom: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
    .dash-hero:hover .hero-go { transform: none; }
}


/* ==================================================================
   MESSAGES ("Job completed" etc.)
   ================================================================== */
.flash {
    border: 0;
    border-left: 4px solid;
    border-radius: 14px;
    color: var(--skip-ink);
    font-weight: 500;
}
.flash.alert-success { background: rgba(48, 156, 174, .12); border-color: var(--skip-teal); }
.flash.alert-danger  { background: rgba(227, 6, 19, .08);   border-color: var(--skip-red); }


/* ==================================================================
   SHARED: little status labels and slide-up sheets
   ================================================================== */
.chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .6rem;
    border-radius: 999px;
    background: var(--skip-field);
    color: var(--skip-ink);
    font-size: .75rem;
    font-weight: 700;
    white-space: nowrap;
}
.chip-teal { background: rgba(48, 156, 174, .15); color: var(--skip-accent-text); }
.chip-red  { background: rgba(227, 6, 19, .1);    color: var(--skip-red); }

.job-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .55rem; }
.job-chips:empty { display: none; }

.action-sheet {
    height: auto !important;
    max-height: 92vh;
    border-radius: 24px 24px 0 0;
    border: 0 !important;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.action-sheet .offcanvas-title { font-weight: 800; font-stretch: 110%; font-size: 1.3rem; }
.action-sheet .form-label { font-weight: 600; }
.sheet-intro { color: var(--skip-muted); font-size: .92rem; }

.sheet-input {
    background-color: var(--skip-field);
    border: 2px solid transparent;
    border-radius: 14px;
    min-height: 3.25rem;
    font-size: 1.05rem;
}
.sheet-input:focus {
    background-color: var(--skip-surface);
    border-color: var(--skip-teal);
    box-shadow: 0 0 0 4px var(--bs-focus-ring-color);
}

/* Big teal button for the main thing to do */
.btn-main-action {
    min-height: 3.5rem;
    border: 0;
    border-radius: 14px;
    background: var(--skip-teal-dark);
    color: #FFFFFF;
    font-weight: 700;
    font-size: 1.05rem;
}
.btn-main-action:hover,
.btn-main-action:focus-visible { background: var(--skip-teal-dark); color: #FFFFFF; filter: brightness(1.1); }
.btn-main-action .bi { margin-right: .35rem; }

@media (min-width: 992px) {
    /* On a PC the sheets sit in the middle rather than full width */
    .action-sheet,
    .more-sheet { width: 560px; margin: 0 auto; }
}


/* ==================================================================
   JOBS LIST
   ================================================================== */
.list-hint {
    margin: -.75rem 0 1rem;
    color: var(--skip-muted);
    font-size: .82rem;
}

.job-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .65rem;
}

.job-card {
    position: relative;
    overflow: hidden;
    background: var(--skip-surface);
    border: 1px solid var(--skip-line);
    border-radius: 18px;
    transition: border-color .15s, box-shadow .15s;
}
/* coloured stripe down the left = the job's label colour */
.job-card::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 7px;
    background: var(--job-colour);
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .15);   /* keeps pale colours visible */
}

.job-main {
    padding: .9rem 1rem .9rem 1.35rem;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;    /* stops double-tap zooming the page */
}
.job-main:focus-visible { outline: 3px solid var(--bs-focus-ring-color); outline-offset: -3px; }

.job-top { display: flex; align-items: baseline; gap: .75rem; }
.job-title { flex: 1; font-weight: 700; font-size: 1.05rem; line-height: 1.3; }
.job-no { color: var(--skip-muted); font-size: .8rem; font-weight: 600; white-space: nowrap; }

.job-customer { margin-top: .15rem; color: var(--skip-accent-text); font-weight: 600; }

.job-site {
    color: var(--skip-muted);
    font-size: .9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.job-card.is-done .job-title,
.job-card.is-done .job-customer { opacity: .6; }
.job-card.is-void .job-title { text-decoration: line-through; opacity: .6; }

.job-card.is-selected {
    border-color: var(--skip-teal);
    box-shadow: 0 0 0 3px var(--bs-focus-ring-color);
}

/* Quick actions, shown after one tap */
.job-actions {
    display: none;
    border-top: 1px solid var(--skip-line);
    margin-left: 7px;
}
.job-card.is-selected .job-actions { display: flex; animation: actions-in .18s ease-out; }

@keyframes actions-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: none; }
}

.job-actions > a,
.job-actions > form { flex: 1; display: flex; }

.job-actions a,
.job-actions button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .2rem;
    padding: .7rem .25rem;
    background: none;
    border: 0;
    color: var(--skip-ink);
    font-size: .78rem;
    font-weight: 700;
    text-decoration: none;
}
.job-actions .bi { font-size: 1.25rem; color: var(--skip-accent-text); }
/* thin line between each action */
.job-actions > * + * { border-left: 1px solid var(--skip-line) !important; }
.job-actions a:hover,
.job-actions button:hover { background: var(--skip-field); }


/* ---- Day switcher: floats above the bottom bar ---- */
.day-switcher-space { height: 6rem; }

.day-switcher {
    position: fixed;
    z-index: 1025;
    left: 50%;
    bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: .25rem;
    padding: .35rem;
    border-radius: 999px;
    background: var(--skip-surface);
    border: 1px solid var(--skip-line);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .14);
}

.day-btn {
    width: 3.25rem;
    height: 3.25rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--skip-red);
    color: #FFFFFF;
    font-size: 1.35rem;
    text-decoration: none;
    transition: transform .12s;
}
.day-btn:hover  { color: #FFFFFF; filter: brightness(1.08); }
.day-btn:active { transform: scale(.92); }
/* Drivers can't go back past today or beyond the last day they're allowed to see */
.day-btn.is-off { background: var(--skip-field); color: var(--skip-muted); pointer-events: none; }

.day-label {
    position: relative;
    min-width: 8.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 .75rem;
    line-height: 1.2;
}
.day-label strong { font-size: 1rem; }
.day-label small  { color: var(--skip-muted); font-size: .78rem; font-weight: 600; }

/* The real date box is invisible and covers the label, so tapping opens the calendar */
.day-label input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

@media (min-width: 992px) {
    .day-switcher { bottom: 1.5rem; left: calc(50% + 132px); }   /* 132px = half the sidebar */
}


/* ==================================================================
   ONE JOB
   ================================================================== */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    margin-bottom: 1rem;
    color: var(--skip-accent-text);
    font-weight: 700;
    text-decoration: none;
}

.job-hero {
    position: relative;
    overflow: hidden;
    padding: 1.25rem 1.25rem 1.25rem 1.6rem;
    border-radius: 22px;
    background: var(--skip-surface);
    border: 1px solid var(--skip-line);
}
.job-hero::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 8px;
    background: var(--job-colour);
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .15);
}
.job-hero-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: .45rem; }
.job-hero .job-no { font-size: .98rem; }
.job-type {
    font-size: .98rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--skip-muted);
}
.job-hero h1 {
    margin: .35rem 0 .2rem;
    font-stretch: 112%;
    font-weight: 800;
    font-size: clamp(1.45rem, 5.5vw, 2rem);
    line-height: 1.15;
    letter-spacing: -.01em;
}
.job-service {
    display: flex;
    align-items: flex-start;
    gap: .4rem;
    margin: .35rem 0 .3rem;
    padding: .45rem .7rem;
    border-radius: 10px;
    background: var(--skip-field);
    font-weight: 700;
    line-height: 1.3;
}
.job-service .bi { color: var(--skip-accent-text); margin-top: .1rem; }
.job-card .job-service { display: inline-flex; padding: .2rem .55rem; font-size: .88rem; margin: .3rem 0 .15rem; }

.job-hero-customer { margin: 0; color: var(--skip-accent-text); font-weight: 600; font-size: 1.05rem; }

.job-actions-panel {
    display: flex;
    flex-direction: column;
    gap: .65rem;
    margin: 1rem 0;
}
.follow-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
.follow-buttons .btn { min-height: 3.25rem; }
.undo-form { text-align: center; }
.undo-form .btn-link { color: var(--skip-muted); font-size: .9rem; }

.linked-jobs { display: flex; flex-direction: column; gap: .65rem; margin-bottom: 1rem; }

.detail-grid { display: grid; gap: 1rem; }

.detail-card {
    padding: 1.15rem 1.25rem;
    border-radius: 20px;
    background: var(--skip-surface);
    border: 1px solid var(--skip-line);
}
.detail-card h2 {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0 0 .85rem;
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--skip-muted);
}
.detail-card h2 .count {
    padding: .05rem .5rem;
    border-radius: 999px;
    background: var(--skip-field);
    color: var(--skip-ink);
    letter-spacing: 0;
}

.site-address { margin: 0 0 .5rem; font-size: 1.05rem; font-weight: 500; line-height: 1.45; }

/* Navigation links: an address opens Google Maps, ///words open what3words */
.address-link { color: inherit; text-decoration: underline; text-decoration-color: var(--skip-line);
                text-underline-offset: 3px; }
.address-link:hover, .address-link:focus { color: var(--skip-accent-text); text-decoration-color: currentColor; }
.site-w3w { display: block; margin-top: .3rem; }
.w3w-link { color: var(--skip-ink); font-weight: 600; text-decoration: none; }
.w3w-link:hover, .w3w-link:focus { text-decoration: underline; }
.w3w-slashes { color: var(--skip-red); font-weight: 700; margin-right: 1px; }
.site-contact { color: var(--skip-muted); margin-bottom: .5rem; }
.site-note {
    margin-bottom: .5rem;
    padding: .6rem .8rem;
    border-radius: 12px;
    background: var(--skip-field);
    font-size: .92rem;
}
.site-note .bi { color: var(--skip-accent-text); margin-right: .25rem; }
.site-missing { color: var(--skip-muted); margin: 0; }
.site-buttons { margin-top: .75rem; }
.site-buttons { display: flex; gap: .65rem; flex-wrap: wrap; }
.site-buttons .btn { flex: 1; min-height: 3rem; }

.detail-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .55rem 1.25rem;
    margin: 0;
}
.detail-list dt { color: var(--skip-muted); font-weight: 500; }
.detail-list dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }

.job-comments {
    margin-top: 1rem;
    padding: .85rem 1rem;
    border-radius: 12px;
    background: var(--skip-field);
    white-space: normal;
}

/* ---- Signatures ---- */
.sig-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }

.sig-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    min-height: 7.5rem;
    padding: .75rem;
    border-radius: 16px;
    border: 2px dashed var(--skip-line);
    background: transparent;
    color: var(--skip-muted);
    font-weight: 600;
}
.sig-tile .bi { font-size: 1.6rem; color: var(--skip-accent-text); }
.sig-tile:hover { border-color: var(--skip-teal); }
.sig-tile.has-sig { border-style: solid; padding: .5rem; }
.sig-tile img {
    width: 100%;
    aspect-ratio: 5 / 2;
    object-fit: contain;
    border-radius: 10px;
    background: #FFFFFF;
}
.sig-label { font-size: .85rem; text-align: center; }

.sig-pad-wrap { position: relative; }
.sig-pad {
    display: block;
    width: 100%;
    height: 220px;
    border-radius: 16px;
    border: 2px dashed var(--skip-line);
    background: #FFFFFF;
    touch-action: none;        /* drawing mustn't scroll the page */
    cursor: crosshair;
}
.sig-pad-hint {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    color: #B3B7B8;
    font-weight: 600;
    pointer-events: none;
}
.sig-error { min-height: 1.5rem; margin: .4rem 0; color: var(--skip-red); font-size: .9rem; font-weight: 600; }
.sig-buttons { display: grid; grid-template-columns: 1fr 2fr; gap: .65rem; }
.sig-buttons .btn { min-height: 3.5rem; }

/* ---- Photos ---- */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
    gap: .6rem;
}
.photo-tile { position: relative; }
.photo-tile img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 14px;
    background: var(--skip-field);
}
.photo-delete {
    position: absolute;
    top: .35rem;
    right: .35rem;
    width: 1.9rem;
    height: 1.9rem;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
    color: #FFFFFF;
    font-size: .8rem;
}

.photo-add {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    border-radius: 14px;
    border: 2px dashed var(--skip-line);
    color: var(--skip-accent-text);
    font-weight: 700;
    font-size: .85rem;
    cursor: pointer;
}
.photo-add .bi { font-size: 1.6rem; }
.photo-add:hover { border-color: var(--skip-teal); }
.photo-add { position: relative; }
/* The real file box: invisible but still "there", because some phones won't open a display:none file box */
.photo-add input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}
.photo-add.is-busy { opacity: .5; pointer-events: none; }
.photo-status { margin: .6rem 0 0; color: var(--skip-muted); font-size: .9rem; }
.photo-status:empty { display: none; }

@media (min-width: 768px) {
    .detail-grid { grid-template-columns: 1fr 1fr; }
    .job-actions-panel { flex-direction: row; flex-wrap: wrap; }
    .job-actions-panel > form:first-child { flex: 1 1 100%; }
    .follow-buttons { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .job-card.is-selected .job-actions { animation: none; }
    .day-btn:active { transform: none; }
}


/* ---- Waste card ---- */
.ewc-desc {
    margin: .4rem 0 1rem;
    color: var(--skip-muted);
    font-size: .88rem;
    line-height: 1.35;
}
.ewc-desc:empty { margin-bottom: .75rem; }
.weight-group .form-control { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.weight-group .form-control:only-child { border-radius: 14px; }
.weight-group .input-group-text {
    border: 0;
    border-radius: 0 14px 14px 0;
    background: var(--skip-line);
    color: var(--skip-ink);
    font-weight: 600;
}
.weight-group .form-control:focus { z-index: 3; }

/* ---- Collection / exchange, below the photos ---- */
.follow-panel {
    margin-top: 1rem;
    padding: 1.15rem 1.25rem;
    border-radius: 20px;
    border: 1.5px dashed var(--skip-line);
}
.follow-panel h2 {
    margin: 0 0 .85rem;
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--skip-muted);
}


/* ---- Waste & charges card ---- */
.field-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
    margin-bottom: .9rem;
}
.field-pair .form-label { white-space: nowrap; }
.per-unit { color: var(--skip-muted); font-weight: 500; font-size: .85em; }

.money-group .input-group-text {
    border: 0;
    border-radius: 14px 0 0 14px;
    background: var(--skip-line);
    color: var(--skip-ink);
    font-weight: 700;
}
.money-group .form-control { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.money-group .form-control:focus { z-index: 3; }


.locked-note {
    padding: .6rem .8rem;
    border-radius: 12px;
    background: rgba(227, 6, 19, .08);
    font-size: .9rem;
    font-weight: 600;
}
.locked-note .bi { color: var(--skip-red); margin-right: .25rem; }

.totals {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .45rem 1rem;
    margin: .5rem 0 0;
    padding: 1rem 1.1rem;
    border-radius: 14px;
    background: var(--skip-field);
}
.totals dt { color: var(--skip-muted); font-weight: 500; }
.totals dt small { font-weight: 500; }
.totals dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.totals dd.is-zero { color: var(--skip-muted); font-weight: 500; }
.totals .totals-line { padding-top: .5rem; border-top: 1px solid var(--skip-line); color: var(--skip-ink); font-weight: 700; }
.totals .totals-grand { font-size: 1.2rem; font-weight: 800; color: var(--skip-ink); }


/* ---- Permit row (in Waste & charges) ---- */
.permit-row {
    display: flex;
    align-items: center;
    gap: .85rem;
    margin-top: 1rem;
    padding: .85rem 1rem;
    border-radius: 14px;
    border: 1.5px dashed var(--skip-line);
}
.permit-row .row-icon { width: 2.5rem; height: 2.5rem; font-size: 1.15rem; background: rgba(227, 6, 19, .09); color: var(--skip-red); }
.permit-info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.permit-info span { font-size: .9rem; }
.permit-row { flex-wrap: wrap; }
.permit-row .btn { flex: 1 1 100%; min-height: 3rem; }   /* button on its own line underneath */
.permit-details dd .chip { margin-left: .35rem; }


/* ---- Time on site ---- */
.btn-site {
    min-height: 3.5rem;
    border-radius: 14px;
    border: 2px solid var(--skip-teal-dark);
    color: var(--skip-accent-text);
    font-weight: 700;
    font-size: 1.05rem;
}
.btn-site:hover { background: var(--skip-teal-dark); color: #FFFFFF; }
.btn-site .bi { margin-right: .35rem; }

.on-site-bar {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .75rem .75rem .75rem 1rem;
    border-radius: 16px;
    background: rgba(48, 156, 174, .12);
    border: 1.5px solid var(--skip-teal);
}
.on-site-text { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.on-site-text span { color: var(--skip-muted); font-size: .9rem; }
.btn-finish {
    min-height: 3rem;
    padding: 0 1.25rem;
    border: 0;
    border-radius: 12px;
    background: var(--skip-red);
    color: #FFFFFF;
    font-weight: 700;
}
.btn-finish:hover { background: var(--skip-red); color: #FFFFFF; filter: brightness(1.08); }

/* gently pulsing dot = "you're on the clock" */
.on-site-pulse {
    width: .8rem;
    height: .8rem;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--skip-teal);
    animation: on-site-pulse 1.6s ease-out infinite;
}
@keyframes on-site-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(48, 156, 174, .6); }
    100% { box-shadow: 0 0 0 .7rem rgba(48, 156, 174, 0); }
}

.on-site-done {
    margin: 0;
    padding: .7rem 1rem;
    border-radius: 14px;
    background: var(--skip-field);
    font-weight: 600;
}
.on-site-done .bi { color: var(--skip-accent-text); margin-right: .3rem; }

.time-sum {
    margin: .75rem 0 0;
    padding: .6rem .8rem;
    border-radius: 12px;
    background: var(--skip-field);
    font-size: .9rem;
    font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
    .on-site-pulse { animation: none; }
}


/* ---- Folding card (Time on site): tap the heading to open ---- */
.fold-card { padding: 0; }
.fold-card summary {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1.15rem 1.25rem;
    cursor: pointer;
    list-style: none;                 /* hide the browser's own triangle */
    -webkit-tap-highlight-color: transparent;
}
.fold-card summary::-webkit-details-marker { display: none; }
.fold-card summary h2 { margin: 0; flex: 1; }
.fold-summary { color: var(--skip-ink); font-weight: 700; font-size: .92rem; }
.fold-chevron { color: var(--skip-muted); transition: transform .2s; }
.fold-card[open] .fold-chevron { transform: rotate(180deg); }
.fold-card summary:focus-visible { outline: 3px solid var(--bs-focus-ring-color); outline-offset: -3px; border-radius: 20px; }
.fold-body { padding: 0 1.25rem 1.15rem; }

@media (prefers-reduced-motion: reduce) {
    .fold-chevron { transition: none; }
}


/* ---- Additional items ---- */
.item-list { list-style: none; margin: 0 0 .75rem; padding: 0; }
.item-list li {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem 0;
    border-bottom: 1px solid var(--skip-line);
}
.item-list li:first-child { padding-top: 0; }
.item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.item-text span { color: var(--skip-muted); font-size: .88rem; }
.item-total { font-weight: 700; font-variant-numeric: tabular-nums; }
.item-remove {
    width: 2.25rem;
    height: 2.25rem;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--skip-field);
    color: var(--skip-muted);
}
.item-remove:hover { background: rgba(227, 6, 19, .1); color: var(--skip-red); }
.item-sum { margin: 0 0 1rem; color: var(--skip-muted); font-size: .92rem; }
.item-sum strong { color: var(--skip-ink); }

.linked-jobs-bottom { margin: 1rem 0 0; }
.fold-card { scroll-margin-top: 5rem; }   /* not hidden under the top bar when jumped to */


/* ---- Service: big and clear on the job page ---- */
.service-block {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    margin: .6rem 0 .5rem;
    padding: .75rem .95rem;
    border-radius: 14px;
    background: rgba(48, 156, 174, .12);
    border-left: 4px solid var(--skip-teal);
}
.service-label {
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--skip-accent-text);
}
.service-label .bi { margin-right: .2rem; }
.service-block strong { font-size: 1.2rem; line-height: 1.25; }
.service-block.is-missing { background: var(--skip-field); border-left-color: var(--skip-line); }
.service-block.is-missing strong { font-size: 1rem; color: var(--skip-muted); font-weight: 600; }

/* ---- Site contact list ---- */
.contact-list { list-style: none; margin: 0 0 .75rem; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.contact-list li { display: flex; align-items: baseline; gap: .5rem; overflow-wrap: anywhere; }
.contact-list .bi { color: var(--skip-accent-text); }
.contact-list a { color: var(--skip-ink); font-weight: 600; text-decoration: none; border-bottom: 1px dotted var(--skip-muted); }
.contact-list small { color: var(--skip-muted); }


/* ---- Wasted journey / void ---- */
.chip-purple { background: rgba(160, 64, 192, .13); color: #8A32A8; }
[data-bs-theme="dark"] .chip-purple { color: #CB8BE0; }

.status-banner {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .75rem .75rem .75rem 1rem;
    border-radius: 16px;
    border-left: 5px solid;
}
.status-banner > .bi { font-size: 1.4rem; }
.status-banner > div { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.status-banner span { color: var(--skip-muted); font-size: .92rem; }
.status-banner .btn-link { font-weight: 700; color: var(--skip-accent-text); }
.status-banner.is-void   { background: rgba(227, 6, 19, .08);  border-color: var(--skip-red); }
.status-banner.is-void > .bi { color: var(--skip-red); }
.status-banner.is-wasted { background: rgba(160, 64, 192, .1); border-color: #A040C0; }
.status-banner.is-wasted > .bi { color: #A040C0; }

.problem-buttons { display: flex; gap: .65rem; }
.btn-problem {
    flex: 1;
    min-height: 2.75rem;
    border-radius: 12px;
    border: 1.5px solid var(--skip-line);
    color: var(--skip-muted);
    font-weight: 600;
    font-size: .92rem;
}
.btn-problem:hover { border-color: var(--skip-red); color: var(--skip-red); background: transparent; }


/* ---- Sub-headings inside a card (Tipping, Charges) ---- */
.form-subhead {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin: 1.4rem 0 .8rem;
    padding-top: 1rem;
    border-top: 1px solid var(--skip-line);
    font-size: .95rem;
    font-weight: 800;
}
.form-subhead .bi { color: var(--skip-accent-text); }
.same-ticket-row { display: flex; justify-content: flex-end; }
.same-ticket {
    /* Bootstrap's link-button colours, set to the app's teal in every state */
    --bs-btn-color: var(--skip-accent-text);
    --bs-btn-hover-color: var(--skip-accent-text);
    --bs-btn-active-color: var(--skip-accent-text);
    padding: .3rem 0 0;
    font-size: .85rem;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
}


/* ---- Business details page ---- */
.logo-row { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.logo-preview {
    width: 9rem; height: 6rem;
    display: grid; place-items: center;
    border-radius: 14px; border: 2px dashed var(--skip-line);
    background: #FFFFFF; overflow: hidden;
}
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-preview span { color: #85857F; font-size: .85rem; }
.logo-controls { flex: 1; min-width: 12rem; }
.profile-form textarea.sheet-input { min-height: 0; }
.profile-save { margin-top: 1rem; }
@media (min-width: 768px) {
    .wide-card { grid-column: 1 / -1; }
    .profile-save { max-width: 26rem; margin-left: auto; }
}


/* ---- Email: who to send to ---- */
.send-to-list { display: flex; flex-direction: column; gap: .5rem; }
.send-to {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem .9rem;
    border-radius: 14px;
    border: 1.5px solid var(--skip-line);
    cursor: pointer;
}
.send-to .form-check-input { width: 1.3rem; height: 1.3rem; margin: 0; flex-shrink: 0; }
.send-to span { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.send-to small { color: var(--skip-muted); overflow-wrap: anywhere; }
.send-to:has(input:checked) { border-color: var(--skip-teal); background: rgba(48, 156, 174, .08); }
.send-to.is-empty { opacity: .55; cursor: default; }


/* ==================================================================
   CUSTOMERS
   ================================================================== */

/* Search box */
.search-bar {
    position: relative;
    margin-bottom: 1.25rem;
}
.search-bar > .bi {
    position: absolute;
    left: 1rem; top: 50%;
    transform: translateY(-50%);
    color: var(--skip-muted);
    pointer-events: none;
}
.search-bar .form-control {
    min-height: 3.25rem;
    padding-left: 2.75rem;
    padding-right: 2.75rem;
    border-radius: 14px;
    border: 2px solid transparent;
    background-color: var(--skip-surface);
    box-shadow: 0 0 0 1px var(--skip-line);
}
.search-bar .form-control:focus { border-color: var(--skip-teal); box-shadow: 0 0 0 4px var(--bs-focus-ring-color); }
.search-clear {
    position: absolute;
    right: .75rem; top: 50%;
    transform: translateY(-50%);
    color: var(--skip-muted);
    padding: .25rem .4rem;
}

/* Account code badge */
.account-code {
    padding: .1rem .5rem;
    border-radius: 6px;
    background: var(--skip-field);
    color: var(--skip-ink);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .03em;
    white-space: nowrap;
}

.customer-card { --job-colour: var(--skip-teal); }
.customer-card.is-on-stop { --job-colour: var(--skip-red); }
.customer-card .job-actions a { font-size: .7rem; line-height: 1.15; text-align: center; }
.customer-hero { --job-colour: var(--skip-teal); }

/* Previous / next pages */
.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.25rem;
    color: var(--skip-muted);
    font-weight: 600;
}

.onstop-switch .form-check-input { width: 2.6em; height: 1.4em; }
.onstop-switch .form-check-input:checked { background-color: var(--skip-red); border-color: var(--skip-red); }
.onstop-switch label { padding-left: .35rem; padding-top: .1rem; }
.onstop-switch small { color: var(--skip-muted); }

/* Lists of sites / agreements, with buttons on the right */
.record-list { list-style: none; margin: 0 0 .9rem; padding: 0; }
.record-list li {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 0;
    border-bottom: 1px solid var(--skip-line);
}
.record-list li:first-child { padding-top: 0; }
.record-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.record-text span { font-size: .92rem; }
.record-text small { color: var(--skip-muted); }
.record-buttons { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }
.record-buttons .btn-sm { border-radius: 10px; font-weight: 700; white-space: nowrap; }

.icon-btn {
    width: 2.4rem;
    height: 2.4rem;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--skip-field);
    color: var(--skip-ink);
    text-decoration: none;
}
.icon-btn:hover { color: var(--skip-accent-text); }
.icon-btn.is-danger:hover { color: var(--skip-red); background: rgba(227, 6, 19, .1); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }

/* Lists of jobs / invoices that link through */
.link-list { list-style: none; margin: 0; padding: 0; }
.link-list a {
    position: relative;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem 0 .65rem .9rem;
    border-bottom: 1px solid var(--skip-line);
    color: var(--skip-ink);
    text-decoration: none;
}
.link-list a::before {             /* job colour stripe */
    content: "";
    position: absolute;
    left: 0; top: .6rem; bottom: .6rem;
    width: 4px;
    border-radius: 2px;
    background: var(--job-colour, var(--skip-line));
}
.link-list a:hover strong { color: var(--skip-accent-text); }
.link-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.link-main small { color: var(--skip-muted); }
.link-side { display: flex; align-items: center; gap: .4rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Cards in a grid must never grow wider than their column (long drop-down
   options, e.g. waste code descriptions, would otherwise push the page sideways) */
.detail-grid > * { min-width: 0; }
.sheet-input, .form-select { max-width: 100%; }
/* Side-by-side boxes (and date boxes, which browsers give a minimum width) shrink to fit */
.field-pair > * { min-width: 0; }
.sheet-input[type="date"], .sheet-input[type="time"] { min-width: 0; width: 100%; }

/* ---- Customer page: summary in the heading, edit form folded away ---- */
.customer-summary { display: grid; gap: .75rem; margin-top: .75rem; }
@media (min-width: 576px) { .customer-summary { grid-template-columns: 1fr 1fr; } }
.edit-grid { gap: 0 2rem; }
.edit-block .form-subhead.mt-0 { margin-top: 0; padding-top: 0; border-top: 0; }
@media (max-width: 767.98px) { .edit-block + .edit-block .form-subhead { margin-top: 1.4rem; } }


/* ---- Jobs list: "Hide done jobs" switch ---- */
.hide-done {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    margin: -.5rem 0 1rem;
    color: var(--skip-ink);
    font-weight: 600;
    font-size: .92rem;
    text-decoration: none;
}
.hide-done small { color: var(--skip-muted); font-weight: 500; }
.hide-done-switch {
    position: relative;
    width: 2.6rem;
    height: 1.45rem;
    border-radius: 999px;
    background: var(--skip-line);
    transition: background-color .15s;
}
.hide-done-switch::after {
    content: "";
    position: absolute;
    top: .2rem; left: .2rem;
    width: 1.05rem; height: 1.05rem;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
    transition: transform .15s;
}
.hide-done.is-on .hide-done-switch { background: var(--skip-teal-dark); }
.hide-done.is-on .hide-done-switch::after { transform: translateX(1.15rem); }
.hide-done:hover { color: var(--skip-accent-text); }
@media (prefers-reduced-motion: reduce) {
    .hide-done-switch, .hide-done-switch::after { transition: none; }
}


/* ---- Customer page: agreements select which jobs / invoices show ---- */
.agreement-list li {
    margin: 0 -.6rem;
    padding: .7rem .6rem;
    border-radius: 14px;
    border-bottom: 0;
    border: 1.5px solid transparent;
}
.agreement-list li + li { margin-top: .35rem; }
.agreement-list li.is-selected { border-color: var(--skip-teal); background: rgba(48, 156, 174, .08); }
.agreement-select { color: var(--skip-ink); text-decoration: none; }
.agreement-select:hover strong { color: var(--skip-accent-text); }
.agreement-select small { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; margin-top: .2rem; }
.agreement-select .chip { font-size: .7rem; padding: .1rem .45rem; }
.agreement-footer { display: flex; gap: .6rem; margin-top: .9rem; }
.agreement-footer .btn { flex: 1; }
.agreement-footer .btn.is-active { background: var(--skip-teal-dark); color: #FFFFFF; border-color: var(--skip-teal-dark); }

.history-column { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.showing-for { margin: -.5rem 0 .75rem; color: var(--skip-muted); font-size: .9rem; }
.showing-for strong { color: var(--skip-accent-text); }
#jobs, #invoices, #agreements, #sites { scroll-margin-top: 5rem; }
/* Phones: an agreement's buttons go on their own line under its details */
@media (max-width: 575.98px) {
    .agreement-list li { flex-wrap: wrap; }
    .agreement-list .agreement-select { flex: 1 1 100%; }
    .agreement-list .record-buttons { flex: 1 1 100%; justify-content: flex-end; }
}
.agreement-footer .btn { font-size: .92rem; white-space: nowrap; padding-left: .5rem; padding-right: .5rem; }

.last-job { margin-top: .3rem; color: var(--skip-muted); font-size: .8rem; font-weight: 600; }
.last-job .bi { margin-right: .2rem; }

.new-customer-btn { display: flex; align-items: center; justify-content: center; gap: .4rem; width: 100%; margin-bottom: .9rem; }
@media (min-width: 768px) { .new-customer-btn { width: auto; display: inline-flex; padding: 0 1.5rem; } }


/* ---- Customers list: recent jobs inside a tapped card ---- */
.card-panel { display: none; margin-left: 7px; padding: .2rem 1rem .9rem; border-top: 1px solid var(--skip-line); }
.job-card.is-selected .card-panel { display: block; animation: actions-in .18s ease-out; }
.recent-title { margin: .8rem 0 .4rem; font-size: .75rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--skip-muted); }
.recent-empty { margin: .7rem 0 0; color: var(--skip-muted); font-size: .9rem; }
.recent-list { list-style: none; margin: 0; padding: 0; }
.recent-list li {
    position: relative;
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem 0 .5rem .75rem;
    border-bottom: 1px solid var(--skip-line);
}
.recent-list li:last-child { border-bottom: 0; }
.recent-list li::before {
    content: "";
    position: absolute;
    left: 0; top: .5rem; bottom: .5rem;
    width: 4px; border-radius: 2px;
    background: var(--job-colour, var(--skip-line));
}
.recent-job { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; color: var(--skip-ink); text-decoration: none; }
.recent-job strong { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-job small { color: var(--skip-muted); }
.clone-btn { border-radius: 10px; font-weight: 700; white-space: nowrap; }

.bottom-nav button:disabled { opacity: .45; }

/* ---- On route ---- */
.btn-route {
    min-height: 3rem;
    border-radius: 14px;
    border: 1.5px dashed var(--skip-teal-dark);
    color: var(--skip-accent-text);
    font-weight: 700;
}
.btn-route:hover { background: rgba(48, 156, 174, .1); color: var(--skip-accent-text); }
.btn-route .bi, .on-route-bar .bi { margin-right: .35rem; }
.on-route-bar {
    padding: .7rem 1rem;
    border-radius: 14px;
    background: rgba(48, 156, 174, .1);
    color: var(--skip-accent-text);
}
.on-route-bar span { color: var(--skip-muted); }
.chip-route { background: rgba(48, 156, 174, .15); color: var(--skip-accent-text); }
#signatures, #photos { scroll-margin-top: 5rem; }


/* ==================================================================
   INVOICES
   ================================================================== */
.page-buttons { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.page-buttons .btn { flex: 1 1 10rem; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 3rem; }
.btn-count {
    min-width: 1.5rem;
    padding: 0 .4rem;
    border-radius: 999px;
    background: var(--skip-red);
    color: #FFFFFF;
    font-size: .8rem;
    line-height: 1.5rem;
}

.invoice-card { --job-colour: var(--skip-red); }
.invoice-card.is-paid { --job-colour: var(--skip-teal); }
.invoice-sums {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .2rem .9rem;
    margin-top: .3rem;
    color: var(--skip-muted);
    font-size: .88rem;
    font-variant-numeric: tabular-nums;
}
.invoice-sums strong { margin-left: auto; color: var(--skip-ink); font-size: 1.05rem; }
.invoice-items .item-text span { color: var(--skip-ink); font-size: .9rem; }
.invoice-items .item-text small { color: var(--skip-muted); }

.invoice-hero { --job-colour: var(--skip-red); }
.invoice-hero a { color: inherit; }
.invoice-total-big { margin: .35rem 0 .2rem; font-size: 1.9rem; font-weight: 800; font-variant-numeric: tabular-nums; }

/* Batch email */
.send-all { display: flex; align-items: center; gap: .6rem; margin-bottom: .75rem; color: var(--skip-muted); font-size: .9rem; cursor: pointer; }
.send-all .form-check-input { width: 1.2rem; height: 1.2rem; margin: 0; }
.batch-text { flex: 1; }
.send-to .item-total { flex-shrink: 0; }

/* Jobs not invoiced report */
.report-dates { margin-bottom: 1rem; }
.report-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .5rem;
    margin-bottom: 1rem;
}
.report-summary div {
    display: flex;
    flex-direction: column;
    padding: .7rem .8rem;
    border-radius: 14px;
    background: var(--skip-surface);
    border: 1px solid var(--skip-line);
}
.report-summary span { color: var(--skip-muted); font-size: .78rem; font-weight: 600; }
.report-summary strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
@media (max-width: 575.98px) { .report-summary { grid-template-columns: repeat(2, 1fr); } }

/* Printing a page (e.g. the report): just the content */
@media print {
    .app-sidebar, .app-topbar, .bottom-nav, .no-print, .flash, .day-switcher { display: none !important; }
    .app-page, .app-content { background: #FFFFFF !important; padding: 0 !important; }
    .detail-card, .report-summary div { border-color: #999 !important; }
    .link-list a::before { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

.batch-customer { font-size: .92rem; overflow-wrap: anywhere; }
.batch-email { overflow-wrap: anywhere; }

/* ---- Search with a button ---- */
.search-bar.has-button .form-control { padding-right: 8.5rem; }
.search-bar.has-button .search-clear { right: 6.4rem; }
.search-go {
    position: absolute;
    right: .35rem; top: 50%;
    transform: translateY(-50%);
    min-height: 2.6rem;
    padding: 0 1rem;
    border: 0;
    border-radius: 11px;
    background: var(--skip-teal-dark);
    color: #FFFFFF;
    font-weight: 700;
}
.search-go:hover, .search-go:focus-visible { background: var(--skip-teal-dark); color: #FFFFFF; filter: brightness(1.1); }

/* ---- Invoice payment ---- */
.paid-note { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .6rem; margin-bottom: .25rem; }
.paid-note .bi { color: var(--skip-accent-text); }
.paid-note span { color: var(--skip-muted); font-size: .9rem; }


/* ==================================================================
   LOOKUP TABLES
   ================================================================== */
.lookup-menu { display: grid; gap: .6rem; }
@media (min-width: 768px) { .lookup-menu { grid-template-columns: 1fr 1fr; } }
.lookup-tile {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .9rem 1rem;
    border-radius: 18px;
    background: var(--skip-surface);
    border: 1px solid var(--skip-line);
    color: var(--skip-ink);
    text-decoration: none;
}
.lookup-tile:hover { border-color: var(--skip-teal); }
.lookup-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.lookup-text small { color: var(--skip-muted); }
.lookup-count {
    min-width: 2.2rem;
    padding: .15rem .55rem;
    border-radius: 999px;
    background: var(--skip-field);
    font-weight: 700;
    font-size: .85rem;
    text-align: center;
}
.lookup-tile > .bi-chevron-right { color: var(--skip-muted); }
.lookup-form { max-width: 40rem; }
.lookup-delete { margin-top: 1rem; max-width: 40rem; }
@media (min-width: 768px) { .lookup-form + .profile-save { max-width: 40rem; margin-left: 0; } }


/* ---- Find address (postcode lookup) ---- */
.postcode-finder {
    margin-bottom: 1.1rem;
    padding: .9rem;
    border-radius: 14px;
    background: rgba(48, 156, 174, .07);
    border: 1px dashed rgba(48, 156, 174, .5);
}
.finder-row { display: flex; gap: .5rem; }
.finder-row .finder-postcode { flex: 1; min-width: 0; }
.finder-row .finder-go { flex-shrink: 0; min-height: 3rem; white-space: nowrap; }
.finder-message:empty { display: none; }
.finder-message { margin-top: .5rem; }
.finder-results {
    list-style: none;
    margin: .5rem 0 0;
    padding: 0;
    max-height: 18rem;
    overflow-y: auto;
    border-radius: 12px;
    background: var(--skip-surface);
    border: 1px solid var(--skip-line);
}
.finder-results button {
    display: block;
    width: 100%;
    padding: .7rem .9rem;
    border: 0;
    border-bottom: 1px solid var(--skip-line);
    background: none;
    color: var(--skip-ink);
    text-align: left;
    font-size: .92rem;
}
.finder-results li:last-child button { border-bottom: 0; }
.finder-results button:hover, .finder-results button:focus-visible { background: rgba(48, 156, 174, .1); }


/* ---- Linked companies ---- */
.link-notice {
    display: flex;
    align-items: center;
    gap: .9rem;
    margin: 0 0 1.25rem;
    padding: .9rem 1rem;
    border-radius: 18px;
    background: rgba(48, 156, 174, .12);
    border: 1.5px solid var(--skip-teal);
    color: var(--skip-ink);
    text-decoration: none;
}
.link-notice .row-icon { background: var(--skip-teal-dark); color: #FFFFFF; }
.link-notice-text { flex: 1; display: flex; flex-direction: column; line-height: 1.35; }
.link-notice-text small { color: var(--skip-accent-text); font-weight: 600; }
.link-row { flex-wrap: wrap; }
.link-buttons { display: flex; gap: .5rem; flex: 1 1 100%; }
.link-buttons form { flex: 1; }
.link-buttons .btn { width: 100%; min-height: 2.75rem; }


/* ---- Business details: serial and one-off PIN ---- */
.pin-row { display: flex; gap: .75rem; margin-bottom: .75rem; }
.pin-row > div {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: .7rem .9rem;
    border-radius: 14px;
    background: var(--skip-field);
}
.pin-row span { color: var(--skip-muted); font-size: .8rem; font-weight: 600; }
.pin-row strong { font-size: 1.3rem; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.pin-code { color: var(--skip-accent-text); letter-spacing: .25em !important; }

/* ---- Business details: central register check ---- */
.register-check { margin-top: .9rem; border-top: 1px solid var(--skip-line); padding-top: .7rem; }
.register-check summary { cursor: pointer; font-weight: 700; font-size: .92rem; }
.register-check ul { list-style: none; margin: .6rem 0 0; padding: 0; }
.register-check li { display: flex; gap: .5rem; padding: .3rem 0; font-size: .9rem; }
.register-check li span { display: flex; flex-direction: column; min-width: 0; }
.register-check small { color: var(--skip-muted); overflow-wrap: anywhere; }
.register-check .is-ok { color: var(--skip-accent-text); }
.register-check .is-bad, .register-check li.is-bad i { color: var(--skip-red); }
.register-check li.is-ok i { color: var(--skip-accent-text); }

/* ---- Serial number and one-off PIN in the menu (More panel on a phone, sidebar on a PC) ---- */
.more-ids { display: flex; gap: .6rem; padding: 0 1.25rem .75rem; }
.more-id {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: .45rem .6rem;
    border-radius: 12px;
    background: rgba(48, 156, 174, .12);
    line-height: 1.2;
}
.more-id small { color: var(--skip-muted); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.more-id strong { color: var(--skip-accent-text); font-size: 1.2rem; letter-spacing: .15em; font-variant-numeric: tabular-nums; }
.menu-id { white-space: nowrap; }
.menu-id strong { color: var(--skip-accent-text); letter-spacing: .06em; font-variant-numeric: tabular-nums; }

/* ---- Weighbridge PIN (job page strip, list label) ---- */
.job-pin {
    display: flex;
    align-items: center;
    gap: .8rem;
    margin: 0 0 1rem;
    padding: .75rem .9rem;
    border-radius: 16px;
    background: var(--skip-surface);
    border: 1px solid var(--skip-line);
}
.job-pin.has-pin { border-color: var(--skip-teal); background: rgba(48, 156, 174, .08); }
.job-pin .row-icon { flex-shrink: 0; }
.job-pin-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.job-pin-text small { color: var(--skip-muted); font-weight: 700; font-size: .78rem; }
.job-pin-text strong { font-size: 1.45rem; letter-spacing: .2em; color: var(--skip-accent-text); font-variant-numeric: tabular-nums; }
.job-pin-note { color: var(--skip-muted); font-size: .82rem; }
.job-pin-form { margin: 0; flex-shrink: 0; }
.job-pin-form .btn { white-space: nowrap; border-radius: 10px; font-weight: 700; }
.job-pin-form .bi { margin-right: .3rem; }
/* On a jobs list card: the same strip, sitting under the site line */
.job-pin-card { margin: .6rem 0 0; padding: .55rem .75rem; }
.job-pin-card .row-icon { width: 2.6rem; height: 2.6rem; font-size: 1.2rem; }
.is-spinning .bi { display: inline-block; animation: pin-spin .8s linear infinite; }
@keyframes pin-spin { to { transform: rotate(360deg); } }
.pin-changed { animation: pin-flash 1.2s ease-out; }
@keyframes pin-flash { 0% { background: rgba(48, 156, 174, .35); border-radius: 6px; } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .is-spinning .bi, .pin-changed { animation: none; } }


/* ---- Subcontracted jobs (sent by a full Skiptrak company) ---- */
.chip-subcontract { background: rgba(87, 87, 86, .12); color: var(--skip-ink); }
.job-card.is-subcontract .job-main::before,
.job-card.is-subcontract::before {
    /* a striped stripe, so they stand apart from your own jobs at a glance */
    background-image: repeating-linear-gradient(180deg, transparent 0 6px, rgba(255, 255, 255, .75) 6px 10px);
}
/* Supplier jobs: the same stripes in purple, a purple chip and banner */
.job-card.is-supplier .job-main::before,
.job-card.is-supplier::before {
    background-image: repeating-linear-gradient(180deg, transparent 0 6px, var(--skip-supplier) 6px 10px);
}
.chip-supplier { background: color-mix(in srgb, var(--skip-supplier) 16%, transparent); color: var(--skip-supplier); font-weight: 600; }
.chip-supplier .bi { color: var(--skip-supplier); }
.subcontract-banner {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    margin: 0 0 1rem;
    padding: .8rem 1rem;
    border-radius: 16px;
    background: var(--skip-field);
    border-left: 5px solid var(--skip-grey);
}
.subcontract-banner > .bi { font-size: 1.35rem; color: var(--skip-grey); }
.subcontract-banner div { display: flex; flex-direction: column; line-height: 1.35; }
.subcontract-banner span { color: var(--skip-muted); font-size: .9rem; }
.subcontract-banner.is-supplier { background: color-mix(in srgb, var(--skip-supplier) 9%, var(--skip-field)); border-left-color: var(--skip-supplier); }
.subcontract-banner.is-supplier > .bi { color: var(--skip-supplier); }
.subcontract-banner.is-cancelled { background: rgba(227, 6, 19, .08); border-left-color: var(--skip-red); }
.subcontract-banner.is-cancelled > .bi { color: var(--skip-red); }
/* Link removed: warning (the job can still be done) */
.subcontract-banner.is-unlinked { background: rgba(227, 6, 19, .05); border-left-color: var(--skip-red); }
.subcontract-banner.is-unlinked > .bi { color: var(--skip-red); }

/* Incoming jobs */
.incoming-from { color: var(--skip-accent-text); font-weight: 700; font-size: .88rem; margin-bottom: .2rem; }
.incoming-from .is-supplier { color: var(--skip-supplier); }
.incoming-card h2.incoming-title { font-size: 1.15rem; text-transform: none; letter-spacing: 0; color: var(--skip-ink); margin-bottom: .6rem; }
.incoming-buttons { display: flex; gap: .6rem; margin-top: 1rem; }
.incoming-buttons form { flex: 2; }
.incoming-buttons > .btn { flex: 1; }


/* ==================================================================
   SKIPTRAK PDA (drivers app) – additions
   ================================================================== */

/* ---- Driver drop-down at the top of Home and the jobs list ---- */
.driver-picker {
    margin: 0 0 1.25rem;
    padding: .9rem 1rem 1rem;
    border-radius: 18px;
    background: var(--skip-surface);
    border: 1px solid var(--skip-line);
}
.driver-picker .form-label { font-weight: 700; margin-bottom: .4rem; }
.driver-picker-row { display: flex; gap: .5rem; }
.driver-picker-row .form-select { flex: 1; min-width: 0; }

/* ---- Gross / tare / net on the job page ---- */
.weight-trio { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.weight-trio > div { min-width: 0; }
.tare-hint { margin: .35rem 0 0; font-size: .85rem; color: var(--skip-muted); }
.tare-hint .btn-link { padding: 0; font-size: .85rem; font-weight: 700; vertical-align: baseline; color: var(--skip-accent-text); }
.net-line { margin: .5rem 0 1rem; color: var(--skip-muted); font-size: .92rem; }
.net-line strong { color: var(--skip-ink); }

/* ---- Waste breakdown ---- */
.breakdown-bar {
    display: flex;
    height: .6rem;
    border-radius: 999px;
    overflow: hidden;
    background: var(--skip-field);
    margin: .25rem 0 .9rem;
}
.breakdown-bar span { background: var(--skip-teal); border-right: 2px solid var(--skip-surface); }
.breakdown-bar span:nth-child(even) { background: var(--skip-teal-dark); }
.breakdown-left { font-size: .92rem; color: var(--skip-muted); margin: 0 0 .9rem; }
.breakdown-left strong { color: var(--skip-ink); }

/* ---- Complete job: "Waiting for photos…", "Saving and completing…" ---- */
.complete-status { margin: .5rem 0 0; text-align: center; font-size: .9rem; font-weight: 600; color: var(--skip-accent-text); }
.complete-status:empty { display: none; }

/* Nett while it's worked out from gross and tare: shown, not typed */
#nett[readonly] { color: var(--skip-ink); font-weight: 700; background: transparent; border: 1px dashed var(--skip-line); }

/* Weight (tonnes): always nett ÷ 1000, shown like a box but not typed in */
.weight-tonnes {
    display: flex;
    align-items: center;
    min-height: calc(1.5em + 1.5rem + 2px);
    padding: 0 .9rem;
    border-radius: 14px;
    border: 1px dashed var(--skip-line);
    font-weight: 700;
    color: var(--skip-ink);
}

/* ---- Job filter: driver and date, one row each on a phone, side by side when wider ---- */
.job-filter-row { display: grid; grid-template-columns: 1fr; gap: .75rem; }
.job-filter-row > div { min-width: 0; }
.job-filter-row .form-control[type="date"] { min-width: 0; width: 100%; }
@media (min-width: 576px) {
    .job-filter-row { grid-template-columns: 1.4fr 1fr; }
}

/* ---- Cash job not paid: amount to collect (SHOW_DRIVER_CASH_JOB_PRICES) ---- */
.status-banner.is-collect { background: rgba(227, 6, 19, .07); border-color: var(--skip-red); }
.status-banner.is-collect > .bi { color: var(--skip-red); }
.status-banner.is-collect strong { font-size: 1.15rem; }


/* ==================================================================
   PHONE OUTLINE ON A PC / LAPTOP (device.php)
   The real app is shown inside, 390px wide, so it looks just as on a phone.
   ================================================================== */
.device-page {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 50% 35%, rgba(48, 156, 174, .10), transparent 60%),
        var(--skip-page);
}
.device-stage {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
}
.device {
    --device-bezel: 12px;
    position: relative;
    width: calc(390px + 2 * var(--device-bezel));
    height: min(calc(844px + 2 * var(--device-bezel)), calc(100vh - 6rem));
    min-height: 520px;
    padding: var(--device-bezel);
    border-radius: 56px;
    background: #16191B;
    box-shadow:
        inset 0 0 0 2px #3A3F42,                 /* the metal edge */
        0 30px 70px rgba(0, 0, 0, .28),
        0 8px 20px rgba(0, 0, 0, .12);
}
.device-screen {
    display: block;
    width: 390px;
    height: 100%;
    border: 0;
    border-radius: 44px;
    background: var(--skip-page);
}
/* side buttons */
.device-button { position: absolute; width: 4px; border-radius: 2px; background: #2B3033; }
.device-button-power  { right: -4px; top: 180px; height: 84px; }
.device-button-volume { left: -4px;  top: 150px; height: 120px; }

.device-caption {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0;
    color: var(--skip-muted);
    font-size: .9rem;
}
.device-caption img { border-radius: 6px; }
.device-caption strong { color: var(--skip-ink); }


/* ---- "Please wait" while saving (showBusy() in app.js) ---- */
.busy-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;                         /* above slide-up sheets */
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(20, 24, 26, .45);
}
.busy-overlay.is-on { display: flex; }
.busy-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    min-width: 13rem;
    max-width: 20rem;
    padding: 1.5rem 1.75rem;
    border-radius: 20px;
    background: var(--skip-surface);
    color: var(--skip-ink);
    text-align: center;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .25);
}
.busy-text { font-size: 1.1rem; }
.busy-slow { color: var(--skip-muted); font-size: .85rem; }
.busy-slow:empty { display: none; }
.busy-spinner {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    border: 4px solid var(--skip-field);
    border-top-color: var(--skip-teal);
    animation: busy-spin .8s linear infinite;
}
@keyframes busy-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .busy-spinner { animation-duration: 2.4s; }
}

/* ---- Signatures still needed before the job can be completed ---- */
.sig-needed {
    display: flex;
    gap: .45rem;
    align-items: baseline;
    margin: -.25rem 0 .9rem;
    color: var(--skip-red);
    font-size: .92rem;
    font-weight: 600;
}


/* ---- Bottom bar with six buttons (a job: Jobs, Save, Signature, Photo, Complete, More) ----
   A little tighter so they all fit on a small phone */
.bottom-nav:has(> :nth-child(6)) a,
.bottom-nav:has(> :nth-child(6)) button { min-width: 0; font-size: .68rem; }
.bottom-nav:has(> :nth-child(6)) .bi { padding: .3rem .75rem; }

/* Save on the bottom bar: a red dot when the job has changes not saved yet */
#nav-save .bi { position: relative; }
#nav-save.has-changes { color: var(--skip-accent-text); }
#nav-save.has-changes .bi::after {
    content: "";
    position: absolute;
    top: .15rem;
    right: .45rem;
    width: .55rem;
    height: .55rem;
    border-radius: 50%;
    background: var(--skip-red);
    border: 2px solid var(--skip-surface);
}


/* ==================================================================
   SEARCHABLE PICKERS (assets/js/picker.js) – waste codes, additional items
   ================================================================== */
/* The job's Waste code: a button that looks like the other boxes */
.picker-button {
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.picker-button.is-empty { color: var(--skip-muted); }

/* The slide-up panel: a fixed height, so it doesn't jump about while filtering */
.picker-sheet { height: 85vh !important; }
.picker-sheet .offcanvas-body { display: flex; flex-direction: column; min-height: 0; padding-top: .25rem; }
.picker-sheet .picker { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.picker-sheet .picker-list { flex: 1; }

.picker-search { margin-bottom: .6rem; }

.picker-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 14px;
    border: 1px solid var(--skip-line);
}
.picker-inline .picker-list { max-height: 38vh; }
.picker-list li + li { border-top: 1px solid var(--skip-line); }

.picker-option {
    display: flex;
    align-items: center;
    gap: .75rem;
    width: 100%;
    min-height: 3.1rem;
    padding: .6rem .9rem;
    border: 0;
    background: none;
    color: var(--skip-ink);
    text-align: left;
    font-size: 1rem;
    line-height: 1.3;
}
.picker-option:hover,
.picker-option:focus-visible { background: var(--skip-field); }
.picker-option .picker-text { flex: 1; min-width: 0; }
.picker-option .bi { visibility: hidden; color: var(--skip-accent-text); font-size: 1.2rem; }
.picker-option.is-chosen { background: rgba(48, 156, 174, .12); font-weight: 700; }
.picker-option.is-chosen .bi { visibility: visible; }
.picker-option.is-none { color: var(--skip-muted); font-style: italic; }

.picker-none { margin: .75rem 0 0; color: var(--skip-muted); font-size: .92rem; text-align: center; }
.picker-chosen { margin: 0 0 .5rem; font-weight: 600; color: var(--skip-accent-text); }
.picker-chosen .bi { margin-right: .2rem; }
.picker-error { margin: .35rem 0 0; color: var(--skip-red); font-size: .9rem; font-weight: 600; }
.picker-error:empty { display: none; }
.picker-inline { margin-bottom: 1rem; }


/* ---- Skip Jobs: a heading for each day in the list ("Today · Tue 24 Nov") ---- */
.job-day-head {
    list-style: none;
    margin: .5rem .25rem .1rem;
    font-weight: 800;
    font-size: .95rem;
    color: var(--skip-ink);
    letter-spacing: .01em;
}
.job-day-head:first-child { margin-top: 0; }
.job-day-head span { color: var(--skip-muted); font-weight: 600; }

/* Missed jobs: an earlier day's job still not done – amber heading, badge and tag */
.job-day-head.is-missed { color: #9A5B00; }
.job-day-head.is-missed .bi { margin-right: .3rem; }
.missed-badge {
    display: inline-block;
    margin-left: .4rem;
    padding: .1rem .55rem;
    border-radius: 999px;
    background: #F6A400;
    color: #FFFFFF !important;
    font-size: .75rem;
    font-weight: 800;
    vertical-align: .1em;
}
.chip-missed { background: rgba(246, 164, 0, .18); color: #8A5200; }
.job-card.is-missed { box-shadow: 0 0 0 2px rgba(246, 164, 0, .55); }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .job-day-head.is-missed { color: #FFC24D; }
    :root:not([data-theme="light"]) .chip-missed { color: #FFC24D; }
}
:root[data-theme="dark"] .job-day-head.is-missed,
:root[data-theme="dark"] .chip-missed { color: #FFC24D; }


/* ---- Skip Jobs: Refresh top right, "Updated" under it (own row – separate from the driver drop-down) ---- */
.jobs-toolbar {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 .9rem;
}
.jobs-refresh { display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; }
.btn-refresh { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; }
.btn-refresh .bi { font-size: 1.1rem; }
.jobs-updated { color: var(--skip-muted); font-size: .85rem; }


/* ---- Sign-in page: the driver code box, and the office / driver switch ---- */
.code-input {
    font-size: 1.5rem !important;
    font-weight: 700;
    letter-spacing: .35em;
    text-transform: uppercase;
}
.login-switch { margin: 1.25rem 0 0; text-align: center; font-size: .92rem; }
.login-switch a { color: var(--skip-muted); }

/* ---- Sign-in page: code maker for the office (closed until opened) ---- */
.code-maker { margin: .75rem 0 0; text-align: center; font-size: .92rem; }
.code-maker summary { color: var(--skip-muted); cursor: pointer; list-style: none; text-decoration: underline; }
.code-maker summary::-webkit-details-marker { display: none; }
.code-maker-body {
    margin-top: .75rem;
    padding: 1rem;
    border-radius: 16px;
    border: 1px solid var(--skip-line);
    background: var(--skip-surface);
}
.new-code {
    display: block;
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: .3em;
    padding-left: .3em;                 /* balances the letter spacing */
    color: var(--skip-ink);
    font-variant-numeric: tabular-nums;
}
.code-maker-buttons { display: flex; gap: .5rem; justify-content: center; margin: .75rem 0; }
.code-maker-note { margin: 0; color: var(--skip-muted); font-size: .85rem; }


/* ==================================================================
   STEP BY STEP (job page) and WORKING WITHOUT SIGNAL
   ================================================================== */
.job-flow { display: flex; flex-direction: column; gap: .6rem; }

/* Progress: Route · Arrive · Sign · Photos · Finish · Complete */
.flow-steps {
    display: flex;
    justify-content: space-between;
    list-style: none;
    margin: 0 0 .2rem;
    padding: 0;
    position: relative;
}
.flow-steps::before {                                   /* the line behind the dots */
    content: "";
    position: absolute;
    top: .45rem;
    left: 1.2rem;
    right: 1.2rem;
    height: 2px;
    background: var(--skip-line);
}
.flow-steps li {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .3rem;
    flex: 1;
    min-width: 0;
    font-size: .7rem;
    font-weight: 600;
    color: var(--skip-muted);
}
.flow-dot {
    width: .95rem;
    height: .95rem;
    border-radius: 50%;
    background: var(--skip-surface);
    border: 2px solid var(--skip-line);
}
.flow-steps li.is-done .flow-dot { background: var(--skip-teal); border-color: var(--skip-teal); }
.flow-steps li.is-current .flow-dot {
    background: var(--skip-red);
    border-color: var(--skip-red);
    box-shadow: 0 0 0 4px rgba(227, 6, 19, .15);
}
.flow-steps li.is-current { color: var(--skip-ink); font-weight: 800; }
.flow-steps li.is-done { color: var(--skip-accent-text); }

.flow-status { margin: 0; text-align: center; font-weight: 600; color: var(--skip-ink); min-height: 1.2em; }
.flow-status:empty { display: none; }
.flow-status .on-site-pulse { display: inline-block; vertical-align: middle; margin-right: .3rem; }
.flow-waiting, .photo-waiting {
    display: inline-block;
    padding: .05rem .5rem;
    border-radius: 999px;
    background: rgba(246, 164, 0, .2);
    color: #8A5200;
    font-size: .75rem;
    font-weight: 700;
}
.flow-action .btn-main-action { padding-top: .95rem; padding-bottom: .95rem; font-size: 1.15rem; }
.flow-also { display: block; width: 100%; text-align: center; margin-top: .35rem; }
.flow-also .btn-link, .btn-link.flow-also { color: var(--skip-accent-text); font-weight: 600; }

/* Signature / photo kept on the phone (no signal), waiting to send */
.sig-tile.is-waiting { outline: 2px dashed #F6A400; outline-offset: -2px; }
.photo-tile.is-waiting { position: relative; outline: 2px dashed #F6A400; outline-offset: -2px; }
.photo-tile.is-waiting .photo-waiting { position: absolute; left: .35rem; bottom: .35rem; }

/* The bar at the top: no signal / changes waiting to send */
.offline-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .35rem;
    margin: 0 0 .9rem;
    padding: .6rem .9rem;
    border-radius: 14px;
    background: rgba(48, 156, 174, .12);
    color: var(--skip-ink);
    font-size: .9rem;
}
.offline-bar.is-offline { background: rgba(246, 164, 0, .18); }
.offline-bar .btn-link { padding: 0; margin-left: auto; font-weight: 700; color: var(--skip-accent-text); }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .flow-waiting,
    :root:not([data-theme="light"]) .photo-waiting { color: #FFC24D; }
}

/* ---- Step by step: payment (SKIPTRAKPDA_SETPAID) and a needed photo ---- */
.flow-total { margin: 0 0 .5rem; text-align: center; font-size: 1.05rem; }
.flow-total strong { font-size: 1.4rem; margin-left: .35rem; }
.flow-paid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    margin: 0 0 .5rem;
    font-weight: 700;
    color: var(--skip-accent-text);
}
.flow-paid .btn-link { padding: 0; font-weight: 600; color: var(--skip-muted); }
.flow-note { margin: .4rem 0 0; text-align: center; font-size: .9rem; color: var(--skip-muted); }


/* ---- Back to top (app.js): bottom corner, above the phone's bottom bar ---- */
.back-to-top {
    position: fixed;
    right: 1rem;
    bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
    z-index: 1030;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: 0;
    background: var(--skip-teal);
    color: #FFFFFF;
    font-size: 1.3rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
    opacity: 0;
    transform: translateY(.75rem);
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}
.back-to-top.is-on { opacity: 1; transform: none; pointer-events: auto; }
@media (min-width: 992px) {
    .back-to-top { bottom: 1.5rem; }        /* no bottom bar on a PC */
}
@media (prefers-reduced-motion: reduce) {
    .back-to-top { transition: none; }
}

/* Jumping to a section (e.g. Weights from the bottom bar): clear of the top bar */
#weights, #signatures, #photos, #charges, #breakdown { scroll-margin-top: 5.5rem; }

/* ---- Disposal (step by step): nothing to fill in yet ---- */
.disposal-coming {
    margin: 0 0 1.25rem;
    padding: 1.25rem;
    border-radius: 16px;
    border: 1px dashed var(--skip-line);
    text-align: center;
    color: var(--skip-muted);
}
.disposal-coming .bi { font-size: 2rem; color: var(--skip-accent-text); }
.disposal-coming p { margin: .35rem 0 0; }
.disposal-coming strong { color: var(--skip-ink); }

/* ---- Wasted journey: at the bottom of the job ---- */
.problem-bottom { margin: 1.25rem 0 4.5rem; }      /* room below it, so Back to top never covers it */
.problem-bottom .btn-problem { width: 100%; }

/* ---- PDA settings (office): a list of switches ---- */
.settings-note { color: var(--skip-muted); font-size: .9rem; margin: 0 0 .9rem; }
.settings-list { list-style: none; margin: 0; padding: 0; }
.settings-list > li { padding: .9rem 0; border-bottom: 1px solid var(--skip-line); }
.settings-list > li:first-child { padding-top: 0; }
.settings-switch { display: flex; align-items: flex-start; gap: .75rem; padding-left: 0; margin: 0; }
.settings-switch .form-check-input { flex: none; float: none; margin: .15rem 0 0; width: 2.6em; height: 1.4em; }
.settings-switch label { display: flex; flex-direction: column; gap: .15rem; }
.settings-switch label span { color: var(--skip-muted); font-size: .92rem; }
.settings-switch label small { color: var(--skip-muted); font-size: .75rem; letter-spacing: .02em; }


/* ---- Risk assessment tick box (SKIPTRAKPDA_RISKASSES) ---- */
.risk-box {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: .75rem 0 0;
    padding: .75rem 1rem;
    border-radius: 14px;
    border: 1px solid var(--skip-line);
    background: var(--skip-surface);
}
.risk-box .form-check { margin: 0; display: flex; align-items: center; gap: .6rem; }
.risk-box .form-check-input { width: 1.6rem; height: 1.6rem; margin: 0; }
.risk-status { margin-left: auto; font-size: .85rem; font-weight: 600; color: var(--skip-accent-text); }

/* ---- Customer notes (SKIPTRAKPDA_CUSTNOTE): read only ---- */
.customer-note { border-left: 4px solid var(--skip-teal); }


/* ---- Refresh on the right of the first date heading (Skip Jobs Summary) ---- */
.job-day-head.has-refresh {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}
.job-day-head .day-head-text { color: inherit; font-weight: inherit; }
.job-day-head .jobs-updated { color: var(--skip-muted); font-weight: 400; }

/* "Tap a job for options…" – at the very bottom, under the jobs */
.list-hint-bottom { margin: 1rem 0 .5rem; text-align: center; }
