/* An author rule beats the browser's own [hidden] { display: none }, whatever its
   specificity, so every class that sets a display would otherwise go on showing
   while hidden. Declared once here rather than opted out of case by case. */
[hidden] {
    display: none !important;
}

/* A validation summary with nothing to say. ASP.NET renders it as
   validation-summary-valid (an empty list) and swaps to -errors once there is
   an error, server-side or from the unobtrusive validator, so it only shows
   when it has something in it. */
.validation-summary-valid {
    display: none;
}

.btn-login {
    border-radius: 14px;
    display: block;
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    letter-spacing: 0.3px;
    transition: background 0.2s, transform 0.1s;
}
.form-group label {
    display: block;
    color: #4b5563;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.btn-login:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px #fff, 0 0 0 5px #2563eb;
}

.form-group .form-control
{
    width: 100%;
    border: 1.5px solid #e5e7eb;
    border-radius: 14px;
    padding: 13px 16px;
    font-size: 0.95rem;
    color: #374151;
    background: #fff;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    height: auto !important;
}

.form-control::placeholder {
    color: #6b7280;
}

.form-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.alert-danger {
    border-radius: 12px;
    font-size: 0.875rem;
    margin-bottom: 16px;
}

/* Password toggle */
.password-wrapper {
    position: relative;
}

.password-wrapper .form-control {
    padding-right: 48px;
}

.toggle-pwd {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: none;
    border-radius: 10px;
    color: #4b5563;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.toggle-pwd:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.toggle-pwd:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* index */
.action-grid {
    width: 100%;
    max-width: 1040px;
    margin: 0 auto;
}

/* The same surface as the recent rows below it (tokens.css): one radius, one
   border, one resting elevation. Two languages on one screen read as two apps. */
.action-card {
    position: relative;
    overflow: visible;
    display: flex;
    width: 100%;
    /* AdminLTE's .card adds 1rem below, on top of the column's own spacing. */
    margin-bottom: 0;
    border: 1px solid var(--ink-100);
    border-radius: var(--r-lg);
    min-height: 170px;
    background: var(--paper);
    box-shadow: var(--e1);
    transition: transform 120ms cubic-bezier(.23, 1, .32, 1),
                box-shadow 120ms cubic-bezier(.23, 1, .32, 1),
                border-color 120ms cubic-bezier(.23, 1, .32, 1);
}

.action-card:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--e1), 0 0 0 3px var(--accent-wash);
}

.action-card:hover {
    border-color: var(--ink-200);
    box-shadow: var(--e2);
}

/* Press lands on press-in and is felt, not watched: a slight give, no lift. */
.action-card:active {
    transform: scale(.98);
    border-color: var(--accent);
    box-shadow: var(--e1);
}

.action-card .card-body {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.action-card-title {
    color: var(--ink-900);
    font-weight: 700;
    line-height: 1.15;
    margin: 0;
    max-width: calc(100% - 118px);
}

.action-card-desc {
    color: var(--ink-500);
    font-size: 0.8rem;
    line-height: 1.35;
    max-width: calc(100% - 118px);
    margin: 6px 0 0;
}

.action-card-go {
    margin-top: auto;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 700;
}

.img-pickup,
.img-delivery {
    position: absolute;
    right: -8px;
    bottom: -8px;
    width: auto;
    height: 104px;
    max-width: 45%;
    z-index: 0;
    pointer-events: none;
}

/* pickup modal */
.pickup-modal {
    border: none;
    border-radius: 18px;
}

.pickup-modal-title {
    color: #0b1f3a;
    font-size: 1.15rem;
    font-weight: 800;
}

/* Rendered as a <button> inside its own form — each option posts into the
   POST-only Scanner step. The reset keeps it looking like the old link. */
.pickup-option {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px;
    border: 1px solid #eef1f5;
    border-radius: 14px;
    background: #fff;
    text-align: left;
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.pickup-option-form + .pickup-option-form,
.start-company + .start-company {
    margin-top: 10px;
}

/* The company the pickup is for, under the pane's question — the driver chose
   it a moment ago on the pane before, and it scopes everything after. */
.start-company-name {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 600;
}

.start-company-name:empty {
    display: none;
}

.start-company-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* Changes the company for this pickup only; the default stays the default. Text
   sized, but a 44px target like every other control in the modal. */
.start-company-change {
    min-height: 44px;
    padding: 0 8px;
    border: none;
    background: none;
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.start-company-change:hover {
    color: var(--accent-press);
}

.start-company-change:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--r-sm);
}

.start-company-default {
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: var(--r-pill);
    background: var(--ink-100);
    color: var(--ink-500);
    font-size: 11px;
    font-weight: 600;
    vertical-align: middle;
}

/* Returns from the Warehouse / Outlet pane to the company pane. Same 44px target
   and ghost look as the wizard's own back button. */
.start-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: -8px 0 -8px -8px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #334155;
    cursor: pointer;
}

