.client-routing-modal.modal {
    padding: 0 !important;
    overflow: hidden;
}

.client-routing-modal .modal-dialog {
    width: calc(100vw - 24px);
    max-width: none;
    height: calc(100vh - 24px);
    min-height: 0;
    margin: 12px auto;
}

.client-routing-modal .modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    border: 0;
    border-radius: 14px;
    box-shadow: 0 22px 64px rgba(17, 37, 63, .24);
}

.client-routing-header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    min-height: 74px;
    padding: 15px 22px;
    color: #fff;
    border: 0;
    background: linear-gradient(125deg, #103b66 0%, #0b70a5 58%, #0b8890 100%);
}

/* O clearfix do Bootstrap vira item flex e desloca o titulo para o centro. */
.client-routing-header::before,
.client-routing-header::after {
    display: none;
    content: none;
}

.client-routing-header .client-modal-heading {
    display: flex;
    align-items: center;
    order: 1;
    gap: 13px;
    min-width: 0;
    margin: 0 auto 0 0;
    padding: 0;
    background: transparent;
    text-align: left;
}

.client-routing-header .client-modal-heading-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    font-size: 29px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .14);
}

.client-routing-header .client-modal-heading h3 {
    margin: 0 0 2px;
    font-size: 21px;
    font-weight: 600;
}

.client-routing-header .client-modal-heading p {
    margin: 0;
    font-size: 12px;
    opacity: .82;
}

.client-routing-title {
    display: flex;
    align-items: center;
    gap: 13px;
}

.client-routing-title > i {
    width: 42px;
    height: 42px;
    font-size: 29px;
    line-height: 42px;
    text-align: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, .14);
}

.client-routing-title h3 {
    margin: 0 0 2px;
    font-size: 21px;
    font-weight: 600;
}

.client-routing-title p {
    margin: 0;
    font-size: 12px;
    opacity: .82;
}

.client-routing-header .close {
    order: 2;
    color: #fff;
    opacity: .85;
    text-shadow: none;
}

.client-routing-body {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    padding: 0;
    overflow: hidden;
    color: #26384a;
    background: #f3f6f9;
}

.client-routing-footer {
    flex: 0 0 auto;
    height: 54px;
    padding: 9px 18px;
    border-color: #e1e8ef;
    background: #fff;
}

.client-routing-stale,
.client-routing-unassigned-warning {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 18px;
    font-size: 12px;
    border-bottom: 1px solid transparent;
}

.client-routing-unassigned-warning {
    color: #815512;
    border-color: #efd59e;
    background: #fff7e4;
}

.client-routing-stale {
    color: #7a4a0a;
    border-color: #f0cf93;
    background: #fff5dc;
}

.client-routing-layout {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    height: 100%;
}

.client-routing-sidebar {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 16px;
    overflow: hidden;
    border-right: 1px solid #dce5ed;
    background: #fff;
}

.client-routing-sidebar-head,
.client-routing-section-title,
.client-routing-operation-head,
.client-routing-route-head,
.client-routing-head-actions,
.client-routing-form-actions,
.client-routing-stop-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.client-routing-sidebar-head {
    margin-bottom: 12px;
}

.client-routing-sidebar-head strong {
    font-size: 15px;
}

.client-routing-search {
    margin: 10px 0;
    border-color: #dbe4ec;
    box-shadow: none;
}

.client-routing-operation-list {
    min-height: 0;
    overflow: auto;
}

.client-routing-operation-item {
    display: block;
    width: 100%;
    margin: 0 0 8px;
    padding: 11px 12px;
    text-align: left;
    color: #2e4052;
    border: 1px solid #e1e8ee;
    border-radius: 9px;
    background: #fff;
    transition: border-color .16s ease, background-color .16s ease, transform .16s ease;
}

.client-routing-operation-item:hover {
    border-color: #9dc5dc;
    background: #f7fbfd;
    transform: translateY(-1px);
}

.client-routing-operation-item.active {
    color: #0b5889;
    border-color: #55a4cf;
    background: #eaf5fb;
    box-shadow: inset 3px 0 #1683bb;
}

