/**
 * Sunpal staff ops — semantic overrides on Pico CSS.
 * H-A-H Phase 5: extracted from layouts/app.blade.php inline styles.
 * Load after vendor/pico.min.css. Preserve existing class contracts.
 */

:root {
    --ink: #090b0d;
    --muted: #5f6764;
    --line: #d7dfd9;
    --green: #168b3d;
    --green-deep: #0b3d22;
    --soft: #f3f7f4;
    --bg: #eef3f0;
    --white: #fff;
    --danger: #9d251c;

    /* Pico token bridge — brand without redesign */
    --pico-font-family: Sora, ui-sans-serif, sans-serif;
    --pico-font-family-sans-serif: Sora, ui-sans-serif, sans-serif;
    --pico-background-color: var(--bg);
    --pico-color: var(--ink);
    --pico-primary: var(--green);
    --pico-primary-background: var(--green);
    --pico-primary-underline: rgba(22, 139, 61, 0.5);
    --pico-primary-hover: var(--green-deep);
    --pico-primary-hover-background: var(--green-deep);
    --pico-secondary: var(--ink);
    --pico-secondary-background: var(--ink);
    --pico-secondary-hover: var(--green);
    --pico-secondary-hover-background: var(--green);
    --pico-border-radius: 0.5rem;
    --pico-form-element-border-color: #cfd8d2;
    --pico-form-element-background-color: #fff;
    --pico-muted-color: var(--muted);
    --pico-muted-border-color: var(--line);
    --pico-card-background-color: var(--white);
    --pico-card-border-color: var(--line);
    --pico-card-box-shadow: 0 8px 24px rgba(9, 11, 13, 0.04);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    font-family: Sora, ui-sans-serif, sans-serif;
}

a { color: inherit; text-decoration: none; }

/* Shell layout — undo Pico nav/main chrome */
.shell {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}

.shell > nav,
nav[aria-label="Staff console"] {
    display: block;
    width: auto;
    height: auto;
    margin: 0;
    padding: 22px 16px;
    background: linear-gradient(180deg, #0b3d22 0%, #092819 55%, #071c12 100%);
    color: #fff;
    border: 0;
    box-shadow: none;
}

nav .brand { display: block; margin-bottom: 22px; padding: 0 8px; }
nav .brand img { display: block; width: 138px; max-width: 100%; height: auto; filter: brightness(0) invert(1); }
nav .nav-label {
    margin: 18px 8px 8px;
    color: rgba(255, 255, 255, 0.45);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
nav a {
    display: block;
    width: auto;
    margin-bottom: 3px;
    padding: 10px 12px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 13px;
    font-weight: 600;
    background: transparent;
    border: 0;
}
nav a:hover,
nav a.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}
nav a.active { box-shadow: inset 3px 0 0 #7ddea0; }

.shell > main,
main:not(.staff-guest) {
    max-width: none;
    margin: 0;
    padding: 28px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
}
.topbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

/* Mobile shell chrome — hidden on desktop */
.staff-mobile-bar,
.staff-nav-backdrop,
.staff-nav-close {
    display: none;
}
.staff-nav-top {
    display: contents;
}
.staff-nav-logout { margin-top: 18px; }
body.is-staff-nav-open {
    overflow: hidden;
    touch-action: none;
}

/* App-like staff shell (HTMX boost) */
.staff-app { min-height: 100dvh; }
.staff-app-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 3px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.staff-app-progress i {
    display: block;
    height: 100%;
    width: 40%;
    border-radius: 999px;
    background: linear-gradient(90deg, #7ddea0, #168b3d, #0b3d22);
    animation: staff-app-progress 0.9s ease-in-out infinite;
}
.htmx-request .staff-app-progress,
.staff-app-progress.htmx-request,
body.is-staff-navigating .staff-app-progress,
body.is-staff-submitting .staff-app-progress {
    opacity: 1;
}
@keyframes staff-app-progress {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(320%); }
}
.staff-app-body.is-staff-submitting,
.staff-app-body.is-staff-navigating {
    cursor: progress;
}
@media (prefers-reduced-motion: no-preference) {
    .staff-app.htmx-settling #staff-main,
    .staff-app.htmx-swapping #staff-main {
        animation: staff-app-fade 0.22s ease;
    }
}
@keyframes staff-app-fade {
    from { opacity: 0.72; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}
.staff-app-toast-host {
    position: fixed;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    z-index: 120;
    display: grid;
    gap: 8px;
    width: min(360px, calc(100vw - 32px));
    pointer-events: none;
}
.staff-app-toast {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    box-shadow: 0 16px 40px rgba(20, 32, 26, 0.16);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.35;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.22s ease, transform 0.22s ease;
}
.staff-app-toast.is-in { opacity: 1; transform: translateY(0); }
.staff-app-toast.is-out { opacity: 0; transform: translateY(8px); }
.staff-app-toast.is-ok {
    border-color: #b7e4c7;
    background: #f3faf6;
    color: #0f6b2f;
}
.staff-app-toast.is-err {
    border-color: #f0b4b4;
    background: #fdecec;
    color: #9b1c1c;
}

h1 { margin: 0; font-size: 28px; letter-spacing: -0.03em; }
h2 { font-size: 17px; margin: 0 0 14px; letter-spacing: -0.02em; }

.grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.panel,
.card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 8px 24px rgba(9, 11, 13, 0.04);
}

.card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}
.card strong {
    display: block;
    margin-top: 6px;
    font-size: 28px;
    letter-spacing: -0.03em;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}