.start-back:hover {
    background: #f1f5f9;
}

.start-back:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: -2px;
}

.pickup-option:hover {
    border-color: #c7d7fb;
    box-shadow: 0 4px 14px rgba(37, 99, 235, .08);
    text-decoration: none;
}

.pickup-option-icon {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #eaf1ff;
    border-radius: 14px;
}

.pickup-option-icon i {
    font-size: 22px;
    color: #2563eb;
}

.pickup-option-label {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.pickup-option-name {
    color: #1f2937;
    font-size: 1rem;
    font-weight: 700;
}

/* Names where the cartons end up. The two options run identical steps, so the
   direction of the run is the only thing that distinguishes them. */
.pickup-option-run {
    color: #64748b;
    font-size: 0.82rem;
    margin-top: 2px;
}

.pickup-option-chevron {
    flex: 0 0 auto;
    color: #cbd5e1;
    font-size: 0.85rem;
}

.pickup-option:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: -2px;
}

/* ---- SweetAlert2 — branded to the wizard look ---- */
.swal2-popup {
    border-radius: var(--r-lg);
    padding: 28px 24px 24px;
    box-shadow: 0 24px 60px rgba(15, 23, 41, .18);
}

.swal2-title {
    color: var(--ink-900);
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: -.02em;
}

.swal2-html-container {
    color: var(--ink-500);
    font-size: 1rem;
}

.swal2-actions {
    gap: 10px;
    margin-top: 22px;
}

.swal2-styled.swal2-confirm {
    background: var(--accent);
    border-radius: var(--r-md);
    min-height: 44px;
    padding: 11px 26px;
    font-weight: 600;
    box-shadow: none;
}

.swal2-styled.swal2-confirm:hover {
    background: var(--accent-press);
}

.swal2-styled.swal2-cancel {
    background: var(--ink-100);
    color: var(--ink-700);
    border-radius: var(--r-md);
    min-height: 44px;
    padding: 11px 26px;
    font-weight: 600;
}

.swal2-styled.swal2-cancel:hover {
    background: var(--ink-200);
}

.swal2-styled:focus {
    box-shadow: none;
}

.swal2-icon.swal2-success {
    border-color: var(--ok);
}

.swal2-icon.swal2-success [class^='swal2-success-line'] {
    background-color: var(--ok);
}

.swal2-icon.swal2-success .swal2-success-ring {
    border-color: rgba(14, 124, 74, .35);
}

/* Success number block rendered inside the alert */
.swal-record {
    margin-top: 6px;
    line-height: 1.4;
}

.swal-record-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ink-500);
    margin-bottom: 4px;
}

.swal-record-number {
    font-family: 'Chivo Mono', ui-monospace, 'SF Mono', Menlo, monospace;
    font-variant-numeric: tabular-nums;
    color: var(--accent);
    font-weight: 600;
    font-size: 1.5rem;
}