.client-routing-operation-item strong,
.client-routing-operation-item span,
.client-routing-operation-item small,
.client-routing-operation-item em {
    display: block;
}

.client-routing-operation-item strong {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-routing-operation-item span {
    margin: 3px 0 5px;
    color: #66798b;
    font-size: 11px;
}

.client-routing-operation-item em {
    margin-top: 5px;
    color: #7b8b99;
    font-size: 10px;
    font-style: normal;
}

.client-routing-operation-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.client-routing-operation-meta small {
    color: #718394;
    font-size: 10px;
}

.client-routing-operation-empty,
.client-routing-empty,
.client-routing-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 170px;
    padding: 24px;
    text-align: center;
    color: #708395;
    border: 1px dashed #c9d4de;
    border-radius: 10px;
    background: #fafcfd;
}

.client-routing-operation-empty i,
.client-routing-empty i,
.client-routing-welcome i {
    margin-bottom: 8px;
    color: #6baccd;
    font-size: 30px;
}

.client-routing-operation-empty strong,
.client-routing-empty strong {
    margin-bottom: 4px;
    color: #45596c;
}

.client-routing-content {
    min-width: 0;
    overflow: auto;
    background: #f5f7fa;
}

.client-routing-operation {
    min-height: 100%;
    padding: 17px 20px 28px;
}

.client-routing-operation-head {
    align-items: flex-start;
    margin-bottom: 13px;
}

.client-routing-operation-head h4 {
    margin: 0 0 3px;
    color: #1f3448;
    font-size: 20px;
    font-weight: 600;
}

.client-routing-operation-head p {
    margin: 0;
    color: #718292;
    font-size: 12px;
}

.client-routing-head-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.client-routing-tabs {
    display: flex;
    gap: 4px;
    margin: 0 0 15px;
    padding: 4px;
    overflow-x: auto;
    border: 1px solid #dfe7ee;
    border-radius: 10px;
    background: #fff;
}

.client-routing-tabs button {
    flex: 0 0 auto;
    padding: 8px 12px;
    color: #5b6f81;
    border: 0;
    border-radius: 7px;
    background: transparent;
}

.client-routing-tabs button.active {
    color: #fff;
    background: #1379ad;
}

.client-routing-tabs .label {
    margin-left: 4px;
}

.client-routing-tab-content {
    min-height: 360px;
}

.client-routing-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}

.client-routing-summary-card {
    padding: 16px;
    border: 1px solid #e0e7ed;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(34, 59, 83, .04);
}

.client-routing-summary-card span,
.client-routing-summary-card small,
.client-routing-route-head span,
.client-routing-route-card > small,
.client-routing-table td small,
.client-routing-selected-address small,
.client-routing-address-results small,
.client-routing-timeline small {
    display: block;
}

.client-routing-summary-card > span {
    margin-bottom: 7px;
    color: #758697;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.client-routing-summary-card strong {
    color: #21384d;
    font-size: 19px;
}

.client-routing-summary-card small {
    margin-top: 4px;
    color: #728495;
}

.client-routing-next-step {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    padding: 15px;
    color: #245976;
    border: 1px solid #b8d8e8;
    border-radius: 10px;
    background: #edf8fd;
}

.client-routing-next-step i {
    font-size: 24px;
}

.client-routing-next-step strong,
.client-routing-next-step span {
    display: block;
}

.client-routing-routes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.client-routing-route-card {
    padding: 15px;
    border: 1px solid #e0e7ed;
    border-radius: 10px;
    background: #fff;
}

.client-routing-route-head span,
.client-routing-route-card > small {
    color: #728394;
    font-size: 11px;
}

.client-routing-route-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
}

.client-routing-route-actions .btn {
    margin: 0;
}

.client-routing-route-card dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 12px 0 0;
}

.client-routing-route-card dl > div {
    padding: 8px;
    text-align: center;
    border-radius: 7px;
    background: #f3f6f8;
}