th, td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    font-size: 13px;
    background: transparent;
}
th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    background: #f7faf8;
}

input, select, textarea {
    width: 100%;
    margin: 0;
    border: 1px solid #cfd8d2;
    border-radius: 8px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 16px; /* iOS Safari zooms focused fields under 16px */
    font-weight: 500;
    line-height: 1.35;
    background: #fff;
    color: var(--ink);
}
textarea { min-height: 96px; }

/* Ops-wide: beat Pico / component overrides that shrink controls on mobile */
body.staff-app-body input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]):not([type="image"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
body.staff-app-body select,
body.staff-app-body textarea,
body.staff-app-body .form-grid input,
body.staff-app-body .form-grid select,
body.staff-app-body .form-grid textarea,
main.staff-guest input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
main.staff-guest select,
main.staff-guest textarea {
    font-size: 16px !important;
}

label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 12px;
}
label span {
    display: block;
    color: var(--ink);
    font-weight: 700;
    margin-bottom: 6px;
}

button,
.button,
[role="button"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    margin: 0;
    border: 0;
    border-radius: 8px;
    padding: 10px 14px;
    background: var(--green);
    color: #fff;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}
button:hover,
.button:hover { background: var(--green-deep); }
.button.secondary,
button.secondary {
    background: var(--ink);
    border: 0;
}
button:disabled,
.button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.full { grid-column: 1 / -1; }

.social-test-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 4px 0 8px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 8px;
}
.social-test-row .muted {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
    max-width: 42ch;
}

.notice {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 14px;
    background: #ecfdf3;
    color: #067647;
    border: 1px solid #abefc6;
    font-size: 13px;
}
.error {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 14px;
    background: #fef3f2;
    color: var(--danger);
    border: 1px solid #fecdca;
    font-size: 13px;
}

.staff-guest {
    min-height: 100dvh;
    max-width: none;
    margin: 0;
    display: grid;
    place-items: center;
    padding: max(20px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
    background:
        radial-gradient(900px 420px at 12% -8%, rgba(22, 139, 61, 0.22), transparent 55%),
        radial-gradient(700px 360px at 100% 0%, rgba(11, 61, 34, 0.1), transparent 50%),
        linear-gradient(180deg, #e8f3ec 0%, var(--bg) 42%, #f7faf8 100%);
}
.staff-guest-inner { width: min(440px, 100%); }
.staff-guest .panel { width: 100%; }
.staff-guest-brand {
    display: inline-flex;
    margin-bottom: 18px;
    animation: staff-install-rise 0.35s ease both;
}
.staff-guest-brand img { width: min(168px, 52vw); height: auto; }
.staff-guest-footer {
    margin: 18px 0 0;
    font-size: 13px;
    text-align: center;
}
.staff-guest-footer a {
    color: var(--green);
    font-weight: 700;
}

.staff-login-panel {
    padding: 22px 20px 20px;
    border-radius: 18px;
    border-color: rgba(183, 228, 199, 0.7);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), #fff 40%),
        var(--white);
    box-shadow: 0 22px 50px rgba(20, 32, 26, 0.1);
    animation: staff-install-rise 0.4s ease 0.05s both;
}
.staff-login-head { margin-bottom: 18px; }
.staff-login-kicker {
    margin: 0 0 6px;
    color: var(--green);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.staff-login-panel h2 {
    margin: 0 0 8px;
    font-size: clamp(1.45rem, 5vw, 1.7rem);
    letter-spacing: -0.03em;
    line-height: 1.15;
}
.staff-login-lead {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}
.staff-login-form {
    display: grid;
    gap: 14px;
}
.staff-login-field {
    display: grid;
    gap: 6px;
    margin: 0;
}
.staff-login-field span {
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
}
.staff-login-field input {
    width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 16px; /* iOS zoom-safe */
}
.staff-login-remember {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 2px 0 0;
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}
.staff-login-remember input[type="checkbox"] {
    width: 1.15rem;
    height: 1.15rem;
    margin: 0;
    accent-color: var(--green);
}
.staff-login-submit {
    width: 100%;
    min-height: 50px;
    margin: 4px 0 0;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(180deg, #1a9a46, var(--green));
    color: #fff;
    font-size: 16px;
    font-weight: 750;
    letter-spacing: -0.01em;
    box-shadow: 0 12px 24px rgba(22, 139, 61, 0.28);
}
.staff-login-submit:active { transform: translateY(1px); }
.staff-login-setup {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}
.staff-login-setup a {
    color: var(--green);
    font-weight: 700;
}
.staff-login-panel .staff-install {
    margin-top: 16px;
}
.staff-install[hidden] { display: none !important; }
.staff-install-btn {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    text-align: left;
    margin: 0;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid #b7e4c7;
    background:
        linear-gradient(145deg, rgba(232, 246, 238, 0.95), #fff 55%);
    color: var(--text, #14201a);
    box-shadow: 0 10px 28px rgba(20, 32, 26, 0.06);
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.staff-install-btn:hover {
    border-color: #168b3d;
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(20, 32, 26, 0.1);
}
.staff-install-btn:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none;
}
.staff-install-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #0f6b2f;
    color: #fff;
}
.staff-install-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}
.staff-install-copy strong {
    font-size: 15px;
    font-weight: 750;
    letter-spacing: -0.01em;
}
.staff-install-copy span {
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.35;
}
.staff-install-ios {
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #d7e0da;
    background: #f7fbf8;
    animation: staff-install-rise 0.22s ease both;
}
.staff-install-ios ol {
    margin: 0;
    padding-left: 1.2rem;
    display: grid;
    gap: 6px;
    color: var(--text, #14201a);
    font-size: 13px;
    line-height: 1.45;
}
.staff-install-hint {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.4;
}
@keyframes staff-install-rise {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.muted { color: var(--muted); }

.dealers-filter-grid {
    grid-template-columns: 2fr 1fr auto;
}
.pay-url-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.pay-url-row input {
    flex: 1;
    min-width: 0;
    font-size: 16px;
}
.payout-field {
    width: 160px;
    max-width: 100%;
}

@media (max-width: 900px) {
    html,
    body.staff-app-body {
        overflow-x: clip;
    }

    .shell {
        grid-template-columns: 1fr;
        padding-top: calc(58px + env(safe-area-inset-top));
        max-width: 100vw;
    }
    .shell.is-nav-open { overflow: hidden; }

    .staff-mobile-bar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 110;
        display: grid;
        grid-template-columns: 44px 1fr auto;
        align-items: center;
        gap: 10px;
        min-height: calc(58px + env(safe-area-inset-top));
        padding:
            calc(8px + env(safe-area-inset-top))
            max(12px, env(safe-area-inset-right))
            8px
            max(12px, env(safe-area-inset-left));
        background: linear-gradient(180deg, #0b3d22 0%, #092819 100%);
        color: #fff;
        box-shadow: 0 10px 28px rgba(7, 28, 18, 0.28);
    }
    .staff-mobile-menu {
        position: relative;
        z-index: 120;
        width: 44px;
        height: 44px;
        min-height: 44px;
        display: grid;
        gap: 5px;
        align-content: center;
        justify-items: center;
        margin: 0;
        padding: 10px;
        border: 0;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
        cursor: pointer;
        -webkit-appearance: none;
        appearance: none;
    }
    .staff-mobile-menu span {
        display: block;
        width: 18px;
        height: 2px;
        border-radius: 999px;
        background: #fff;
    }
    .staff-mobile-brand {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
        color: #fff;
        font-weight: 750;
        letter-spacing: -0.02em;
    }
    .staff-mobile-brand img {
        width: 92px;
        height: auto;
        filter: brightness(0) invert(1);
    }
    .staff-mobile-brand span {
        padding: 3px 8px;
        border-radius: 999px;
        background: rgba(125, 222, 160, 0.18);
        color: #b8f0c9;
        font-size: 11px;
        font-weight: 800;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }
    .staff-mobile-chat {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        padding: 0 14px;
        border-radius: 999px;
        background: #168b3d;
        color: #fff;
        font-size: 13px;
        font-weight: 750;
    }

    .staff-nav-backdrop {
        position: fixed;
        inset: 0;
        z-index: 105;
        display: none !important;
        background: rgba(7, 28, 18, 0.48);
        backdrop-filter: blur(2px);
    }
    .shell.is-nav-open .staff-nav-backdrop,
    .staff-app.is-nav-open .staff-nav-backdrop,
    body.is-staff-nav-open .staff-nav-backdrop,
    .staff-nav-backdrop.is-visible {
        display: block !important;
    }

    .shell > nav,
    nav[aria-label="Staff console"],
    #staff-console-nav {
        position: fixed !important;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 115;
        width: min(320px, 88vw);
        max-width: 100%;
        padding:
            calc(14px + env(safe-area-inset-top))
            14px
            calc(18px + env(safe-area-inset-bottom));
        overflow: auto;
        -webkit-overflow-scrolling: touch;
        transform: translate3d(-105%, 0, 0);
        transition: transform 0.24s ease;
        box-shadow: 18px 0 40px rgba(7, 28, 18, 0.28);
        pointer-events: none;
        visibility: hidden;
    }
    .shell.is-nav-open > nav,
    .shell.is-nav-open nav[aria-label="Staff console"],
    .shell.is-nav-open #staff-console-nav,
    .staff-app.is-nav-open #staff-console-nav,
    body.is-staff-nav-open #staff-console-nav,
    .shell > nav.is-open,
    nav[aria-label="Staff console"].is-open,
    #staff-console-nav.is-open {
        transform: translate3d(0, 0, 0) !important;
        pointer-events: auto !important;
        visibility: visible !important;
    }
    .staff-nav-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin-bottom: 8px;
    }
    nav .brand { margin-bottom: 0; padding: 0; }
    nav .brand img { width: 120px; }
    .staff-nav-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        margin: 0;
        padding: 0 14px;
        border: 1px solid rgba(255, 255, 255, 0.18);
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
        font-size: 13px;
        font-weight: 700;
    }
    nav .nav-label { display: block; }
    nav .nav-links {
        display: grid;
        gap: 2px;
    }
    nav a {
        margin: 0;
        padding: 13px 12px;
        font-size: 15px;
        border-radius: 10px;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    .staff-nav-logout { display: block; }

    .grid,
    .form-grid { grid-template-columns: 1fr; }
    .shell > main,
    main:not(.staff-guest) {
        padding: 16px max(16px, env(safe-area-inset-right)) 28px max(16px, env(safe-area-inset-left));
    }
    .topbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
        margin-bottom: 16px;
    }
    .topbar h1 {
        font-size: clamp(1.35rem, 6vw, 1.7rem);
    }
    .topbar-actions {
        width: 100%;
        justify-content: stretch;
    }
    .topbar-actions .button,
    .topbar-actions a.button,
    .topbar-actions button {
        flex: 1 1 auto;
        text-align: center;
    }
    .panel,
    .card {
        border-radius: 14px;
        padding: 16px;
        max-width: 100%;
        overflow-x: auto;
    }

    .table-scroll,
    table {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    table thead,
    table tbody,
    table tr {
        width: max-content;
        min-width: 100%;
    }
    table th,
    table td {
        white-space: nowrap;
    }
    table td .button,
    table td button,
    table td a.button {
        white-space: nowrap;
    }

    /* Touch-first buttons across staff ops (inputs already 16px globally) */
    .staff-app-body button,
    .staff-app-body .button,
    .staff-app-body a.button {
        min-height: 44px;
        border-radius: 12px;
    }
    .staff-app-body .form-grid > div:has(> button),
    .staff-app-body .form-grid > button {
        grid-column: 1 / -1;
    }
    .staff-app-body .form-grid button,
    .staff-app-body .form-grid .button {
        width: 100%;
    }
    .staff-app-body .form-grid label,
    .staff-app-body .form-grid > div {
        min-width: 0;
    }
    .staff-app-body .actions {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .staff-app-body .actions .button,
    .staff-app-body .actions button,
    .staff-app-body .actions a.button,
    .staff-app-body .actions select,
    .staff-app-body .actions input {
        width: 100% !important;
        max-width: 100%;
    }

    .dealers-filter-grid {
        grid-template-columns: 1fr;
    }
    .pay-url-row {
        flex-wrap: wrap;
    }
    .pay-url-row input {
        flex: 1 1 100%;
        font-size: 16px !important;
    }
    .pay-url-row button {
        width: 100%;
    }
    .payout-field,
    .payout-confirm input,
    .payout-confirm select {
        width: 100% !important;
        max-width: 100%;
        min-width: 0;
    }

    .sqco-filters {
        flex-direction: column;
        align-items: stretch;
    }
    .sqco-filters select,
    .sqco-filters input[type="search"] {
        min-width: 0 !important;
        width: 100%;
        flex: 1 1 auto;
    }
    .sqco-link-field {
        min-width: 0;
        width: 100%;
    }
    .sqco-link-field input {
        width: 100%;
    }

    .sqc-ev-dialog {
        z-index: 130;
        padding:
            calc(12px + env(safe-area-inset-top))
            12px
            calc(12px + env(safe-area-inset-bottom));
        align-items: end;
    }
    .sqc-ev-panel {
        max-height: min(88dvh, 900px);
        width: 100%;
        border-radius: 16px 16px 0 0;
    }
    .sqc-ev-btn,
    .sqc-ev-toolbar button,
    .sqc-ev-toolbar a.button {
        min-height: 44px;
    }

    .staff-app-toast-host {
        left: 16px;
        right: 16px;
        width: auto;
    }

    /* Settings / ops inline width hacks */
    .staff-app-body input[style*="width:"],
    .staff-app-body select[style*="width:"] {
        width: 100% !important;
        max-width: 100%;
    }
}

/* ------------------------------------------------------------------
   SKU factory packs — world-class staff UI
------------------------------------------------------------------- */
.sfp { display: grid; gap: 16px; }
.sfp-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.8fr);
    gap: 22px;
    align-items: start;
    background:
        linear-gradient(145deg, rgba(232, 246, 238, 0.85), #fff 48%),
        var(--white);
}
.sfp-kicker {
    margin: 0 0 6px;
    color: var(--green);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.sfp-hero h2 {
    margin: 0 0 8px;
    font-size: 1.55rem;
    letter-spacing: -0.02em;
}
.sfp-hero h2 code {
    font: inherit;
    font-weight: 800;
}
.sfp-hero p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
    max-width: 58ch;
}
.sfp-hero-note { margin-top: 10px !important; font-size: 13px; }
.sfp-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.sfp-stat {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.85);
}
.sfp-stat span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.sfp-stat strong {
    display: block;
    margin-top: 4px;
    font-size: 1.45rem;
    letter-spacing: -0.03em;
}
.sfp-stat.is-ready strong { color: var(--green); }
.sfp-stat.is-partial strong { color: #8a5a12; }
.sfp-stat.is-empty strong { color: #7a8280; }

.sfp-list { display: grid; gap: 12px; }
.sfp-sku { margin: 0; padding: 16px 18px; }
.sfp-sku-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.sfp-sku-code { margin: 0 0 4px; }
.sfp-sku-code code {
    font-size: 12px;
    font-weight: 700;
    color: var(--green-deep);
}
.sfp-sku h3 {
    margin: 0;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}
.sfp-sku-meta {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
}
.sfp-sku-aside {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.sfp-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid transparent;
    white-space: nowrap;
}
.sfp-badge--ready,
.sfp-badge--published {
    color: #0f6b2f;
    background: #e8f6ee;
    border-color: #b7e4c7;
}
.sfp-badge--partial,
.sfp-badge--draft,
.sfp-badge--fallback {
    color: #8a5a12;
    background: #fff7e8;
    border-color: #f0d9a8;
}
.sfp-badge--empty,
.sfp-badge--missing {
    color: #5f6764;
    background: #f3f5f4;
    border-color: #d7dfd9;
}

.sfp-kind-rail {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.sfp-kind {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    font-size: 12px;
    font-weight: 650;
    color: var(--muted);
}
.sfp-kind-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #c5cdc8;
}
.sfp-kind--published .sfp-kind-dot { background: var(--green); }
.sfp-kind--fallback .sfp-kind-dot,
.sfp-kind--draft .sfp-kind-dot { background: #d4a017; }
.sfp-kind--missing .sfp-kind-dot { background: #c5cdc8; }
.sfp-kind--published { color: #0f6b2f; border-color: #b7e4c7; background: #f3faf6; }
.sfp-kind-pref {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--green-deep);
    opacity: 0.75;
}

.sfp-readiness {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.88);
}
.sfp-readiness-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
    color: var(--muted);
    font-weight: 650;
}
.sfp-readiness-top strong {
    color: var(--ink);
    font-size: 1.1rem;
}
.sfp-meter {
    margin: 10px 0 8px;
    height: 8px;
    border-radius: 999px;
    background: #e7eee9;
    overflow: hidden;
}
.sfp-meter i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #1aa34a, var(--green-deep));
    border-radius: inherit;
}
.sfp-readiness-meta {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.sfp-asset-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.sfp-asset { margin: 0; padding: 16px 18px; }
.sfp-asset-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
}
.sfp-asset-head h3 {
    margin: 0 0 4px;
    font-size: 1rem;
}
.sfp-asset-head p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}
.sfp-asset-current { margin-bottom: 12px; }
.sfp-file {
    display: grid;
    gap: 2px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #cfe3d6;
    background: #f3faf6;
    color: inherit;
}
.sfp-file strong { font-size: 13px; }
.sfp-file span {
    color: var(--muted);
    font-size: 12px;
    word-break: break-word;
}
.sfp-file.is-fallback {
    border-color: #f0d9a8;
    background: #fffaf0;
}
.sfp-file.is-empty,
.sfp-file.is-text {
    border-color: var(--line);
    background: #f7f9f8;
}
.sfp-form { display: grid; gap: 10px; }
.sfp-form-row {
    display: grid;
    grid-template-columns: 1.4fr 0.6fr;
    gap: 10px;
}
.sfp-form label { margin: 0; }
.sfp-form label span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}
.sfp-form input,
.sfp-form textarea {
    margin: 0;
    width: 100%;
}
.sfp-upload {
    padding: 10px 12px;
    border: 1px dashed #b9c9be;
    border-radius: 12px;
    background: #fbfcfb;
}
.sfp-form-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
}
.sfp-check {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 13px;
    font-weight: 650;
}
.sfp-check input { width: auto; margin: 0; }
.sfp-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sfp-asset--labels { grid-column: 1 / -1; }
.sfp-label-list { display: grid; gap: 8px; margin-bottom: 14px; }
.sfp-label-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    padding: 12px 14px;
    border: 1px solid #cfe3d6;
    border-radius: 12px;
    background: #f3faf6;
}
.sfp-label-meta { display: grid; gap: 2px; min-width: 0; }
.sfp-label-meta strong { font-size: 14px; }
.sfp-label-meta span {
    color: var(--muted);
    font-size: 12px;
    word-break: break-word;
}
.sfp-label-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.sfp-inline-delete { margin: 0; display: inline; }
.sfp-btn-danger { color: #9b1c1c !important; border-color: #f0b4b4 !important; }
.sfp-form-title {
    margin: 0 0 4px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--green-deep);
}
.sfp-label-add {
    padding-top: 12px;
    border-top: 1px dashed #c9d6cd;
}
.sfp-upload-progress {
    display: grid;
    gap: 6px;
    margin-top: 4px;
}
.sfp-upload-track {
    height: 8px;
    border-radius: 999px;
    background: #e7eee9;
    overflow: hidden;
}
.sfp-upload-track i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #1aa34a, var(--green-deep));
    transition: width 0.12s linear;
}
.sfp-upload-progress span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}
.sfp-form.is-uploading { opacity: 0.92; pointer-events: none; }