.swal-record-number .copy-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    vertical-align: middle;
    color: var(--ink-400);
    font-size: .95rem;
    cursor: pointer;
    transition: color .12s;
}

.swal-record-number .copy-icon:hover {
    color: var(--accent);
}

.swal-record-number .swal-record-copy:not(.copy-icon) {
    cursor: pointer;
}

/* Text that copies itself when tapped (general.js). Marked only by the pointer and a
   dotted underline on hover, so a number still reads as a number. */
.copyToClipboard {
    cursor: pointer;
    border-radius: 4px;
}

.copyToClipboard:hover {
    text-decoration: underline dotted;
    text-underline-offset: 3px;
}

.copyToClipboard:focus-visible,
.swal-record-copy:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---- md and up: the cards finally get room, and the art is allowed to grow ---- */
@media (min-width: 768px) {
    .action-card {
        min-height: 240px;
    }

    .action-card .card-body {
        padding: 22px;
    }

    .action-card-title {
        font-size: 1.6rem;
    }

    .action-card-desc {
        font-size: 0.9rem;
    }

    .img-pickup,
    .img-delivery {
        height: 160px;
    }

    .action-card-title,
    .action-card-desc {
        max-width: calc(100% - 180px);
    }
}

/* consignment.css already honours this; general.css did not. */
@media (prefers-reduced-motion: reduce) {
    .action-card,
    .btn-login,
    .pickup-option {
        transition: none;
    }

    .action-card:active {
        transform: none;
    }
}

/* ---- App footer ----
   Pinned to the bottom of every screen. Fixed height: tokens.css --app-footer-h
   is built from it, and the page keeps that much room at its foot so the last row
   is never hidden behind it. */
.main-footer {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--app-footer-h);
    margin: 0;
    padding: 0 16px var(--safe-bottom);
    border-top: 1px solid var(--ink-100);
    background: var(--paper);
    color: var(--ink-500);
    font-size: 12px;
    line-height: 16px;
    text-align: center;
}

.wrapper {
    padding-bottom: var(--app-footer-h);
}

/* ---- App header ----
   Brand and company on the left, the account on the right, on every signed-in page.
   The company line is the header's reason to exist on a job: it names the company
   the job is being recorded against, and falls back to the login's default. */
.app-header {
    /* Pinned while the page scrolls. The sticky filter rail and pickup-group
       headings, and the location step's fixed column, all sit at
       --app-header-h on the assumption that this stays put. */
    position: sticky;
    top: 0;
    z-index: 1034;
    padding-top: env(safe-area-inset-top, 0px);
    background: var(--paper);
    border-bottom: 1px solid var(--ink-100);
}

.app-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    /* Fixed, not min: tokens.css --app-header-h is built from this 60px. */
    height: 60px;
    padding: 0 8px 0 16px;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 44px;
}

.app-brand-mark:hover,
.app-brand-mark:focus {
    color: #fff;
    text-decoration: none;
}

.app-brand-mark:focus-visible,
.app-brand-text:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--r-sm);
}

.app-brand-mark {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--r-md);
    background: var(--accent);
    color: #fff;
    font-size: 16px;
}

/* Opens the company picker. A bare button, so it still reads as the brand. */
.app-brand-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    min-height: 44px;
    justify-content: center;
    padding: 0;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
}

/* Off the home screen the company is shown, not changeable. */
span.app-brand-text {
    cursor: default;
}

.app-brand-caret {
    margin-left: 4px;
    font-size: 10px;
    color: var(--ink-400);
}

/* The header's company in the picker: marked, and not offered as a change. */
.app-company-option.is-current {
    border-color: var(--accent);
    background: var(--accent-wash);
}

.app-company-option.is-current .pickup-option-chevron {
    color: var(--accent);
}

.app-brand-name {
    font-size: 16px;
    line-height: 20px;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--ink-900);
}