.client-routing-route-card dt {
    color: #738493;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.client-routing-route-card dd {
    margin: 3px 0 0;
    color: #2e475d;
    font-size: 12px;
    font-weight: 600;
}

.client-routing-route-progress {
    height: 7px;
    margin: 12px 0 7px;
    overflow: hidden;
    border-radius: 10px;
    background: #e8edf1;
}

.client-routing-route-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #1688bc, #17a087);
}

.client-routing-route-stops {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    overflow-x: auto;
    border-top: 1px solid #edf1f4;
}

.client-routing-route-stops span {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 5px;
    padding: 4px 8px;
    color: #456273;
    font-size: 10px;
    border-radius: 14px;
    background: #edf5f8;
}

.client-routing-route-stops b,
.client-routing-sequence {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    color: #fff;
    border-radius: 50%;
    background: #1382b5;
}

.client-routing-sequence.unassigned {
    background: #b8c1c9;
}

.client-routing-section-title {
    margin-bottom: 12px;
}

.client-routing-section-title strong,
.client-routing-section-title small {
    display: block;
}

.client-routing-section-title strong {
    color: #263d52;
    font-size: 15px;
}

.client-routing-section-title small {
    color: #738595;
    font-size: 11px;
}

.client-routing-form-panel {
    position: absolute;
    z-index: 4;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 20px;
    overflow: auto;
    background: #f5f7fa;
}

.client-routing-inline-form {
    position: static;
    margin-bottom: 15px;
    padding: 16px;
    border: 1px solid #cfdde7;
    border-radius: 10px;
    background: #fff;
}

.client-routing-form-panel .form-group label {
    color: #526779;
    font-size: 11px;
    font-weight: 600;
}

.client-routing-form-panel .form-control,
.client-routing-stop-tools .form-control {
    border-color: #ced9e2;
    box-shadow: none;
}

.client-routing-location-box {
    position: relative;
    margin-bottom: 14px;
    padding: 13px;
    border: 1px solid #dbe4eb;
    border-radius: 9px;
    background: #fbfcfd;
}

.client-routing-location-box.has-error {
    border-color: #d9534f;
}

.client-routing-address-results {
    position: absolute;
    z-index: 10;
    right: 15px;
    left: 15px;
    max-height: 220px;
    overflow: auto;
    border: 1px solid #bfcdd8;
    border-radius: 0 0 8px 8px;
    background: #fff;
    box-shadow: 0 12px 24px rgba(32, 56, 78, .17);
}

.client-routing-address-results button {
    display: block;
    width: 100%;
    padding: 9px 11px;
    text-align: left;
    color: #32495d;
    border: 0;
    border-bottom: 1px solid #e9eef2;
    background: #fff;
}

.client-routing-address-results button:hover {
    background: #edf7fb;
}

.client-routing-address-results small,
.client-routing-selected-address small {
    color: #738494;
    font-size: 10px;
}

.client-routing-selected-address {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 11px;
    color: #32596b;
    border-radius: 7px;
    background: #eaf6f4;
}

.client-routing-selected-address > i {
    color: #138b77;
    font-size: 18px;
}

.client-routing-field-error {
    display: block;
    margin-top: 4px;
    color: #c43834;
    font-size: 10px;
}

.client-routing-check {
    display: block;
    padding-top: 7px;
    color: #536b7c;
    font-size: 12px;
    font-weight: 400;
}

.client-routing-window-check {
    margin: 2px 0 12px;
    padding: 8px 10px;
    border-radius: 7px;
    background: #f0f5f8;
}

.client-routing-form-actions {
    justify-content: flex-end;
    padding-top: 12px;
    border-top: 1px solid #e8edf1;
}

.client-routing-readonly {
    min-height: 34px;
    padding: 7px 10px;
    color: #516575;
    border: 1px solid #d6dfe6;
    border-radius: 4px;
    background: #f4f6f8;
}

.client-routing-table {
    margin-bottom: 0;
    font-size: 12px;
    border: 1px solid #dfe6ec;
    background: #fff;
}

.client-routing-table th {
    color: #607384;
    font-size: 10px;
    letter-spacing: .03em;
    text-transform: uppercase;
    background: #edf2f5;
}

