/* Force parent WordPress / Elementor container carrying the tracker to 100% full width */
.elementor-section:has(.zdt-app) > .elementor-container,
.e-con:has(.zdt-app),
.e-con-inner:has(.zdt-app),
.elementor-widget-shortcode:has(.zdt-app),
.elementor-widget-container:has(.zdt-app),
.wp-block-group:has(.zdt-app),
.entry-content:has(.zdt-app) {
    width: 100% !important;
    max-width: 100% !important;
    --content-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.zdt-app {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    color: #1f2937;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
}

.zdt-app *,
.zdt-app *::before,
.zdt-app *::after {
    box-sizing: border-box;
}

/* Prevent long addresses, inputs, or Leaflet maps from pushing any column past 100% */
.zdt-grid-2 > *,
.zdt-grid-driver > *,
.zdt-grid-4 > *,
.zdt-row-2 > *,
.zdt-flex-between > *,
.zdt-search-bar > * {
    min-width: 0;
}

.zdt-app .leaflet-container {
    width: 100% !important;
    max-width: 100% !important;
}

.zdt-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #111827;
    color: #fff;
    padding: 20px 24px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-bottom: 4px solid var(--zdt-primary, #800020);
    width: 100%;
    max-width: 100%;
}

.zdt-brand {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 21px;
    overflow-wrap: break-word;
    word-break: break-word;
}

.zdt-brand img {
    height: 38px;
    width: auto;
    max-width: 100%;
    border-radius: 6px;
}

.zdt-badge-demo {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(255, 255, 255, 0.16);
    padding: 5px 12px;
    border-radius: 999px;
}

.zdt-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.zdt-app .zdt-tab-btn {
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: transparent;
    color: #e5e7eb;
    padding: 11px 18px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    white-space: normal !important;
    text-align: center;
    line-height: 1.3;
    overflow-wrap: break-word;
}

.zdt-app .zdt-tab-btn.active,
.zdt-app .zdt-tab-btn:hover {
    background: var(--zdt-primary, #800020);
    color: #fff;
    border-color: var(--zdt-primary, #800020);
}

.zdt-panel {
    display: none;
    width: 100%;
    max-width: 100%;
}

.zdt-panel.active {
    display: block;
}

.zdt-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
    margin-bottom: 20px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.zdt-heading-lg {
    margin: 4px 0;
    font-size: 26px;
    font-weight: 800;
    color: #111827;
    line-height: 1.25;
    overflow-wrap: break-word;
}

.zdt-heading-md {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 800;
    color: #111827;
    line-height: 1.3;
    overflow-wrap: break-word;
}

.zdt-subtext {
    margin: 4px 0 0;
    font-size: 15px;
    color: #4b5563;
    line-height: 1.5;
    overflow-wrap: break-word;
}

.zdt-helper {
    font-size: 14.5px;
    color: #4b5563;
}

.zdt-muted-sm {
    font-size: 13.5px;
    color: #6b7280;
    margin-top: 4px;
}

.zdt-mode-status {
    font-size: 14px;
    font-weight: 700;
    margin-top: 6px;
}

.zdt-search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    width: 100%;
}

.zdt-search-bar .zdt-input {
    flex: 1;
    min-width: 0;
}

.zdt-filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
}

.zdt-filter-bar .zdt-select {
    min-width: 210px;
}

.zdt-chip-group {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: 4px;
}

.zdt-status-align {
    text-align: right;
}

.zdt-map-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
}

.zdt-flex-row,
.zdt-btn-group,
.zdt-actions-cell {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.zdt-flex-between {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.zdt-grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 20px;
    width: 100%;
}

.zdt-grid-driver {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
    gap: 20px;
    align-items: start;
    width: 100%;
}

.zdt-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
    width: 100%;
}

.zdt-row-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
}

.zdt-kpi {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-left: 5px solid var(--zdt-primary, #800020);
    border-radius: 12px;
    padding: 16px 18px;
    overflow: hidden;
    width: 100%;
}

.zdt-kpi-val {
    font-size: 30px;
    font-weight: 800;
    color: #111827;
    margin-top: 4px;
    line-height: 1.2;
}

.zdt-label {
    font-size: 13px;
    font-weight: 700;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: block;
    overflow-wrap: break-word;
}

.zdt-app .zdt-input,
.zdt-app .zdt-select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.4;
    color: #111827;
    background: #fff;
    margin: 0;
}