.app-brand-company {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    line-height: 16px;
    font-weight: 500;
    color: var(--ink-500);
}

.app-account {
    flex: 0 0 auto;
}

.app-account-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 4px;
    border: none;
    border-radius: var(--r-pill);
    background: transparent;
    color: var(--ink-700);
    cursor: pointer;
    transition: background-color 120ms cubic-bezier(.23, 1, .32, 1);
}

.app-account-btn:hover,
.app-account-btn[aria-expanded="true"] {
    background: var(--ink-50);
}

.app-account-btn:focus {
    outline: none;
}

.app-account-btn:focus-visible {
    box-shadow: 0 0 0 2px var(--accent);
}

.app-avatar {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--r-pill);
    background: var(--accent-wash);
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .02em;
}

.app-avatar.is-large {
    width: 44px;
    height: 44px;
    font-size: 15px;
}

/* Phone: the avatar alone. The name is in the menu, one tap away. */
.app-account-name,
.app-account-caret {
    display: none;
}

.app-account-name {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 600;
}

.app-account-caret {
    margin-right: 6px;
    font-size: 11px;
    color: var(--ink-400);
}

.app-menu {
    width: 280px;
    max-width: calc(100vw - 16px);
    margin-top: 6px;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--ink-100);
    border-radius: var(--r-md);
    box-shadow: var(--e2);
}

.app-menu-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.app-menu-who {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-menu-name,
.app-menu-email {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-menu-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink-900);
}

.app-menu-email {
    font-size: 13px;
    color: var(--ink-500);
}

.app-menu-foot {
    margin: 0;
    border-top: 1px solid var(--ink-100);
}

.app-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    padding: 0 16px;
    border: none;
    background: transparent;
    color: var(--ink-700);
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background-color 120ms cubic-bezier(.23, 1, .32, 1);
}

.app-menu-item:hover,
.app-menu-item:focus-visible {
    outline: none;
    background: var(--ink-50);
    color: var(--ink-900);
}

@media (min-width: 768px) {
    .app-header-inner {
        padding: 0 16px 0 24px;
    }

    .app-account-btn {
        padding-right: 8px;
    }

    .app-account-name,
    .app-account-caret {
        display: inline-block;
    }
}

/* ---- Loading ----
   window.General.Loading (general.js). At once: a bar running along the top and a
   layer that takes no taps. Once a wait passes 300ms (.is-slow): a light dim and a
   card naming the wait. Over the header and Bootstrap's dialogs (1050), under
   SweetAlert2 (1060), so an error alert always lands on top of it. */
.app-loading {
    position: fixed;
    inset: 0;
    z-index: 1055;
    cursor: progress;
    transition: background-color 150ms ease-out;
}

.app-loading[hidden] {
    display: none;
}

.app-loading-bar {
    position: absolute;
    top: env(safe-area-inset-top, 0px);
    left: 0;
    width: 40%;
    height: 3px;
    border-radius: 0 var(--r-pill) var(--r-pill) 0;
    background: var(--accent);
    animation: app-loading-bar 1.1s ease-in-out infinite;
}

@keyframes app-loading-bar {
    from { transform: translateX(-100%); }
    to { transform: translateX(250%); }
}

.app-loading-card {
    position: absolute;
    top: 50%;
    left: 50%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: var(--r-lg);
    background: var(--paper);
    box-shadow: var(--e2);
    color: var(--ink-900);
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -50%);
    transition: opacity 150ms ease-out;
}

.app-loading-card i {
    color: var(--accent);
    font-size: 18px;
}

.app-loading.is-slow {
    background: rgba(15, 23, 41, .18);
}

.app-loading.is-slow .app-loading-card {
    opacity: 1;
    visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
    .app-account-btn,
    .app-menu-item {
        transition: none;
    }

    /* A still bar across the top instead of one sweeping along it. */
    .app-loading-bar {
        width: 100%;
        animation: none;
        opacity: .6;
    }
}