.client-routing-table td {
    vertical-align: middle !important;
}

.client-routing-table td strong {
    color: #294055;
}

.client-routing-table td small {
    color: #738493;
    font-size: 10px;
}

.client-routing-row-actions {
    width: 1%;
    white-space: nowrap;
}

.client-routing-row-actions .btn,
.client-routing-row-actions .btn-group {
    margin-left: 3px;
}

.client-routing-status-menu {
    min-width: 180px;
    z-index: 1070;
}

.client-routing-status-menu > li > a {
    padding: 9px 14px;
}

.client-routing-stop-tools {
    justify-content: flex-start;
    margin-bottom: 10px;
}

.client-routing-stop-tools .form-control:first-child {
    max-width: 420px;
}

.client-routing-stop-tools .form-control:last-child {
    max-width: 220px;
}

.client-routing-execution-form {
    margin-bottom: 12px;
    padding: 13px 15px;
    border: 1px solid #a9cddd;
    border-radius: 9px;
    background: #edf8fc;
}

.client-routing-execution-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.client-routing-execution-head strong,
.client-routing-execution-head small {
    display: block;
}

.client-routing-execution-head small {
    color: #688092;
}

#routing-operation-map {
    width: 100%;
    height: 470px;
    border: 1px solid #cbd7e0;
    border-radius: 10px;
    background: #dfe8ee;
}

.client-routing-modal .client-routing-leaflet-popup .leaflet-popup-content,
.client-routing-modal .client-routing-leaflet-label {
    min-width: 150px;
    margin: 10px 14px;
    line-height: 1.35;
    white-space: normal;
}

.client-routing-modal .client-routing-leaflet-label {
    margin: 0;
    padding: 8px 11px;
}

.client-routing-modal .client-routing-map-popup,
.client-routing-modal .client-routing-map-popup > strong,
.client-routing-modal .client-routing-map-popup > span {
    position: static !important;
    display: block !important;
    float: none !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    line-height: 18px !important;
    white-space: normal !important;
}

.client-routing-modal .client-routing-map-popup > strong {
    color: #183a54;
    font-size: 12px;
    font-weight: 700;
}

.client-routing-modal .client-routing-map-popup > span {
    margin-top: 3px !important;
    color: #647b8c;
    font-size: 11px;
}

.client-routing-map-routes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    margin-top: 10px;
}

.client-routing-map-routes article {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px;
    border: 1px solid #dce5eb;
    border-radius: 8px;
    background: #fff;
}

.client-routing-map-routes strong,
.client-routing-map-routes span {
    display: block;
}

.client-routing-map-routes span {
    color: #748595;
    font-size: 10px;
}

.client-routing-timeline {
    position: relative;
    padding-left: 12px;
}

.client-routing-timeline:before {
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 19px;
    width: 2px;
    content: '';
    background: #d7e2e9;
}

.client-routing-timeline article {
    position: relative;
    display: flex;
    gap: 13px;
    margin-bottom: 9px;
    padding: 11px 13px;
    border: 1px solid #e0e7ec;
    border-radius: 8px;
    background: #fff;
}

.client-routing-timeline article > i {
    z-index: 1;
    margin-top: 4px;
    color: #1785b6;
    font-size: 10px;
}

.client-routing-timeline strong,
.client-routing-timeline span {
    display: block;
}

.client-routing-timeline span {
    color: #5f7385;
    font-size: 11px;
}

.client-routing-danger-actions {
    margin-top: 25px;
    padding-top: 12px;
    text-align: right;
    border-top: 1px solid #dfe6ec;
}

.client-routing-loading,
.client-routing-welcome {
    padding: 50px 20px;
}

.client-routing-loading i {
    margin-right: 7px;
}