.zdt-app input[type="file"].zdt-input {
    font-size: 14px;
    padding: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zdt-app .zdt-input:focus,
.zdt-app .zdt-select:focus {
    outline: none;
    border-color: var(--zdt-primary, #800020);
    box-shadow: 0 0 0 3px rgba(128, 0, 32, 0.12);
}

.zdt-app .zdt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 8px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none !important;
    line-height: 1.3;
    white-space: normal !important;
    text-align: center;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    height: auto !important;
}

.zdt-app .zdt-btn:hover {
    opacity: 0.92;
}

.zdt-app .zdt-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.zdt-app .zdt-btn-sm {
    padding: 9px 13px;
    font-size: 14px;
}

.zdt-app .zdt-btn-icon {
    width: auto !important;
    min-width: 40px;
    padding: 6px 12px !important;
}

.zdt-app .zdt-btn-primary {
    background: var(--zdt-primary, #800020) !important;
    color: #fff !important;
}

.zdt-app .zdt-btn-dark {
    background: #111827 !important;
    color: #fff !important;
}

.zdt-app .zdt-btn-green {
    background: #15803d !important;
    color: #fff !important;
}

.zdt-app .zdt-btn-blue {
    background: #1d4ed8 !important;
    color: #fff !important;
}

.zdt-app .zdt-btn-amber {
    background: #b45309 !important;
    color: #fff !important;
}

.zdt-app .zdt-btn-outline {
    background: #fff !important;
    color: #374151 !important;
    border: 1px solid #cbd5e1 !important;
}

.zdt-app .zdt-btn-danger {
    background: #dc2626 !important;
    color: #fff !important;
}

.zdt-map {
    width: 100% !important;
    max-width: 100% !important;
    height: 400px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    z-index: 1;
}

.zdt-info-box {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
    font-size: 15px;
    line-height: 1.75;
    overflow-wrap: break-word;
    word-break: break-word;
    width: 100%;
}

.zdt-pod-box {
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
    overflow-wrap: break-word;
    width: 100%;
}

.zdt-pod-title {
    font-size: 14px;
    font-weight: 800;
    color: #166534;
    margin-bottom: 6px;
}

.zdt-pod-meta {
    font-size: 14.5px;
    color: #14532d;
    margin-bottom: 8px;
}

.zdt-timeline {
    max-height: 260px;
    overflow-y: auto;
    font-size: 14.5px;
    line-height: 1.5;
    border-left: 3px solid #e5e7eb;
    padding-left: 14px;
    overflow-wrap: break-word;
    width: 100%;
}

.zdt-stepper {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin: 24px 0 28px;
    width: 100%;
}

.zdt-stepper::before {
    content: "";
    position: absolute;
    top: 17px;
    left: 10%;
    right: 10%;
    height: 3px;
    background: #e5e7eb;
    z-index: 0;
}

.zdt-step {
    position: relative;
    z-index: 1;
    text-align: center;
    flex: 1;
    min-width: 0;
    padding: 0 3px;
}

.zdt-step-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}

.zdt-step.done .zdt-step-dot {
    background: var(--zdt-primary, #800020);
    color: #fff;
}

.zdt-step-label {
    font-size: 13.5px;
    font-weight: 600;
    color: #374151;
    overflow-wrap: break-word;
}

.zdt-pill {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    max-width: 100%;
}

.zdt-pill-Assigned {
    background: #fef3c7;
    color: #92400e;
}

.zdt-pill-Picked {
    background: #dbeafe;
    color: #1e40af;
}

.zdt-pill-In {
    background: #ede9fe;
    color: #5b21b6;
}

.zdt-pill-Delivered {
    background: #dcfce7;
    color: #166534;
}

.zdt-order-item {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 15px;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s;
    overflow-wrap: break-word;
    width: 100%;
}

.zdt-order-item:hover,
.zdt-order-item.selected {
    border-color: var(--zdt-primary, #800020);
    background: #fdf2f4;
}

.zdt-workspace {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    background: #fafafa;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.zdt-mode-box {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    background: #fff;
    margin-bottom: 16px;
    width: 100%;
    overflow: hidden;
}

.zdt-mode-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.zdt-app .zdt-mode-btn {
    padding: 12px;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    background: #f9fafb;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    color: #374151;
    white-space: normal !important;
    text-align: center;
    line-height: 1.3;
    width: 100%;
}

.zdt-app .zdt-mode-btn.active {
    border-color: var(--zdt-primary, #800020);
    background: #fdf2f4;
    color: var(--zdt-primary, #800020);
}

.zdt-sig-canvas {
    width: 100%;
    max-width: 100%;
    height: 160px;
    border: 2px dashed #9ca3af;
    border-radius: 8px;
    background: #fff;
    touch-action: none;
    cursor: crosshair;
    display: block;
}

.zdt-table-wrap {
    width: 100%;
}

.zdt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14.5px;
    table-layout: auto;
}

.zdt-table th,
.zdt-table td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
    overflow-wrap: break-word;
}

.zdt-table th {
    background: #f9fafb;
    font-size: 13px;
    text-transform: uppercase;
    color: #4b5563;
}

.zdt-chip {
    display: inline-block;
    padding: 7px 12px;
    background: #f3f4f6;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #d1d5db;
    text-align: center;
}

.zdt-chip:hover {
    border-color: var(--zdt-primary, #800020);
    color: var(--zdt-primary, #800020);
}

.zdt-pulse {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--zdt-primary, #800020);
    border: 3px solid #fff;
    box-shadow: 0 0 0 6px rgba(128, 0, 32, 0.28);
}

.zdt-dest-pin {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    background: #15803d;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.zdt-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #111827;
    color: #fff;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    z-index: 999999;
    display: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.28);
    max-width: 420px;
}

.zdt-modal-bg {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999998;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.zdt-modal {
    background: #fff;
    border-radius: 14px;
    max-width: 540px;
    width: 100%;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    max-height: 92vh;
    overflow-y: auto;
}

.zdt-modal-title {
    font-size: 19px;
    color: #111827;
}

.zdt-modal-sub {
    font-size: 14.5px;
    color: #4b5563;
    margin: 0 0 12px;
    line-height: 1.5;
}

.zdt-modal-preview {
    font-size: 14px;
    background: #f9fafb;
    margin-bottom: 16px;
}

.zdt-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.zdt-modal-actions .zdt-btn:first-child {
    flex: 1;
}

/* ============================================================================
 * TABLET & MOBILE RESPONSIVENESS (100% FULL WIDTH, ZERO SWIPING)
 * ========================================================================= */
@media (max-width: 960px) {
    .zdt-grid-2,
    .zdt-grid-driver {
        grid-template-columns: minmax(0, 1fr);
    }

    .zdt-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .zdt-app {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: hidden !important;
    }

    .zdt-header {
        padding: 16px;
        gap: 14px;
        border-radius: 0;
        margin-bottom: 14px;
    }

    .zdt-brand {
        font-size: 19px;
        width: 100%;
    }

    .zdt-tabs {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }

    .zdt-app .zdt-tab-btn {
        width: 100%;
        min-height: 46px;
        padding: 12px 14px;
        font-size: 15px;
    }

    .zdt-card {
        padding: 16px;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 0;
        border-left: none;
        border-right: none;
        margin-bottom: 14px;
    }

    .zdt-grid-4 {
        padding: 0 12px;
        gap: 10px;
        margin-bottom: 14px;
    }

    .zdt-workspace,
    .zdt-mode-box,
    .zdt-info-box,
    .zdt-pod-box {
        padding: 14px;
        width: 100%;
    }

    .zdt-search-bar,
    .zdt-filter-bar {
        flex-direction: column;
        width: 100%;
    }

    .zdt-filter-bar .zdt-select {
        min-width: 0;
        width: 100%;
    }

    .zdt-row-2,
    .zdt-mode-tabs {
        grid-template-columns: minmax(0, 1fr);
    }

    .zdt-status-align {
        text-align: left;
        width: 100%;
    }

    .zdt-map {
        width: 100% !important;
        height: 300px;
    }

    .zdt-map-footer {
        flex-direction: column;
        align-items: stretch;
    }

    /* Full-width, readable, touch-friendly buttons on mobile */
    .zdt-app .zdt-btn {
        width: 100%;
        min-height: 46px;
        padding: 12px 14px;
        font-size: 15px;
    }

    .zdt-btn-group,
    .zdt-flex-row,
    .zdt-actions-cell,
    .zdt-modal-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .zdt-modal-actions .zdt-btn:first-child {
        flex: none;
    }

    .zdt-chip-group {
        display: flex;
        flex-direction: column;
        width: 100%;
        margin: 8px 0 0;
    }

    .zdt-chip {
        width: 100%;
        padding: 10px 12px;
    }

    .zdt-stepper::before {
        top: 14px;
    }

    .zdt-step-dot {
        width: 30px;
        height: 30px;
        font-size: 13px;
    }

    .zdt-step-label {
        font-size: 11px;
        line-height: 1.25;
    }

    .zdt-kpi {
        padding: 13px;
    }

    .zdt-kpi .zdt-label {
        font-size: 11.5px;
    }

    .zdt-kpi-val {
        font-size: 24px;
    }

    /* Convert Admin Tables into Stacked Full-Width Cards (ZERO Horizontal Swiping) */
    .zdt-table thead {
        display: none;
    }

    .zdt-table,
    .zdt-table tbody,
    .zdt-table tr,
    .zdt-table td {
        display: block;
        width: 100%;
    }

    .zdt-table tr {
        background: #f9fafb;
        border: 1px solid #e5e7eb;
        border-radius: 10px;
        padding: 14px;
        margin-bottom: 14px;
    }

    .zdt-table td {
        padding: 8px 0;
        border-bottom: 1px dashed #e5e7eb;
        font-size: 14.5px;
        white-space: normal !important;
        overflow-wrap: break-word;
        word-break: break-word;
    }

    .zdt-table td:last-child {
        border-bottom: none;
        padding-bottom: 0;
        padding-top: 12px;
    }

    .zdt-table td::before {
        content: attr(data-label);
        display: block;
        font-size: 11.5px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: #6b7280;
        margin-bottom: 4px;
    }

    .zdt-table td[colspan]::before {
        display: none;
    }

    .zdt-modal-bg {
        padding: 10px;
    }

    .zdt-modal {
        width: 100%;
        max-width: 100%;
        padding: 18px;
    }

    .zdt-toast {
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        text-align: center;
    }
}