/* Delivery sign-off dialog — global (Syncfusion dlg shell is outside Blazor CSS isolation). */

.e-dlg-overlay:has(+ .delivery-signoff-dialog) {
    z-index: 53999 !important;
    background-color: rgba(15, 23, 42, 0.45) !important;
}

.delivery-signoff-dialog.e-dialog {
    z-index: 54000 !important;
}

/* Fallback when :has is unavailable — Syncfusion sets inline z-index from ZIndex param;
   keep dialog clearly above On Delivery logs (52000). */
.delivery-signoff-dialog.e-dialog {
    position: fixed !important;
    z-index: 54000 !important;
    width: min(520px, 94vw) !important;
    max-width: 520px !important;
    height: auto !important;
    max-height: 78vh !important;
    margin: 0 !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    pointer-events: auto !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.28) !important;
}

.delivery-signoff-dialog.e-dialog > .e-dlg-header-content {
    flex: 0 0 auto !important;
    padding: 0.65rem 0.9rem !important;
}

.delivery-signoff-dialog.e-dialog > .e-dlg-content {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
    padding: 0 !important;
    pointer-events: auto !important;
}

.delivery-signoff-dialog .dsd-header {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    padding-right: 1.25rem;
}

.delivery-signoff-dialog .dsd-title {
    font-size: 1rem;
    font-weight: 800;
    color: #002245;
}

.delivery-signoff-dialog .dsd-subtitle {
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.delivery-signoff-dialog .dsd-body {
    max-height: calc(78vh - 56px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.75rem 0.9rem 0.9rem;
    background: #fff;
    pointer-events: auto !important;
}

.delivery-signoff-dialog .dsd-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 4rem;
    color: #475569;
    font-weight: 650;
}

.delivery-signoff-dialog .dsd-state--error {
    color: #b91c1c;
}

/* Override mobile walk-in page styles that force full viewport height + grey wash. */
.delivery-signoff-dialog .walkin-detail-root,
.delivery-signoff-dialog .dsd-form {
    min-height: 0 !important;
    height: auto !important;
    background: transparent !important;
    padding-bottom: 0.25rem !important;
    gap: 0 !important;
}

.delivery-signoff-dialog .walkin-detail-header {
    padding: 0 0 0.65rem !important;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 0.35rem;
}

.dsd-invoice-header {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.dsd-invoice-header .walkin-detail-client {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 800;
    color: #03142E;
}

.dsd-invoice-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem 0;
    font-size: 0.82rem;
    line-height: 1.35;
}

.dsd-invoice-info__item {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    min-width: 0;
    color: #334155;
    font-weight: 600;
}

.dsd-invoice-info__item:not(:last-child)::after {
    content: "";
    display: inline-block;
    width: 3px;
    height: 3px;
    margin: 0 0.45rem;
    border-radius: 50%;
    background: #94a3b8;
    flex: 0 0 auto;
}

.dsd-invoice-info__inv {
    color: #1d4ed8;
    font-weight: 700;
}

.dsd-invoice-info__total {
    color: #15803d;
    font-weight: 800;
}

.dsd-invoice-info__term {
    color: #475569;
    font-weight: 600;
}

.dsd-invoice-info__addr {
    color: #0f172a;
    font-size: 0.90rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.dsd-invoice-info__addr i {
    color: #1d4ed8;
    flex: 0 0 auto;
}

.delivery-signoff-dialog .walkin-section-label {
    margin-top: 0.55rem !important;
    margin-bottom: 0.3rem !important;
    font-size: 0.75rem !important;
}

.delivery-signoff-dialog .walkin-note-input {
    min-height: 52px !important;
    max-height: 72px !important;
}

.delivery-signoff-dialog .walkin-sig-container {
    margin-bottom: 0.35rem;
}

.delivery-signoff-dialog .dsd-signature {
    width: 100%;
    height: 110px !important;
}

.delivery-signoff-dialog .walkin-save-btn {
    margin-top: 0.5rem;
}

.delivery-signoff-dialog .delivery-confirm-panel {
    margin-top: 0.5rem;
}

.delivery-signoff-dialog .dsd-tabs {
    display: flex;
    gap: 0.35rem;
    margin: 0 0 0.75rem;
    padding: 0.25rem;
    border-radius: 10px;
    background: #f1f5f9;
}

.delivery-signoff-dialog .dsd-tab {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #475569;
    font-size: 0.84rem;
    font-weight: 800;
    cursor: pointer;
}

.delivery-signoff-dialog .dsd-tab:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.delivery-signoff-dialog .dsd-tab--active {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.delivery-signoff-dialog .dsd-tab__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: #ff6600;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
}

.delivery-signoff-dialog .dsd-photos-link {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    border: 0;
    background: transparent;
    color: #1d4ed8;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    padding: 0;
}

.delivery-signoff-dialog .walkin-section-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.delivery-signoff-dialog .dsd-photos-panel {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding-top: 0.15rem;
}

.delivery-signoff-dialog .dsd-photos-busy,
.delivery-signoff-dialog .dsd-photos-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 7rem;
    padding: 1rem;
    border-radius: 10px;
    border: 1px dashed #cbd5e1;
    background: #f8fafc;
    color: #64748b;
    font-weight: 650;
    text-align: center;
}

.delivery-signoff-dialog .dsd-photos-error,
.walkin-detail-root .dsd-photos-error {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
    font-size: 0.88rem;
    font-weight: 650;
    line-height: 1.35;
    cursor: pointer;
}

.delivery-signoff-dialog .dsd-photos-error i,
.walkin-detail-root .dsd-photos-error i {
    flex-shrink: 0;
    margin-top: 0.1rem;
    color: #dc2626;
}

.delivery-signoff-dialog .dsd-photos-error__dismiss,
.walkin-detail-root .dsd-photos-error__dismiss {
    margin-left: auto;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0 0.15rem;
    cursor: pointer;
    opacity: 0.75;
}

.delivery-signoff-dialog .dsd-photos-error__dismiss:hover,
.walkin-detail-root .dsd-photos-error__dismiss:hover {
    opacity: 1;
}

.delivery-signoff-dialog .dsd-photos-progress,
.walkin-detail-root .dsd-photos-progress {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.85rem 0.9rem;
    border-radius: 10px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
}

.delivery-signoff-dialog .dsd-photos-progress__row,
.walkin-detail-root .dsd-photos-progress__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.delivery-signoff-dialog .dsd-photos-progress__label,
.walkin-detail-root .dsd-photos-progress__label {
    color: #1e3a8a;
    font-size: 0.88rem;
    font-weight: 700;
    min-width: 0;
}

.delivery-signoff-dialog .dsd-photos-progress__pct,
.walkin-detail-root .dsd-photos-progress__pct {
    color: #1d4ed8;
    font-size: 0.85rem;
    font-weight: 800;
    flex-shrink: 0;
}

.delivery-signoff-dialog .dsd-photos-progress__track,
.walkin-detail-root .dsd-photos-progress__track {
    height: 10px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.18);
    overflow: hidden;
}