@media (max-width: 1100px) {
    .client-routing-layout {
        grid-template-columns: 240px minmax(0, 1fr);
    }

    .client-routing-summary-grid,
    .client-routing-map-routes {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .client-routing-modal .modal-dialog {
        width: calc(100vw - 16px);
        height: calc(100vh - 16px);
        margin: 8px auto;
    }

    .client-routing-modal .modal-content {
        height: 100%;
        min-height: 0;
        border-radius: 12px;
    }

    .client-routing-header {
        min-height: 65px;
        padding: 10px 13px;
    }

    .client-routing-title > i {
        width: 36px;
        height: 36px;
        font-size: 24px;
        line-height: 36px;
    }

    .client-routing-header .client-modal-heading-icon {
        width: 36px;
        height: 36px;
        font-size: 24px;
    }

    .client-routing-title h3 {
        font-size: 17px;
    }

    .client-routing-header .client-modal-heading h3 {
        font-size: 17px;
    }

    .client-routing-title p {
        display: none;
    }

    .client-routing-header .client-modal-heading p {
        display: none;
    }

    .client-routing-body {
        height: auto;
        max-width: 100%;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        overscroll-behavior-x: none;
        -webkit-overflow-scrolling: touch;
    }

    .client-routing-footer {
        height: 48px;
        padding: 7px 10px;
    }

    .client-routing-layout {
        display: block;
        width: 100%;
        max-width: 100%;
        height: auto;
    }

    .client-routing-sidebar {
        display: block;
        padding: 11px;
        overflow: visible;
        border-right: 0;
        border-bottom: 1px solid #dbe4eb;
    }

    .client-routing-search {
        margin-bottom: 7px;
    }

    .client-routing-operation-list {
        display: flex;
        gap: 7px;
        overflow-x: auto;
    }

    .client-routing-operation-item {
        flex: 0 0 220px;
        margin: 0;
    }

    .client-routing-operation-empty {
        min-height: 110px;
    }

    .client-routing-content {
        width: 100%;
        max-width: 100%;
        overflow: visible;
    }

    .client-routing-operation {
        padding: 13px 11px 24px;
    }

    .client-routing-operation-head {
        display: block;
    }

    .client-routing-head-actions {
        justify-content: flex-start;
        margin-top: 10px;
    }

    .client-routing-summary-grid,
    .client-routing-routes,
    .client-routing-map-routes {
        grid-template-columns: 1fr;
    }

    .client-routing-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .client-routing-summary-card {
        padding: 12px;
    }

    .client-routing-summary-card strong {
        font-size: 16px;
    }

    .client-routing-route-actions {
        width: 100%;
        justify-content: flex-start;
        margin-top: 9px;
    }

    .client-routing-form-panel {
        position: absolute;
        z-index: 4;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 14px 12px 70px;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        overscroll-behavior-x: none;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        background: #f5f7fa;
    }

    /* As margens negativas de .row no Bootstrap ultrapassavam o painel por
       alguns pixels. Em uma rolagem diagonal o WebView passava a mover o
       formulário inteiro para os lados. */
    .client-routing-form-panel .row {
        max-width: 100%;
        margin-right: 0;
        margin-left: 0;
    }

    .client-routing-form-panel form,
    .client-routing-form-panel [class*="col-"] {
        min-width: 0;
        max-width: 100%;
    }

    .client-routing-inline-form {
        position: static;
        padding: 13px;
    }

    .client-routing-section-title {
        align-items: flex-start;
    }

    .client-routing-section-title small {
        max-width: 190px;
    }

    .client-routing-stop-tools {
        display: block;
    }

    .client-routing-stop-tools .form-control {
        max-width: none !important;
        margin-bottom: 7px;
    }

    .client-routing-table {
        min-width: 880px;
    }

    #routing-operation-map {
        height: 390px;
    }

    .client-routing-stale,
    .client-routing-unassigned-warning {
        align-items: flex-start;
        padding: 8px 11px;
    }
}

@media (max-width: 480px) {
    .client-routing-modal .modal-dialog {
        width: calc(100vw - 10px);
        height: calc(100vh - 10px);
        margin: 5px auto;
    }
}

@media (max-width: 420px) {
    .client-routing-summary-grid {
        grid-template-columns: 1fr;
    }

    .client-routing-head-actions .btn {
        flex: 1 1 auto;
    }
}