@media (max-width: 980px) {
    .sfp-hero,
    .sfp-asset-grid,
    .sfp-form-row { grid-template-columns: 1fr; }
    .sfp-sku-aside { align-items: flex-start; }
}

/* ------------------------------------------------------------------
   Supplier QC ops console (staff)
------------------------------------------------------------------- */
.sqco { display: grid; gap: 16px; }
.sqco-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(240px, 0.85fr);
    gap: 22px;
    align-items: start;
    background:
        linear-gradient(145deg, rgba(232, 246, 238, 0.85), #fff 48%),
        var(--white);
}
.sqco-hero-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px 16px;
    margin-bottom: 8px;
}
.sqco-hero-title-row > div { min-width: 0; flex: 1 1 220px; }
.sqco-hero-title-row h2 { margin-bottom: 0; }
.sqco-hero-title-row .sfp-kicker { margin-bottom: 6px; }
.sqco-tip {
    position: relative;
    flex: 0 0 auto;
    max-width: min(340px, 100%);
}
.sqco-tip-summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 7px 12px;
    border: 1px solid #b7e4c7;
    border-radius: 999px;
    background: #f3faf6;
    color: #0f6b2f;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
}
.sqco-tip-summary::-webkit-details-marker { display: none; }
.sqco-tip[open] .sqco-tip-summary {
    border-color: #168b3d;
    background: #e8f6ee;
}
.sqco-tip-badge {
    display: inline-grid;
    place-items: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    background: #168b3d;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}
.sqco-tip-body {
    margin-top: 10px;
    padding: 12px 14px;
    border: 1px solid #b7e4c7;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(20, 32, 26, 0.08);
    color: var(--text, #14201a);
    font-size: 13px;
    line-height: 1.5;
}
.sqco-tip-body ol {
    margin: 0;
    padding-left: 1.15rem;
    display: grid;
    gap: 6px;
}
.sqco-tip-body p {
    margin: 10px 0 0;
    color: var(--muted);
    max-width: none;
}
.sqco-tip-body code {
    font-size: 12px;
}
.sqco-hero h2 {
    margin: 0 0 8px;
    font-size: 1.45rem;
    letter-spacing: -0.02em;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.sqco-hero h2 code { font: inherit; font-weight: 800; }
.sqco-hero p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
    max-width: 62ch;
}
/* Beat global `button` / `button:hover` greens so filter tiles stay readable. */
.sqco-hero .sfp-stats {
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
}
.sqco-hero a.sfp-stat,
.sqco-hero button.sfp-stat {
    display: block;
    width: 100%;
    text-decoration: none;
    color: inherit;
    text-align: left;
    font-weight: inherit;
    font-family: inherit;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.sqco-hero a.sfp-stat:hover,
.sqco-hero button.sfp-stat:hover {
    background: #f3faf6;
    border-color: #b7e4c7;
    box-shadow: 0 0 0 2px rgba(26, 163, 74, 0.10);
    color: inherit;
}
.sqco-hero a.sfp-stat.is-active,
.sqco-hero button.sfp-stat.is-active,
.sqco-hero a.sfp-stat.is-active:hover,
.sqco-hero button.sfp-stat.is-active:hover {
    background: #e8f6ee;
    border-color: #168b3d;
    box-shadow: 0 0 0 2px rgba(26, 163, 74, 0.16);
    color: inherit;
}
.sqco-hero .sfp-stat.is-active span {
    color: #0f6b2f;
}
.sqco-hero .sfp-stat.is-active strong {
    color: #0a3d1c;
}
.sqco-empty {
    padding: 18px 8px;
    color: var(--muted);
    line-height: 1.55;
}
.sqco-empty p { margin: 0 0 8px; }
.sqco-empty p:last-child { margin-bottom: 0; }
.sqco-empty a { font-weight: 700; }
.sqco-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
}
.sqco-filters select { width: auto; min-width: 180px; margin: 0; }
.sqco-filters input[type="search"] { margin: 0; min-width: 240px; flex: 1; }
.sqco-table code {
    font-size: 12px;
    font-weight: 700;
    color: var(--green-deep);
}
.sqco-warn { color: #8a5a12; }
.sqco-muted {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}
.sqco-link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
    margin-top: 14px;
}
.sqco-link-field {
    flex: 1;
    min-width: 220px;
    margin: 0;
}
.sqco-link-field span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}
.sqco-link-field input { margin: 0; width: 100%; }
.sqco-identity { margin-top: 14px; }
.sqco-identity summary {
    cursor: pointer;
    font-weight: 700;
}
.sqco-readiness {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
}
.sqco-checks {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: grid;
    gap: 10px;
}
.sqco-checks li {
    display: grid;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #f7f9f8;
}
.sqco-checks li.is-ok {
    border-color: #b7e4c7;
    background: #f3faf6;
}
.sqco-checks li.is-warn {
    border-color: #f0d9a8;
    background: #fffaf0;
}
.sqco-checks strong { font-size: 13px; }
.sqco-checks span {
    color: var(--muted);
    font-size: 12px;
}
.sqco-decide-hint {
    margin: 12px 0 0;
    font-size: 13px;
    font-weight: 650;
}
.sqco-decide-hint.is-ok { color: #0f6b2f; }
.sqco-decide-hint.is-warn { color: #8a5a12; }
.sqco-section-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.sqco-section-head h3 { margin: 0 0 6px; }
.sqco-section-head p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
    max-width: 56ch;
}
.sqco-factory-list {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
    display: grid;
    gap: 8px;
}
.sqco-factory-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}
.sqco-factory-list li div {
    display: grid;
    gap: 2px;
}
.sqco-factory-list span,
.sqco-factory-list em {
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}
.sqco-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.sqco-dl {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 8px 12px;
    margin: 0;
}
.sqco-dl dt {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}
.sqco-dl dd { margin: 0; }
.sqco-evidence {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.sqco-evidence-card {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #f7f9f8;
}
.sqco-evidence-card strong { font-size: 13px; line-height: 1.35; }
.sqco-evidence-card span,
.sqco-evidence-card a { font-size: 13px; }
.sqco-evidence-meta {
    color: var(--muted);
    font-size: 12px !important;
}
.sqco-evidence-card.is-ok {
    border-color: #b7e4c7;
    background: #f3faf6;
}
.sqco-evidence-card.is-missing {
    border-color: #f0d9a8;
    background: #fffaf0;
}
.sqco-evidence-thumb {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid #d7e0da;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(243, 246, 244, 0.95)),
        #eef3f0;
    text-decoration: none;
    color: inherit;
}
.sqco-evidence-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.sqco-evidence-thumb.is-empty {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.sqco-evidence-badge {
    display: inline-grid;
    place-items: center;
    min-width: 3.5rem;
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    background: #14201a;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
}
.sqco-evidence-thumb:focus-visible {
    outline: 2px solid #168b3d;
    outline-offset: 2px;
}

/* Shared evidence lightbox (staff + supplier portal class names) */
body.sqc-ev-open { overflow: hidden; }
.sqc-ev-dialog {
    position: fixed;
    inset: 0;
    z-index: 130;
    display: grid;
    place-items: center;
    padding: 18px;
}
.sqc-ev-dialog[hidden] { display: none !important; }
.sqc-ev-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 32, 26, 0.62);
    backdrop-filter: blur(2px);
}
.sqc-ev-panel {
    position: relative;
    z-index: 1;
    width: min(980px, 100%);
    max-height: min(92vh, 900px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 28px 70px rgba(20, 32, 26, 0.28);
}
.sqc-ev-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line, #d7e0da);
    background: linear-gradient(180deg, #f7fbf8, #fff);
}
.sqc-ev-heading h3 {
    margin: 0;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}
.sqc-ev-kicker {
    margin: 0 0 4px;
    color: var(--muted, #5c6b63);
    font-size: 12px;
    font-weight: 700;
}
.sqc-ev-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.sqc-ev-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid #c9d5ce;
    background: #fff;
    color: #14201a;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
.sqc-ev-btn:hover { border-color: #168b3d; }
.sqc-ev-btn:disabled { opacity: 0.45; cursor: default; }
.sqc-ev-btn-close { background: #14201a; color: #fff; border-color: #14201a; }
.sqc-ev-stage {
    min-height: 280px;
    padding: 16px;
    overflow: auto;
    background:
        radial-gradient(700px 280px at 50% 0%, rgba(22, 139, 61, 0.08), transparent 60%),
        #f3f6f4;
    display: grid;
    place-items: center;
}
.sqc-ev-media {
    max-width: 100%;
    max-height: min(70vh, 720px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(20, 32, 26, 0.12);
}
.sqc-ev-pdf {
    width: 100%;
    height: min(70vh, 720px);
    border: 1px solid #d7e0da;
}
.sqc-ev-file,
.sqc-ev-empty {
    text-align: center;
    color: var(--muted, #5c6b63);
}
.sqc-ev-file { display: grid; gap: 12px; justify-items: center; }

@media print {
    body.sqc-ev-open > *:not(.sqc-ev-dialog) { display: none !important; }
    .sqc-ev-dialog,
    .sqc-ev-panel { position: static; inset: auto; max-height: none; box-shadow: none; }
    .sqc-ev-backdrop,
    .sqc-ev-toolbar { display: none !important; }
    .sqc-ev-stage { padding: 0; background: #fff; }
    .sqc-ev-media { max-height: none; box-shadow: none; }
}
.sqco-serials {
    max-height: 220px;
    overflow: auto;
    font-size: 0.85rem;
    margin: 0;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fbfcfb;
}
.sqco-rescue {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}
.sqco-rescue h4 { margin: 0 0 8px; }
.sqco-decision {
    border-color: #b7e4c7;
    background:
        linear-gradient(180deg, rgba(232, 246, 238, 0.55), #fff 40%),
        var(--white);
}
.sqco-decision.is-exiting,
.sqco-rescue.is-exiting {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.sqco-toast-host {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 90;
    display: grid;
    gap: 8px;
    width: min(360px, calc(100vw - 32px));
    pointer-events: none;
}
.sqco-toast {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text, #14201a);
    box-shadow: 0 16px 40px rgba(20, 32, 26, 0.16);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.35;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.22s ease, transform 0.22s ease;
}
.sqco-toast.is-in { opacity: 1; transform: translateY(0); }
.sqco-toast.is-out { opacity: 0; transform: translateY(8px); }
.sqco-toast.is-ok {
    border-color: #b7e4c7;
    background: #f3faf6;
    color: #0f6b2f;
}
.sqco-toast.is-err {
    border-color: #f0b4b4;
    background: #fdecec;
    color: #9b1c1c;
}
.sqco-toast.is-info {
    border-color: #c9d5ce;
    background: #f7fbf8;
}

@media (max-width: 980px) {
    .sqco-hero,
    .sqco-grid,
    .sqco-evidence,
    .sqco-dl { grid-template-columns: 1fr; }
}

/* Crew photo QC — autosave slots */
.crew-photo-slots {
  display: grid;
  gap: 12px;
  margin: 12px 0 16px;
}
.crew-photo-slot {
  border: 1px solid var(--line, #d9e0db);
  border-radius: 10px;
  padding: 12px;
  background: #fff;
}
.crew-photo-slot.is-saved {
  border-color: rgba(22, 139, 61, 0.35);
  background: #f7fbf8;
}
.crew-photo-slot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.crew-photo-slot-head strong {
  font-size: 14px;
}
.crew-photo-slot-head span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted, #66756c);
}
.crew-photo-slot.is-saved .crew-photo-slot-head span {
  color: var(--green, #168b3d);
}
.crew-photo-preview {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
}
.crew-photo-file {
  display: block;
  margin: 0;
}
.crew-photo-file span {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
}
.crew-photo-progress {
  height: 6px;
  margin-top: 8px;
  border-radius: 999px;
  background: #e7eee9;
  overflow: hidden;
}
.crew-photo-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--green, #168b3d);
}
.crew-photo-msg {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted, #66756c);
}
.crew-photo-msg.is-ok { color: var(--green, #168b3d); }
.crew-photo-msg.is-err { color: #b42318; }

/* Support ticket thread (Operations) */
.ticket-thread { display: grid; gap: 12px; }
.ticket-msg {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: #fff;
}
.ticket-msg--staff {
  background: #f3f8f4;
  border-color: #cfe3d5;
}
.ticket-msg--customer { background: #fff; }
.ticket-msg header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 13px;
}
.ticket-msg header time { color: var(--muted); }
.ticket-msg__body {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
}