.delivery-signoff-dialog .dsd-photos-progress__bar,
.walkin-detail-root .dsd-photos-progress__bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #2563eb 0%, #0ea5e9 100%);
    transition: width 0.2s ease;
}

.delivery-signoff-dialog .dsd-photos-progress__cancel,
.walkin-detail-root .dsd-photos-progress__cancel {
    align-self: flex-end;
    border: 1px solid #93c5fd;
    background: #fff;
    color: #1d4ed8;
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: 8px;
    padding: 0.35rem 0.75rem;
    min-height: 36px;
    cursor: pointer;
}

.delivery-signoff-dialog .dsd-photos-progress__cancel:hover:not(:disabled),
.walkin-detail-root .dsd-photos-progress__cancel:hover:not(:disabled) {
    background: #dbeafe;
}

.delivery-signoff-dialog .dsd-photos-progress__cancel:disabled,
.walkin-detail-root .dsd-photos-progress__cancel:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.delivery-signoff-dialog .dsd-photos-empty {
    flex-direction: column;
}

.delivery-signoff-dialog .dsd-photos-empty i {
    font-size: 1.4rem;
    color: #94a3b8;
}

.delivery-signoff-dialog .pod-pick-btn--disabled {
    opacity: 0.55;
    pointer-events: none;
}

/* Full-page sign-off uses the same tab chrome */
.dsd-tabs--page {
    display: flex;
    gap: 0.35rem;
    margin: 0.75rem 0.85rem 0.35rem;
    padding: 0.25rem;
    border-radius: 10px;
    background: #f1f5f9;
}

.dsd-tabs--page .dsd-tab {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #475569;
    font-size: 0.84rem;
    font-weight: 800;
    cursor: pointer;
}

.dsd-tabs--page .dsd-tab--active {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.dsd-tabs--page .dsd-tab__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: #ff6600;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
}

.walkin-detail-root .dsd-photos-link {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    border: 0;
    background: transparent;
    color: #1d4ed8;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    padding: 0;
}

.walkin-detail-root .walkin-section-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.walkin-detail-root .dsd-photos-panel {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.35rem 0.85rem 1rem;
}

.walkin-detail-root .dsd-photos-busy,
.walkin-detail-root .dsd-photos-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 7rem;
    padding: 1rem;
    border-radius: 10px;
    border: 1px dashed #cbd5e1;
    background: #f8fafc;
    color: #64748b;
    font-weight: 650;
    text-align: center;
}

.walkin-detail-root .dsd-photos-empty {
    flex-direction: column;
}

.walkin-detail-root .pod-pick-btn--disabled {
    opacity: 0.55;
    pointer-events: none;
}

.dsd-photos-host--hidden {
    display: none !important;
}

.pod-thumb-wrap--processing .pod-thumb {
    opacity: 0.65;
}

.pod-thumb--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    min-height: 72px;
}

.pod-thumb--ready {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    background: #ecfdf5;
    color: #047857;
    min-height: 72px;
    font-size: 0.75rem;
    font-weight: 700;
}

.pod-thumb--ready i {
    font-size: 1.25rem;
}

.pod-thumb-busy {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.2rem 0.35rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-align: center;
    color: #0f172a;
    background: rgba(255, 255, 255, 0.88);
}
